-
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
refactor(connector): [CyberSource] Enhance currency Mapping with ConnectorCurrencyCommon Trait #2626
refactor(connector): [CyberSource] Enhance currency Mapping with ConnectorCurrencyCommon Trait #2626
Conversation
Hey @mdrokz, could you address the failing CI checks? |
Just synced the changes from main can you run the CI checks again ? |
@mdrokz The formatting check is failing, could you please address it? |
Done |
@SanchithHegde can you review this ? |
@@ -109,6 +140,70 @@ fn build_bill_to( | |||
}) | |||
} | |||
|
|||
impl TryFrom<&CybersourceRouterData<&types::PaymentsAuthorizeRouterData>> |
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.
Instead of using new try_from , you can edit the exisiting try_from
impl TryFrom<&types::PaymentsAuthorizeRouterData> for CybersourcePaymentsRequest { | ||
type Error = error_stack::Report<errors::ConnectorError>; | ||
fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { |
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.
impl TryFrom<&types::PaymentsAuthorizeRouterData> for CybersourcePaymentsRequest { | |
type Error = error_stack::Report<errors::ConnectorError>; | |
fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { | |
impl TryFrom<&CybersourceRouterData<&types::PaymentsAuthorizeRouterData>> for CybersourcePaymentsRequest { | |
type Error = error_stack::Report<errors::ConnectorError>; | |
fn try_from(item: &CybersourceRouterData<&types::PaymentsAuthorizeRouterData>) -> Result<Self, Self::Error> { |
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.
Done i removed the old try form since both of them were same.
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
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.
Looks good to me!
Thanks for the PR, @mdrokz!
Type of Change
Description
This PR implements
get_currency_unit
for cybersource to convert payments fromBase
toMinor
it also implements router data to handle the conversion.Additional Changes
Motivation and Context
Closes #2222
How did you test it?
I tested by sending a payment request & verifying the amount is showed in minor units in the cybersource console
Checklist
cargo +nightly fmt --all
cargo clippy