Copy id over Solidus' payment response_code on Stripe's payment intent creation#239
Merged
waiting-for-dev merged 1 commit intoMar 22, 2023
Merged
Conversation
ec0d0e1 to
e519474
Compare
elia
approved these changes
Mar 21, 2023
elia
left a comment
Member
There was a problem hiding this comment.
🙌
Left two suggestions for your consideration, but happy to see this merged as it is as well 👍
kennyadsl
approved these changes
Mar 21, 2023
kennyadsl
left a comment
Member
There was a problem hiding this comment.
👍 Left a question before approval.
| ).tap { confirm_stripe_payment_intent(_1.id) } | ||
| ) | ||
| .tap { confirm_stripe_payment_intent(_1.id) } | ||
| .tap { payment.update_column(:response_code, _1.id) } # rubocop:disable Rails/SkipsModelValidations |
Member
There was a problem hiding this comment.
Did you consider updating the response code before calling confirm_stripe_payment_intent ?
Contributor
Author
There was a problem hiding this comment.
Oh, yeah, that was the whole point of this PR 😅 Changed, thanks for pointing out.
…t creation On #222, we're handling the `payment_intent.succeeded` webhook by fetching the associated payment via the `Spree::Payment#response_code` field. However, the response code wasn't filled until after the authorization was completed on Stripe. Once we implement auto-capture (see #178), that could be an issue, as we could receive the webhook before the column update. We're now filling `response_code` just after the payment intent creation, which always happens before confirmation on Stripe (see #231). Closes #238
e519474 to
8154a41
Compare
Contributor
Author
|
Merging, as CI will be fixed with solidusio/solidus_starter_frontend#332 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On #222, we're handling the
payment_intent.succeededwebhook by fetching the associated payment via theSpree::Payment#response_codefield. However, the response code wasn't filled until after the authorization was completed on Stripe. Once we implement auto-capture (see #178), that could be an issue, as we could receive the webhook before the column update.We're now filling
response_codejust after the payment intent creation, which always happens before confirmation on Stripe (see #231).Closes #238
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: