Closed fanwgwg closed 2 years ago
Another thing I observe is that no matter Alipay is installed or not, if I cancel the payment within Alipay (e.g, tapping close button in the redirected Alipay activity), the PaymentIntentResult
will contain status RequiresAction
instead of Cancelled
, with message We are unable to authenticate your payment method. Please choose a different payment method and try again
Hi @fanwgwg, thanks for raising the issue. I'm working on reproducing and fixing this. If the issue is always reproducible, can you share the full stack trace for the exception?
Hey @fanwgwg, I was able to reproduce and fixed the issue in #5554.
Regarding the status after cancelation, RequiresAction
is correct, and means that the user needs to confirm the payment on Alipay. Canceled
in this case would mean that you've canceled the Payment Intent, and it cannot be confirmed anymore. See more about the Intent statuses on our docs: https://stripe.com/docs/payments/intents#intent-statuses.
I also added examples of integrating with and without the Alipay SDK on the PR above. When the user cancels the flow, the Payment Intent stays in status RequiresAction
, and you can try to confirm it again.
The fix is live in v20.13.0, please try it out and let us know if you have any problems.
The integration docs were also updated to clarify the RequiresAction
status.
Thanks again for raising this!
Thank you @bruno-stripe for the quick action! I have one question regarding the PR #5554 and the documentation. In PR #5554, the example AlipayPaymentNativeActivity
was updated with the following code block
StripeIntent.Status.RequiresAction ->
updateStatus("\n\nUser canceled confirmation")
From what I can understand, we're treating RequiresAction
as cancellation here. However, at the documentation here, it still says that
Remember to handle the RequiresAction status and call handleNextActionForPayment to open the Alipay app (if installed) or shows its own UI and communicates the result back to the Stripe SDK automatically.
Should we still handle the RequiresAction
by calling handleNextActionForPayment
?
Friendly ping :)
Hey @fanwgwg, thanks for pointing that out.
I'll update the docs. That's not required, as the confirmAlipayPayment
method will already handle authentication, and if the status is still RequiresAction
after that, it means the user canceled the authentication.
stripe.confirmAlipayPayment(
ConfirmPaymentIntentParams.createAlipay(paymentIntentClientSecret),
{ data -> PayTask(this@AlipayActivity).payV2(data, true) }
)
Summary
I'm trying to integrate with Alipay using this SDK. However, after a successful alipay payment (I have alipay app installed on my device, the payment is redirected to the alipay app and it succeeds, I'm not able to reproduce this issue if Alipay is not installed),
ApiResultCallback#onError
was triggered, with the following errorCode to reproduce
ApiResultCallback#onError
callback is triggered.Android version
Android 12. Alipay sdk
com.alipay.sdk:alipaysdk-android:15.8.11@aar
from maven.Impacted devices
Installation method
Through gradle
implementation 'com.stripe:stripe-android:20.10.0'
Dependency Versions
kotlin: stripe-android:
implementation 'com.stripe:stripe-android:20.10.0'
Android Gradle Plugin: 7.3.0-rc01 Gradle: 7.4SDK classes
Video
Other information