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 dummy billing connector auth flow (#7819)

Aditya Chaurasiabca8979a0cd2
diff --git a/api-reference-v2/openapi_spec.json b/api-reference-v2/openapi_spec.json
index 10682866ab..4539e39ec4 100644
--- a/api-reference-v2/openapi_spec.json
+++ b/api-reference-v2/openapi_spec.json
@@ -7742,6 +7742,7 @@
"type": "string",
"enum": [
"adyenplatform",
+ "stripe_billing_test",
"phonypay",
"fauxpay",
"pretendpay",
@@ -21050,6 +21051,7 @@
"description": "RoutableConnectors are the subset of Connectors that are eligible for payments routing",
"enum": [
"adyenplatform",
+ "stripe_billing_test",
"phonypay",
"fauxpay",
"pretendpay",
diff --git a/api-reference/openapi_spec.json b/api-reference/openapi_spec.json
index dafeaf65c0..8cd7b792ae 100644
--- a/api-reference/openapi_spec.json
+++ b/api-reference/openapi_spec.json
@@ -9792,6 +9792,7 @@
"type": "string",
"enum": [
"adyenplatform",
+ "stripe_billing_test",
"phonypay",
"fauxpay",
"pretendpay",
@@ -25541,6 +25542,7 @@
"description": "RoutableConnectors are the subset of Connectors that are eligible for payments routing",
"enum": [
"adyenplatform",
+ "stripe_billing_test",
"phonypay",
"fauxpay",
"pretendpay",
diff --git a/crates/api_models/src/enums.rs b/crates/api_models/src/enums.rs
index 212504baaa..6cadf9651b 100644
--- a/crates/api_models/src/enums.rs
+++ b/crates/api_models/src/enums.rs
@@ -160,10 +160,14 @@ pub enum TaxConnectors {
Taxjar,
}
-#[derive(Clone, Debug, serde::Serialize, strum::EnumString)]
+#[derive(Clone, Debug, serde::Serialize, strum::EnumString, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum BillingConnectors {
Chargebee,
+ Recurly,
+ Stripebilling,
+ #[cfg(feature = "dummy_connector")]
+ DummyBillingConnector,
}
#[derive(
diff --git a/crates/common_enums/src/connector_enums.rs b/crates/common_enums/src/connector_enums.rs
index 70efd457a9..803daccbd2 100644
--- a/crates/common_enums/src/connector_enums.rs
+++ b/crates/common_enums/src/connector_enums.rs
@@ -27,6 +27,10 @@ pub use crate::PaymentMethodType;
pub enum RoutableConnectors {
Adyenplatform,
#[cfg(feature = "dummy_connector")]
+ #[serde(rename = "stripe_billing_test")]
+ #[strum(serialize = "stripe_billing_test")]
+ DummyBillingConnector,
+ #[cfg(feature = "dummy_connector")]
#[serde(rename = "phonypay")]
#[strum(serialize = "phonypay")]
DummyConnector1,
@@ -170,6 +174,10 @@ pub enum RoutableConnectors {
pub enum Connector {
Adyenplatform,
#[cfg(feature = "dummy_connector")]
+ #[serde(rename = "stripe_billing_test")]
+ #[strum(serialize = "stripe_billing_test")]
+ DummyBillingConnector,
+ #[cfg(feature = "dummy_connector")]
#[serde(rename = "phonypay")]
#[strum(serialize = "phonypay")]
DummyConnector1,
@@ -354,6 +362,8 @@ impl Connector {
}
pub fn is_separate_authentication_supported(self) -> bool {
match self {
+ #[cfg(feature = "dummy_connector")]
+ Self::DummyBillingConnector => false,
#[cfg(feature = "dummy_connector")]
Self::DummyConnector1
| Self::DummyConnector2
@@ -500,6 +510,8 @@ impl From<RoutableConnectors> for Connector {
match routable_connector {
RoutableConnectors::Adyenplatform => Self::Adyenplatform,
#[cfg(feature = "dummy_connector")]
+ RoutableConnectors::DummyBillingConnector => Self::DummyBillingConnector,
+ #[cfg(feature = "dummy_connector")]
RoutableConnectors::DummyConnector1 => Self::DummyConnector1,
#[cfg(feature = "dummy_connector")]
RoutableConnectors::DummyConnector2 => Self::DummyConnector2,
@@ -608,6 +620,8 @@ impl TryFrom<Connector> for RoutableConnectors {
match connector {
Connector::Adyenplatform => Ok(Self::Adyenplatform),
#[cfg(feature = "dummy_connector")]
+ Connector::DummyBillingConnector => Ok(Self::DummyBillingConnector),
+ #[cfg(feature = "dummy_connector")]
Connector::DummyConnector1 => Ok(Self::DummyConnector1),
#[cfg(feature = "dummy_connector")]
Connector::DummyConnector2 => Ok(Self::DummyConnector2),
diff --git a/crates/connector_configs/src/connector.rs b/crates/connector_configs/src/connector.rs
index 782ca4cb71..71a6020722 100644
--- a/crates/connector_configs/src/connector.rs
+++ b/crates/connector_configs/src/connector.rs
@@ -363,6 +363,8 @@ impl ConnectorConfig {
Connector::Cryptopay => Ok(connector_data.cryptopay),
Connector::CtpVisa => Ok(connector_data.ctp_visa),
Connector::Cybersource => Ok(connector_data.cybersource),
+ #[cfg(feature = "dummy_connector")]
+ Connector::DummyBillingConnector => Ok(connector_data.dummy_connector),
Connector::Iatapay => Ok(connector_data.iatapay),
Connector::Itaubank => Ok(connector_data.itaubank),
Connector::Opennode => Ok(connector_data.opennode),
diff --git a/crates/router/src/core/admin.rs b/crates/router/src/core/admin.rs
index c2f26b1ed9..9ec1d80961 100644
--- a/crates/router/src/core/admin.rs
+++ b/crates/router/src/core/admin.rs
@@ -1246,7 +1246,8 @@ impl ConnectorAuthTypeAndMetadataValidation<'_> {
}
// api_enums::Connector::Payone => {payone::transformers::PayoneAuthType::try_from(val)?;Ok(())} Added as a template code for future usage
#[cfg(feature = "dummy_connector")]
- api_enums::Connector::DummyConnector1
+ api_enums::Connector::DummyBillingConnector
+ | api_enums::Connector::DummyConnector1
| api_enums::Connector::DummyConnector2
| api_enums::Connector::DummyConnector3
| api_enums::Connector::DummyConnector4
diff --git a/crates/router/src/types/api.rs b/crates/router/src/types/api.rs
index ad50919ae0..d0a9e458ff 100644
--- a/crates/router/src/types/api.rs
+++ b/crates/router/src/types/api.rs
@@ -390,6 +390,10 @@ impl ConnectorData {
enums::Connector::DummyConnector7 => Ok(ConnectorEnum::Old(Box::new(
&connector::DummyConnector::<7>,
))),
+ #[cfg(feature = "dummy_connector")]
+ enums::Connector::DummyBillingConnector => Ok(ConnectorEnum::Old(Box::new(
+ &connector::DummyConnector::<8>,
+ ))),
enums::Connector::Ebanx => {
Ok(ConnectorEnum::Old(Box::new(connector::Ebanx::new())))
}
diff --git a/crates/router/src/types/transformers.rs b/crates/router/src/types/transformers.rs
index 54abe8f7ce..fbc1897bcb 100644
--- a/crates/router/src/types/transformers.rs
+++ b/crates/router/src/types/transformers.rs
@@ -1,4 +1,3 @@
-// use actix_web::HttpMessage;
use actix_web::http::header::HeaderMap;
use api_models::{
cards_info as card_info_types, enums as api_enums, gsm as gsm_api_types, payment_methods,
@@ -336,6 +335,12 @@ impl ForeignTryFrom<api_enums::Connector> for common_enums::RoutableConnectors {
api_enums::Connector::Zen => Self::Zen,
api_enums::Connector::Zsl => Self::Zsl,
#[cfg(feature = "dummy_connector")]
+ api_enums::Connector::DummyBillingConnector => {
+ Err(common_utils::errors::ValidationError::InvalidValue {
+ message: "stripe_billing_test is not a routable connector".to_string(),
+ })?
+ }
+ #[cfg(feature = "dummy_connector")]
api_enums::Connector::DummyConnector1 => Self::DummyConnector1,
#[cfg(feature = "dummy_connector")]
api_enums::Connector::DummyConnector2 => Self::DummyConnector2,