mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user