Skip to content
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] 3DSecure 2 Hook webview not coming back to App, even with valid returnURL #4565

Open
RaphJustPark opened this issue Feb 13, 2025 · 2 comments
Labels
kind:bug triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@RaphJustPark
Copy link

Summary

On our native iOS App, we trigger Stripe Payment actions using
STPPaymentHandler.shared().handleNextAction(forPayment: paymentIntentClientSecret, with: authenticationContext, returnURL: returnURL, completion: completion)

When trying to pay with card 4000002500003155, the result is a .threeDS2Redirect with a hook.stripe.com fallback URL from APIRequest<STP3DS2AuthenticateResponse>.

The return URL is registered in Info.plist and tested. It is passed along successfully to APIRequest<STP3DS2AuthenticateResponse> on if let returnURLString = returnURLString { params["fallback_return_url"] = returnURLString }

But still, when the SafariWebView opens, and we authenticate, the Webview never closes and the text "You may now close this window" sits there.

Another successful test that the returnUrl works, is that I opened regular Safari while having the in-app safari webview from Stripe opened, once I executed "myapp://stripe-payment", the App opened and the line StripeAPI.handleURLCallback(with: url) from AppDelegate kicked in.

Code to reproduce

I posted most of the snippets above, but the App triggers Stripe using
STPPaymentHandler.shared().handleNextAction(forPayment: paymentIntentClientSecret, with: authenticationContext, returnURL: returnURL, completion: completion)

with a valid intent + valid returnURL

iOS version

iOS 18

Installation method

Cocoapods

SDK version

23.27.0

Other information

@davidme-stripe
Copy link
Contributor

davidme-stripe commented Feb 13, 2025

Hi @RaphJustPark, thanks for filing this! It seems like iOS might be using a different callback to ask your app to open the URL. Does your app have a SceneDelegate? This is common if you created it on/after iOS 13.

You might need to configure it to respond to the URL in your func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) implementation: https://docs.stripe.com/payments/accept-a-payment?platform=ios#ios-set-up-return-url

Let me know if that ends up working! If not, we can try looking into a few other things.

@nenadvulic
Copy link

same here. i'm using appdelegate the callback don't trigger

@yuki-stripe yuki-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

4 participants