mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 00:49:42 +08:00
Feat(Connector): [ACI] Implement Przelewy24 Bank Redirect (#1064)
This commit is contained in:
@ -646,7 +646,10 @@ pub enum BankRedirectData {
|
|||||||
// Issuer value corresponds to the bank
|
// Issuer value corresponds to the bank
|
||||||
issuer: api_enums::BankNames,
|
issuer: api_enums::BankNames,
|
||||||
},
|
},
|
||||||
Przelewy24 {},
|
Przelewy24 {
|
||||||
|
// Shopper Email
|
||||||
|
email: Email,
|
||||||
|
},
|
||||||
Sofort {
|
Sofort {
|
||||||
/// The billing details for bank redirection
|
/// The billing details for bank redirection
|
||||||
billing_details: BankRedirectBilling,
|
billing_details: BankRedirectBilling,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
use common_utils::pii::Email;
|
||||||
use error_stack::report;
|
use error_stack::report;
|
||||||
use masking::Secret;
|
use masking::Secret;
|
||||||
use reqwest::Url;
|
use reqwest::Url;
|
||||||
@ -73,6 +74,8 @@ pub struct BankRedirectionPMData {
|
|||||||
bank_account_bic: Option<Secret<String>>,
|
bank_account_bic: Option<Secret<String>>,
|
||||||
#[serde(rename = "bankAccount.iban")]
|
#[serde(rename = "bankAccount.iban")]
|
||||||
bank_account_iban: Option<Secret<String>>,
|
bank_account_iban: Option<Secret<String>>,
|
||||||
|
#[serde(rename = "customer.email")]
|
||||||
|
customer_email: Option<Email>,
|
||||||
shopper_result_url: Option<String>,
|
shopper_result_url: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,6 +86,9 @@ pub enum PaymentBrand {
|
|||||||
Ideal,
|
Ideal,
|
||||||
Giropay,
|
Giropay,
|
||||||
Sofortueberweisung,
|
Sofortueberweisung,
|
||||||
|
InteracOnline,
|
||||||
|
Przelewy,
|
||||||
|
Trustly,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Eq, PartialEq, Serialize)]
|
#[derive(Debug, Clone, Eq, PartialEq, Serialize)]
|
||||||
@ -145,6 +151,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for AciPaymentsRequest {
|
|||||||
bank_account_bank_name: None,
|
bank_account_bank_name: None,
|
||||||
bank_account_bic: None,
|
bank_account_bic: None,
|
||||||
bank_account_iban: None,
|
bank_account_iban: None,
|
||||||
|
customer_email: None,
|
||||||
shopper_result_url: item.request.router_return_url.clone(),
|
shopper_result_url: item.request.router_return_url.clone(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
@ -158,6 +165,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for AciPaymentsRequest {
|
|||||||
bank_account_bank_name: None,
|
bank_account_bank_name: None,
|
||||||
bank_account_bic: bank_account_bic.clone(),
|
bank_account_bic: bank_account_bic.clone(),
|
||||||
bank_account_iban: bank_account_iban.clone(),
|
bank_account_iban: bank_account_iban.clone(),
|
||||||
|
customer_email: None,
|
||||||
shopper_result_url: item.request.router_return_url.clone(),
|
shopper_result_url: item.request.router_return_url.clone(),
|
||||||
})),
|
})),
|
||||||
api_models::payments::BankRedirectData::Ideal { bank_name, .. } => {
|
api_models::payments::BankRedirectData::Ideal { bank_name, .. } => {
|
||||||
@ -167,6 +175,7 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for AciPaymentsRequest {
|
|||||||
bank_account_bank_name: Some(bank_name.to_string()),
|
bank_account_bank_name: Some(bank_name.to_string()),
|
||||||
bank_account_bic: None,
|
bank_account_bic: None,
|
||||||
bank_account_iban: None,
|
bank_account_iban: None,
|
||||||
|
customer_email: None,
|
||||||
shopper_result_url: item.request.router_return_url.clone(),
|
shopper_result_url: item.request.router_return_url.clone(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
@ -177,6 +186,18 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for AciPaymentsRequest {
|
|||||||
bank_account_bank_name: None,
|
bank_account_bank_name: None,
|
||||||
bank_account_bic: None,
|
bank_account_bic: None,
|
||||||
bank_account_iban: None,
|
bank_account_iban: None,
|
||||||
|
customer_email: None,
|
||||||
|
shopper_result_url: item.request.router_return_url.clone(),
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
api_models::payments::BankRedirectData::Przelewy24 { email } => {
|
||||||
|
PaymentDetails::BankRedirect(Box::new(BankRedirectionPMData {
|
||||||
|
payment_brand: PaymentBrand::Przelewy,
|
||||||
|
bank_account_country: None,
|
||||||
|
bank_account_bank_name: None,
|
||||||
|
bank_account_bic: None,
|
||||||
|
bank_account_iban: None,
|
||||||
|
customer_email: Some(email.to_owned()),
|
||||||
shopper_result_url: item.request.router_return_url.clone(),
|
shopper_result_url: item.request.router_return_url.clone(),
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user