#jry_j-alipay-reactnative

1 messages ยท Page 1 of 1 (latest)

zealous sandal
#

@scarlet hull hello! Flagging I know ~nothing about React Native but my team does so I can work with you and try to clarify and get you unblocked

#

So you mention a webview overlay, can you share a screenshot of what you see first and also share the relevant code and what is blocking you?

scarlet hull
#

of course

#

Here's the implementation in my App.js, translated from the functional example that you guys had in the documentation

zealous sandal
#

Can you share real code instead of pictures of code?

scarlet hull
#

oh sorry

#

async componentDidMount() { const initialUrl = await Linking.getInitialURL(); this.handleDeepLink(initialUrl); Linking.addEventListener('url', (event) => { console.warn('EVENT'); this.handleDeepLink(event.url); }); }

#

handleDeepLink = async (url) => { console.warn('url', url); if (url && url.includes('safepay')) { await handleURLCallback(url); console.warn('SAFEPAY'); } }; componentWillUnmount() { Linking.removeEventListener('url', (event) => { console.warn('EVENT'); this.handleDeepLink(event.url); }); }

clever kiln
#

hey there

scarlet hull
#

Hi

clever kiln
#

are there any errors surfaced related to this? can you share an example payment intent ID you're creating with a redirect back to your app?

scarlet hull
#

Sure

#

I haven't seen any errors

#

pi_3Ja3WTIRk2Tp6gkD17hv6u9C

#

do you need the full object or just the id?

#

const paymentIntent = await stripe.paymentIntents.create({ payment_method_types: ['alipay', 'card'], amount: 1099, currency: 'cad', customer: stripe_cuid, }); I'm currently using the example from doc to create the Payment Intents

scarlet hull
#

do you guys need more info?

zealous sandal
#

cc @clever kiln

#

@scarlet hull sorry for the delay

scarlet hull
#

No worries, I've been self teaching the whole development so it may just be I'm too dumb haha ๐Ÿ˜…

clever kiln
#

@scarlet hull in you initial message you mentioned urlScheme but i dont see that mentioned anywhere else -- how are you using this currently to redirect?

scarlet hull
#

that's in my App.js in the StripeProvider container

#

<StripeProvider // Stripe Migration publishableKey={STRIPE_PUBLISHABLE_KEY} urlScheme={'myapp'} merchantIdentifier='PLACEHOLDER' // for Apple Pay > <View style={styles.container}> {Platform.OS === 'ios' && <StatusBar barStyle='default' />} <Provider store={store}> <AppNavigator /> </Provider> </View> </StripeProvider>

#

I replaced my actual urlScheme with 'myapp' and replaced my merchant identifier as well just for privacy sake

#

In the payment intent object I see on the Alipay webscreen, it will have a return_url parameter that takes my urlScheme and add ://safepay at the end, so in this case it'll be myapp://safepay

clever kiln
#

you need to set up some underlying infra to have your app get those requests

scarlet hull
#

ok let me take a look

#

nice!

#

it looks like it's fixed

clever kiln
#

awesome!

scarlet hull
#

thanks so much, I wouldn't have ever guessed that to be the case

#

looks like I was missing those setups with linking

clever kiln
#

glad to hear thats working for you, thanks for you patience here ๐Ÿ™‚