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

fix(core): introduce new attempt and intent status to handle multiple partial captures #2802

Merged
merged 16 commits into from
Nov 17, 2023

Conversation

hrithikesh026
Copy link
Contributor

Type of Change

  • Bugfix

Description

  • Add PartiallyCapturedAndCapturable enum type to IntentStatus
  • Add PartialChargedAndChargeable enum type to AttemptStatus

(1) Currently, single 'manual' capture results in 'succeeded'(intent) and 'charged'(attempt) statuses during a successful full/partial capture.

(2) 'Multiple manual' capture results in:
(a) 'partially captured'(intent) and 'partially charged'(attempt) when amount_capturable>0
(b) 'succeeded' (intent) and 'charged' (attempt) statuses when amount_capturable=0 after a successful capture
(c) 'succeeded'(intent) and 'voided'(attempt) when a void call is made after at least one successful partial capture
(d) 'cancelled'(attempt) and 'voided'(intent) when a void call is made even before one successful partial capture

In order to address the incongruity in intent vs attempt statuses in (2)(c) case, we would need to introduce another set of non-terminal statuses ['partially captured and capturable' (intent); 'partially captured and capturable'(attempt)] which would be mapped to (2)(a) case above whereas the 'partially captured'(intent) and 'partially charged'(attempt) statuses would be mapped to (2)(c) case.

Even in case of single 'partial' captures, the statuses should be updated to 'partially captured'(intent) and 'partially charged'(attempt).

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?

Manual
Screenshot 2023-11-07 at 4 12 43 PM

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

@hrithikesh026 hrithikesh026 added A-core Area: Core flows S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Nov 7, 2023
@hrithikesh026 hrithikesh026 added this to the November 2023 Release milestone Nov 7, 2023
@hrithikesh026 hrithikesh026 self-assigned this Nov 7, 2023
@hrithikesh026 hrithikesh026 requested review from a team as code owners November 7, 2023 11:15
Copy link
Member

@pixincreate pixincreate left a comment

Choose a reason for hiding this comment

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

Added what I observed..

hrithikesh026 and others added 3 commits November 9, 2023 13:24
…status/up.sql

Co-authored-by: Narayan Bhat <48803246+Narayanbhat166@users.noreply.github.com>
…status/down.sql

Co-authored-by: Narayan Bhat <48803246+Narayanbhat166@users.noreply.github.com>
Narayanbhat166
Narayanbhat166 previously approved these changes Nov 9, 2023
@pixincreate
Copy link
Member

Kindly check the deployment readiness.

jarnura
jarnura previously approved these changes Nov 16, 2023
@hrithikesh026 hrithikesh026 dismissed stale reviews from jarnura and Narayanbhat166 via 8588a31 November 16, 2023 10:36
Narayanbhat166
Narayanbhat166 previously approved these changes Nov 16, 2023
@pixincreate pixincreate added this pull request to the merge queue Nov 16, 2023
@likhinbopanna likhinbopanna removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Nov 16, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Nov 16, 2023
@pixincreate pixincreate added this pull request to the merge queue Nov 17, 2023
@pixincreate
Copy link
Member

pixincreate commented Nov 17, 2023

@SanchithHegde, can you look into deployment readiness being unresponsive (I believe, it is the same issue that we observed yesterday. Waits for hours.) here in merge queue?

Merged via the queue into main with commit cb88be0 Nov 17, 2023
10 of 12 checks passed
@pixincreate pixincreate deleted the introduce-new-attempt-and-intent-status branch November 17, 2023 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Core flows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants