diff --git a/config/config.example.toml b/config/config.example.toml index cd036fc03d..775318e7d0 100644 --- a/config/config.example.toml +++ b/config/config.example.toml @@ -356,6 +356,12 @@ indomaret = {country = "ID", currency = "IDR"} open_banking_uk = {country = "GB", currency = "GBP"} 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"} +seven_eleven = {country = "JP", currency = "JPY"} +lawson = {country = "JP", currency = "JPY"} +mini_stop = {country = "JP", currency = "JPY"} +family_mart = {country = "JP", currency = "JPY"} +seicomart = {country = "JP", currency = "JPY"} +pay_easy = {country = "JP", currency = "JPY"} [pm_filters.zen] credit = { not_available_flows = { capture_method = "manual" } } diff --git a/config/development.toml b/config/development.toml index 8591e3dae2..d568a9d1b7 100644 --- a/config/development.toml +++ b/config/development.toml @@ -287,6 +287,12 @@ indomaret = {country = "ID", currency = "IDR"} open_banking_uk = {country = "GB", currency = "GBP"} 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"} +seven_eleven = {country = "JP", currency = "JPY"} +lawson = {country = "JP", currency = "JPY"} +mini_stop = {country = "JP", currency = "JPY"} +family_mart = {country = "JP", currency = "JPY"} +seicomart = {country = "JP", currency = "JPY"} +pay_easy = {country = "JP", currency = "JPY"} [pm_filters.braintree] paypal = { currency = "AUD,BRL,CAD,CNY,CZK,DKK,EUR,HKD,HUF,ILS,JPY,MYR,MXN,TWD,NZD,NOK,PHP,PLN,GBP,RUB,SGD,SEK,CHF,THB,USD" } diff --git a/config/docker_compose.toml b/config/docker_compose.toml index f6215ab144..21490be482 100644 --- a/config/docker_compose.toml +++ b/config/docker_compose.toml @@ -235,6 +235,12 @@ indomaret = {country = "ID", currency = "IDR"} open_banking_uk = {country = "GB", currency = "GBP"} 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"} +seven_eleven = {country = "JP", currency = "JPY"} +lawson = {country = "JP", currency = "JPY"} +mini_stop = {country = "JP", currency = "JPY"} +family_mart = {country = "JP", currency = "JPY"} +seicomart = {country = "JP", currency = "JPY"} +pay_easy = {country = "JP", currency = "JPY"} [pm_filters.zen] credit = { not_available_flows = { capture_method = "manual" } } diff --git a/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 32e4054038..276e75ef14 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -962,6 +962,22 @@ pub struct IndomaretVoucherData { pub email: Email, } +#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize, ToSchema)] +pub struct JCSVoucherData { + /// The billing first name for Japanese convenience stores + #[schema(value_type = String, example = "Jane")] + pub first_name: Secret, + /// The billing second name Japanese convenience stores + #[schema(value_type = String, example = "Doe")] + pub last_name: Option>, + /// The Email ID for Japanese convenience stores + #[schema(value_type = String, example = "example@me.com")] + pub email: Email, + /// The telephone number for Japanese convenience stores + #[schema(value_type = String, example = "9999999999")] + pub phone_number: String, +} + #[derive(Debug, Clone, Eq, PartialEq, serde::Deserialize, serde::Serialize, ToSchema)] pub struct AchBillingDetails { /// The Email ID for ACH billing @@ -1320,6 +1336,12 @@ pub enum VoucherData { Alfamart(Box), Indomaret(Box), Oxxo, + SevenEleven(Box), + Lawson(Box), + MiniStop(Box), + FamilyMart(Box), + Seicomart(Box), + PayEasy(Box), } #[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)] @@ -1525,6 +1547,8 @@ pub struct VoucherNextStepData { pub reference: String, /// Url to download the payment instruction pub download_url: Option, + /// Url to payment instruction page + pub instructions_url: Option, } #[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index d13789be0d..f90f183648 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -975,6 +975,12 @@ pub enum PaymentMethodType { Vipps, Walley, WeChatPay, + SevenEleven, + Lawson, + MiniStop, + FamilyMart, + Seicomart, + PayEasy, } #[derive( diff --git a/crates/common_enums/src/transformers.rs b/crates/common_enums/src/transformers.rs index 8e1bd1cb3b..8f967ddf94 100644 --- a/crates/common_enums/src/transformers.rs +++ b/crates/common_enums/src/transformers.rs @@ -1611,6 +1611,12 @@ impl From for PaymentMethod { PaymentMethodType::Givex => Self::GiftCard, PaymentMethodType::Oxxo => Self::Voucher, PaymentMethodType::OpenBankingUk => Self::BankRedirect, + PaymentMethodType::SevenEleven => Self::Voucher, + PaymentMethodType::Lawson => Self::Voucher, + PaymentMethodType::MiniStop => Self::Voucher, + PaymentMethodType::FamilyMart => Self::Voucher, + PaymentMethodType::Seicomart => Self::Voucher, + PaymentMethodType::PayEasy => Self::Voucher, } } } diff --git a/crates/router/src/connector/adyen.rs b/crates/router/src/connector/adyen.rs index ba4e83f414..54cf4b35ca 100644 --- a/crates/router/src/connector/adyen.rs +++ b/crates/router/src/connector/adyen.rs @@ -1351,7 +1351,6 @@ impl api::IncomingWebhook for Adyen { .change_context(errors::ConnectorError::WebhookSourceVerificationFailed)?; let base64_signature = notif_item.additional_data.hmac_signature; - Ok(base64_signature.as_bytes().to_vec()) } diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index 02f1b570ca..229af792c9 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -471,6 +471,27 @@ pub enum AdyenPaymentMethod<'a> { Benefit, #[serde(rename = "knet")] Knet, + #[serde(rename = "econtext_seven_eleven")] + SevenEleven(Box), + #[serde(rename = "econtext_stores")] + Lawson(Box), + #[serde(rename = "econtext_stores")] + MiniStop(Box), + #[serde(rename = "econtext_stores")] + FamilyMart(Box), + #[serde(rename = "econtext_stores")] + Seicomart(Box), + #[serde(rename = "econtext_stores")] + PayEasy(Box), +} + +#[derive(Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct JCSVoucherData { + first_name: Secret, + last_name: Option>, + shopper_email: Email, + telephone_number: String, } #[derive(Debug, Clone, Serialize)] @@ -594,6 +615,18 @@ pub enum OnlineBankingCzechRepublicBanks { C, } +impl TryFrom<&Box> for JCSVoucherData { + type Error = Error; + fn try_from(jcs_data: &Box) -> Result { + Ok(Self { + first_name: jcs_data.first_name.clone(), + last_name: jcs_data.last_name.clone(), + shopper_email: jcs_data.email.clone(), + telephone_number: jcs_data.phone_number.clone(), + }) + } +} + impl TryFrom<&api_enums::BankNames> for OnlineBankingCzechRepublicBanks { type Error = Error; fn try_from(bank_name: &api_enums::BankNames) -> Result { @@ -1082,6 +1115,18 @@ pub enum PaymentType { DanamonVa, #[serde(rename = "doku_mandiri_va")] MandiriVa, + #[serde(rename = "econtext_seven_eleven")] + SevenEleven, + #[serde(rename = "econtext_stores")] + Lawson, + #[serde(rename = "econtext_stores")] + MiniStop, + #[serde(rename = "econtext_stores")] + FamilyMart, + #[serde(rename = "econtext_stores")] + Seicomart, + #[serde(rename = "econtext_stores")] + PayEasy, } #[derive(Debug, Clone, Serialize, Deserialize)] @@ -1531,7 +1576,13 @@ fn get_social_security_number( | payments::VoucherData::PagoEfectivo | payments::VoucherData::RedCompra | payments::VoucherData::Oxxo - | payments::VoucherData::RedPagos => None, + | payments::VoucherData::RedPagos + | payments::VoucherData::SevenEleven { .. } + | payments::VoucherData::Lawson { .. } + | payments::VoucherData::MiniStop { .. } + | payments::VoucherData::FamilyMart { .. } + | payments::VoucherData::Seicomart { .. } + | payments::VoucherData::PayEasy { .. } => None, } } @@ -1614,6 +1665,24 @@ impl<'a> TryFrom<&api_models::payments::VoucherData> for AdyenPaymentMethod<'a> }))) } payments::VoucherData::Oxxo => Ok(AdyenPaymentMethod::Oxxo), + payments::VoucherData::SevenEleven(jcs_data) => Ok(AdyenPaymentMethod::SevenEleven( + Box::new(JCSVoucherData::try_from(jcs_data)?), + )), + payments::VoucherData::Lawson(jcs_data) => Ok(AdyenPaymentMethod::Lawson(Box::new( + JCSVoucherData::try_from(jcs_data)?, + ))), + payments::VoucherData::MiniStop(jcs_data) => Ok(AdyenPaymentMethod::MiniStop( + Box::new(JCSVoucherData::try_from(jcs_data)?), + )), + payments::VoucherData::FamilyMart(jcs_data) => Ok(AdyenPaymentMethod::FamilyMart( + Box::new(JCSVoucherData::try_from(jcs_data)?), + )), + payments::VoucherData::Seicomart(jcs_data) => Ok(AdyenPaymentMethod::Seicomart( + Box::new(JCSVoucherData::try_from(jcs_data)?), + )), + payments::VoucherData::PayEasy(jcs_data) => Ok(AdyenPaymentMethod::PayEasy(Box::new( + JCSVoucherData::try_from(jcs_data)?, + ))), payments::VoucherData::Efecty | payments::VoucherData::PagoEfectivo | payments::VoucherData::RedCompra @@ -3045,7 +3114,13 @@ pub fn get_wait_screen_metadata( | PaymentType::DanamonVa | PaymentType::Giftcard | PaymentType::MandiriVa - | PaymentType::PaySafeCard => Ok(None), + | PaymentType::PaySafeCard + | PaymentType::SevenEleven + | PaymentType::Lawson + | PaymentType::MiniStop + | PaymentType::FamilyMart + | PaymentType::Seicomart + | PaymentType::PayEasy => Ok(None), } } @@ -3058,11 +3133,17 @@ pub fn get_present_to_shopper_metadata( PaymentType::Alfamart | PaymentType::Indomaret | PaymentType::BoletoBancario - | PaymentType::Oxxo => { + | PaymentType::Oxxo + | PaymentType::Lawson + | PaymentType::MiniStop + | PaymentType::FamilyMart + | PaymentType::Seicomart + | PaymentType::PayEasy => { let voucher_data = payments::VoucherNextStepData { expires_at: response.action.expires_at.clone(), reference, download_url: response.action.download_url.clone(), + instructions_url: response.action.instructions_url.clone(), }; Some(common_utils::ext_traits::Encode::< @@ -3141,7 +3222,8 @@ pub fn get_present_to_shopper_metadata( | PaymentType::Twint | PaymentType::Vipps | PaymentType::Swish - | PaymentType::PaySafeCard => Ok(None), + | PaymentType::PaySafeCard + | PaymentType::SevenEleven => Ok(None), } } diff --git a/crates/router/src/connector/stripe/transformers.rs b/crates/router/src/connector/stripe/transformers.rs index a0d0878f7b..70a4a07560 100644 --- a/crates/router/src/connector/stripe/transformers.rs +++ b/crates/router/src/connector/stripe/transformers.rs @@ -616,6 +616,12 @@ impl TryFrom for StripePaymentMethodType { | enums::PaymentMethodType::Oxxo | enums::PaymentMethodType::Benefit | enums::PaymentMethodType::Knet + | enums::PaymentMethodType::SevenEleven + | enums::PaymentMethodType::Lawson + | enums::PaymentMethodType::MiniStop + | enums::PaymentMethodType::FamilyMart + | enums::PaymentMethodType::Seicomart + | enums::PaymentMethodType::PayEasy | enums::PaymentMethodType::Walley => Err(errors::ConnectorError::NotImplemented( connector_util::get_unimplemented_payment_method_error_message("stripe"), ) @@ -919,6 +925,12 @@ fn infer_stripe_pay_later_type( | enums::PaymentMethodType::PaySafeCard | enums::PaymentMethodType::Givex | enums::PaymentMethodType::Oxxo + | enums::PaymentMethodType::SevenEleven + | enums::PaymentMethodType::Lawson + | enums::PaymentMethodType::MiniStop + | enums::PaymentMethodType::FamilyMart + | enums::PaymentMethodType::Seicomart + | enums::PaymentMethodType::PayEasy | enums::PaymentMethodType::WeChatPay => Err(errors::ConnectorError::NotImplemented( connector_util::get_unimplemented_payment_method_error_message("stripe"), )), diff --git a/crates/router/src/connector/zen/transformers.rs b/crates/router/src/connector/zen/transformers.rs index 15347f581c..7f8c3d4cd0 100644 --- a/crates/router/src/connector/zen/transformers.rs +++ b/crates/router/src/connector/zen/transformers.rs @@ -245,9 +245,15 @@ impl ZenPaymentChannels::PclBoacompraRedcompra } api_models::payments::VoucherData::RedPagos => ZenPaymentChannels::PclBoacompraRedpagos, - api_models::payments::VoucherData::Alfamart { .. } + api_models::payments::VoucherData::Oxxo { .. } + | api_models::payments::VoucherData::Alfamart { .. } | api_models::payments::VoucherData::Indomaret { .. } - | api_models::payments::VoucherData::Oxxo { .. } => Err( + | api_models::payments::VoucherData::SevenEleven { .. } + | api_models::payments::VoucherData::Lawson { .. } + | api_models::payments::VoucherData::MiniStop { .. } + | api_models::payments::VoucherData::FamilyMart { .. } + | api_models::payments::VoucherData::Seicomart { .. } + | api_models::payments::VoucherData::PayEasy { .. } => 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 3954cc6a7e..815a195ac8 100644 --- a/crates/router/src/core/payments/helpers.rs +++ b/crates/router/src/core/payments/helpers.rs @@ -1574,6 +1574,12 @@ pub fn validate_payment_method_type_against_payment_method( | api_enums::PaymentMethodType::Indomaret | api_enums::PaymentMethodType::Alfamart | api_enums::PaymentMethodType::Oxxo + | api_enums::PaymentMethodType::SevenEleven + | api_enums::PaymentMethodType::Lawson + | api_enums::PaymentMethodType::MiniStop + | api_enums::PaymentMethodType::FamilyMart + | api_enums::PaymentMethodType::Seicomart + | api_enums::PaymentMethodType::PayEasy ), api_enums::PaymentMethod::GiftCard => { matches!( diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index b650b1d859..22240c3ac1 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -200,6 +200,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::IndomaretVoucherData, api_models::payments::Address, api_models::payments::VoucherData, + api_models::payments::JCSVoucherData, api_models::payments::AlfamartVoucherData, api_models::payments::IndomaretVoucherData, api_models::payments::BankRedirectData, diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index 80574fe946..6bf55b0888 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -266,6 +266,12 @@ impl ForeignFrom for api_enums::PaymentMethod { | api_enums::PaymentMethodType::Alfamart | api_enums::PaymentMethodType::Indomaret | api_enums::PaymentMethodType::Oxxo + | api_enums::PaymentMethodType::SevenEleven + | api_enums::PaymentMethodType::Lawson + | api_enums::PaymentMethodType::MiniStop + | api_enums::PaymentMethodType::FamilyMart + | api_enums::PaymentMethodType::Seicomart + | api_enums::PaymentMethodType::PayEasy | 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 23d2d44031..0063db9498 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -5533,6 +5533,37 @@ "partially_captured" ] }, + "JCSVoucherData": { + "type": "object", + "required": [ + "first_name", + "last_name", + "email", + "phone_number" + ], + "properties": { + "first_name": { + "type": "string", + "description": "The billing first name for Japanese convenience stores", + "example": "Jane" + }, + "last_name": { + "type": "string", + "description": "The billing second name Japanese convenience stores", + "example": "Doe" + }, + "email": { + "type": "string", + "description": "The Email ID for Japanese convenience stores", + "example": "example@me.com" + }, + "phone_number": { + "type": "string", + "description": "The telephone number for Japanese convenience stores", + "example": "9999999999" + } + } + }, "KakaoPayRedirection": { "type": "object" }, @@ -8002,7 +8033,13 @@ "upi_collect", "vipps", "walley", - "we_chat_pay" + "we_chat_pay", + "seven_eleven", + "lawson", + "mini_stop", + "family_mart", + "seicomart", + "pay_easy" ] }, "PaymentMethodUpdate": { @@ -10635,6 +10672,72 @@ "enum": [ "oxxo" ] + }, + { + "type": "object", + "required": [ + "seven_eleven" + ], + "properties": { + "seven_eleven": { + "$ref": "#/components/schemas/JCSVoucherData" + } + } + }, + { + "type": "object", + "required": [ + "lawson" + ], + "properties": { + "lawson": { + "$ref": "#/components/schemas/JCSVoucherData" + } + } + }, + { + "type": "object", + "required": [ + "mini_stop" + ], + "properties": { + "mini_stop": { + "$ref": "#/components/schemas/JCSVoucherData" + } + } + }, + { + "type": "object", + "required": [ + "family_mart" + ], + "properties": { + "family_mart": { + "$ref": "#/components/schemas/JCSVoucherData" + } + } + }, + { + "type": "object", + "required": [ + "seicomart" + ], + "properties": { + "seicomart": { + "$ref": "#/components/schemas/JCSVoucherData" + } + } + }, + { + "type": "object", + "required": [ + "pay_easy" + ], + "properties": { + "pay_easy": { + "$ref": "#/components/schemas/JCSVoucherData" + } + } } ] },