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

1.2 KB
Raw Blame
//! Constants that are used in the domain models.

use std::{collections::HashSet, sync::LazyLock};

pub static ROUTING_ENABLED_PAYMENT_METHODS: LazyLock<HashSet<common_enums::PaymentMethod>> =
    LazyLock::new(|| {
        let mut set = HashSet::new();
        set.insert(common_enums::PaymentMethod::BankTransfer);
        set.insert(common_enums::PaymentMethod::BankDebit);
        set.insert(common_enums::PaymentMethod::BankRedirect);
        set
    });

pub static ROUTING_ENABLED_PAYMENT_METHOD_TYPES: LazyLock<
    HashSet<common_enums::PaymentMethodType>,
> = LazyLock::new(|| {
    let mut set = HashSet::new();
    set.insert(common_enums::PaymentMethodType::GooglePay);
    set.insert(common_enums::PaymentMethodType::ApplePay);
    set.insert(common_enums::PaymentMethodType::Klarna);
    set.insert(common_enums::PaymentMethodType::Paypal);
    set.insert(common_enums::PaymentMethodType::SamsungPay);
    set
});

/// Length of the unique reference ID generated for connector mandate requests
pub const CONNECTOR_MANDATE_REQUEST_REFERENCE_ID_LENGTH: usize = 18;

/// Custom list for masking sensitive webhook headers in the events API.
pub const SENSITIVE_WEBHOOK_HEADER_NAMES: [&str; 1] = ["authorization"];