You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When calling confirmPayment (of the useStripe hook) with the paymentMethodId option. The urlScheme of the StripeProvider is ignored. This issue is iOS only.
To Reproduce
Steps to reproduce the behavior:
Call confirmPayment with an existing paymentMethodId, and have your app scheme in the provider:
constMyPaymentComponent=()=>{const{ confirmPayment }=useStripe();constpay=async()=>{const{ paymentIntent, error }=awaitconfirmPayment(stripe_client_secret,//// Note: the paymentMethod used needs to trigger a 3DS WebView flow.{type: 'Card',paymentMethodId: 'pm_somepmid'},);}return<ButtononPress={pay}title="pay"/>}constMyParentComponent=()=>(<StripeProviderpublishableKey="mypublishablekey"urlScheme="my-app"><MyPaymentComponent/></StripeProvider>);
Expected behavior
The "return_url" should visible in the POST /v1/payment_intents/..../confirm request on the stripe dashboard, consequently once the 3DS WebView challenge was completed, it should be closed and return to the app.
Screenshots If applicable, add screenshots to help explain your problem.
Smartphone (please complete the following information):
Device: iPhone 12 (simulator)
OS: iOS
Version: 14.5
Additional context
I have applied this patch to fix the issue, for stripe-react-native version 0.1.4:
diff --git a/node_modules/@stripe/stripe-react-native/ios/StripeSdk.swift b/node_modules/@stripe/stripe-react-native/ios/StripeSdk.swift
index 379e1f1..4e9deba 100644
--- a/node_modules/@stripe/stripe-react-native/ios/StripeSdk.swift+++ b/node_modules/@stripe/stripe-react-native/ios/StripeSdk.swift@@ -603,10 +603,10 @@ class StripeSdk: RCTEventEmitter, STPApplePayContextDelegate, STPBankSelectionVi
paymentIntentParams.paymentMethodParams = paymentMethodParams
paymentIntentParams.paymentMethodOptions = paymentMethodOptions
paymentIntentParams.shipping = Mappers.mapToShippingDetails(shippingDetails: params["shippingDetails"] as? NSDictionary)
+ }- if let urlScheme = urlScheme {- paymentIntentParams.returnURL = Mappers.mapToReturnURL(urlScheme: urlScheme)- }+ if let urlScheme = urlScheme {+ paymentIntentParams.returnURL = Mappers.mapToReturnURL(urlScheme: urlScheme)
}
let paymentHandler = STPPaymentHandler.shared()
The text was updated successfully, but these errors were encountered:
Describe the bug
When calling confirmPayment (of the useStripe hook) with the paymentMethodId option. The urlScheme of the StripeProvider is ignored. This issue is iOS only.
To Reproduce
Steps to reproduce the behavior:
Call confirmPayment with an existing paymentMethodId, and have your app scheme in the provider:
Expected behavior
The "return_url" should visible in the
POST /v1/payment_intents/..../confirm
request on the stripe dashboard, consequently once the 3DS WebView challenge was completed, it should be closed and return to the app.Screenshots
If applicable, add screenshots to help explain your problem.Smartphone (please complete the following information):
Additional context
I have applied this patch to fix the issue, for stripe-react-native version 0.1.4:
The text was updated successfully, but these errors were encountered: