mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(payouts): apple pay decrypt payout (#9857)
This commit is contained in:
@ -56,6 +56,7 @@ pub enum PayoutConnectors {
|
||||
Paypal,
|
||||
Stripe,
|
||||
Wise,
|
||||
Worldpay,
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2")]
|
||||
@ -85,6 +86,7 @@ impl From<PayoutConnectors> for RoutableConnectors {
|
||||
PayoutConnectors::Paypal => Self::Paypal,
|
||||
PayoutConnectors::Stripe => Self::Stripe,
|
||||
PayoutConnectors::Wise => Self::Wise,
|
||||
PayoutConnectors::Worldpay => Self::Worldpay,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -105,6 +107,7 @@ impl From<PayoutConnectors> for Connector {
|
||||
PayoutConnectors::Paypal => Self::Paypal,
|
||||
PayoutConnectors::Stripe => Self::Stripe,
|
||||
PayoutConnectors::Wise => Self::Wise,
|
||||
PayoutConnectors::Worldpay => Self::Worldpay,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -125,6 +128,7 @@ impl TryFrom<Connector> for PayoutConnectors {
|
||||
Connector::Paypal => Ok(Self::Paypal),
|
||||
Connector::Stripe => Ok(Self::Stripe),
|
||||
Connector::Wise => Ok(Self::Wise),
|
||||
Connector::Worldpay => Ok(Self::Worldpay),
|
||||
_ => Err(format!("Invalid payout connector {value}")),
|
||||
}
|
||||
}
|
||||
|
||||
@ -375,6 +375,7 @@ pub struct PixBankTransfer {
|
||||
#[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum Wallet {
|
||||
ApplePayDecrypt(ApplePayDecrypt),
|
||||
Paypal(Paypal),
|
||||
Venmo(Venmo),
|
||||
}
|
||||
@ -414,6 +415,25 @@ pub struct Venmo {
|
||||
pub telephone_number: Option<Secret<String>>,
|
||||
}
|
||||
|
||||
#[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)]
|
||||
pub struct ApplePayDecrypt {
|
||||
/// The dpan number associated with card number
|
||||
#[schema(value_type = String, example = "4242424242424242")]
|
||||
pub dpan: CardNumber,
|
||||
|
||||
/// The card's expiry month
|
||||
#[schema(value_type = String)]
|
||||
pub expiry_month: Secret<String>,
|
||||
|
||||
/// The card's expiry year
|
||||
#[schema(value_type = String)]
|
||||
pub expiry_year: Secret<String>,
|
||||
|
||||
/// The card holder's name
|
||||
#[schema(value_type = String, example = "John Doe")]
|
||||
pub card_holder_name: Option<Secret<String>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, ToSchema, Clone, Serialize, router_derive::PolymorphicSchema)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct PayoutCreateResponse {
|
||||
@ -1000,6 +1020,18 @@ impl From<Wallet> for payout_method_utils::WalletAdditionalData {
|
||||
telephone_number: telephone_number.map(From::from),
|
||||
}))
|
||||
}
|
||||
Wallet::ApplePayDecrypt(ApplePayDecrypt {
|
||||
expiry_month,
|
||||
expiry_year,
|
||||
card_holder_name,
|
||||
..
|
||||
}) => Self::ApplePayDecrypt(Box::new(
|
||||
payout_method_utils::ApplePayDecryptAdditionalData {
|
||||
card_exp_month: expiry_month,
|
||||
card_exp_year: expiry_year,
|
||||
card_holder_name,
|
||||
},
|
||||
)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user