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(feature_matrix): add feature matrix for both paytm and phonepe (#8822)

Uzair Khancf5737f48261
diff --git a/crates/hyperswitch_connectors/src/connectors/paytm.rs b/crates/hyperswitch_connectors/src/connectors/paytm.rs
index 4a72fa8857..adce5aa1b3 100644
--- a/crates/hyperswitch_connectors/src/connectors/paytm.rs
+++ b/crates/hyperswitch_connectors/src/connectors/paytm.rs
@@ -1,7 +1,5 @@
pub mod transformers;
-use std::sync::LazyLock;
-
use common_enums::enums;
use common_utils::{
errors::CustomResult,
@@ -24,7 +22,8 @@ use hyperswitch_domain_models::{
RefundsData, SetupMandateRequestData,
},
router_response_types::{
- ConnectorInfo, PaymentsResponseData, RefundsResponseData, SupportedPaymentMethods,
+ ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,
+ SupportedPaymentMethods, SupportedPaymentMethodsExt,
},
types::{
PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,
@@ -42,6 +41,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
+use lazy_static::lazy_static;
use transformers as paytm;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -588,20 +588,50 @@ impl webhooks::IncomingWebhook for Paytm {
}
}
-static PAYTM_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
- LazyLock::new(SupportedPaymentMethods::new);
-
-static PAYTM_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
- display_name: "Paytm",
- description: "Paytm connector",
- connector_type: enums::PaymentConnectorCategory::PaymentGateway,
-};
+lazy_static! {
+ static ref PAYTM_SUPPORTED_PAYMENT_METHODS: SupportedPaymentMethods = {
+ let supported_capture_methods = vec![enums::CaptureMethod::Automatic];
+
+ let mut paytm_supported_payment_methods = SupportedPaymentMethods::new();
+ paytm_supported_payment_methods.add(
+ enums::PaymentMethod::Upi,
+ enums::PaymentMethodType::UpiCollect,
+ PaymentMethodDetails{
+ mandates: common_enums::FeatureStatus::NotSupported,
+ refunds: common_enums::FeatureStatus::NotSupported,
+ supported_capture_methods: supported_capture_methods.clone(),
+ specific_features: None,
+ },
+ );
+
+ paytm_supported_payment_methods.add(
+ enums::PaymentMethod::Upi,
+ enums::PaymentMethodType::UpiIntent,
+ PaymentMethodDetails{
+ mandates: common_enums::FeatureStatus::NotSupported,
+ refunds: common_enums::FeatureStatus::NotSupported,
+ supported_capture_methods,
+ specific_features: None,
+ },
+ );
+
+ paytm_supported_payment_methods
+ };
+
+ static ref PAYTM_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
+ display_name: "PAYTM",
+ description:
+ "Paytm is an Indian multinational fintech company specializing in digital payments and financial services. Initially known for its mobile wallet, it has expanded to include a payment bank, e-commerce, ticketing, and wealth management services.",
+ connector_type: enums::PaymentConnectorCategory::PaymentGateway,
+ };
+
+ static ref PAYTM_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new();
-static PAYTM_SUPPORTED_WEBHOOK_FLOWS: [enums::EventClass; 0] = [];
+}
impl ConnectorSpecifications for Paytm {
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
- Some(&PAYTM_CONNECTOR_INFO)
+ Some(&*PAYTM_CONNECTOR_INFO)
}
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
@@ -609,6 +639,6 @@ impl ConnectorSpecifications for Paytm {
}
fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {
- Some(&PAYTM_SUPPORTED_WEBHOOK_FLOWS)
+ Some(&*PAYTM_SUPPORTED_WEBHOOK_FLOWS)
}
}
diff --git a/crates/hyperswitch_connectors/src/connectors/phonepe.rs b/crates/hyperswitch_connectors/src/connectors/phonepe.rs
index 43ea9538fd..5fdb515adc 100644
--- a/crates/hyperswitch_connectors/src/connectors/phonepe.rs
+++ b/crates/hyperswitch_connectors/src/connectors/phonepe.rs
@@ -1,7 +1,5 @@
pub mod transformers;
-use std::sync::LazyLock;
-
use common_enums::enums;
use common_utils::{
errors::CustomResult,
@@ -24,7 +22,8 @@ use hyperswitch_domain_models::{
RefundsData, SetupMandateRequestData,
},
router_response_types::{
- ConnectorInfo, PaymentsResponseData, RefundsResponseData, SupportedPaymentMethods,
+ ConnectorInfo, PaymentMethodDetails, PaymentsResponseData, RefundsResponseData,
+ SupportedPaymentMethods, SupportedPaymentMethodsExt,
},
types::{
PaymentsAuthorizeRouterData, PaymentsCaptureRouterData, PaymentsSyncRouterData,
@@ -42,6 +41,7 @@ use hyperswitch_interfaces::{
types::{self, Response},
webhooks,
};
+use lazy_static::lazy_static;
use transformers as phonepe;
use crate::{constants::headers, types::ResponseRouterData, utils};
@@ -588,20 +588,50 @@ impl webhooks::IncomingWebhook for Phonepe {
}
}
-static PHONEPE_SUPPORTED_PAYMENT_METHODS: LazyLock<SupportedPaymentMethods> =
- LazyLock::new(SupportedPaymentMethods::new);
-
-static PHONEPE_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
- display_name: "Phonepe",
- description: "Phonepe connector",
- connector_type: enums::PaymentConnectorCategory::PaymentGateway,
-};
+lazy_static! {
+ static ref PHONEPE_SUPPORTED_PAYMENT_METHODS: SupportedPaymentMethods = {
+ let supported_capture_methods = vec![enums::CaptureMethod::Automatic];
+
+ let mut phonepe_supported_payment_methods = SupportedPaymentMethods::new();
+ phonepe_supported_payment_methods.add(
+ enums::PaymentMethod::Upi,
+ enums::PaymentMethodType::UpiCollect,
+ PaymentMethodDetails{
+ mandates: common_enums::FeatureStatus::NotSupported,
+ refunds: common_enums::FeatureStatus::NotSupported,
+ supported_capture_methods: supported_capture_methods.clone(),
+ specific_features: None,
+ },
+ );
+
+ phonepe_supported_payment_methods.add(
+ enums::PaymentMethod::Upi,
+ enums::PaymentMethodType::UpiIntent,
+ PaymentMethodDetails{
+ mandates: common_enums::FeatureStatus::NotSupported,
+ refunds: common_enums::FeatureStatus::NotSupported,
+ supported_capture_methods,
+ specific_features: None,
+ },
+ );
+
+ phonepe_supported_payment_methods
+ };
+
+ static ref PHONEPE_CONNECTOR_INFO: ConnectorInfo = ConnectorInfo {
+ display_name: "PHONEPE",
+ description:
+ "PhonePe is a digital payments and financial services platform built on the UPI system. It allows users to make instant payments, recharge mobiles, pay bills, and access financial services like investments and insurance.",
+ connector_type: enums::PaymentConnectorCategory::PaymentGateway,
+ };
+
+ static ref PHONEPE_SUPPORTED_WEBHOOK_FLOWS: Vec<enums::EventClass> = Vec::new();
-static PHONEPE_SUPPORTED_WEBHOOK_FLOWS: [enums::EventClass; 0] = [];
+}
impl ConnectorSpecifications for Phonepe {
fn get_connector_about(&self) -> Option<&'static ConnectorInfo> {
- Some(&PHONEPE_CONNECTOR_INFO)
+ Some(&*PHONEPE_CONNECTOR_INFO)
}
fn get_supported_payment_methods(&self) -> Option<&'static SupportedPaymentMethods> {
@@ -609,6 +639,6 @@ impl ConnectorSpecifications for Phonepe {
}
fn get_supported_webhook_flows(&self) -> Option<&'static [enums::EventClass]> {
- Some(&PHONEPE_SUPPORTED_WEBHOOK_FLOWS)
+ Some(&*PHONEPE_SUPPORTED_WEBHOOK_FLOWS)
}
}