-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Handle partial captures #268
Conversation
Codecov Report
@@ Coverage Diff @@
## master #268 +/- ##
==========================================
+ Coverage 99.56% 99.58% +0.01%
==========================================
Files 26 26
Lines 460 477 +17
==========================================
+ Hits 458 475 +17
Misses 2 2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
👍
app/subscribers/solidus_stripe/webhook/payment_intent_subscriber.rb
Outdated
Show resolved
Hide resolved
e47d22a
to
2e20c51
Compare
Stripe allows for a payment to be partially captured, creating a refund for the remaining amount [1]. We're now acting accordingly by changing how we handle the `payment_intent.succeeded` webhook. When the capture is total, we do as before. For partial captures, on top of the latter, we create a Solidus refund for the uncaptured amount. [1] - https://stripe.com/docs/payments/place-a-hold-on-a-payment-method#capture-funds Closes #221
2e20c51
to
f3632d5
Compare
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.
Thanks for looking into this @waiting-for-dev 🙌 Looks great!
Summary
Stripe allows for a payment to be partially captured, creating a refund for the remaining amount.
We're now acting accordingly by changing how we handle the
payment_intent.succeeded
webhook. When the capture is total, we do as before. For partial captures, on top of the latter, we create a Solidus refund for the uncaptured amount.Closes #221
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: