-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(router): [Nuvei] add amount conversion framework for connectors #6166
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
base: main
Are you sure you want to change the base?
Conversation
Review changes with SemanticDiff. Analyzed 4 of 4 files. Overall, the semantic diff is 11% smaller than the GitHub diff.
|
let connector_req = nuvei::NuveiPaymentFlowRequest::try_from(req)?; | ||
let amount = connector_utils::convert_amount( | ||
self.amount_converter, | ||
req.request.minor_amount, |
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 take the amount value for capture from minor_amount_to_capture
let connector_req = nuvei::NuveiPaymentFlowRequest::try_from(req)?; | ||
let refund_amount = connector_utils::convert_amount( | ||
self.amount_converter, | ||
req.request.minor_amount, |
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 take the amount value for refund from minor_refund_amount
Add the amount conversion for the following api flows as well: |
hey @kaustubh1106 kindly look into the changes requested |
@mrudulvajpayee4935 sure |
Hey @kaustubh1106 Were you able to work on the changes? |
Hi @kaustubh1106 |
Hey @kaustubh1106 any update on the changes! |
Type of Change
Description
This feature introduces a new
Unit
struct along with the MinorUnit type to standardize amount handling across all connectors within the application. The primary objective is to centralize the conversion logic within the core framework, eliminating the need for each connector to handle its own conversion.By standardizing the format and placing the conversion logic in one location, this change simplifies the codebase and reduces potential inconsistencies in how amounts are managed across different connectors. Each connector can now simply invoke the convert function to receive amounts in their required format, based on their documentation.
This update will make future modifications and bug fixes easier to implement, as all amount conversions are now handled by a single, unified system.
fixes #6023
Checklist
cargo +nightly fmt --all
cargo clippy