stripe / stripe-ios

Stripe iOS SDK
https://stripe.com
MIT License
2.12k stars 979 forks source link

Safari does not automatically dismiss 3DS w/ manual confirmation #1283

Closed yuki-stripe closed 5 years ago

yuki-stripe commented 5 years ago

Summary

I am facing almost the same issue, but I am instead using a manual confirmation. Cards I am using: 4000000000003055 4000002500003155

Here in guide (https://stripe.com/docs/mobile/ios/authentication#return-url) said that I can specify a URL scheme and if it specified - user should not click "Done" button to close the Safari window and get completion back. For now, nothing happens when I click to verify or fail test payment. Completion block works only if I click "Done" button. I've checked my URL scheme from the browser - it works fine opening an app. I've also checked VC I am trying to present from (specified with STPAuthenticationContext). It have no presented VCs on it and I've also set up breakpoints from console to check for all URL methods that can stop or lock web view requests - nothing found.

Code to reproduce

STPPaymentHandler.shared().handleNextAction(forPayment: clientSecret, with: self, returnURL: "myURLSheme")

iOS version

12.4

Installation method

CocoaPods

SDK version

16.0.3

Originally posted by @IvanBuravchenko95 in https://github.com/stripe/stripe-ios/issues/1280#issuecomment-519116358

yuki-stripe commented 5 years ago

@IvanBuravchenko95 Automatically closing the Safari VC current does not work; we're working on a fix. That said, you should see a "Return to merchant" button on the final page, and clicking that button should dismiss the Safari VC.

Are you passing the return_url when you create and confirm the PaymentIntent on your backend?

IvanBuravchenko95 commented 5 years ago

@yuki-stripe providing this url on server helped me, button is now appearing and navigates back to an app, thanks!

El-Fitz commented 5 years ago

Hello!

I still have the same issue (safari not automatically closing on completion), with sdk version 17.0.0 using a manual confirmation. We are correctly passing the return url on the backend, and weirdly it works perfectly fine using our staging environment with Stripe dev keys.

But, when running it in production with Stripe production keys, the Safari ViewController won't automatically close anymore. It's driving us crazy ^^'

yuki-stripe commented 5 years ago

Hi @El-Fitz,

Could you provide me with a payment intent id that reproduces this issue so I can dig into it? You can find it in https://dashboard.stripe.com/events. It looks something like pi_1FK9b5KlwPmebFhpTrpEmAFG

yuki-stripe commented 5 years ago

@El-Fitz I tested in production with an AMEX card and found Safari ViewController automatically closed, as expected. This behavior might be specific to the bank or issuer.

El-Fitz commented 5 years ago

Hi @yuki-stripe !

Sorry for the delay. I don't personally have access to the stripe dashboard (working as a freelance).

Here are two payment intents (dev & production): dev: pi_1FKfspJTwGgAGkZk5uZmicBQ prod: pi_1FKfwBJTwGgAGkZkDcNPxW4h

It definitely isn't the bank or issuer, because we get it with every single major French bank, and also with both Revolut & N26, using both Visa & MasterCard issued cards. Also, the Safari VC is properly redirected. It just... doesn't close automatically in production.

One question; does Stripe add any parameters to the callback url the backend gives it, and does the iOS sdk need these parameters for the auto-close?