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 Gcash for Adyen (#1576)

AkshayaFoigerdf0ef157c3a1
diff --git a/config/development.toml b/config/development.toml
index 6c01b9546a..eb94426292 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 9e7b5562e3..90dd1f22e9 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 58b5c48b63..a05089d4b8 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 33baed2cf9..1218e983bc 100644
--- a/crates/common_enums/src/transformers.rs
+++ b/crates/common_enums/src/transformers.rs
@@ -1555,6 +1555,7 @@ impl From<PaymentMethodType> 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 972d7a6d86..7a43f6f314 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<BlikRedirectionData>),
ClearPay(Box<AdyenPayLaterData>),
Eps(Box<BankRedirectionWithIssuer<'a>>),
+ #[serde(rename = "gcash")]
+ Gcash(Box<GcashData>),
Giropay(Box<BankRedirectionPMData>),
Gpay(Box<AdyenGPay>),
#[serde(rename = "gopay_wallet")]
GoPay(Box<GoPayData>),
Ideal(Box<BankRedirectionWithIssuer<'a>>),
+ #[serde(rename = "kakaopay")]
Kakaopay(Box<KakaoPayData>),
Mandate(Box<AdyenMandate>),
Mbway(Box<MbwayData>),
@@ -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 4ede9eca3a..74773958a1 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 12e1922b2a..4335aece5c 100644
--- a/crates/router/src/types/transformers.rs
+++ b/crates/router/src/types/transformers.rs
@@ -177,6 +177,7 @@ impl ForeignFrom<api_enums::PaymentMethodType> 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 1c6690a47f..e2686ca24b 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": [