-
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
fix(connectors): Amount received should be zero for pending
and failed
status
#4331
Conversation
pending
and failed
statuspending
and failed
status
| storage_enums::AttemptStatus::Failure | ||
| storage_enums::AttemptStatus::CaptureFailed | ||
| storage_enums::AttemptStatus::Voided => 0, | ||
_ => item.data.request.amount_to_capture, |
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.
Please mention all the statuses here, instead of using default case.
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.
Please resolve given comments
| storage_enums::AttemptStatus::Authorized | ||
| storage_enums::AttemptStatus::Failure | ||
| enums::AttemptStatus::RouterDeclined | ||
| enums::AttemptStatus::AuthenticationFailed |
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.
Please use either storage_enums
or enums
in the match arms. Not both.
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.
LGTM
Type of Change
Description
Amount received as well as amount capturable were both showing total amount during pending status but this breaks the convention i.e amount_received + amount_capturable = total amount .
Additional Changes
Motivation and Context
How did you test it?
Tested through postman:
Create MCA (Adyen or Paypal): (eg. Paypal)
Create a payment with Capture as Manual:
Retrieve the Payment: The status should be
requires_capture
Capture the Payment:
status
should be processing andamount_received
should be 0 (zero). Example Response is belowChecklist
cargo +nightly fmt --all
cargo clippy