Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

refactor(api_models): follow naming convention for wallets & paylater payment method data enums (#1338)

Arjun Karthik6c0d136cee10
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index ee8ef27987..e743e9a853 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -504,8 +504,8 @@ pub enum PayLaterData {
#[schema(value_type = String)]
billing_name: Secret<String>,
},
- PayBright {},
- Walley {},
+ PayBrightRedirect {},
+ WalleyRedirect {},
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]
@@ -809,16 +809,16 @@ pub struct BankDebitBilling {
#[serde(rename_all = "snake_case")]
pub enum WalletData {
/// The wallet data for Ali Pay redirect
- AliPay(AliPayRedirection),
+ AliPayRedirect(AliPayRedirection),
/// The wallet data for Apple pay
ApplePay(ApplePayWalletData),
/// Wallet data for apple pay redirect flow
ApplePayRedirect(Box<ApplePayRedirectData>),
/// The wallet data for Google pay
GooglePay(GooglePayWalletData),
- MbWay(Box<MbWayRedirection>),
+ MbWayRedirect(Box<MbWayRedirection>),
/// The wallet data for MobilePay redirect
- MobilePay(Box<MobilePayRedirection>),
+ MobilePayRedirect(Box<MobilePayRedirection>),
/// This is for paypal redirection
PaypalRedirect(PaypalRedirection),
/// The wallet data for Paypal
diff --git a/crates/router/src/connector/aci/transformers.rs b/crates/router/src/connector/aci/transformers.rs
index 01782f8ae1..e831cc4bc5 100644
--- a/crates/router/src/connector/aci/transformers.rs
+++ b/crates/router/src/connector/aci/transformers.rs
@@ -158,14 +158,14 @@ impl TryFrom<&types::PaymentsAuthorizeRouterData> for AciPaymentsRequest {
})),
api::PaymentMethodData::PayLater(_) => PaymentDetails::Klarna,
api::PaymentMethodData::Wallet(ref wallet_data) => match wallet_data {
- api_models::payments::WalletData::MbWay(data) => {
+ api_models::payments::WalletData::MbWayRedirect(data) => {
PaymentDetails::Wallet(Box::new(WalletPMData {
payment_brand: PaymentBrand::Mbway,
account_id: Some(data.telephone_number.clone()),
shopper_result_url: item.request.router_return_url.clone(),
}))
}
- api_models::payments::WalletData::AliPay { .. } => {
+ api_models::payments::WalletData::AliPayRedirect { .. } => {
PaymentDetails::Wallet(Box::new(WalletPMData {
payment_brand: PaymentBrand::AliPay,
account_id: None,
diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs
index 422f50436e..a724d87b30 100644
--- a/crates/router/src/connector/adyen/transformers.rs
+++ b/crates/router/src/connector/adyen/transformers.rs
@@ -1121,20 +1121,20 @@ impl<'a> TryFrom<&api::WalletData> for AdyenPaymentMethod<'a> {
};
Ok(AdyenPaymentMethod::AdyenPaypal(Box::new(wallet)))
}
- api_models::payments::WalletData::AliPay(_) => {
+ api_models::payments::WalletData::AliPayRedirect(_) => {
let alipay_data = AliPayData {
payment_type: PaymentType::Alipay,
};
Ok(AdyenPaymentMethod::AliPay(Box::new(alipay_data)))
}
- api_models::payments::WalletData::MbWay(data) => {
+ api_models::payments::WalletData::MbWayRedirect(data) => {
let mbway_data = MbwayData {
payment_type: PaymentType::Mbway,
telephone_number: data.telephone_number.clone(),
};
Ok(AdyenPaymentMethod::Mbway(Box::new(mbway_data)))
}
- api_models::payments::WalletData::MobilePay(_) => {
+ api_models::payments::WalletData::MobilePayRedirect(_) => {
let data = MobilePayData {
payment_type: PaymentType::MobilePay,
};
@@ -1171,12 +1171,12 @@ impl<'a> TryFrom<&api::PayLaterData> for AdyenPaymentMethod<'a> {
payment_type: PaymentType::Afterpaytouch,
})))
}
- api_models::payments::PayLaterData::PayBright { .. } => {
+ api_models::payments::PayLaterData::PayBrightRedirect { .. } => {
Ok(AdyenPaymentMethod::PayBright(Box::new(PayBrightData {
payment_type: PaymentType::PayBright,
})))
}
- api_models::payments::PayLaterData::Walley { .. } => {
+ api_models::payments::PayLaterData::WalleyRedirect { .. } => {
Ok(AdyenPaymentMethod::Walley(Box::new(WalleyData {
payment_type: PaymentType::Walley,
})))
diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs
index 2500365f83..ca0e35d660 100644
--- a/crates/router/src/connector/stripe/transformers.rs
+++ b/crates/router/src/connector/stripe/transformers.rs
@@ -1042,7 +1042,7 @@ fn create_stripe_payment_method(
StripePaymentMethodType::Wechatpay,
StripeBillingAddress::default(),
)),
- payments::WalletData::AliPay(_) => Ok((
+ payments::WalletData::AliPayRedirect(_) => Ok((
StripePaymentMethodData::Wallet(StripeWallet::AlipayPayment(AlipayPayment {
payment_method_types: StripePaymentMethodType::Alipay,
payment_method_data_type: StripePaymentMethodType::Alipay,
@@ -2513,7 +2513,7 @@ impl
});
Ok(Self::Wallet(wallet_info))
}
- payments::WalletData::AliPay(_) => {
+ payments::WalletData::AliPayRedirect(_) => {
let wallet_info = StripeWallet::AlipayPayment(AlipayPayment {
payment_method_types: StripePaymentMethodType::Alipay,
payment_method_data_type: StripePaymentMethodType::Alipay,