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

feat(router): make core changes in payments flow to support incremental authorization #3009

Merged
merged 10 commits into from
Nov 30, 2023

Conversation

sai-harsha-vardhan
Copy link
Contributor

@sai-harsha-vardhan sai-harsha-vardhan commented Nov 29, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Incremental authorizations allows you to increase authorized amount for a payment before capturing it

  • This is possible only for card payments and specific networks, with some criteria specific to connector
  • Incremental Authorizations can be done multiple times and maximum attempts is again based on connector
  • Total amount capturable would be sum of initial authorized amount and all the incremented additional amounts
  1. accept request_incremental_authorization flag in payments request
  2. send the corresponding value in payments_authorize_data to connecor flows
  3. receive incremental_authorization_allowed from connector flows
  4. store them in payment_intent and send incremental_authorization_allowed back in payments response

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Tested Manually

  1. send request_incremental_authorization as true in request, with capture_method automatic. should fail with an error
image
  1. send request_incremental_authorization as false in request, see incremental_authorization_allowed being false in response for successful payment in Cybersouce
image
  1. send request_incremental_authorization as true in request, see incremental_authorization_allowed being true in response for successful payment in Cybersouce
image

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@sai-harsha-vardhan sai-harsha-vardhan added A-core Area: Core flows C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 29, 2023
@sai-harsha-vardhan sai-harsha-vardhan self-assigned this Nov 29, 2023
@sai-harsha-vardhan sai-harsha-vardhan added M-database-changes Metadata: This PR involves database schema changes M-api-contract-changes Metadata: This PR involves API contract changes labels Nov 29, 2023
Narayanbhat166
Narayanbhat166 previously approved these changes Nov 30, 2023
@sahkal
Copy link
Contributor

sahkal commented Nov 30, 2023

@sai-harsha-vardhan Please resolve conflicts.

@sahkal sahkal self-requested a review November 30, 2023 08:13
@sahkal
Copy link
Contributor

sahkal commented Nov 30, 2023

@sai-harsha-vardhan CI checks are failing along with OPENAPI specs can you please fix these.

Copy link
Contributor

@prasunna09 prasunna09 left a comment

Choose a reason for hiding this comment

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

Have reviewed only connector changes!

@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Nov 30, 2023
Merged via the queue into main with commit 1ca2ba4 Nov 30, 2023
10 of 12 checks passed
@Gnanasundari24 Gnanasundari24 deleted the add-core-changes-incremental-authorization branch November 30, 2023 11:39
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants