-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(core): payments overcapture support for V1 #6824
Open
AkshayaFoiger
wants to merge
88
commits into
main
Choose a base branch
from
over-capture
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+705
−33
Conversation
This file contains 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
61fe94c
to
1c1510f
Compare
hrithikesh026
previously approved these changes
Jan 22, 2025
sai-harsha-vardhan
previously approved these changes
Jan 22, 2025
deepanshu-iiitu
approved these changes
Jan 22, 2025
jarnura
previously approved these changes
Jan 24, 2025
swangi-kumari
previously approved these changes
Jan 24, 2025
deepanshu-iiitu
previously approved these changes
Jan 24, 2025
483407c
@@ -932,6 +948,7 @@ impl From<ProfileSetter> for Profile { | |||
three_ds_decision_manager_config: value.three_ds_decision_manager_config, | |||
card_testing_guard_config: value.card_testing_guard_config, | |||
card_testing_secret_key: value.card_testing_secret_key, | |||
always_request_overcapture: None, |
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.
why is this none?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-feature
Category: Feature request or enhancement
M-api-contract-changes
Metadata: This PR involves API contract changes
M-database-changes
Metadata: This PR involves database schema changes
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 you to capture with an amount that’s higher than the authorised amount for a card payment. Unlike incremental authorisations, overcapture doesn’t result in additional authorisations with the card networks.
In this PR, Overcapture is implemented for stripe card payments.
Additional Changes
API contract changes:
a) /payments create request to include
request_overcapture
booleanb) /payments response to include
c) Profile create request and response to include
always_request_overcapture
(boolean)d) Profile update request and response to include
always_request_overcapture
(boolean)DB changes:
a) request_overcapture enum(Enable/Skip) field to be introduced in payment_intent
b)ovecapture_status enum(Applicable/NotApplicable) to be introduced in payment_attempt
d) always_request_overcapture boolean field to be introduced in business_profiles table
Not Handled (phase 2 )
a) Error is not thrown, when overcapture is not supported by the connector/capture_type
b) List of supported connector and payment method not maintained.
c) Extend this feature for multiple manual capture and incremental authorization
-> Cypress test not added because it cannot be tested, via stripe. As this functionality has to be enabled by stripe.
-> Supported only for stripe card flow
How did you test it?
"always_request_overcapture": true
Response
DB - business_profile will have a field called always_request_overcapture , marked as

true
request_overcapture
in the payment request"always_request_overcapture": false
Response
Response
Hardcoded testcases - cannot be tested in integ/sandbox/prod. These are tests triggered after hardcoding the amount values.
Response
Overcapture the authorized amount
Response
Refund
Response
Checklist
cargo +nightly fmt --all
cargo clippy