feat(connector): [Adyen] Implement Vipps in Wallets (#1554)

Co-authored-by: chikke srujan <121822803+srujanchikke@users.noreply.github.com>
Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
Sakil Mostak
2023-07-18 19:34:52 +05:30
committed by GitHub
parent 7549cd3aa6
commit e271ced69e
6 changed files with 32 additions and 0 deletions

View File

@ -981,6 +981,8 @@ pub enum WalletData {
SamsungPay(Box<SamsungPayWalletData>),
/// Wallet data for Twint Redirection
TwintRedirect {},
/// Wallet data for Vipps Redirection
VippsRedirect {},
/// The wallet data for WeChat Pay Redirection
WeChatPayRedirect(Box<WeChatPayRedirection>),
/// The wallet data for WeChat Pay

View File

@ -593,6 +593,7 @@ pub enum PaymentMethodType {
Trustly,
Twint,
UpiCollect,
Vipps,
Walley,
WeChatPay,
}

View File

@ -1577,6 +1577,7 @@ impl From<PaymentMethodType> for PaymentMethod {
PaymentMethodType::Trustly => Self::BankRedirect,
PaymentMethodType::Twint => Self::Wallet,
PaymentMethodType::UpiCollect => Self::Upi,
PaymentMethodType::Vipps => Self::Wallet,
PaymentMethodType::Walley => Self::PayLater,
PaymentMethodType::WeChatPay => Self::Wallet,
}

View File

@ -310,6 +310,7 @@ pub enum AdyenPaymentMethod<'a> {
BacsDirectDebit(Box<BacsDirectDebitData>),
SamsungPay(Box<SamsungPayPmData>),
Twint(Box<TwintWalletData>),
Vipps(Box<VippsWalletData>),
}
#[derive(Debug, Clone, Serialize)]
@ -674,6 +675,12 @@ pub struct TwintWalletData {
payment_type: PaymentType,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct VippsWalletData {
#[serde(rename = "type")]
payment_type: PaymentType,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AdyenPayLaterData {
#[serde(rename = "type")]
@ -754,6 +761,7 @@ pub enum PaymentType {
BacsDirectDebit,
Samsungpay,
Twint,
Vipps,
}
pub struct AdyenTestBankNames<'a>(&'a str);
@ -1242,6 +1250,12 @@ impl<'a> TryFrom<&api::WalletData> for AdyenPaymentMethod<'a> {
};
Ok(AdyenPaymentMethod::Twint(Box::new(data)))
}
api_models::payments::WalletData::VippsRedirect { .. } => {
let data = VippsWalletData {
payment_type: PaymentType::Vipps,
};
Ok(AdyenPaymentMethod::Vipps(Box::new(data)))
}
_ => Err(errors::ConnectorError::NotImplemented("Payment method".to_string()).into()),
}
}

View File

@ -175,6 +175,7 @@ impl ForeignFrom<api_enums::PaymentMethodType> for api_enums::PaymentMethod {
| api_enums::PaymentMethodType::MobilePay
| api_enums::PaymentMethodType::SamsungPay
| api_enums::PaymentMethodType::Twint
| api_enums::PaymentMethodType::Vipps
| api_enums::PaymentMethodType::WeChatPay
| api_enums::PaymentMethodType::GoPay
| api_enums::PaymentMethodType::Gcash

View File

@ -6839,6 +6839,7 @@
"trustly",
"twint",
"upi_collect",
"vipps",
"walley",
"we_chat_pay"
]
@ -9090,6 +9091,18 @@
}
}
},
{
"type": "object",
"required": [
"vipps_redirect"
],
"properties": {
"vipps_redirect": {
"type": "object",
"description": "Wallet data for Vipps Redirection"
}
}
},
{
"type": "object",
"required": [