stripe/stripe-terminal-ios

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

Closed this issue · 5 comments

<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

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?

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

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.

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

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