-
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
feat(connector): [Tsys] Currency Unit Conversion #2749
base: main
Are you sure you want to change the base?
Conversation
My bad , got some issues due which CI is failing. I am working on it now. |
Please address the failing CI checks |
Hey @zakhaev26 , |
I am getting some errors on running
and
can someone please guide me how to fix these issues ? |
Getting Errors at tsys/transformers.rs ..at TsysRefundRouter :
These were my changes I made according to help messages after |
Hey @zakhaev26,
|
|
||
let connector_router_data = tsys::TsysRouterData::try_from(( | ||
&self.get_currency_unit(), | ||
req.request.currency, | ||
req.request.amount, | ||
req, | ||
))?; | ||
|
||
let req_obj = tsys::TsysPaymentsRequest::try_from(&connector_router_data)?; | ||
|
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.
Undo these changes in PaymentsSync
flow.
This implemented to be done for line 151
in the
impl ConnectorIntegration<api::Authorize , types::PaymentsAuthorizeData, types::PaymentsResponseData>
for Tsys
{
...
fn get_request_body(
&self,
req: &types::PaymentsAuthorizeRouterData,
) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> {
...
}
}
and similar change has to be implemented for Capture flow, line 322
impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::PaymentsResponseData>
for Tsys
{
....
fn get_request_body(
&self,
req: &types::PaymentsCaptureRouterData,
) -> CustomResult<Option<types::RequestBody>, errors::ConnectorError> {
//do your changes here
...
}
}
fn try_from(item: &types::PaymentsAuthorizeRouterData) -> Result<Self, Self::Error> { | ||
fn try_from( | ||
item: &TsysRouterData<&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.
Instances where item.request
is utilized should be substituted with item.router_data.request
In case you have any queries, you can ask them on this PR thread, or on slack whichever you are comfortable with
Hey @zakhaev26 |
Type of Change
Description
get_currency_unit
fn. ,TsysRouterData<T>
struct and functionalityAdditional Changes
Motivation and Context
How did you test it?
Got to test it by paying using Tsys and test the currency unit.
Checklist
cargo +nightly fmt --all
cargo clippy