#shiva - react native
1 messages ยท Page 1 of 1 (latest)
Hello! Just starting a thread for you -- I'll review and respond as soon as I can ๐
thank you
Which payment method are you using here, and is this in test mode or live?
I believe in live mode its possible that some banks might not automatically redirect and some action is needed, but in test mode i expect that your authentication pages should redirect automatically
can i share you the video for test mode ?
Sure, but please be sure to obscure any secrets or private info
Hey there, have you implement handle for deep links on return?
See here: https://stripe.com/docs/payments/ideal/accept-a-payment?platform=react-native#react-native-handle-deep-linking
Or, since it looks like you using the payment element, this set up for IOS:
https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-set-up-return-url
The example appears to be near the root, but anywhere to handle the event appropriate, its your choice
Note the link to the react native docs which also requires some configuration
I see this function:
const handleDeepLink = async () => {
if (url && url.includes(safepay)) {
await handleURLCallback(url);
navigation.navigate('PaymentResultScreen', { url });
}
};
which url is being refffered here ?
there is no variable of url here
its the parameter of the async function in the callback
your snippet is not what in the docs
const handleDeepLink = useCallback(
async (url: string | null) => { // <<<<<<< url is the param here
if (url && url.includes('safepay')) {
await handleURLCallback(url);
// Add extra handling here as you see fit
}
},
[handleURLCallback]
);
i copied from the doc
Sorry i sent a second link for the payment element scenario
this ๐
It's not needed on android, that platform allows us to handle the necessary piece automatically
this extra setup step is iOS only
(your video showed iOS which is part of what guided me to this)
ok
but
const handleDeepLink = useCallback(
async (url: string | null) => {
if (url && url.includes('safepay')) {
await handleURLCallback(url);
// Add extra handling here as you see fit
}
},
[handleURLCallback]
);
what is useCallback now ?
i dont thiink this documentation is correct/complete
useCallback is from React, it's not specific to Stripe. eg, a sibling to useState and useEffect etc
I see ther eis an if condition that check for safe_pay but my url does not have that
exp://172.16.0.10:19000/--/home?payment_intent=&payment_intent_client_secret=*&redirect_status=succeeded
this is what i get when i print url
No, you'd change that to be based on your own URL, if i recall
i believe "safepay" is merely an example
๐
is
if (url && url.includes('succeeded')) {
a good practice ?
You'd want it to be specific to your custom redirect url
ie you might use in prod: mycoolapp://paymentsuccess/path/here and match on paymentsuccess, etc
Hey Shiva. ๐