#kevin_code
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- kevin_code, 8 minutes ago, 5 messages
- kevin_code, 4 hours ago, 11 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1270030433475887278
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
We can't re-open threads, we expect to chat in real-time here so if you go afk then your thread gets closed after inactivity.
Hey I have the same problem on my thread ๐
Oh okay sorry I didn't had the notification that was why I didn't answered :/
Should we re-create the issue ?
Nah I think I got the gist of it.
You are saying your deeplinking isn't working for 3DS
But it is for Paypal?
Is that correct?
Sorry I badly explained, for PayPal the deeplink is working but for 3DS it's for a credit card that the deeplink is not working, I haven't checked 3DS for PayPal yet, how do I test that out of curiosity?
Oh okay didn't understand my bad
Can you share a PaymentIntent that you tested with for Paypal and one that you tested with for card?
Oh okay let me find the IDs, I come back to you right now
Sure
So here is the payment intent for PayPal : pi_3PkSK1BBURfSZNfg0HKAoWn3
And here is the payment intent for the credit card : pi_3PkSLVBBURfSZNfg0ReSxhvL
Thanks, while I look at those can you share your deep linking code?
Yeah what do you need to see precisely?
The relevant Stripe deep linking code
Should look similar to https://docs.stripe.com/payments/accept-a-payment?platform=react-native#react-native-set-up-return-url
// linking.ts
import { LinkingOptions, NavigatorScreenParams } from '@react-navigation/native';
import { Linking } from 'react-native';
import { useStripe } from '@stripe/stripe-react-native';
import { MainStackParamsList } from './main-stack/main-stack';
export const useLinking = () => {
const { handleURLCallback } = useStripe();
const linking: LinkingOptions<{
MainStack: NavigatorScreenParams<MainStackParamsList>;
}> = {
prefixes: ['https://*.example.com'],
// Custom function to get the URL which was used to open the app
getInitialURL: Linking.getInitialURL,
// Custom function to subscribe to incoming links
subscribe: (listener: (url: string) => void) => {
const linkingSubscription = Linking.addEventListener('url', async ({ url }) => {
listener(url);
// This promise return a boolean to check if the URL is handled by Stripe or not
// cf: https://docs.stripe.com/payments/accept-a-payment?platform=react-native#react-native-set-up-return-url
await handleURLCallback(url);
});
return () => {
linkingSubscription.remove();
};
},
config: {
screens: {
MainStack: {
screens: {
Recap: {
path: 'safepay',
},
},
},
},
},
};
return { linking };
};
// app.tsx
import { NavigationContainer } from '@react-navigation/native';
const { linking } = useLinking();
<NavigationContainer
ref={navigationRef}
theme={navTheme}
onReady={onReadyWithSentry}
linking={linking}
>.....</NavigationContainer>
First part of the code is the linking object I need for react-navigation and second part is where I apply it
Hmm for 3DS for the card payment you are handling it client-side using the SDK?
Are you calling handleNextAction()?
I'm currently watching the codebase which was done years ago and not updated since
So when we add a credit card, we call createPaymentMethod first and if the intent status is equal to requires_action we call handleNextAction
This is what is done currently on master and the deeplink not enabled on our app
Yep okay and are you setting a returnURL when you call handleNextAction()?
Ah I didn't saw we could put a second parameter, let me try and tell you if that works or not ! ๐
Should the return URL be the baseURL like https://www.example.com or does it need to be the whole URL like https://www.example.com/cart ?
It should be whatever URL your deeplinking expects. Likely the same as what you are setting when you confirm Paypal payments like I can see you did here: https://dashboard.stripe.com/test/logs/req_kalnvGyDJXmVBE
Okay thanks I'll check if it works!
๐
Mmmmm so when testing createPaymentMethod is being called but handleNextAction is not needed because the intent status is not requires_action , I suppose I'm being redirected because of StripeProvider urlScheme props but IDK why here the deeplink is not working but for PayPal it does work ๐ค
No in that case you are handling the redirect yourself
We would not redirect at all for you if you create/confirm a PaymentIntent on your backend and then 3DS isn't needed and the PaymentIntent moves to succeeded.
The createPaymentMethod request doesn't really do anything except create the PM object
You are then passing that to your backend to create a PaymentIntent
You need to look at your backend code for what it is doing if that PaymentIntent creation request returns a status of succeeded (meaning 3DS wasn't required)
Mmmmmm
On our side the back-end does not handle the redirection at all and the issue happens only now since I added the urlScheme props in the StripeProvider because without this on the master branch I don't have any redirection and it works fine ๐ค
Can you share the PaymentIntent you just tested with, where you didn't request 3DS?
Yeah of course ! It's this one pi_3PkSNgBBURfSZNfg1crlSTof
That PaymentIntent did go through 3DS
Yes but the issue is that if I'm not adding the urlScheme props in the StripeProvider, it redirects nowhere and shows me this (cf screenshot)
But if I'm adding the urlScheme it redirects me to the URL I put but without the deeplink working, meanwhile it works fine for PayPal ๐ค
I thought you were saying that when 3DS wasn't required you were having an issue
Oh sorry I'm not clear enough
Like for the above we just discussed that you need to set returnURL when calling handleNextAction()
Have you tried that?
Yup I tried but it didn't work :/
Okay and the PaymentIntent you just shared was when you tested that?
Yup that's it !
K one sec
Hmm okay can you try setting the return_url server-side as well when you create your PaymentIntent
I didn't think you need to do this, but you are using the legacy manual_confirmation flow here
Which really makes things a bit different
Notice that you do do this for Paypal....
Oh okay that's because of the old flow... we wanted to implement PayPal on this old flow before doing a big refactoring that's why ๐ญ
I'll need a back-end dev so it might take more time to do this :/
I do think that is going to be the next thing to try here
Okay thank you I'll try this and surely open a new thread to come back to you or someone else
Thank you for the time you spent with me, you really helped me ๐