mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +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>),
|
SamsungPay(Box<SamsungPayWalletData>),
|
||||||
/// Wallet data for Twint Redirection
|
/// Wallet data for Twint Redirection
|
||||||
TwintRedirect {},
|
TwintRedirect {},
|
||||||
|
/// Wallet data for Vipps Redirection
|
||||||
|
VippsRedirect {},
|
||||||
/// The wallet data for WeChat Pay Redirection
|
/// The wallet data for WeChat Pay Redirection
|
||||||
WeChatPayRedirect(Box<WeChatPayRedirection>),
|
WeChatPayRedirect(Box<WeChatPayRedirection>),
|
||||||
/// The wallet data for WeChat Pay
|
/// The wallet data for WeChat Pay
|
||||||
|
|||||||
@ -593,6 +593,7 @@ pub enum PaymentMethodType {
|
|||||||
Trustly,
|
Trustly,
|
||||||
Twint,
|
Twint,
|
||||||
UpiCollect,
|
UpiCollect,
|
||||||
|
Vipps,
|
||||||
Walley,
|
Walley,
|
||||||
WeChatPay,
|
WeChatPay,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1577,6 +1577,7 @@ impl From<PaymentMethodType> for PaymentMethod {
|
|||||||
PaymentMethodType::Trustly => Self::BankRedirect,
|
PaymentMethodType::Trustly => Self::BankRedirect,
|
||||||
PaymentMethodType::Twint => Self::Wallet,
|
PaymentMethodType::Twint => Self::Wallet,
|
||||||
PaymentMethodType::UpiCollect => Self::Upi,
|
PaymentMethodType::UpiCollect => Self::Upi,
|
||||||
|
PaymentMethodType::Vipps => Self::Wallet,
|
||||||
PaymentMethodType::Walley => Self::PayLater,
|
PaymentMethodType::Walley => Self::PayLater,
|
||||||
PaymentMethodType::WeChatPay => Self::Wallet,
|
PaymentMethodType::WeChatPay => Self::Wallet,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -310,6 +310,7 @@ pub enum AdyenPaymentMethod<'a> {
|
|||||||
BacsDirectDebit(Box<BacsDirectDebitData>),
|
BacsDirectDebit(Box<BacsDirectDebitData>),
|
||||||
SamsungPay(Box<SamsungPayPmData>),
|
SamsungPay(Box<SamsungPayPmData>),
|
||||||
Twint(Box<TwintWalletData>),
|
Twint(Box<TwintWalletData>),
|
||||||
|
Vipps(Box<VippsWalletData>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
@ -674,6 +675,12 @@ pub struct TwintWalletData {
|
|||||||
payment_type: PaymentType,
|
payment_type: PaymentType,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct VippsWalletData {
|
||||||
|
#[serde(rename = "type")]
|
||||||
|
payment_type: PaymentType,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct AdyenPayLaterData {
|
pub struct AdyenPayLaterData {
|
||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
@ -754,6 +761,7 @@ pub enum PaymentType {
|
|||||||
BacsDirectDebit,
|
BacsDirectDebit,
|
||||||
Samsungpay,
|
Samsungpay,
|
||||||
Twint,
|
Twint,
|
||||||
|
Vipps,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct AdyenTestBankNames<'a>(&'a str);
|
pub struct AdyenTestBankNames<'a>(&'a str);
|
||||||
@ -1242,6 +1250,12 @@ impl<'a> TryFrom<&api::WalletData> for AdyenPaymentMethod<'a> {
|
|||||||
};
|
};
|
||||||
Ok(AdyenPaymentMethod::Twint(Box::new(data)))
|
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()),
|
_ => 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::MobilePay
|
||||||
| api_enums::PaymentMethodType::SamsungPay
|
| api_enums::PaymentMethodType::SamsungPay
|
||||||
| api_enums::PaymentMethodType::Twint
|
| api_enums::PaymentMethodType::Twint
|
||||||
|
| api_enums::PaymentMethodType::Vipps
|
||||||
| api_enums::PaymentMethodType::WeChatPay
|
| api_enums::PaymentMethodType::WeChatPay
|
||||||
| api_enums::PaymentMethodType::GoPay
|
| api_enums::PaymentMethodType::GoPay
|
||||||
| api_enums::PaymentMethodType::Gcash
|
| api_enums::PaymentMethodType::Gcash
|
||||||
|
|||||||
@ -6839,6 +6839,7 @@
|
|||||||
"trustly",
|
"trustly",
|
||||||
"twint",
|
"twint",
|
||||||
"upi_collect",
|
"upi_collect",
|
||||||
|
"vipps",
|
||||||
"walley",
|
"walley",
|
||||||
"we_chat_pay"
|
"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",
|
"type": "object",
|
||||||
"required": [
|
"required": [
|
||||||
|
|||||||
Reference in New Issue
Block a user