File tree 4 files changed +7
-3
lines changed
app/models/payment/applepay
4 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ case class ApplePayment(
25
25
import Validation ._
26
26
27
27
override def validate : ValidatedNel [Failure , ApplePayment ] = {
28
- (validExpr(stripeTokenId.startsWith(" tok_" ), " stripeTokenId should start with 'tok_'" ) |@| super .validate).map {
28
+ (validExpr(stripeTokenId.startsWith(" tok_" ), " Stripe token should start with 'tok_'" ) |@| super .validate).map {
29
29
case _ ⇒ this
30
30
}
31
31
}
Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ object CartFailures {
20
20
override def description = s " order with referenceNumber= $refNum is an empty cart "
21
21
}
22
22
23
+ case class NoCartFound (customerId : Int ) extends Failure {
24
+ override def description = s " no cart was found for a customer with id= $customerId"
25
+ }
26
+
23
27
case class NoShipAddress (refNum : String ) extends Failure {
24
28
override def description = s " order with referenceNumber= $refNum has no shipping address "
25
29
}
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ object Checkout {
127
127
cart ← * <~ Carts
128
128
.findByAccountId(customer.accountId)
129
129
.one
130
- .mustFindOr(GeneralFailure ( " Cart not found! " ))
130
+ .mustFindOr(NoCartFound (customer.accountId ))
131
131
order ← * <~ Checkout (cart, CartValidator (cart)).checkout
132
132
} yield order
133
133
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ class ApplePayIntegrationTest
59
59
val api = cartsApi(api_newCustomerCart(customer.id).referenceNumber)
60
60
api.payments.applePay
61
61
.add(payment)(defaultAdminAuth)
62
- .mustFailWith400(GeneralFailure (" stripeTokenId should start with 'tok_'" ))
62
+ .mustFailWith400(GeneralFailure (" Stripe token should start with 'tok_'" ))
63
63
}
64
64
65
65
" Capture of Apple Pay payments" - {
You can’t perform that action at this time.
0 commit comments