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: Allow payment cancels for more statuses #1027

Merged
merged 14 commits into from
May 9, 2023

Conversation

prajjwalkumar17
Copy link
Contributor

@prajjwalkumar17 prajjwalkumar17 commented May 2, 2023

requires_payment_method, requires_capture, requires_confirmation, requires_action

Type of Change

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

Description

Previously while cancelling payment from some of the the payment intent statuses like requires_payment_method, requires_capture, requires_confirmation, requires_action there was an error thrown that these can't be cancelled as they haven't been authorized. Hence now we can cancel these payments too.

Additional Changes

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

Motivation and Context

As for the above statuses we aren't involving the connector and handling the requests ourselves in update method hence having a check and voding the payment attempt and cancelling the payment_intent status in DB.

How did you test it?

Tested it by using postman as now we are able to cancel the payment in all those cases.

Checklist

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

…uires_payment_method, requires_capture, requires_confirmation, requires_action
@prajjwalkumar17 prajjwalkumar17 requested review from a team, jarnura and ashokkjag as code owners May 2, 2023 10:50
@prajjwalkumar17 prajjwalkumar17 changed the title feat/Now we can eve cancel the payments that are in the states of req… feat/Payments of statuses like requires_payment_method, requires_capture, requires_confirmation, requires_action can be cancelled May 2, 2023
@prajjwalkumar17 prajjwalkumar17 self-assigned this May 2, 2023
@prajjwalkumar17 prajjwalkumar17 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 R-waiting-on-L1 Review: Waiting on L1 reviewer labels May 2, 2023
@prajjwalkumar17 prajjwalkumar17 changed the title feat/Payments of statuses like requires_payment_method, requires_capture, requires_confirmation, requires_action can be cancelled feat:Payments of statuses like requires_payment_method, requires_capture, requires_confirmation, requires_action can be cancelled May 2, 2023
@prajjwalkumar17 prajjwalkumar17 changed the title feat:Payments of statuses like requires_payment_method, requires_capture, requires_confirmation, requires_action can be cancelled feat:Payments of different statuses made cancellable May 2, 2023
@prajjwalkumar17 prajjwalkumar17 added R-waiting-on-L2 Review: Waiting on L2 reviewer R-L1-completed Review: L1 Review completed and removed R-waiting-on-L1 Review: Waiting on L1 reviewer labels May 8, 2023
@SanchithHegde SanchithHegde added S-ready-for-merge R-L2-completed Review: L2 Review completed and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed R-waiting-on-L2 Review: Waiting on L2 reviewer R-L1-completed Review: L1 Review completed labels May 8, 2023
@prajjwalkumar17 prajjwalkumar17 added this to the May 2023 Release milestone May 9, 2023
@tinu-hareesswar tinu-hareesswar changed the title feat:Payments of different statuses made cancellable feat: Allow payment cancels for more statuses May 9, 2023
@jarnura jarnura added this pull request to the merge queue May 9, 2023
Merged via the queue into main with commit a2a6bab May 9, 2023
@SanchithHegde SanchithHegde deleted the feat/Cancelling_Payments_for_all_Statuses branch May 9, 2023 18:50
@SanchithHegde SanchithHegde removed S-ready-for-merge R-L2-completed Review: L2 Review completed labels May 9, 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
Projects
No open projects
Status: Merged
4 participants