feat(router): add support for overcapture#8949
Merged
likhinbopanna merged 55 commits intomainfrom Sep 9, 2025
Merged
Conversation
deepanshu-iiitu
previously approved these changes
Aug 25, 2025
Contributor
deepanshu-iiitu
left a comment
There was a problem hiding this comment.
Connector changes look good
hrithikesh026
requested changes
Aug 28, 2025
migrations/2025-08-25-832974_overcapture_flags_to_payment_intent_attempt_and_profile/up.sql
Outdated
Show resolved
Hide resolved
Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com>
…nt_attempt_and_profile/up.sql Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com>
hrithikesh026
previously approved these changes
Sep 4, 2025
deepanshu-iiitu
approved these changes
Sep 8, 2025
Gnanasundari24
approved these changes
Sep 9, 2025
ThisIsMani
approved these changes
Sep 9, 2025
Contributor
ThisIsMani
left a comment
There was a problem hiding this comment.
Dashboard specific changes looks fine.
Closed
2 tasks
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.
Type of Change
Description
Overcapture allows a merchant to capture more than the originally authorized amount for a transaction. In most cases, this is controlled by a connector-level configuration. However, some connectors (such as Stripe) also allow merchants to explicitly request overcapture via the Payments API.
Proposed Solution:
When
confirm = falseand capture is manual →payment_intent.enable_overcapture = request.enable_overcaptureWhen
confirm = trueand capture is manual →request.enable_overcaptureis present →payment_intent.enable_overcapture = request.enable_overcapturepayment_intent.enable_overcapture = profile.always_enable_overcaptureSome connectors return a flag (e.g.,
is_overcapture_enabled) in the authorization response along with the maximum capturable amount. We store this in the payment attempt and expose it in the payments response.If the connector does not return either the flag or the capturable amount, we fall back to mapping
payment_intent.enable_overcaptureto theis_overcapture_enabledflag in the payment attempt. This ensures overcapture is treated as supported whenever the merchant has enabled it at the connector level.Overcapture is integrated for Stripe and Adyen
Additional Changes
How did you test it?
Configure Always-On Overcapture and Execute Stripe Payment
Update profile to always enable overcapture
Response
Do a payment via stripe
Response (The feature has to be enabled at stripe)
Override the profile config by passing enable_overcapture = false in the payments request
Response
Try capturing amount greater than auth amount. This must throw an error
Response
Verify Overcapture Support in Adyen Payments
Response
Complete the 3ds flow
Psync
Do a capture for 100 dollars
Response
Setup the webhooks and you must receive a capture webhook with amount - 100 dollars after this do a Psync
Adyen Cypress test
Checklist
cargo +nightly fmt --allcargo clippySummary by CodeRabbit