feat(connector): [Adyen] implement Adyen bank transfers and voucher payments in Indonesia (#1804)

Co-authored-by: Sk Sakil Mostak <skmahim71@gmail.com>
Co-authored-by: Pa1NarK <69745008+pixincreate@users.noreply.github.com>
This commit is contained in:
AkshayaFoiger
2023-08-02 19:04:33 +05:30
committed by GitHub
parent 9122daae24
commit 9977f9d40e
13 changed files with 954 additions and 165 deletions

View File

@ -765,8 +765,8 @@ pub enum AdditionalPaymentData {
MandatePayment {},
Reward {},
Upi {},
Voucher {},
GiftCard {},
Voucher {},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
@ -901,6 +901,32 @@ pub enum BankRedirectData {
},
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct AlfamartVoucherData {
/// The billing first name for Alfamart
#[schema(value_type = String, example = "Jane")]
pub first_name: Secret<String>,
/// The billing second name for Alfamart
#[schema(value_type = String, example = "Doe")]
pub last_name: Option<Secret<String>>,
/// The Email ID for Alfamart
#[schema(value_type = String, example = "example@me.com")]
pub email: Email,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct IndomaretVoucherData {
/// The billing first name for Alfamart
#[schema(value_type = String, example = "Jane")]
pub first_name: Secret<String>,
/// The billing second name for Alfamart
#[schema(value_type = String, example = "Doe")]
pub last_name: Option<Secret<String>>,
/// The Email ID for Alfamart
#[schema(value_type = String, example = "example@me.com")]
pub email: Email,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct AchBillingDetails {
/// The Email ID for ACH billing
@ -908,6 +934,19 @@ pub struct AchBillingDetails {
pub email: Email,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct DokuBillingDetails {
/// The billing first name for Doku
#[schema(value_type = String, example = "Jane")]
pub first_name: Secret<String>,
/// The billing second name for Doku
#[schema(value_type = String, example = "Doe")]
pub last_name: Option<Secret<String>>,
/// The Email ID for Doku billing
#[schema(value_type = String, example = "example@me.com")]
pub email: Email,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
pub struct MultibancoBillingDetails {
#[schema(value_type = String, example = "example@me.com")]
@ -977,6 +1016,34 @@ pub enum BankTransferData {
/// The billing details for Multibanco
billing_details: MultibancoBillingDetails,
},
PermataBankTransfer {
/// The billing details for Permata Bank Transfer
billing_details: DokuBillingDetails,
},
BcaBankTransfer {
/// The billing details for BCA Bank Transfer
billing_details: DokuBillingDetails,
},
BniVaBankTransfer {
/// The billing details for BniVa Bank Transfer
billing_details: DokuBillingDetails,
},
BriVaBankTransfer {
/// The billing details for BniVa Bank Transfer
billing_details: DokuBillingDetails,
},
CimbVaBankTransfer {
/// The billing details for BniVa Bank Transfer
billing_details: DokuBillingDetails,
},
DanamonVaBankTransfer {
/// The billing details for BniVa Bank Transfer
billing_details: DokuBillingDetails,
},
MandiriVaBankTransfer {
/// The billing details for BniVa Bank Transfer
billing_details: DokuBillingDetails,
},
Pix {},
Pse {},
}
@ -1215,6 +1282,8 @@ pub enum VoucherData {
PagoEfectivo,
RedCompra,
RedPagos,
Alfamart(Box<AlfamartVoucherData>),
Indomaret(Box<IndomaretVoucherData>),
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
@ -1408,11 +1477,13 @@ pub struct BankTransferNextStepsData {
#[serde(flatten)]
pub bank_transfer_instructions: BankTransferInstructions,
/// The details received by the receiver
pub receiver: ReceiverDetails,
pub receiver: Option<ReceiverDetails>,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct VoucherNextStepData {
/// Voucher expiry date and time
pub expires_at: Option<String>,
/// Reference number required for the transaction
pub reference: String,
/// Url to download the payment instruction
@ -1434,6 +1505,8 @@ pub struct WaitScreenInstructions {
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum BankTransferInstructions {
/// The instructions for Doku bank transactions
DokuBankTransferInstructions(Box<DokuBankTransferInstructions>),
/// The credit transfer for ACH transactions
AchCreditTransfer(Box<AchTransfer>),
/// The instructions for SEPA bank transactions
@ -1473,6 +1546,16 @@ pub struct MultibancoTransferInstructions {
pub entity: String,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct DokuBankTransferInstructions {
#[schema(value_type = String, example = "2023-07-26T17:33:00-07-21")]
pub expires_at: Option<String>,
#[schema(value_type = String, example = "122385736258")]
pub reference: Secret<String>,
#[schema(value_type = String)]
pub instructions_url: Option<Url>,
}
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)]
pub struct AchTransfer {
#[schema(value_type = String, example = "122385736258")]