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

returnUrlForSca: How to se up a dynamic link (with format https://...) when kIsWeb=false #142

Open
danielo17 opened this issue Jul 11, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@danielo17
Copy link

Hello,

I'm busy with a stripe integration with stripe-sdk. Great library btw.

I need to have my app 3DSecure ready, therefore I'm testing with cards forcing the extra authentication step. A dynamic link is supposed to bring back the user to the app once this is done.

Everything works fine for me, except that I don't manage to set up the dynamic link, because the library seems to be forcing NOT to have an http://... format. Checking the code in stripe-sdk, this is the part that Is blocking me.

_bool _isValidScheme() {
var isHttpScheme = ['http', 'https'].contains(returnUrlForSca.split(':')[0]);
if (kIsWeb) {
assert(isHttpScheme, 'Return URL schema must be http/https when compiled for web.');
} else {
assert(!isHttpScheme, 'Return URL schema must not http/https when compiled for mobile.');
}
return true;
}

If I comply with the "non http" format, I get an error when stripe redirects back.

I had a look to the Stripe API and seems to be no limitation in this sense. An optional param "returnURL" can be passed to ConfirmPaymentIntent, which is what I'm doing.

Did anyone set up a dynamic link -a deep link- (so that the URL redirects to a particular) part of the application to continue successfully using this library?

Many thanks in advance.

@ezet
Copy link
Owner

ezet commented Feb 9, 2022

I haven't considered this case. The check is there to make sure users don't accidentally use https on ios/android, as that is usually not what you want. I'll consider support for dynamic links in the future. The library is set up to automatically handle the deeplink for you after 3ds, using traditional deeplink mechanics.

@ezet ezet closed this as completed Feb 9, 2022
@ezet ezet reopened this Feb 9, 2022
@ezet ezet added the enhancement New feature or request label Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants