-
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(connector): [Paypal] fix amount to its currency base unit #1780
Conversation
if currency.is_zero_decimal_currency() { | ||
Ok(amount_f64.to_string()) | ||
} else { | ||
Ok(format!("{amount_f64:.2}")) |
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.
Should you vary based on 2 or 3 decimal currency?
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.
As far as we checked there are no connectors which accepts 3 digit decimals. Currently this method is being used in PayPal only, which don't accept 3 digit decimals for 3 decimal currency.
Type of Change
Description
Fix amount to its currency base unit.
ref for currency decimal - https://docs.adyen.com/development-resources/currency-codes
Additional Changes
Motivation and Context
How did you test it?
For JPY
For USD, We are converting cents to dollars
Checklist
cargo +nightly fmt --all
cargo clippy