mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Add some logic to check whether a saved card has been selected before making a request from Stripe
This commit is contained in:
@@ -125,6 +125,13 @@ describe 'Checkout service', ->
|
||||
Checkout.purchase()
|
||||
expect(StripeJS.requestToken).toHaveBeenCalled()
|
||||
|
||||
it "doesn't hit Stripe when reusing a credit card", inject (StripeJS) ->
|
||||
spyOn(StripeJS, "requestToken")
|
||||
Checkout.secrets.selected_card = 1
|
||||
Checkout.purchase()
|
||||
expect(StripeJS.requestToken).not.toHaveBeenCalled()
|
||||
|
||||
|
||||
describe "data preprocessing", ->
|
||||
beforeEach ->
|
||||
Checkout.order.payment_method_id = 99
|
||||
|
||||
Reference in New Issue
Block a user