-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(connector): [Trustpayments] Integrate EPS, TRUSTLY, PAYSERA, ALIPAY, SEPA #9512
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
base: main
Are you sure you want to change the base?
feat(connector): [Trustpayments] Integrate EPS, TRUSTLY, PAYSERA, ALIPAY, SEPA #9512
Conversation
Changed Files
|
2fa07d8
to
3d3e3e4
Compare
resolve merge conflicts
…igurations git rebase merge conflicts
merge conflicts fix
8c83817
to
34355ff
Compare
crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
Outdated
Show resolved
Hide resolved
pub billingfirstname: Option<String>, | ||
pub billinglastname: Option<String>, |
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.
Make the PII fields secret
api_key = "API Key" | ||
|
||
[gigadat] | ||
[gigadat.connector_auth.HeaderKey] |
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.
remove this change
[gigadat.connector_auth.HeaderKey] | ||
api_key = "API Key" |
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.
remove this
pub pan: Option<cards::CardNumber>, | ||
pub expirydate: Option<Secret<String>>, | ||
pub securitycode: Option<Secret<String>>, | ||
pub credentialsonfile: Option<String>, | ||
pub settlestatus: Option<String>, |
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.
Dont make individual fields optional
Create a struct and add fields there, use the struct here and flatten it
Some(common_enums::CaptureMethod::Automatic) | None => vec!["AUTH".to_string()], | ||
Some(common_enums::CaptureMethod::Manual) => vec!["AUTH".to_string()], |
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.
Why are we sending AUTH for both Automatic and Manual captures?
PaymentMethodData::Card(req_card) => Self::build_card_request(item, &auth, &req_card), | ||
PaymentMethodData::BankRedirect(bank_redirect_data) => match bank_redirect_data { | ||
BankRedirectData::Eps { .. } => Self::build_eps_request(item, &auth), | ||
BankRedirectData::Trustly { .. } => Self::build_trustly_request(item, &auth), | ||
_ => Err(errors::ConnectorError::NotImplemented( | ||
"Bank redirect method not supported".to_string(), | ||
) | ||
.into()), | ||
}, | ||
PaymentMethodData::Wallet(wallet_data) => match wallet_data { | ||
WalletData::AliPayRedirect { .. } => Self::build_alipay_request(item, &auth), | ||
WalletData::Paysera(_) => Self::build_paysera_request(item, &auth), | ||
_ => Err(errors::ConnectorError::NotImplemented( | ||
"Wallet method not supported".to_string(), | ||
) | ||
.into()), | ||
}, | ||
PaymentMethodData::BankTransfer(bank_transfer_data) => match &*bank_transfer_data { | ||
BankTransferData::SepaBankTransfer { .. } => Self::build_sepa_request(item, &auth), | ||
_ => Err(errors::ConnectorError::NotImplemented( | ||
"Bank transfer method not supported".to_string(), | ||
) | ||
.into()), | ||
}, |
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.
Use TryFrom's instead of functions
billingfirstname: item.router_data.get_optional_billing_first_name(), | ||
billinglastname: item.router_data.get_optional_billing_last_name(), | ||
billingcountryiso2a: item | ||
.router_data | ||
.get_optional_billing_country() | ||
.map(|country| country.to_string()), | ||
billingemail: item.router_data.get_optional_billing_email(), |
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 these fields are optional then why have you added them in crates/payment_methods/src/configs/payment_connector_required_fields.rs for EPS?
} | ||
Some(TrustpaymentsSettleStatus::PendingSettlementRedirect) => { | ||
// settlestatus "10" = Pending settlement. The initial status after a successful AUTH request, indicating funds have not yet been settled | ||
common_enums::AttemptStatus::Authorizing |
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.
common_enums::AttemptStatus::Authorizing | |
common_enums::AttemptStatus::Pending |
} else if self.authcode.is_some() { | ||
// For card payments with authcode | ||
self.map_settlestatus_to_attempt_status(common_enums::AttemptStatus::Authorized) |
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.
Why is default Authorized?
common_enums::AttemptStatus::Voided | ||
} | ||
Some(TrustpaymentsSettleStatus::PendingSettlementRedirect) => { | ||
common_enums::AttemptStatus::Authorizing |
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.
common_enums::AttemptStatus::Authorizing | |
common_enums::AttemptStatus::Pending |
Type of Change
Description
ADD new payment method for Trustpayments
EPS
SEPA
TRUSTLY
PAYSERA
ALIPAY
Additional Changes
Motivation and Context
closes #9543
How did you test it?
EPS
Payment Request
Payment Response
Confirm page
Psync Response
Paysera
Payment Request
Payment Response
Confirm page
Psync Response
TRUSTLY
Payment Request
Payment Response
Confirm page
Psync Response
ALIPAY
Payment Request
Payment Response
Confirm page
Not able to test it because of alipay sandbox error<
SEPA
TODO
Checklist
cargo +nightly fmt --all
cargo clippy