To make it easier to diagnose your issue, please fill out the following:
Facing issue with 3DS redirect
A simple summary of the problems you're having.
I am facing 3 issues while incorporating 3DS redirect.
Issue #1) When using redirectcontext, when I used redirectContext?.startRedirectFlow(from: self) or redirectContext?.startSafariViewControllerRedirectFlow(from: self), the safari view controller seems to come and go back in a flash without any intervention and brings me back to the app.
Issue #2) When I used redirectContext?.startSafariAppRedirectFlow(), the safari view controller page for payment authorization looks to open fine. However, when I click on authorize payment button, it does not automatically gets me back to the app. Instead shows a button saying "Return to App_name". Shouldnt I be automatically redirected to the app as I have mentioned the return URL when creating the 3Dsource?
Issue #3) With #2 mentioned above, when I click on "Return to App", the appdelegate boolean stripeHandled returns as false, even though I can see that the url returned to the app is the one that I set as the return URL while creating the 3D source,
Please let me know what am I missing!
If possible, please include a brief piece of code (or ideally, a link to an example project) demonstrating the problem you're having.
func paymentContext(_ paymentContext: STPPaymentContext, didCreatePaymentResult paymentResult: STPPaymentResult, completion: @escaping STPErrorBlock) {
let source = paymentResult.source.stripeID
self.price = (Int(amountTextBox.text!)!) * 100
createStripeSource(card: source)
}
func createStripeSource(card: String) {
let threedparams = STPSourceParams.threeDSecureParams(withAmount: 1098, currency: "hkd", returnURL: "stripe-payment://stripe-redirect", card: (card))
STPAPIClient.shared().createSource(with: threedparams) { source, error in
if let err = error {
print(error?.localizedDescription)
} else if let source = source {
let redirectContext = STPRedirectContext(source: source, completion: { (sourceID, clientSecret, error) in
print("User back !")
STPAPIClient.shared().startPollingSource(withId: sourceID, clientSecret: clientSecret!, timeout: 10, completion: { source, err in
if let source: STPSource = source {
switch source.status {
case STPSourceStatus.chargeable:
print("chargeable")
case STPSourceStatus.consumed, STPSourceStatus.canceled, STPSourceStatus.pending, STPSourceStatus.failed, STPSourceStatus.unknown:
print("failed")
}
} else if let err: Error = error {
print("source: polling err \(err)")
}
})
}
)
//redirectContext?.startRedirectFlow(from: self)
redirectContext?.startSafariAppRedirectFlow()
//redirectContext?.startSafariViewControllerRedirectFlow(from: self)
}
}
}
11.2 and 10.3.1
What version of iOS are you observing the problem on?
How did you install our SDK?
pod 'Stripe', :git => 'https://github.com/stripe/stripe-ios.git', :branch => 'v12.1.2'
when I used only pod 'Stripe', version 11.5.0 is getting installed... when used the above, it installed v12.1.1
12.1.1
What version of our SDK are you using? You can find this by either looking at your Podfile.lock (if you're using Cocoapods), your Cartfile.resolved (if you're using Carthage), or by looking at the value of STPSDKVersion in STPAPIClient.h.
Anything else you can include that'll make it easier for us to help you!
Hi @buntydey ,
Sorry to hear you're having trouble with your 3DS integration!
1) I believe this will happen when 3DS is optional on the source. You can use the 4000000000003063 test card number to create a source for which 3DS is required. [0]
2) Due to limitations with app redirects in Safari, we need to display a button in order to redirect the customer back to your app.
3) This looks like it may be a bug on our end – we'll try to get a fix into the next release.
Hope this helps. You can follow up with [email protected] if you run into any other issues with your integration.
Ben
[0] https://stripe.com/docs/testing#3ds-cards
Hi, for #1, I am indeed using card 3063, and NOT a non 3DS card. Please advice.
For #3, any date for your next release?
Also, could you advice why "pod Stripe" installs v11.5.0 and not the latest version?
We are experiencing the same problem as described in issue 1 with STPRedirectContext and iDEAL sources, but only in Live Mode. Stripe SDK v12.1.2
Hi @buntydey,
Thanks for reporting these issues, and I'm sorry you haven't heard back from us sooner.
the safari view controller seems to come and go back in a flash without any intervention and brings me back to the app
I am indeed using card 3063, and NOT a non 3DS card. Please advice.
I believe that you've been seeing this, but I've been unable to reproduce this with 3D Secure 🙁 I was able to reproduce the same buggy behavior with iDEAL (reported by @SteveLeviathan), and we just released v13.0.1 with a fix.
When you're able to update, I'd really like to know if 13.0.1 fixes it or if it's still happening for you with 3DS.
when I click on "Return to App", the appdelegate boolean stripeHandled returns as false
I was able to reproduce this, but haven't gotten it fixed yet. We think the SafariViewController flow is better, both the user experience and for your conversion rate, so hopefully 13.0.1 will let you switch back to the in-app browser. That doesn't excuse the bug, and we're tracking it internally to fix.
could you advice why "pod Stripe" installs v11.5.0 and not the latest version?
I do not know, and I hope you've figured it out. Perhaps you need to run pod repo update, or the automatic repo update is failing for some reason?
@SteveLeviathan - I really appreciate your help (through Eoin) getting the iDEAL bug tracked down and fixed.
@danj-stripe Yesterday evening I've completed an iDEAL payment in Live Mode via SFSafariViewController with your changes from the PR, so I can confirm it now works.
@buntydey I'm going to close this, but if the SafariViewController flow doesn't work after updating to 13.0.1 or later, please let us know.
run well with the stripe-ios example(obj-c) which is using the startRedirectFlowFromViewController, but failed to get response from alipay in the example of https://github.com/tipsi/tipsi-stripe even after stripe version updated(updated to 13.0.1). This library is calling the startSafariAppRedirectFlow function.
find out callback.listener(inside STPURLCallbackHandler.m > handleURLCallback function ) is not present after redirection. Seems similar action need to take on the startSafariAppRedirectFlow function as the startRedirectFlowFromViewController function?
issue resolved. it is the react native stripe library issue. sorry for misleading. thanks.
Most helpful comment
@danj-stripe Yesterday evening I've completed an iDEAL payment in Live Mode via SFSafariViewController with your changes from the PR, so I can confirm it now works.