-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When processing Result for a PI, refresh until reaches deterministic state #4296
Conversation
1153d78
to
1d719de
Compare
payments-core/src/main/java/com/stripe/android/payments/PaymentFlowResultProcessor.kt
Show resolved
Hide resolved
payments-core/src/main/java/com/stripe/android/payments/PaymentFlowResultProcessor.kt
Outdated
Show resolved
Hide resolved
requestOptions | ||
) | ||
) | ||
while (stripeIntent.requiresAction() && remainingRetries > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make this remainingRetries >= 1
and then we don't have to subtract 1 at the beginning. Kinda messes with my brain a bit. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, updated
} | ||
|
||
if (stripeIntent.requiresAction()) { | ||
throw MaxRetryReachedException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this exception get caught?
Summary
For some payment methods, after user confirmation(resulting in
flowOutCome == SUCCEEDED
), there is a delay when Stripe backend transfers its state out ofrequires_action
. For a PaymentIntent with such payment method, we will need to poll the refresh endpoint until the PaymentIntent reaches a deterministic state.Current wechat pay is the only payment method that requires this. Other payment methods(e.g UPI, see this internal doc for details) might also need this.
For more details, please see this, this and this internal doc
Motivation
relaunch wechat pay
Testing
Screenshots