#kevin_code

1 messages ยท Page 1 of 1 (latest)

bold creekBOT
harsh chasmBOT
#

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.

bold creekBOT
#

๐Ÿ‘‹ 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.

distant sapphire
#

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.

exotic cove
#

Hey I have the same problem on my thread ๐Ÿ˜…

spring kindle
#

Oh okay sorry I didn't had the notification that was why I didn't answered :/

exotic cove
#

Should we re-create the issue ?

distant sapphire
#

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?

spring kindle
#

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?

distant sapphire
#

No that is what I meant above

#

3DS is only for cards

spring kindle
#

Oh okay didn't understand my bad

distant sapphire
#

Can you share a PaymentIntent that you tested with for Paypal and one that you tested with for card?

spring kindle
#

I will gladly share that, how can I do so?

#

You want a video?

distant sapphire
#

No the ID would be great

#

Like pi_xxxxx

spring kindle
#

Oh okay let me find the IDs, I come back to you right now

distant sapphire
#

Sure

spring kindle
#

So here is the payment intent for PayPal : pi_3PkSK1BBURfSZNfg0HKAoWn3
And here is the payment intent for the credit card : pi_3PkSLVBBURfSZNfg0ReSxhvL

distant sapphire
#

Thanks, while I look at those can you share your deep linking code?

spring kindle
#

Yeah what do you need to see precisely?

distant sapphire
#

The relevant Stripe deep linking code

spring kindle
#
// 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

distant sapphire
#

Hmm for 3DS for the card payment you are handling it client-side using the SDK?

#

Are you calling handleNextAction()?

spring kindle
#

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

distant sapphire
#

Yep okay and are you setting a returnURL when you call handleNextAction()?

spring kindle
#

Ah I didn't saw we could put a second parameter, let me try and tell you if that works or not ! ๐Ÿ™

distant sapphire
spring kindle
#

Okay thanks I'll check if it works!

distant sapphire
#

๐Ÿ‘

spring kindle
#

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 ๐Ÿค”

distant sapphire
#

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)

spring kindle
#

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 ๐Ÿค”

distant sapphire
#

Can you share the PaymentIntent you just tested with, where you didn't request 3DS?

spring kindle
#

Yeah of course ! It's this one pi_3PkSNgBBURfSZNfg1crlSTof

distant sapphire
#

That PaymentIntent did go through 3DS

bold creekBOT
spring kindle
#

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 ๐Ÿค”

distant sapphire
#

I thought you were saying that when 3DS wasn't required you were having an issue

spring kindle
#

Oh sorry I'm not clear enough

distant sapphire
#

Like for the above we just discussed that you need to set returnURL when calling handleNextAction()

#

Have you tried that?

spring kindle
#

Yup I tried but it didn't work :/

distant sapphire
#

Okay and the PaymentIntent you just shared was when you tested that?

spring kindle
#

Yup that's it !

distant sapphire
#

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....

spring kindle
#

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 :/

distant sapphire
#

I do think that is going to be the next thing to try here

spring kindle
#

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 ๐Ÿ™