Stripe-android: Is the "return to merchant" screen required?

Created on 20 May 2017  路  13Comments  路  Source: stripe/stripe-android

After 3d secure verification I see this screen:

Are there any ways to skip this screen and redirect user to application as soon as he confirmed 3d secure?
There is no such screen in js version.

triaged

Most helpful comment

Two years later, we have an update!

We just release stripe-android v10.0.0. As part of this release, if you use our new Payment Intent integration, the Stripe Android SDK now manages both native 3DS2 and web-hosted 3DS1 authentication flows for you, including automatically closing out the authentication screen and returning the authentication result to the Activity that launched the authentication flow.

All 13 comments

At the moment there isn't -- in JS we don't have that screen because you can do an auto-redirect, but at the moment we can't auto-launch an Intent to go back to your app.

If we figure out a way to do that, we'll definitely include it quickly.

Can we customize the message on the button? Like "return to WebShop"?

Hello everyone, I probably found a way to avoid showing the "Back to merchant" page, but only if you are using a webview inside your app instead of launching an external browser.

You can override the _onPageStarted_() method of the _WebViewClient_ class and intercept the URLs which will be loaded after a success or failed 3DS.

Failure case:
https://hooks.stripe.com/redirect/complete/src_xxxxxxxxxxxxxx?client_secret=src_client_secret_xxxxxxxxxxxxxxx&error_message=The%20cardholder%20failed%203D%20Secure%20authentication.&status=failure

Success case:
https://hooks.stripe.com/redirect/complete/src_xxxxxxxxxxxxxx?client_secret=src_client_secret_xxxxxxxxxxxxxxx&status=success

So here you can check the value of the status parameter and know if the 3DS was successfully completed or not and act accordingly (e.g. closing the WebView and avoid displaying the "Back to merchant" page)

I imagine this is a tricky way and not an official one, and that these URLs could inadvertently be changed. So anyway, I suggest to still rely on the intent-filter way as written in the official documentation as a backup plan, in case the URLs and parameter you are looking for won't match.

@ema987 I don't totally understand the lifecycle of WebViewClient, so I'm not sure what onPageStarted does exactly. However, I would recommend against doing this not only because the query parameters are not an official interface, but also because we may do additional processing when we load /redirect/complete/*. So, if you're closing the view before we receive that request, you'd be preventing Stripe from completing this processing.

That said, I understand that this view is not a great experience today. We'll look into this some more.

So then, unfortunately, that trick is not feasible. @michelle thank you for your explanation.

We also looked briefly into why this button is necessary -- it's because for a real browser redirect (not opening up a webview), apps like Chrome do not allow websites to automatically redirect to an app URL. The redirect must be triggered by a physical click.

That said, this is clearly suboptimal if you're using webviews, so we're looking into other solutions.

Is there any way to customise or at least translate the "Return to Merchant" button? This is very confusing for non English users.

any news?

Two years later, we have an update!

We just release stripe-android v10.0.0. As part of this release, if you use our new Payment Intent integration, the Stripe Android SDK now manages both native 3DS2 and web-hosted 3DS1 authentication flows for you, including automatically closing out the authentication screen and returning the authentication result to the Activity that launched the authentication flow.

@mshafrir-stripe That's great. Does this also apply to the iDEAL flow?

@utwyko this should work for any authentication that was using PaymentIntent's next_action.redirect_to_url

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andrewmunn picture andrewmunn  路  4Comments

Petrulak picture Petrulak  路  5Comments

danielgomezrico picture danielgomezrico  路  9Comments

jose-t picture jose-t  路  8Comments

odedharth picture odedharth  路  4Comments