-
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): [Worldpay] Currency Unit Conversion #2436
refactor(connector): [Worldpay] Currency Unit Conversion #2436
Conversation
@knutties I have raised a PR. What do I need to do now? |
match | ||
request.order_details.clone(){ | ||
Some(order_details)=> | ||
|
||
Ok(Self { | ||
instruction: Instruction { | ||
value: PaymentValue { |
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.
The amount
field needs to be retrieved from the WorldpayRouterData
value: PaymentValue { | |
value: PaymentValue { | |
amount : item.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.
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.
The
amount
field needs to be retrieved from theWorldpayRouterData
@srujanchikke please check and inform if any further changes to be made.
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.
@Suraj3240 Why do we need to match with order_details
,As We are not using order details
anywhere in payment request ?
Please refer to this pr for more info #2192
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.
@Suraj3240 Why do we need to match with
order_details
,As We are not usingorder details
anywhere in payment request ?Please refer to this pr for more info #2192
So I will have to code for all the payment methods like wallet,cards,etc. as given in this file, right?
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.
You don't have to worry about the other payment methods mapping . But yes , as you mentioned amount should be mapped that way .
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.
@Suraj3240 Why do we need to match with
order_details
,As We are not usingorder details
anywhere in payment request ?Please refer to this pr for more info #2192
In this PR link the fields are derived from the Order_details
. And hence I used that method.
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.
@Suraj3240 Why do we need to match with
order_details
,As We are not usingorder details
anywhere in payment request ?Please refer to this pr for more info #2192
And following the method used in this PR, it is giving out errors.
So pls someone kindly help me.
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 update the branch to ensure the spell check in the CI workflow functions properly.
Hey @Suraj3240 Please use the following cargo commands -
ref - Cargo commands, and fix the errors thrown by clippy for the checks to pass . Please run |
5e6d903
to
7890aeb
Compare
@srujanchikke can you confirm the changes made? |
Can you remove this additional |
@srujanchikke |
Hey @Suraj3240 , Could you run this commands locally , so that the checks won't fail after pushing code . |
efa49e7
to
37d5a7d
Compare
|
Please run |
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!
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, @Suraj3240!
Thanks for your help and support throughout. :)) @srujanchikke @SanchithHegde |
Hey @Suraj3240 , |
Type of Change
Description
This pull request implements the get_currency_unit from the ConnectorCommon trait for the Worldpay connector. This function allows connectors to declare their accepted currency unit as either Base or Minor. For Worldpay it accepts currency as Minor units.
Additional Changes
Links to the files with corresponding changes.
Motivation and Context
Closes #2250.
How did you test it?
I tried setting up and testing using VS code and codesandbox but was not able to do it.
So kindly review the changes and do let me know if any further issues.
Checklist
cargo +nightly fmt --all
cargo clippy