Skip to content
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

Merged
merged 4 commits into from
Oct 19, 2021

Conversation

ccen-stripe
Copy link
Collaborator

@ccen-stripe ccen-stripe commented Oct 15, 2021

Summary

For some payment methods, after user confirmation(resulting in flowOutCome == SUCCEEDED), there is a delay when Stripe backend transfers its state out of requires_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

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Before After
before screenshot after screenshot

skyler-stripe
skyler-stripe previously approved these changes Oct 19, 2021
requestOptions
)
)
while (stripeIntent.requiresAction() && remainingRetries > 0) {
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, updated

@ccen-stripe ccen-stripe merged commit 790d0df into master Oct 19, 2021
@ccen-stripe ccen-stripe deleted the fixWeChat2 branch October 19, 2021 21:40
}

if (stripeIntent.requiresAction()) {
throw MaxRetryReachedException()
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants