feat(connector): [Zen] Add Latam Payment Methods (#1670)

Co-authored-by: swangi-kumari <swangi.12015941@lpu.in>
Co-authored-by: Narayan Bhat <48803246+Narayanbhat166@users.noreply.github.com>
This commit is contained in:
SamraatBansal
2023-07-27 00:54:45 +05:30
committed by GitHub
parent 38f14b9f39
commit 4df67adb9b
21 changed files with 494 additions and 30 deletions

View File

@ -721,6 +721,7 @@ pub enum PaymentMethodData {
MandatePayment,
Reward(RewardData),
Upi(UpiData),
Voucher(VoucherData),
GiftCard(Box<GiftCardData>),
}
@ -764,6 +765,7 @@ pub enum AdditionalPaymentData {
MandatePayment {},
Reward {},
Upi {},
Voucher {},
GiftCard {},
}
@ -964,6 +966,8 @@ pub enum BankTransferData {
/// The billing details for Multibanco
billing_details: MultibancoBillingDetails,
},
Pix {},
Pse {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]
@ -1177,6 +1181,23 @@ pub struct RewardData {
pub merchant_id: String,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct BoletoVoucherData {
/// The shopper's social security number
#[schema(value_type = Option<String>)]
social_security_number: Option<Secret<String>>,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum VoucherData {
Boleto(Box<BoletoVoucherData>),
Efecty,
PagoEfectivo,
RedCompra,
RedPagos,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum PaymentMethodDataResponse {
@ -1192,6 +1213,7 @@ pub enum PaymentMethodDataResponse {
MandatePayment,
Reward,
Upi,
Voucher,
GiftCard,
}
@ -1875,6 +1897,7 @@ impl From<AdditionalPaymentData> for PaymentMethodDataResponse {
AdditionalPaymentData::Reward {} => Self::Reward,
AdditionalPaymentData::Upi {} => Self::Upi,
AdditionalPaymentData::BankTransfer {} => Self::BankTransfer,
AdditionalPaymentData::Voucher {} => Self::Voucher,
AdditionalPaymentData::GiftCard {} => Self::GiftCard,
}
}