diff --git a/config/development.toml b/config/development.toml index 6c01b9546ae..eb944262920 100644 --- a/config/development.toml +++ b/config/development.toml @@ -245,6 +245,7 @@ ali_pay_hk = {country = "HK", currency = "HKD"} bizum = {country = "ES", currency = "EUR"} go_pay = {country = "ID", currency = "IDR"} kakao_pay = {country = "KR", currency = "KRW"} +gcash = {country = "PH", currency = "PHP"} [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/crates/api_models/src/payments.rs b/crates/api_models/src/payments.rs index 9e7b5562e38..90dd1f22e92 100644 --- a/crates/api_models/src/payments.rs +++ b/crates/api_models/src/payments.rs @@ -956,6 +956,8 @@ pub enum WalletData { KakaoPayRedirect(KakaoPayRedirection), /// The wallet data for GoPay redirect GoPayRedirect(GoPayRedirection), + /// The wallet data for Gcash redirect + GcashRedirect(GcashRedirection), /// The wallet data for Apple pay ApplePay(ApplePayWalletData), /// Wallet data for apple pay redirect flow @@ -1048,6 +1050,9 @@ pub struct KakaoPayRedirection {} #[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)] pub struct GoPayRedirection {} +#[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)] +pub struct GcashRedirection {} + #[derive(Eq, PartialEq, Clone, Debug, serde::Deserialize, serde::Serialize, ToSchema)] pub struct MobilePayRedirection {} diff --git a/crates/common_enums/src/enums.rs b/crates/common_enums/src/enums.rs index 58b5c48b635..a05089d4b8b 100644 --- a/crates/common_enums/src/enums.rs +++ b/crates/common_enums/src/enums.rs @@ -571,6 +571,7 @@ pub enum PaymentMethodType { Giropay, GooglePay, GoPay, + Gcash, Ideal, Interac, Klarna, diff --git a/crates/common_enums/src/transformers.rs b/crates/common_enums/src/transformers.rs index 33baed2cf92..1218e983bc6 100644 --- a/crates/common_enums/src/transformers.rs +++ b/crates/common_enums/src/transformers.rs @@ -1555,6 +1555,7 @@ impl From for PaymentMethod { PaymentMethodType::Giropay => Self::BankRedirect, PaymentMethodType::GooglePay => Self::Wallet, PaymentMethodType::GoPay => Self::Wallet, + PaymentMethodType::Gcash => Self::Wallet, PaymentMethodType::Ideal => Self::BankRedirect, PaymentMethodType::Klarna => Self::PayLater, PaymentMethodType::KakaoPay => Self::Wallet, diff --git a/crates/router/src/connector/adyen/transformers.rs b/crates/router/src/connector/adyen/transformers.rs index 972d7a6d860..7a43f6f314a 100644 --- a/crates/router/src/connector/adyen/transformers.rs +++ b/crates/router/src/connector/adyen/transformers.rs @@ -283,11 +283,14 @@ pub enum AdyenPaymentMethod<'a> { Blik(Box), ClearPay(Box), Eps(Box>), + #[serde(rename = "gcash")] + Gcash(Box), Giropay(Box), Gpay(Box), #[serde(rename = "gopay_wallet")] GoPay(Box), Ideal(Box>), + #[serde(rename = "kakaopay")] Kakaopay(Box), Mandate(Box), Mbway(Box), @@ -646,6 +649,8 @@ pub struct GoPayData {} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct KakaoPayData {} +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct GcashData {} #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AdyenGPay { @@ -713,6 +718,7 @@ pub enum PaymentType { Blik, ClearPay, Eps, + Gcash, Giropay, Googlepay, #[serde(rename = "gopay_wallet")] @@ -1200,6 +1206,10 @@ impl<'a> TryFrom<&api::WalletData> for AdyenPaymentMethod<'a> { let kakao_pay_data = KakaoPayData {}; Ok(AdyenPaymentMethod::Kakaopay(Box::new(kakao_pay_data))) } + api_models::payments::WalletData::GcashRedirect(_) => { + let gcash_data = GcashData {}; + Ok(AdyenPaymentMethod::Gcash(Box::new(gcash_data))) + } api_models::payments::WalletData::MbWayRedirect(data) => { let mbway_data = MbwayData { payment_type: PaymentType::Mbway, diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index 4ede9eca3ad..74773958a1d 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -170,6 +170,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::BankDebitData, api_models::payments::AliPayQr, api_models::payments::AliPayRedirection, + api_models::payments::GcashRedirection, api_models::payments::KakaoPayRedirection, api_models::payments::AliPayHkRedirection, api_models::payments::GoPayRedirection, diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs index 12e1922b2a6..4335aece5c1 100644 --- a/crates/router/src/types/transformers.rs +++ b/crates/router/src/types/transformers.rs @@ -177,6 +177,7 @@ impl ForeignFrom for api_enums::PaymentMethod { | api_enums::PaymentMethodType::Twint | api_enums::PaymentMethodType::WeChatPay | api_enums::PaymentMethodType::GoPay + | api_enums::PaymentMethodType::Gcash | api_enums::PaymentMethodType::KakaoPay => Self::Wallet, api_enums::PaymentMethodType::Affirm | api_enums::PaymentMethodType::AfterpayClearpay diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 1c6690a47fb..e2686ca24b0 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -4348,6 +4348,9 @@ "on_session" ] }, + "GcashRedirection": { + "type": "object" + }, "GoPayRedirection": { "type": "object" }, @@ -6809,6 +6812,7 @@ "giropay", "google_pay", "go_pay", + "gcash", "ideal", "interac", "klarna", @@ -8937,6 +8941,17 @@ } } }, + { + "type": "object", + "required": [ + "gcash_redirect" + ], + "properties": { + "gcash_redirect": { + "$ref": "#/components/schemas/GcashRedirection" + } + } + }, { "type": "object", "required": [