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

feat(connector): [Adyen] implement Oxxo (#1808)

AkshayaFoiger5ed3f34c24c8
diff --git a/config/config.example.toml b/config/config.example.toml
index 7f3177d0aa..4887464302 100644
--- a/config/config.example.toml
+++ b/config/config.example.toml
@@ -343,6 +343,7 @@ danamon_va = {country = "ID", currency = "IDR"}
mandiri_va = {country = "ID", currency = "IDR"}
alfamart = {country = "ID", currency = "IDR"}
indomaret = {country = "ID", currency = "IDR"}
+oxxo = {country = "MX", currency = "MXN"}
pay_safe_card = {country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,UAE,UK,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,ISK,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU"}
[pm_filters.zen]
diff --git a/config/development.toml b/config/development.toml
index 0f55665013..fa05727e0f 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -281,6 +281,7 @@ danamon_va = {country = "ID", currency = "IDR"}
mandiri_va = {country = "ID", currency = "IDR"}
alfamart = {country = "ID", currency = "IDR"}
indomaret = {country = "ID", currency = "IDR"}
+oxxo = {country = "MX", currency = "MXN"}
pay_safe_card = {country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,UAE,UK,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,ISK,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU"}
[pm_filters.braintree]
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 9e6dc440aa..7e0d4df6df 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -226,6 +226,7 @@ danamon_va = {country = "ID", currency = "IDR"}
mandiri_va = {country = "ID", currency = "IDR"}
alfamart = {country = "ID", currency = "IDR"}
indomaret = {country = "ID", currency = "IDR"}
+oxxo = {country = "MX", currency = "MXN"}
pay_safe_card = {country = "AT,AU,BE,BR,BE,CA,HR,CY,CZ,DK,FI,FR,GE,DE,GI,HU,IS,IE,KW,LV,IE,LI,LT,LU,MT,MX,MD,ME,NL,NZ,NO,PY,PE,PL,PT,RO,SA,RS,SK,SI,ES,SE,CH,TR,UAE,UK,US,UY", currency = "EUR,AUD,BRL,CAD,CZK,DKK,GEL,GIP,HUF,ISK,KWD,CHF,MXN,MDL,NZD,NOK,PYG,PEN,PLN,RON,SAR,RSD,SEK,TRY,AED,GBP,USD,UYU"}
[pm_filters.zen]
diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs
index cf7006a740..a8659809a4 100644
--- a/crates/api_models/src/payments.rs
+++ b/crates/api_models/src/payments.rs
@@ -1292,6 +1292,7 @@ pub enum VoucherData {
RedPagos,
Alfamart(Box<AlfamartVoucherData>),
Indomaret(Box<IndomaretVoucherData>),
+ Oxxo,
}
#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs
index 22c20e639f..50f3d34e71 100644
--- a/crates/common_enums/src/enums.rs
+++ b/crates/common_enums/src/enums.rs
@@ -917,6 +917,7 @@ pub enum PaymentMethodType {
OnlineBankingFpx,
OnlineBankingPoland,
OnlineBankingSlovakia,
+ Oxxo,
PagoEfectivo,
PermataBankTransfer,
PayBright,
diff --git a/crates/common_enums/src/transformers.rs b/crates/common_enums/src/transformers.rs
index 55f5408210..97704f79ca 100644
--- a/crates/common_enums/src/transformers.rs
+++ b/crates/common_enums/src/transformers.rs
@@ -1606,6 +1606,7 @@ impl From<PaymentMethodType> for PaymentMethod {
PaymentMethodType::RedPagos => Self::Voucher,
PaymentMethodType::Cashapp => Self::Wallet,
PaymentMethodType::Givex => Self::GiftCard,
+ PaymentMethodType::Oxxo => Self::Voucher,
}
}
}
diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs
index 895ea4f98e..3624fb8273 100644
--- a/crates/router/src/connector/adyen/transformers.rs
+++ b/crates/router/src/connector/adyen/transformers.rs
@@ -408,6 +408,8 @@ pub enum AdyenPaymentMethod<'a> {
OnlineBankingFpx(Box<OnlineBankingFpxData>),
#[serde(rename = "molpay_ebanking_TH")]
OnlineBankingThailand(Box<OnlineBankingThailandData>),
+ #[serde(rename = "oxxo")]
+ Oxxo,
#[serde(rename = "paysafecard")]
PaySafeCard,
#[serde(rename = "paybright")]
@@ -975,6 +977,8 @@ pub enum PaymentType {
OnlineBankingFpx,
#[serde(rename = "molpay_ebanking_TH")]
OnlineBankingThailand,
+ #[serde(rename = "oxxo")]
+ Oxxo,
#[serde(rename = "paysafecard")]
PaySafeCard,
PayBright,
@@ -1411,6 +1415,7 @@ fn get_social_security_number(
| payments::VoucherData::Efecty
| payments::VoucherData::PagoEfectivo
| payments::VoucherData::RedCompra
+ | payments::VoucherData::Oxxo
| payments::VoucherData::RedPagos => None,
}
}
@@ -1493,6 +1498,7 @@ impl<'a> TryFrom<&api_models::payments::VoucherData> for AdyenPaymentMethod<'a>
shopper_email: indomaret_data.email.clone(),
})))
}
+ payments::VoucherData::Oxxo => Ok(AdyenPaymentMethod::Oxxo),
payments::VoucherData::Efecty
| payments::VoucherData::PagoEfectivo
| payments::VoucherData::RedCompra
@@ -2794,6 +2800,7 @@ pub fn get_wait_screen_metadata(
})))
}
PaymentType::Affirm
+ | PaymentType::Oxxo
| PaymentType::Afterpaytouch
| PaymentType::Alipay
| PaymentType::AlipayHk
@@ -2856,7 +2863,10 @@ pub fn get_present_to_shopper_metadata(
let reference = response.action.reference.clone();
match response.action.payment_method_type {
- PaymentType::Alfamart | PaymentType::Indomaret | PaymentType::BoletoBancario => {
+ PaymentType::Alfamart
+ | PaymentType::Indomaret
+ | PaymentType::BoletoBancario
+ | PaymentType::Oxxo => {
let voucher_data = payments::VoucherNextStepData {
expires_at: response.action.expires_at.clone(),
reference,
diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs
index 016c0b5903..6d144a4a46 100644
--- a/crates/router/src/connector/stripe/transformers.rs
+++ b/crates/router/src/connector/stripe/transformers.rs
@@ -611,6 +611,7 @@ impl TryFrom<enums::PaymentMethodType> for StripePaymentMethodType {
| enums::PaymentMethodType::PermataBankTransfer
| enums::PaymentMethodType::PaySafeCard
| enums::PaymentMethodType::Givex
+ | enums::PaymentMethodType::Oxxo
| enums::PaymentMethodType::Walley => Err(errors::ConnectorError::NotImplemented(
connector_util::get_unimplemented_payment_method_error_message("stripe"),
)
@@ -909,6 +910,7 @@ fn infer_stripe_pay_later_type(
| enums::PaymentMethodType::PermataBankTransfer
| enums::PaymentMethodType::PaySafeCard
| enums::PaymentMethodType::Givex
+ | enums::PaymentMethodType::Oxxo
| enums::PaymentMethodType::WeChatPay => Err(errors::ConnectorError::NotImplemented(
connector_util::get_unimplemented_payment_method_error_message("stripe"),
)),
diff --git a/crates/router/src/connector/utils.rs b/crates/router/src/connector/utils.rs
index a98400c26e..877778c504 100644
--- a/crates/router/src/connector/utils.rs
+++ b/crates/router/src/connector/utils.rs
@@ -75,7 +75,7 @@ pub trait RouterData {
}
pub fn get_unimplemented_payment_method_error_message(connector: &str) -> String {
- format!("Selected paymemt method through {}", connector)
+ format!("Selected payment method through {}", connector)
}
impl<Flow, Request, Response> RouterData for types::RouterData<Flow, Request, Response> {
diff --git a/crates/router/src/connector/zen/transformers.rs b/crates/router/src/connector/zen/transformers.rs
index 88f85abcaa..97208e6fe1 100644
--- a/crates/router/src/connector/zen/transformers.rs
+++ b/crates/router/src/connector/zen/transformers.rs
@@ -246,7 +246,8 @@ impl
}
api_models::payments::VoucherData::RedPagos => ZenPaymentChannels::PclBoacompraRedpagos,
api_models::payments::VoucherData::Alfamart { .. }
- | api_models::payments::VoucherData::Indomaret { .. } => Err(
+ | api_models::payments::VoucherData::Indomaret { .. }
+ | api_models::payments::VoucherData::Oxxo { .. } => Err(
errors::ConnectorError::NotImplemented("payment method".to_string()),
)?,
};
diff --git a/crates/router/src/core/payments/helpers.rs b/crates/router/src/core/payments/helpers.rs
index 511d0534a8..335a18075e 100644
--- a/crates/router/src/core/payments/helpers.rs
+++ b/crates/router/src/core/payments/helpers.rs
@@ -1570,6 +1570,7 @@ pub fn validate_payment_method_type_against_payment_method(
| api_enums::PaymentMethodType::RedPagos
| api_enums::PaymentMethodType::Indomaret
| api_enums::PaymentMethodType::Alfamart
+ | api_enums::PaymentMethodType::Oxxo
),
api_enums::PaymentMethod::GiftCard => {
matches!(
diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs
index b45b3e11d0..0d6e014b34 100644
--- a/crates/router/src/openapi.rs
+++ b/crates/router/src/openapi.rs
@@ -195,6 +195,8 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::UpiData,
api_models::payments::VoucherData,
api_models::payments::BoletoVoucherData,
+ api_models::payments::AlfamartVoucherData,
+ api_models::payments::IndomaretVoucherData,
api_models::payments::Address,
api_models::payments::VoucherData,
api_models::payments::AlfamartVoucherData,
diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs
index bbf076f3c6..95f8f3c0fd 100644
--- a/crates/router/src/types/transformers.rs
+++ b/crates/router/src/types/transformers.rs
@@ -225,6 +225,7 @@ impl ForeignFrom<api_enums::PaymentMethodType> for api_enums::PaymentMethod {
| api_enums::PaymentMethodType::RedCompra
| api_enums::PaymentMethodType::Alfamart
| api_enums::PaymentMethodType::Indomaret
+ | api_enums::PaymentMethodType::Oxxo
| api_enums::PaymentMethodType::RedPagos => Self::Voucher,
api_enums::PaymentMethodType::Pse
| api_enums::PaymentMethodType::Multibanco
diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json
index d06f9611f8..72243b17a5 100644
--- a/openapi/openapi_spec.json
+++ b/openapi/openapi_spec.json
@@ -7719,6 +7719,7 @@
"online_banking_fpx",
"online_banking_poland",
"online_banking_slovakia",
+ "oxxo",
"pago_efectivo",
"permata_bank_transfer",
"pay_bright",
@@ -10366,6 +10367,12 @@
"$ref": "#/components/schemas/IndomaretVoucherData"
}
}
+ },
+ {
+ "type": "string",
+ "enum": [
+ "oxxo"
+ ]
}
]
},