mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
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:
@ -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
|
||||
|
||||
@ -593,6 +593,7 @@ pub enum PaymentMethodType {
|
||||
Trustly,
|
||||
Twint,
|
||||
UpiCollect,
|
||||
Vipps,
|
||||
Walley,
|
||||
WeChatPay,
|
||||
}
|
||||
|
||||
@ -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,
|
||||
}
|
||||
|
||||
@ -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()),
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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": [
|
||||
|
||||
Reference in New Issue
Block a user