mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 11:24:45 +08:00
feat(router): add new payment methods for Bank redirects, BNPL and wallet (#864)
This commit is contained in:
@ -409,19 +409,34 @@ pub enum PaymentExperience {
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum PaymentMethodType {
|
||||
Credit,
|
||||
Debit,
|
||||
Giropay,
|
||||
Ideal,
|
||||
Sofort,
|
||||
Eps,
|
||||
Klarna,
|
||||
Affirm,
|
||||
AfterpayClearpay,
|
||||
GooglePay,
|
||||
AliPay,
|
||||
ApplePay,
|
||||
Paypal,
|
||||
BancontactCard,
|
||||
Blik,
|
||||
Credit,
|
||||
CryptoCurrency,
|
||||
Debit,
|
||||
Eps,
|
||||
Giropay,
|
||||
GooglePay,
|
||||
Ideal,
|
||||
Klarna,
|
||||
MbWay,
|
||||
MobilePay,
|
||||
OnlineBankingCzechRepublic,
|
||||
OnlineBankingFinland,
|
||||
OnlineBankingPoland,
|
||||
OnlineBankingSlovakia,
|
||||
PayBright,
|
||||
Paypal,
|
||||
Przelewy24,
|
||||
Sofort,
|
||||
Swish,
|
||||
Trustly,
|
||||
Walley,
|
||||
WeChatPay,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -684,6 +699,8 @@ pub enum BankNames {
|
||||
AmericanExpress,
|
||||
BankOfAmerica,
|
||||
Barclays,
|
||||
#[serde(rename = "BLIK - PSP")]
|
||||
BlikPSP,
|
||||
CapitalOne,
|
||||
Chase,
|
||||
Citi,
|
||||
@ -711,13 +728,21 @@ pub enum BankNames {
|
||||
Bank99Ag,
|
||||
BankhausCarlSpangler,
|
||||
BankhausSchelhammerUndSchatteraAg,
|
||||
#[serde(rename = "Bank Millennium")]
|
||||
BankMillennium,
|
||||
#[serde(rename = "Bank PEKAO S.A.")]
|
||||
BankPEKAOSA,
|
||||
BawagPskAg,
|
||||
BksBankAg,
|
||||
BrullKallmusBankAg,
|
||||
BtvVierLanderBank,
|
||||
CapitalBankGraweGruppeAg,
|
||||
#[serde(rename = "Česká spořitelna")]
|
||||
CeskaSporitelna,
|
||||
Dolomitenbank,
|
||||
EasybankAg,
|
||||
#[serde(rename = "ePlatby VÚB")]
|
||||
EPlatbyVUB,
|
||||
ErsteBankUndSparkassen,
|
||||
HypoAlpeadriabankInternationalAg,
|
||||
HypoNoeLbFurNiederosterreichUWien,
|
||||
@ -725,17 +750,57 @@ pub enum BankNames {
|
||||
HypoTirolBankAg,
|
||||
HypoVorarlbergBankAg,
|
||||
HypoBankBurgenlandAktiengesellschaft,
|
||||
#[serde(rename = "Komercní banka")]
|
||||
KomercniBanka,
|
||||
#[serde(rename = "mBank - mTransfer")]
|
||||
MBank,
|
||||
MarchfelderBank,
|
||||
OberbankAg,
|
||||
OsterreichischeArzteUndApothekerbank,
|
||||
#[serde(rename = "Pay with ING")]
|
||||
PayWithING,
|
||||
#[serde(rename = "Płacę z iPKO")]
|
||||
PlaceZIPKO,
|
||||
#[serde(rename = "Płatność online kartą płatniczą")]
|
||||
PlatnoscOnlineKartaPlatnicza,
|
||||
PosojilnicaBankEGen,
|
||||
#[serde(rename = "Poštová banka")]
|
||||
PostovaBanka,
|
||||
RaiffeisenBankengruppeOsterreich,
|
||||
SchelhammerCapitalBankAg,
|
||||
SchoellerbankAg,
|
||||
SpardaBankWien,
|
||||
SporoPay,
|
||||
#[serde(rename = "Santander-Przelew24")]
|
||||
SantanderPrzelew24,
|
||||
TatraPay,
|
||||
Viamo,
|
||||
VolksbankGruppe,
|
||||
VolkskreditbankAg,
|
||||
VrBankBraunau,
|
||||
#[serde(rename = "Pay with Alior Bank")]
|
||||
PayWithAliorBank,
|
||||
#[serde(rename = "Banki Spółdzielcze")]
|
||||
BankiSpoldzielcze,
|
||||
#[serde(rename = "Pay with Inteligo")]
|
||||
PayWithInteligo,
|
||||
#[serde(rename = "BNP Paribas Poland")]
|
||||
BNPParibasPoland,
|
||||
#[serde(rename = "Bank Nowy S.A.")]
|
||||
BankNowySA,
|
||||
#[serde(rename = "Credit Agricole")]
|
||||
CreditAgricole,
|
||||
#[serde(rename = "Pay with BOŚ")]
|
||||
PayWithBOS,
|
||||
#[serde(rename = "Pay with CitiHandlowy")]
|
||||
PayWithCitiHandlowy,
|
||||
#[serde(rename = "Pay with Plus Bank")]
|
||||
PayWithPlusBank,
|
||||
#[serde(rename = "Toyota Bank")]
|
||||
ToyotaBank,
|
||||
VeloBank,
|
||||
#[serde(rename = "e-transfer Pocztowy24")]
|
||||
ETransferPocztowy24,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
|
||||
@ -454,6 +454,8 @@ pub enum PayLaterData {
|
||||
#[schema(value_type = String)]
|
||||
billing_name: Secret<String>,
|
||||
},
|
||||
PayBright {},
|
||||
Walley {},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
@ -510,6 +512,26 @@ impl From<&PaymentMethodData> for AdditionalPaymentData {
|
||||
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum BankRedirectData {
|
||||
BancontactCard {
|
||||
/// The card number
|
||||
#[schema(value_type = String, example = "4242424242424242")]
|
||||
card_number: Secret<String, pii::CardNumber>,
|
||||
/// The card's expiry month
|
||||
#[schema(value_type = String, example = "24")]
|
||||
card_exp_month: Secret<String>,
|
||||
|
||||
/// The card's expiry year
|
||||
#[schema(value_type = String, example = "24")]
|
||||
card_exp_year: Secret<String>,
|
||||
|
||||
/// The card holder's name
|
||||
#[schema(value_type = String, example = "John Test")]
|
||||
card_holder_name: Secret<String>,
|
||||
},
|
||||
Blik {
|
||||
// Blik Code
|
||||
blik_code: String,
|
||||
},
|
||||
Eps {
|
||||
/// The billing details for bank redirection
|
||||
billing_details: BankRedirectBilling,
|
||||
@ -530,6 +552,23 @@ pub enum BankRedirectData {
|
||||
#[schema(value_type = BankNames, example = "abn_amro")]
|
||||
bank_name: api_enums::BankNames,
|
||||
},
|
||||
OnlineBankingCzechRepublic {
|
||||
// Issuer banks
|
||||
issuer: api_enums::BankNames,
|
||||
},
|
||||
OnlineBankingFinland {
|
||||
// Shopper Email
|
||||
email: Option<Secret<String, pii::Email>>,
|
||||
},
|
||||
OnlineBankingPoland {
|
||||
// Issuer banks
|
||||
issuer: api_enums::BankNames,
|
||||
},
|
||||
OnlineBankingSlovakia {
|
||||
// Issuer value corresponds to the bank
|
||||
issuer: api_enums::BankNames,
|
||||
},
|
||||
Przelewy24 {},
|
||||
Sofort {
|
||||
/// The billing details for bank redirection
|
||||
billing_details: BankRedirectBilling,
|
||||
@ -542,6 +581,8 @@ pub enum BankRedirectData {
|
||||
#[schema(example = "en")]
|
||||
preferred_language: String,
|
||||
},
|
||||
Swish {},
|
||||
Trustly {},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
@ -565,14 +606,21 @@ pub struct BankRedirectBilling {
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum WalletData {
|
||||
/// The wallet data for Google pay
|
||||
GooglePay(GooglePayWalletData),
|
||||
/// The wallet data for Ali Pay redirect
|
||||
AliPay(AliPayRedirection),
|
||||
/// The wallet data for Apple pay
|
||||
ApplePay(ApplePayWalletData),
|
||||
/// The wallet data for Paypal
|
||||
PaypalSdk(PayPalWalletData),
|
||||
/// The wallet data for Google pay
|
||||
GooglePay(GooglePayWalletData),
|
||||
MbWay(Box<MbWayRedirection>),
|
||||
/// The wallet data for MobilePay redirect
|
||||
MobilePay(Box<MobilePayRedirection>),
|
||||
/// This is for paypal redirection
|
||||
PaypalRedirect(PaypalRedirection),
|
||||
/// The wallet data for Paypal
|
||||
PaypalSdk(PayPalWalletData),
|
||||
/// The wallet data for WeChat Pay Redirection
|
||||
WeChatPayRedirect(Box<WeChatPayRedirection>),
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
@ -588,9 +636,24 @@ pub struct GooglePayWalletData {
|
||||
pub tokenization_data: GpayTokenizationData,
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct WeChatPayRedirection {}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct PaypalRedirection {}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct AliPayRedirection {}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct MobilePayRedirection {}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct MbWayRedirection {
|
||||
/// Telephone number of the shopper. Should be Portuguese phone number.
|
||||
pub telephone_number: Secret<String>,
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)]
|
||||
pub struct GooglePayPaymentMethodInfo {
|
||||
/// The name of the card network
|
||||
|
||||
Reference in New Issue
Block a user