#guizhong_10139
1 messages · Page 1 of 1 (latest)
Hi
here does not carry available parameters
What you mean exactly by this ? could you please share more details ?
Normally, it should carry the 'payment_intent' parameter for me to use
But after I click, the callback address of the jump does not have this parameter, but there is this parameter in the original window
Can you share the code you are using for confirming the payment intent ?
/payment/stripestatus?payment_intent=pi_3NhqGBDZuQbHB0QK0uQj7Fz8&payment_intent_client_secret=pi_3NhqGBDZuQbHB0QK0uQj7Fz8_secret_t8WNNiuQmbdmb6sZHct8m9Cju Normally it should return like this
Newly opened windows will simply return
'/payment/stripestatus'
What was the status of the Payment Intent after the test ?
After the test, two windows will be generated in the browser, one is the original pop-up window, and the other is a newly generated test window to confirm whether the payment is successful. The original pop-up box can return the link parameters normally, but the newly generated test window to confirm whether the payment is successful will not return the link with the parameters
OK the issue is that you are doing a redirection by your own also
window.location.href
you else block, is valid also when the payment status is suscceeded
You should remove the else block
and add the payment_intent and status in the return_url of the confirmPayment function
But how should I get payment_intent and status in the confirmPayment method
The res.paymentIntent.id parameter I used was obtained after the confirmPayment() method was executed
according to your code you are not passing a status... you'e just passing the payment_intent and the payment_intent_client_Secret
on the redirection, you read the query params and make an API call to fetch the PaymentIntent status
I used the two parameters in the picture, but they are both the return value of confirmPayment()
Other redirected payment methods will automatically carry the correct parameters, only WeChat Pay does not, I have tested other payment methods
Did you tried payment method that requires redirection like wechat ?
in the code you are sharing in some cases, you'll have two redirections in place.
return_url of the confirmPayment and the window.location.href of your code
First keep only return_url one and do again the test.
I have tested Alipay with the same code, there is no problem
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
OK OK
So, when you get redirected back after using WeChat Pay, you don't get the query parameters, correct?
Let me test this.
yes
I have just tested and I am getting the redirect parameters.
Could you please share the PaymentIntent ID pi_xxx?
"pi_3Nhqi2DZuQbHB0QK0sgTqZ14"
can you get it Is there an example that I can refer to
Now Alipay redirected return_url can be obtained, but WeChat payment cannot
I see your API version is not so fresh: 2020-08-27
Could you try sending a request with a newer version?
I will also try using an old version.
Is this the front-end version or the back-end version?
That's Stripe API version, so you will need to use a 'Stripe-Version': '...', header for both calls.
No, sorry, I tried using your version and I am still getting the query parameters. You can disregard that idea.
Can you remove redirect: id_required please?
And see what happens
ok
Does this api version need to be upgraded in the management account? This administrative account is not with me
It still doesn't work, return_url: '/payment/stripestatus' has no parameters
No need for that, it's doesn't seem to be the problem.
What did you do?
I removed redirect: 'if_required' to try to redirect
And it didn't help?
Are you redirecting the customer after they hit /payment/stripestatus?
Maybe you have a site to replicate this? It doesn't sound right. Maybe you could use ngrok.io to allow me to test it for myself: https://ngrok.com/
You can use this URL to test https://test-suda1.huion.cn/hk
This website has both Alipay and WeChat, Alipay is normal
I can't access it, unfortunately, as I am based in Europe.
Also accessible in Europe
Ok, It worked for me. It redirected me somewhere first, with the correct parameters, and then redirected again here: https://test-suda1.huion.cn/hk/payment/result?gateway_trade_no=pi_3NhrEQDZuQbHB0QK0z6HkNb3
So there's something else happening in the background.
Yes, there is no parameter in the newly opened window using WeChat payment, have you seen it?
Yes, before I was redirected to this 👆
I tried again, this is the URL I get before being redirected ☝️
This means /hk/payment/stripestatus path in your backend is doing some redirection.
https://stripe.com/en-hk/payment_methods/test_payment?payment_attempt=payatt_3NhrJODZuQbHB0QK0fIL0c5A After using this address, the redirected link becomes https://test-suda1.huion.cn/hk/payment/stripestatus. missing?payment_intent=pi_3NhrJDDZuQbHB0QK2abgzFnE&payment_intent_client_secret=pi_3NhrJDDZuQbHB0QK2abgzFnE_secret_qSzEEXAmVTFs6GosaMZ1ZSA3t
The original payment window of WeChat payment has parameters. The problem now is that the window I want him to redirect also has parameters, but in fact he does not have them.
It won't be the case in Live mode, because there will be only one tab.
The second tab is only there to help you out in Test mode
ok, that is, in the official environment, there will be no redirection of WeChat payment, but a QR code for users to pay
Hahaha, after working for so long, I found that the official environment will not appear, thank you
Happy to help!