stripe / stripe-terminal-ios

Stripe Terminal iOS SDK
https://stripe.com/docs/terminal/sdk/ios
Other
104 stars 65 forks source link

processPayment canceling paymentIntent Id in error case of failed due to expired card #256

Closed Roniy08 closed 11 months ago

Roniy08 commented 1 year ago

<SCPProcessPaymentError: 0x28239dcO; code = 9020; message = The Stripe API request failed.; requestld = req_SAL****; requestError = 0x2838ebeal; stripeApiError = Your card's expiration year is invalid.; paymentIntent = (null): 0x0>

Summary

expired card swipe in M2 reader automatically cancels paymentIntentID

Code to reproduce

use expired card which have expire year or month.

iOS version

16.2

Installation method

pod file

SDK version

Other information

bric-stripe commented 1 year ago

hi, can you clarify? Are you saying the PaymentIntent moves to the status: cancelled state without you calling cancelPaymentIntent? That would be unexpected. It should move back to status: requires_payment_method. Can you share a PaymentIntent ID that this happened to?

Roniy08 commented 1 year ago

@bric-stripe yes, here is the PaymentIntent ID - pi_3No4yu4DfIvvXFPZ0fDGceIr

bric-stripe commented 1 year ago

thanks for getting that. That PaymentIntent is in the expected requires_payment_method indicating that since the processPaymentIntent failed a new payment method is required. I also confirmed with some internal tools that the only API requests for that PI are the create and then the /confirm call (made by the SDK during processPaymentIntent). No call to /cancel. Can you confirm that's the right PI? if so, where are you seeing that its moving to a canceled status?

If that is the right PI you should be able to retry collectPaymentMethod with that PaymentIntent and then retry process again with that result.

Roniy08 commented 1 year ago

@bric-stripe thanks, for help I will retry with collectpayment method again with same paymentIntent, if something doesn't work I will update here.

bric-stripe commented 11 months ago

Hi, cleaning up old issues. Please re-open if anything else needed for this.