-
Notifications
You must be signed in to change notification settings - Fork 982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Getting 'No such PaymentMethod' error when presenting payment sheet. #4222
Comments
@HiteshPrajapati95 Can you put some logs in your code to check if |
Hi @seanzhang-stripe, I've checked for the same, and there is no change in |
@seanzhang-stripe, The issue is that when SDK fetches payment method from platform, it retrieves the wrong payment method. Somehow SDK gets the payment method from the Connect account, and when it loads the payment sheet UI, it considers it a platform. I think this is why it returns error as No such payment method. |
@HiteshPrajapati95 Did you clone the platform payment method to the connected account, and use the cloned payment method to create a Direct Charge? Can you share with me the relevant PaymentIntent ID? |
When users do not have any saved cards, at that time users enter card details, and that card gets cloned in to connect account through backend setup. After that, using the cloned payment method, payment gets success through intent. Now for the second time, when the user tries to make payment with the saved payment method at that time (when presenting the payment sheet), SDK returns an error by fetching the previously used payment method and closes the payment sheet instantly. For the second time, the payment method clone steps don't perform because of getting a payment sheet error while presenting the payment sheet. Here is the request_id for the same case: req_KUbLmRiDahouB9 |
Summary
I am using same setup as reference link : https://docs.stripe.com/payments/finalize-payments-on-the-server?platform=ios
Getting success when making payment with new card (in case no card has saved with customer) but for the second time when trying to present payment sheet, it immediately closes payment sheet automatically with error 'No such PaymentMethod'.
Code to reproduce
func presentPaymentSheet(from vc: UIViewController, amount: Int, currency: String) {
STPAPIClient.shared.publishableKey = stripePublishableKey
}
iOS version
16.7.10
Installation method
Using cocoapods
SDK version
24.0.0
Other information
Related concern is how SDK is trying to use payment method when payment sheet is not being presented and also user has not selected any payment method to start payment process yet.
The text was updated successfully, but these errors were encountered: