#Tao
1 messages · Page 1 of 1 (latest)
Hi 👋
AliPay requires customers to authenticate and be redirected so you need to provide a return_url when cnfirming the payment.
Can you share an API request ID for this? It will start with req_
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_7p3dQoXihSWFvK
Okay yeah, you need to provide a URL that will return the customer to your website/app
We show how to do that in this section of the doc: https://stripe.com/docs/payments/alipay/accept-a-payment?platform=web&ui=API#submit-payment
I'm trying to use the react native SDK and the docs didn't mention where to put the return_url parameter. The error comes from the line const { error, paymentIntent } = await confirmPayment(clientSecret, {
type: 'Alipay',
});, but there is no param that accepts return_url according to https://stripe.dev/stripe-react-native/api-reference/index.html#ConfirmPaymentResult
Documentation for @stripe/stripe-react-native
Here is the version of that doc for RN: https://stripe.com/docs/payments/alipay/accept-a-payment?platform=mobile&ui=react-native#react-native-redirect-alipay-wallet
It handles things in a different way
Sorry for still being confused. I did follow step 3 for the guide, but the error comes from step 4 with the line
const { error, paymentIntent } = await confirmPayment(clientSecret, {
type: 'Alipay',
});
Is it because I need to implement logic in these lines for step 3
if (stripeHandled) {
// This was a Stripe URL - you can return or add extra handling here as you see fit
} else {
// This was NOT a Stripe URL – handle as you normally would
}
Do you have your custom URL scheme configured?
The Stripe React Native SDK specifies safepay/ as the return URL host for bank redirect and digital wallet payment methods. After the customer completes their payment with Alipay, they’re redirected to myapp://safepay/, where myapp is your custom URL scheme
I am using Expo and I have added
{
"expo": {
"scheme": "myapp"
}
}
I am testing with a ios simulator, is it possible that Alipay can only be tested on an iPhone?
The customer may go out of your app to authenticate, for example, in Safari or their banking app. To allow them to automatically return to your app after authenticating, configure a custom URL scheme or universal link and set up your root component to forward the URL to the Stripe SDK.
So are you opening AliPay to Safari?
I believe it is redirected back to the app by adding the scheme in expo
Sorry I meant launching AliPay in a webview
I'm confused about how Stripe integrates with Alipay for this part, is it designed to launch Alipay in a webview or the actual app?
Webview, AliPay does not allow launching in the app
Because the authentication request has to take place outside your app
Got it, thank you. How does this information affect the fact that we are running into this error? I have configured step 3, but step 4 still returns error with missing return_url.
This is more tricky in React Native because of the deep link URL schemes. I would double check the linking documentation for Expo to make sure everything is set up properly: https://docs.expo.dev/guides/linking/#in-a-standalone-app
Thank you, I will look into that.
I did find a post on stackoverflow with the same issue 7 months ago with no fix. If I still cannot resolve the issue, can you look into the problem internally?
We can continue to investigate this if you come back to this channel and raise the issue.
I managed to solve the issue. I need to provide urlScheme="your-url-scheme" for aliPay in step 1. Thank you for the help.