mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-31 01:57:45 +08:00
feat(connector): [Mollie] Implement Przelewy24 and BancontactCard Bank Redirects for Mollie connector (#1303)
Co-authored-by: Jagan Elavarasan <jaganelavarasan@gmail.com>
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
use api_models::payments;
|
||||
use common_utils::pii::Email;
|
||||
use error_stack::IntoReport;
|
||||
use masking::Secret;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -46,6 +47,8 @@ pub enum PaymentMethodData {
|
||||
Ideal(Box<IdealMethodData>),
|
||||
Paypal(Box<PaypalMethodData>),
|
||||
Sofort,
|
||||
Przelewy24(Box<Przelewy24MethodData>),
|
||||
Bancontact,
|
||||
DirectDebit(Box<DirectDebitMethodData>),
|
||||
}
|
||||
|
||||
@ -68,6 +71,12 @@ pub struct PaypalMethodData {
|
||||
shipping_address: Option<Address>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Przelewy24MethodData {
|
||||
billing_email: Option<Email>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DirectDebitMethodData {
|
||||
@ -159,6 +168,12 @@ impl TryFrom<&api_models::payments::BankRedirectData> for PaymentMethodData {
|
||||
})))
|
||||
}
|
||||
api_models::payments::BankRedirectData::Sofort { .. } => Ok(Self::Sofort),
|
||||
api_models::payments::BankRedirectData::Przelewy24 {
|
||||
billing_details, ..
|
||||
} => Ok(Self::Przelewy24(Box::new(Przelewy24MethodData {
|
||||
billing_email: billing_details.email.clone(),
|
||||
}))),
|
||||
api_models::payments::BankRedirectData::BancontactCard { .. } => Ok(Self::Bancontact),
|
||||
_ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user