refactor(connnector): Structure connector enums in separate files for improved team ownership (#6459)

Co-authored-by: Chikke Srujan <chikke.srujan@Chikke-Srujan-N7WRTY72X7.local>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
chikke srujan
2024-10-30 12:58:58 +05:30
committed by GitHub
parent 7dcffccf3f
commit bb246e27b7
10 changed files with 13002 additions and 12987 deletions

View File

@ -0,0 +1,126 @@
use utoipa::ToSchema;
#[derive(
Clone,
Copy,
Debug,
Eq,
Hash,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
strum::EnumIter,
strum::VariantNames,
ToSchema,
)]
#[router_derive::diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
/// Connectors eligible for payments routing
pub enum RoutableConnectors {
Adyenplatform,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "phonypay")]
#[strum(serialize = "phonypay")]
DummyConnector1,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "fauxpay")]
#[strum(serialize = "fauxpay")]
DummyConnector2,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "pretendpay")]
#[strum(serialize = "pretendpay")]
DummyConnector3,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "stripe_test")]
#[strum(serialize = "stripe_test")]
DummyConnector4,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "adyen_test")]
#[strum(serialize = "adyen_test")]
DummyConnector5,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "checkout_test")]
#[strum(serialize = "checkout_test")]
DummyConnector6,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "paypal_test")]
#[strum(serialize = "paypal_test")]
DummyConnector7,
Aci,
Adyen,
Airwallex,
Authorizedotnet,
Bankofamerica,
Billwerk,
Bitpay,
Bambora,
Bamboraapac,
Bluesnap,
Boku,
Braintree,
Cashtocode,
Checkout,
Coinbase,
Cryptopay,
Cybersource,
Datatrans,
Deutschebank,
// Digitalvirgo, template code for future usage
Dlocal,
Ebanx,
Fiserv,
Fiservemea,
Fiuu,
Forte,
Globalpay,
Globepay,
Gocardless,
Helcim,
Iatapay,
Itaubank,
Klarna,
Mifinity,
Mollie,
Multisafepay,
Nexinets,
Nexixpay,
Nmi,
Noon,
Novalnet,
Nuvei,
// Opayo, added as template code for future usage
Opennode,
// Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage
Paybox,
Payme,
Payone,
Paypal,
Payu,
Placetopay,
Powertranz,
Prophetpay,
Rapyd,
Razorpay,
Riskified,
Shift4,
Signifyd,
Square,
Stax,
Stripe,
// Taxjar,
Trustpay,
// Thunes
// Tsys,
Tsys,
Volt,
Wellsfargo,
// Wellsfargopayout,
Wise,
Worldline,
Worldpay,
Zen,
Plaid,
Zsl,
}

View File

@ -3,6 +3,8 @@ use std::num::{ParseFloatError, TryFromIntError};
use serde::{Deserialize, Serialize};
use utoipa::ToSchema;
pub use super::connector_enums::RoutableConnectors;
#[doc(hidden)]
pub mod diesel_exports {
pub use super::{
@ -140,132 +142,6 @@ pub enum AttemptStatus {
DeviceDataCollectionPending,
}
#[derive(
Clone,
Copy,
Debug,
Eq,
Hash,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
strum::EnumIter,
strum::VariantNames,
ToSchema,
)]
#[router_derive::diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
/// Connectors eligible for payments routing
pub enum RoutableConnectors {
Adyenplatform,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "phonypay")]
#[strum(serialize = "phonypay")]
DummyConnector1,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "fauxpay")]
#[strum(serialize = "fauxpay")]
DummyConnector2,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "pretendpay")]
#[strum(serialize = "pretendpay")]
DummyConnector3,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "stripe_test")]
#[strum(serialize = "stripe_test")]
DummyConnector4,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "adyen_test")]
#[strum(serialize = "adyen_test")]
DummyConnector5,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "checkout_test")]
#[strum(serialize = "checkout_test")]
DummyConnector6,
#[cfg(feature = "dummy_connector")]
#[serde(rename = "paypal_test")]
#[strum(serialize = "paypal_test")]
DummyConnector7,
Aci,
Adyen,
Airwallex,
Authorizedotnet,
Bankofamerica,
Billwerk,
Bitpay,
Bambora,
Bamboraapac,
Bluesnap,
Boku,
Braintree,
Cashtocode,
Checkout,
Coinbase,
Cryptopay,
Cybersource,
Datatrans,
Deutschebank,
// Digitalvirgo, template code for future usage
Dlocal,
Ebanx,
Fiserv,
Fiservemea,
Fiuu,
Forte,
Globalpay,
Globepay,
Gocardless,
Helcim,
Iatapay,
Itaubank,
Klarna,
Mifinity,
Mollie,
Multisafepay,
Nexinets,
Nexixpay,
Nmi,
Noon,
Novalnet,
Nuvei,
// Opayo, added as template code for future usage
Opennode,
// Payeezy, As psync and rsync are not supported by this connector, it is added as template code for future usage
Paybox,
Payme,
Payone,
Paypal,
Payu,
Placetopay,
Powertranz,
Prophetpay,
Rapyd,
Razorpay,
Riskified,
Shift4,
Signifyd,
Square,
Stax,
Stripe,
// Taxjar,
Trustpay,
// Thunes
// Tsys,
Tsys,
Volt,
Wellsfargo,
// Wellsfargopayout,
Wise,
Worldline,
Worldpay,
Zen,
Plaid,
Zsl,
}
impl AttemptStatus {
pub fn is_terminal_status(self) -> bool {
match self {

View File

@ -1,3 +1,4 @@
pub mod connector_enums;
pub mod enums;
pub mod transformers;