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): [Multisafepay] Add support for Ideal and Giropay #4398
base: main
Are you sure you want to change the base?
feat(connector): [Multisafepay] Add support for Ideal and Giropay #4398
Conversation
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.
@TakshPanchal, Thanks for the PR! I have few comments, please resolve them. And also please make sure all CI checks are passed after you push final commit.
@@ -181,6 +185,46 @@ pub enum WalletInfo { | |||
GooglePay(GpayInfo), | |||
} | |||
|
|||
#[derive(Clone, Debug, Eq, PartialEq, Serialize)] |
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.
Are these all derives required? If not please remove the redundant ones from all the enums and structs. #[derive(Debug, Serialize, Clone)]
should work for requests and #[derive(Debug, Deserialize, Clone)]
should work for response.
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.
For BankRedirectInfo
and IdealInfo
, Eq
and PartialEq
will be used for comparing different bank's Info that is why Eq
is needed.
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.
Can you please point to the code where you are comparing different bank's info?
BankNames::VanLanschot => Self("0161"), | ||
BankNames::Yoursafe => Self("0806"), | ||
BankNames::Handelsbanken => Self("1235"), | ||
_ => Err(errors::ConnectorError::NotSupported { |
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 don't use default here, rather mention all the enums. It will help us easily debug any issues when new enum is added.
api::PaymentMethodData::BankRedirect(ref bank_data) => match bank_data { | ||
api::BankRedirectData::Giropay { .. } => Type::Redirect, | ||
api::BankRedirectData::Ideal { .. } => Type::Direct, | ||
_ => Err(errors::ConnectorError::NotImplemented( |
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.
Same here, don't use defaults
api::PaymentMethodData::BankRedirect(ref bank_data) => Some(match bank_data { | ||
api::BankRedirectData::Giropay { .. } => Gateway::Giropay, | ||
api::BankRedirectData::Ideal { .. } => Gateway::Ideal, | ||
_ => Err(errors::ConnectorError::NotImplemented( |
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.
same here
field_name: "eps.bank_name", | ||
}, |
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.
This should be ideal.bank_name .
AcceptanceType, Address, AddressDetails, Amount, AuthenticationForStartResponse, | ||
BankRedirectData, Card, CryptoData, CustomerAcceptance, HeaderPayload, MandateAmountData, | ||
MandateData, MandateTransactionType, MandateType, MandateValidationFields, NextActionType, | ||
OnlineMandate, PayLaterData, PaymentIdType, PaymentListConstraints, | ||
PaymentListFilterConstraints, PaymentListFilters, PaymentListResponse, PaymentListResponseV2, | ||
PaymentMethodData, PaymentMethodDataRequest, PaymentMethodDataResponse, PaymentOp, | ||
PaymentRetrieveBody, PaymentRetrieveBodyWithCredentials, PaymentsApproveRequest, | ||
PaymentsCancelRequest, PaymentsCaptureRequest, PaymentsExternalAuthenticationRequest, |
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.
If this are format changes, please revert them.
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.
This is because I have imported BankRedirectData
and Formatting is done after that. So it is just one addition of t he datatype here.
Hey @TakshPanchal, Your branch has conflicts. Please update it to main. |
Yes, I am aware of that, working on it. Thank you. |
#4397 Linking the issue |
I think I have to do some changes after resolving these merge conflicts. I will look into that. |
I have resolved the conflicts and ran |
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.
@TakshPanchal Apologies, I missed one review comment last time. Could you please resolve this?
pub issuer_id: Option<String>, | ||
} | ||
|
||
pub struct MultisafepayBankNames<'a>(&'a str); |
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.
Can you convert this to an enum. You can use serde rename here.
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.
Completed the change @srujanchikke
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, @TakshPanchal!
Hey @TakshPanchal , Could you please resolve the conflicts ? |
domain::BankRedirectData::Ideal { | ||
billing_details: _, | ||
bank_name, | ||
country: _, |
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.
domain::BankRedirectData::Ideal { | |
billing_details: _, | |
bank_name, | |
country: _, | |
domain::BankRedirectData::Ideal { | |
bank_name, | |
.. |
@@ -181,6 +185,46 @@ pub enum WalletInfo { | |||
GooglePay(GpayInfo), | |||
} | |||
|
|||
#[derive(Clone, Debug, Eq, PartialEq, Serialize)] |
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.
Can you please point to the code where you are comparing different bank's info?
Ideal, | ||
Giropay, |
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 add Currency and Country configs for both Ideal and Giropay in config/development.toml
, config/deployments/sandbox.toml
, config/deployments/integration_test.toml
, config/deployments/production.toml
for Multisafepay
Type of Change
Description
Add iDEAL and Giropay payment processors in Multisafepay connector.
Whole description can be found in #4143 discussion.
Additional Changes
Motivation and Context
Solves the issue #4397
How did you test it?
I have tested the Multisafe payment connector for Giropay and iDeal methods in Postman suit. You can find my fork of Postman's collection below. In
Payments - Create iDeal Payment
andPayments - Create Giropay Direct
inQuick Start
are the requests for the payments.iDeal
By requesting the iDeal payment method with "Ing" bank name, a redirection link can be found, redirecting to the test portal of Multisafepay, where we can see the bank name we selected.
Also, passing bank names not supported by iDeal raises an Error.
Not Passing the bank name in the
payment_method_data
returns an error, too.Giropay
Giropay doesn't support the direct method, so it is not compulsory to enter
bank_name
into thepayment_method_data
. After a successful request to Multisafepay, We will get a redirection link to the Mutisafepay payment's page.Mutisafepay payment page.
Checklist
cargo +nightly fmt --all
cargo clippy