Stripe-ios: 3DS Support

Created on 14 Jul 2016  路  6Comments  路  Source: stripe/stripe-ios

Hi Jack :)

Just wondering whether you're planning on integrating support for 3D Secure into the iOS SDK - similar to how Stripe.js works.

At present, 3DS is quite painful to use with iOS:

  • you can't navigate directly to the redirect_url in a SFSafariViewController because it requires a POST
  • you can't provide an app scheme URL as the return_url

If it's not currently on the roadmap, I'd love it if it was considered!

Most helpful comment

Hey guys, any update on that? 3DS is a key feature for fraud prevention, and the current flow has too much frictions... We'd love to have the same fluidity on the 3DS secure flow than on the rest of your payment flow!

Please keep us posted :) Thanks!

All 6 comments

Hey James - short answer, yes, this is something we'll be working on in the next few months. Thanks for the feedback!

Nice - looking forward to it 馃憤馃徏

As an aside, we're currently handling the first issue by using a data URI containing a tiny bit of HTML to do the form post:

function genDataUri(redirectUrl) {
    const html = `
        <html>
            <body onload="document.frm.submit()">
                <p>Redirecting...</p>
                <form name="frm" method="post" action="${redirectUrl}"></form>
            </body>
        </html>
    `;

    const base64 = new Buffer(html).toString('base64');
    const urlEncoded = encodeURIComponent(base64);

    return `data:text/html;base64,${urlEncoded}`;
}

Actually just to quickly follow up - for anyone who is searching for a solution and comes across this:

The data URI trick does not work in SFSafariViewController. It will not allow you to provide a data URI as the URL. It does work with WKWebView, but then you lose out on the cookies, card details, etc. which are all provided via Safari.

To provide for the best experience, you have to navigate the user to a page on your own website, which then contains HTML along these lines:

<html>
    <body onload="document.frm.submit()">
        <p>Redirecting...</p>
        <form name="frm" method="post" action="https://example.com"></form>
    </body>
</html>

@jflinter Any idea where this sits on the roadmap? We've had more problems with using SFSafariViewController :(

@billinghamj - we're working on it now, but don't have a timeline for when it'll be done, i'm afraid.

Hey guys, any update on that? 3DS is a key feature for fraud prevention, and the current flow has too much frictions... We'd love to have the same fluidity on the 3DS secure flow than on the rest of your payment flow!

Please keep us posted :) Thanks!

Was this page helpful?
0 / 5 - 0 ratings