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): add coingate, paystack connector specifications (#7996)

Anurag6aeaf04ee71e
diff --git a/config/deployments/integration_test.toml b/config/deployments/integration_test.toml
index 17d346b951..42f9a1abee 100644
--- a/config/deployments/integration_test.toml
+++ b/config/deployments/integration_test.toml
@@ -673,6 +673,12 @@ apple_pay = { country = "AD,AE,AG,AL,AM,AO,AR,AT,AU,AZ,BA,BB,BD,BE,BG,BH,BI,BJ,B
credit = {country = "AU,NZ,CN,HK,IN,LK,KR,MY,SG,GB,BE,FR,DE,IT,ME,NL,PL,ES,ZA,AR,BR,CO,MX,PA,UY,US,CA", currency = "AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BYN,BZD,BMD,BTN,BOB,VES,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XAF,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,CZK,DKK,DJF,DOP,XCD,EGP,ERN,ETB,EUR,FKP,FJD,XPF,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KGS,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,NZD,NIO,NGN,VUV,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SHP,SVC,WST,STN,SAR,RSD,SCR,SLL,SGD,SBD,SOS,ZAR,KRW,SSP,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,UGX,UAH,AED,USD,UYU,UZS,VND,XOF,YER,ZMW,ZWL"}
debit = {country = "AU,NZ,CN,HK,IN,LK,KR,MY,SG,GB,BE,FR,DE,IT,ME,NL,PL,ES,ZA,AR,BR,CO,MX,PA,UY,US,CA", currency = "AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,AZN,BSD,BHD,BDT,BBD,BYN,BZD,BMD,BTN,BOB,VES,BAM,BWP,BRL,BND,BGN,BIF,KHR,CAD,CVE,KYD,XAF,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,CZK,DKK,DJF,DOP,XCD,EGP,ERN,ETB,EUR,FKP,FJD,XPF,GMD,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KGS,KWD,LAK,LBP,LSL,LRD,LYD,MOP,MKD,MGA,MWK,MYR,MVR,MRU,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,NZD,NIO,NGN,VUV,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,GBP,QAR,RON,RUB,RWF,SHP,SVC,WST,STN,SAR,RSD,SCR,SLL,SGD,SBD,SOS,ZAR,KRW,SSP,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TRY,TMT,UGX,UAH,AED,USD,UYU,UZS,VND,XOF,YER,ZMW,ZWL"}
+[pm_filters.coingate]
+crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" }
+
+[pm_filters.paystack]
+eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" }
+
[temp_locker_enable_config]
bluesnap.payment_method = "card"
nuvei.payment_method = "card"
diff --git a/config/deployments/production.toml b/config/deployments/production.toml
index a79a21af9a..60e87c35e1 100644
--- a/config/deployments/production.toml
+++ b/config/deployments/production.toml
@@ -682,6 +682,12 @@ przelewy24 = { country = "PL", currency = "CZK,EUR,GBP,PLN" }
trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" }
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" }
+[pm_filters.coingate]
+crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" }
+
+[pm_filters.paystack]
+eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" }
+
[payout_method_filters.adyenplatform]
sepa = { country = "ES,SK,AT,NL,DE,BE,FR,FI,PT,IE,EE,LT,LV,IT,CZ,DE,HU,NO,PL,SE,GB,CH" , currency = "EUR,CZK,DKK,HUF,NOK,PLN,SEK,GBP,CHF" }
diff --git a/config/deployments/sandbox.toml b/config/deployments/sandbox.toml
index 6862f7abeb..39b9013f21 100644
--- a/config/deployments/sandbox.toml
+++ b/config/deployments/sandbox.toml
@@ -684,6 +684,12 @@ przelewy24 = { country = "PL", currency = "CZK,EUR,GBP,PLN" }
trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" }
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" }
+[pm_filters.coingate]
+crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" }
+
+[pm_filters.paystack]
+eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" }
+
[payout_method_filters.stripe]
ach = { country = "US", currency = "USD" }
diff --git a/config/development.toml b/config/development.toml
index b0d9d5f4f8..94d6582fa6 100644
--- a/config/development.toml
+++ b/config/development.toml
@@ -843,6 +843,12 @@ debit = { country = "AD,AE,AF,AG,AI,AL,AM,AO,AQ,AR,AS,AT,AU,AW,AX,AZ,BA,BB,BD,BE
credit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"}
debit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"}
+[pm_filters.coingate]
+crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" }
+
+[pm_filters.paystack]
+eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" }
+
[tokenization]
stripe = { long_lived_token = false, payment_method = "wallet", payment_method_type = { type = "disable_only", list = "google_pay" } }
checkout = { long_lived_token = false, payment_method = "wallet", apple_pay_pre_decrypt_flow = "network_tokenization" }
diff --git a/config/docker_compose.toml b/config/docker_compose.toml
index 46647fd28e..c697223995 100644
--- a/config/docker_compose.toml
+++ b/config/docker_compose.toml
@@ -804,6 +804,12 @@ przelewy24 = { country = "PL", currency = "CZK,EUR,GBP,PLN" }
trustly = { country = "ES,GB,SE,NO,AT,NL,DE,DK,FI,EE,LT,LV", currency = "CZK,DKK,EUR,GBP,NOK,SEK" }
klarna = { country = "AU,AT,BE,CA,CZ,DK,FI,FR,DE,GR,IE,IT,NL,NZ,NO,PL,PT,ES,SE,CH,GB,US", currency = "CHF,DKK,EUR,GBP,NOK,PLN,SEK,USD,AUD,NZD,CAD" }
+[pm_filters.coingate]
+crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" }
+
+[pm_filters.paystack]
+eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" }
+
[bank_config.online_banking_fpx]
adyen.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"
fiuu.banks = "affin_bank,agro_bank,alliance_bank,am_bank,bank_of_china,bank_islam,bank_muamalat,bank_rakyat,bank_simpanan_nasional,cimb_bank,hong_leong_bank,hsbc_bank,kuwait_finance_house,maybank,ocbc_bank,public_bank,rhb_bank,standard_chartered_bank,uob_bank"
diff --git a/crates/hyperswitch_connectors/src/connectors/coingate.rs b/crates/hyperswitch_connectors/src/connectors/coingate.rs
index d6cbe50e44..e6a4e06f47 100644
--- a/crates/hyperswitch_connectors/src/connectors/coingate.rs
+++ b/crates/hyperswitch_connectors/src/connectors/coingate.rs
@@ -1,6 +1,7 @@
pub mod transformers;
+use std::sync::LazyLock;
-use common_enums::{CaptureMethod, PaymentMethod, PaymentMethodType};
+use common_enums::{enums, CaptureMethod, PaymentMethod, PaymentMethodType};
use common_utils::{
crypto,
errors::CustomResult,
@@ -21,7 +22,10 @@ use hyperswitch_domain_models::{
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
RefundsData, SetupMandateRequestData,
},
- router_response_types::{PaymentsResponseData, RefundsResponseData},
+ router_response_types::{
+ ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,
+ SupportedPaymentMethods, SupportedPaymentMethodsExt,
+ },
types::{
PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,
RefundSyncRouterData, RefundsRouterData,
@@ -517,25 +521,7 @@ impl ConnectorIntegration<RSync, RefundsData, RefundsResponseData> for Coingate
}
}
-impl ConnectorValidation for Coingate {
- fn validate_connector_against_payment_request(
- &self,
- capture_method: Option<CaptureMethod>,
- _payment_method: PaymentMethod,
- _pmt: Option<PaymentMethodType>,
- ) -> CustomResult<(), errors::ConnectorError> {
- let capture_method = capture_method.unwrap_or_default();
- match capture_method {
- CaptureMethod::Automatic | CaptureMethod::SequentialAutomatic => Ok(()),
- CaptureMethod::ManualMultiple | CaptureMethod::Scheduled | CaptureMethod::Manual => {
- Err(utils::construct_not_supported_error_report(
- capture_method,
- self.id(),
- ))
- }
- }
- }
-}
+impl ConnectorValidation for Coingate {}
#[async_trait::async_trait]
impl webhooks::IncomingWebhook for Coingate {
@@ -630,4 +616,45 @@ impl webhooks::IncomingWebhook for Coingate {
}
}
-impl ConnectorSpecifications for Coingate {}
+static COINGATE_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
+ LazyLock::new(|| {
+ let supported_capture_methods =
+ vec![CaptureMethod::Automatic, CaptureMethod::SequentialAutomatic];
+
+ let mut coingate_supported_payment_methods = SupportedPaymentMethods::new();
+
+ coingate_supported_payment_methods.add(
+ PaymentMethod::Crypto,
+ PaymentMethodType::CryptoCurrency,
+ PaymentMethodDetails {
+ mandates: enums::FeatureStatus::NotSupported,
+ refunds: enums::FeatureStatus::Supported,
+ supported_capture_methods,
+ specific_features: None,
+ },
+ );
+
+ coingate_supported_payment_methods
+ });
+
+static COINGATE_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
+ display_name: "Coingate",
+ description: "CoinGate's online payment solution makes it easy for businesses to accept Bitcoin, Ethereum, stablecoins and other cryptocurrencies for payments on any website.",
+ connector_type: enums::PaymentConnectorCategory::AlternativePaymentMethod,
+};
+
+static COINGATE_SUPPORTED_WEBHOOK_FLOWS: [enums::EventClass; 1] = [enums::EventClass::Payments];
+
+impl ConnectorSpecifications for Coingate {
+ fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
+ Some(&COINGATE_CONNECTOR_INFO)
+ }
+
+ fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
+ Some(&*COINGATE_SUPPORTED_PAYMENT_METHODS)
+ }
+
+ fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {
+ Some(&COINGATE_SUPPORTED_WEBHOOK_FLOWS)
+ }
+}
diff --git a/crates/hyperswitch_connectors/src/connectors/paystack.rs b/crates/hyperswitch_connectors/src/connectors/paystack.rs
index e613298d07..aabccbef50 100644
--- a/crates/hyperswitch_connectors/src/connectors/paystack.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paystack.rs
@@ -1,5 +1,7 @@
pub mod transformers;
+use std::sync::LazyLock;
+use common_enums::enums;
use common_utils::{
crypto,
errors::CustomResult,
@@ -20,7 +22,10 @@ use hyperswitch_domain_models::{
PaymentsCancelData, PaymentsCaptureData, PaymentsSessionData, PaymentsSyncData,
RefundsData, SetupMandateRequestData,
},
- router_response_types::{PaymentsResponseData, RefundsResponseData},
+ router_response_types::{
+ ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,
+ SupportedPaymentMethods, SupportedPaymentMethodsExt,
+ },
types::{
PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,
RefundSyncRouterData, RefundsRouterData,
@@ -652,4 +657,48 @@ impl webhooks::IncomingWebhook for Paystack {
}
}
-impl ConnectorSpecifications for Paystack {}
+static PAYSTACK_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
+ LazyLock::new(|| {
+ let supported_capture_methods = vec![
+ enums::CaptureMethod::Automatic,
+ enums::CaptureMethod::SequentialAutomatic,
+ ];
+
+ let mut paystack_supported_payment_methods = SupportedPaymentMethods::new();
+
+ paystack_supported_payment_methods.add(
+ enums::PaymentMethod::BankRedirect,
+ enums::PaymentMethodType::Eft,
+ PaymentMethodDetails {
+ mandates: enums::FeatureStatus::NotSupported,
+ refunds: enums::FeatureStatus::Supported,
+ supported_capture_methods,
+ specific_features: None,
+ },
+ );
+
+ paystack_supported_payment_methods
+ });
+
+static PAYSTACK_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
+ display_name: "Paystack",
+ description: "Paystack is a Nigerian financial technology company that provides online and offline payment solutions to businesses across Africa.",
+ connector_type: enums::PaymentConnectorCategory::PaymentGateway,
+};
+
+static PAYSTACK_SUPPORTED_WEBHOOK_FLOWS: [enums::EventClass; 2] =
+ [enums::EventClass::Payments, enums::EventClass::Refunds];
+
+impl ConnectorSpecifications for Paystack {
+ fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
+ Some(&PAYSTACK_CONNECTOR_INFO)
+ }
+
+ fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
+ Some(&*PAYSTACK_SUPPORTED_PAYMENT_METHODS)
+ }
+
+ fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {
+ Some(&PAYSTACK_SUPPORTED_WEBHOOK_FLOWS)
+ }
+}
diff --git a/loadtest/config/development.toml b/loadtest/config/development.toml
index 745dc71dd2..6c0a81b303 100644
--- a/loadtest/config/development.toml
+++ b/loadtest/config/development.toml
@@ -534,6 +534,12 @@ debit = { country = "CN,HK,ID,MY,PH,SG,TH,TW,VN", currency = "CNY,HKD,IDR,MYR,PH
credit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"}
debit = { country = "BE,CH,CO,CR,EC,HN,MX,PA,PR,UY", currency = "CLP,COP,USD"}
+[pm_filters.coingate]
+crypto_currency = { country = "AL, AD, AT, BE, BA, BG, HR, CZ, DK, EE, FI, FR, DE, GR, HU, IS, IE, IT, LV, LT, LU, MT, MD, NL, NO, PL, PT, RO, RS, SK, SI, ES, SE, CH, UA, GB, AR, BR, CL, CO, CR, DO, SV, GD, MX, PE, LC, AU, NZ, CY, HK, IN, IL, JP, KR, QA, SA, SG, EG", currency = "EUR, USD, GBP" }
+
+[pm_filters.paystack]
+eft = { country = "NG, ZA, GH, KE, CI", currency = "NGN, GHS, ZAR, KES, USD" }
+
#tokenization configuration which describe token lifetime and payment method for specific connector
[tokenization]
stripe = { long_lived_token = false, payment_method = "wallet", payment_method_type = { type = "disable_only", list = "google_pay" } }