text
stringlengths 65
57.3k
| file_path
stringlengths 22
92
| module
stringclasses 38
values | type
stringclasses 7
values | struct_name
stringlengths 3
60
⌀ | impl_count
int64 0
60
⌀ | traits
listlengths 0
59
⌀ | tokens
int64 16
8.19k
| function_name
stringlengths 3
85
⌀ | type_name
stringlengths 1
67
⌀ | trait_name
stringclasses 573
values | method_count
int64 0
31
⌀ | public_method_count
int64 0
19
⌀ | submodule_count
int64 0
56
⌀ | export_count
int64 0
9
⌀ |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
// Struct: ContractLabelInformationEventRequest
// File: crates/router/src/core/payments/routing/utils.rs
// Module: router
// Implementations: 0
pub struct ContractLabelInformationEventRequest
|
crates/router/src/core/payments/routing/utils.rs
|
router
|
struct_definition
|
ContractLabelInformationEventRequest
| 0
|
[] | 42
| null | null | null | null | null | null | null |
// Implementation: impl api::PaymentAuthorize for for Katapult
// File: crates/hyperswitch_connectors/src/connectors/katapult.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentAuthorize for for Katapult
|
crates/hyperswitch_connectors/src/connectors/katapult.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 58
| null |
Katapult
|
api::PaymentAuthorize for
| 0
| 0
| null | null |
// Struct: KatapultErrorResponse
// File: crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct KatapultErrorResponse
|
crates/hyperswitch_connectors/src/connectors/katapult/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
KatapultErrorResponse
| 0
|
[] | 48
| null | null | null | null | null | null | null |
// Implementation: impl std::fmt::Display for for TrustpaymentsSettleStatus
// File: crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
// Module: hyperswitch_connectors
// Methods: 1 total (0 public)
impl std::fmt::Display for for TrustpaymentsSettleStatus
|
crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 69
| null |
TrustpaymentsSettleStatus
|
std::fmt::Display for
| 1
| 0
| null | null |
// Implementation: impl api::RefundExecute for for Volt
// File: crates/hyperswitch_connectors/src/connectors/volt.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::RefundExecute for for Volt
|
crates/hyperswitch_connectors/src/connectors/volt.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 57
| null |
Volt
|
api::RefundExecute for
| 0
| 0
| null | null |
// Struct: TokenReference
// File: crates/router/src/core/proxy/utils.rs
// Module: router
// Implementations: 0
pub struct TokenReference
|
crates/router/src/core/proxy/utils.rs
|
router
|
struct_definition
|
TokenReference
| 0
|
[] | 34
| null | null | null | null | null | null | null |
// Function: new
// File: crates/payment_methods/src/configs/payment_connector_required_fields.rs
// Module: payment_methods
pub fn new(bank_config: &BankRedirectConfig) -> Self
|
crates/payment_methods/src/configs/payment_connector_required_fields.rs
|
payment_methods
|
function_signature
| null | null | null | 40
|
new
| null | null | null | null | null | null |
// Struct: PaymentDetails
// File: crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PaymentDetails
|
crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PaymentDetails
| 0
|
[] | 47
| null | null | null | null | null | null | null |
// Struct: ProxyClient
// File: crates/router/src/services/api/client.rs
// Module: router
// Implementations: 2
// Traits: ApiClient
pub struct ProxyClient
|
crates/router/src/services/api/client.rs
|
router
|
struct_definition
|
ProxyClient
| 2
|
[
"ApiClient"
] | 39
| null | null | null | null | null | null | null |
// Implementation: impl ConnectorValidation for for UnifiedAuthenticationService
// File: crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl ConnectorValidation for for UnifiedAuthenticationService
|
crates/hyperswitch_connectors/src/connectors/unified_authentication_service.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 57
| null |
UnifiedAuthenticationService
|
ConnectorValidation for
| 0
| 0
| null | null |
// Function: connector_service_decider
// File: crates/router/src/core/payments.rs
// Module: router
pub fn connector_service_decider<F, RouterDReq, ApiRequest, D>(
state: &SessionState,
req_state: ReqState,
merchant_context: &domain::MerchantContext,
connector: api::ConnectorData,
operation: &BoxedOperation<'_, F, ApiRequest, D>,
payment_data: &mut D,
call_connector_action: CallConnectorAction,
header_payload: HeaderPayload,
business_profile: &domain::Profile,
return_raw_connector_response: Option<bool>,
merchant_connector_account_type_details: domain::MerchantConnectorAccountTypeDetails,
) -> RouterResult<RouterData<F, RouterDReq, router_types::PaymentsResponseData>>
where
F: Send + Clone + Sync,
RouterDReq: Send + Sync,
// To create connector flow specific interface data
D: OperationSessionGetters<F> + OperationSessionSetters<F> + Send + Sync + Clone,
D: ConstructFlowSpecificData<F, RouterDReq, router_types::PaymentsResponseData>,
RouterData<F, RouterDReq, router_types::PaymentsResponseData>: Feature<F, RouterDReq> + Send,
// To construct connector flow specific api
dyn api::Connector:
services::api::ConnectorIntegration<F, RouterDReq, router_types::PaymentsResponseData>,
|
crates/router/src/core/payments.rs
|
router
|
function_signature
| null | null | null | 300
|
connector_service_decider
| null | null | null | null | null | null |
// Struct: AuthipayErrorResponse
// File: crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct AuthipayErrorResponse
|
crates/hyperswitch_connectors/src/connectors/authipay/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
AuthipayErrorResponse
| 0
|
[] | 47
| null | null | null | null | null | null | null |
// Implementation: impl Breadpay
// File: crates/hyperswitch_connectors/src/connectors/breadpay.rs
// Module: hyperswitch_connectors
// Methods: 1 total (1 public)
impl Breadpay
|
crates/hyperswitch_connectors/src/connectors/breadpay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 46
| null |
Breadpay
| null | 1
| 1
| null | null |
// Function: perform_elimination_routing
// File: crates/router/src/core/payments/routing.rs
// Module: router
pub fn perform_elimination_routing(
state: &SessionState,
routable_connectors: Vec<api_routing::RoutableConnectorChoice>,
profile_id: &common_utils::id_type::ProfileId,
merchant_id: &common_utils::id_type::MerchantId,
payment_id: &common_utils::id_type::PaymentId,
elimination_routing_configs_params_interpolator: routing::helpers::DynamicRoutingConfigParamsInterpolator,
elimination_algo_ref: api_routing::EliminationRoutingAlgorithm,
) -> RoutingResult<Vec<api_routing::RoutableConnectorChoice>>
|
crates/router/src/core/payments/routing.rs
|
router
|
function_signature
| null | null | null | 145
|
perform_elimination_routing
| null | null | null | null | null | null |
// Function: retry_webhook_delivery_task
// File: crates/router/src/workflows/outgoing_webhook_retry.rs
// Module: router
pub fn retry_webhook_delivery_task(
db: &dyn StorageInterface,
merchant_id: &id_type::MerchantId,
process: storage::ProcessTracker,
) -> errors::CustomResult<(), errors::StorageError>
|
crates/router/src/workflows/outgoing_webhook_retry.rs
|
router
|
function_signature
| null | null | null | 76
|
retry_webhook_delivery_task
| null | null | null | null | null | null |
// Struct: RefundResponse
// File: crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct RefundResponse
|
crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
RefundResponse
| 0
|
[] | 48
| null | null | null | null | null | null | null |
// Implementation: impl api::PaymentSync for for Hipay
// File: crates/hyperswitch_connectors/src/connectors/hipay.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentSync for for Hipay
|
crates/hyperswitch_connectors/src/connectors/hipay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 58
| null |
Hipay
|
api::PaymentSync for
| 0
| 0
| null | null |
// File: crates/api_models/src/mandates.rs
// Module: api_models
// Public functions: 1
// Public structs: 7
use common_types::payments as common_payments_types;
use masking::Secret;
use serde::{Deserialize, Serialize};
use time::PrimitiveDateTime;
use utoipa::ToSchema;
use crate::enums as api_enums;
#[derive(Default, Debug, Deserialize, Serialize)]
pub struct MandateId {
pub mandate_id: String,
}
#[derive(Default, Debug, Deserialize, Serialize, ToSchema)]
pub struct MandateRevokedResponse {
/// The identifier for mandate
pub mandate_id: String,
/// The status for mandates
#[schema(value_type = MandateStatus)]
pub status: api_enums::MandateStatus,
/// If there was an error while calling the connectors the code is received here
#[schema(example = "E0001")]
pub error_code: Option<String>,
/// If there was an error while calling the connector the error message is received here
#[schema(example = "Failed while verifying the card")]
pub error_message: Option<String>,
}
#[derive(Default, Debug, Deserialize, Serialize, ToSchema, Clone)]
pub struct MandateResponse {
/// The identifier for mandate
pub mandate_id: String,
/// The status for mandates
#[schema(value_type = MandateStatus)]
pub status: api_enums::MandateStatus,
/// The identifier for payment method
pub payment_method_id: String,
/// The payment method
pub payment_method: String,
/// The payment method type
pub payment_method_type: Option<String>,
/// The card details for mandate
pub card: Option<MandateCardDetails>,
/// Details about the customer’s acceptance
#[schema(value_type = Option<CustomerAcceptance>)]
pub customer_acceptance: Option<common_payments_types::CustomerAcceptance>,
}
#[derive(Default, Debug, Deserialize, Serialize, ToSchema, Clone)]
pub struct MandateCardDetails {
/// The last 4 digits of card
pub last4_digits: Option<String>,
/// The expiry month of card
#[schema(value_type = Option<String>)]
pub card_exp_month: Option<Secret<String>>,
/// The expiry year of card
#[schema(value_type = Option<String>)]
pub card_exp_year: Option<Secret<String>>,
/// The card holder name
#[schema(value_type = Option<String>)]
pub card_holder_name: Option<Secret<String>>,
/// The token from card locker
#[schema(value_type = Option<String>)]
pub card_token: Option<Secret<String>>,
/// The card scheme network for the particular card
pub scheme: Option<String>,
/// The country code in in which the card was issued
pub issuer_country: Option<String>,
#[schema(value_type = Option<String>)]
/// A unique identifier alias to identify a particular card
pub card_fingerprint: Option<Secret<String>>,
/// The first 6 digits of card
pub card_isin: Option<String>,
/// The bank that issued the card
pub card_issuer: Option<String>,
/// The network that facilitates payment card transactions
#[schema(value_type = Option<CardNetwork>)]
pub card_network: Option<api_enums::CardNetwork>,
/// The type of the payment card
pub card_type: Option<String>,
/// The nick_name of the card holder
#[schema(value_type = Option<String>)]
pub nick_name: Option<Secret<String>>,
}
#[derive(Clone, Debug, Deserialize, ToSchema, Serialize)]
#[serde(deny_unknown_fields)]
pub struct MandateListConstraints {
/// limit on the number of objects to return
pub limit: Option<i64>,
/// offset on the number of objects to return
pub offset: Option<i64>,
/// status of the mandate
pub mandate_status: Option<api_enums::MandateStatus>,
/// connector linked to mandate
pub connector: Option<String>,
/// The time at which mandate is created
#[schema(example = "2022-09-10T10:11:12Z")]
pub created_time: Option<PrimitiveDateTime>,
/// Time less than the mandate created time
#[schema(example = "2022-09-10T10:11:12Z")]
#[serde(rename = "created_time.lt")]
pub created_time_lt: Option<PrimitiveDateTime>,
/// Time greater than the mandate created time
#[schema(example = "2022-09-10T10:11:12Z")]
#[serde(rename = "created_time.gt")]
pub created_time_gt: Option<PrimitiveDateTime>,
/// Time less than or equals to the mandate created time
#[schema(example = "2022-09-10T10:11:12Z")]
#[serde(rename = "created_time.lte")]
pub created_time_lte: Option<PrimitiveDateTime>,
/// Time greater than or equals to the mandate created time
#[schema(example = "2022-09-10T10:11:12Z")]
#[serde(rename = "created_time.gte")]
pub created_time_gte: Option<PrimitiveDateTime>,
}
/// Details required for recurring payment
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)]
#[serde(tag = "type", content = "data", rename_all = "snake_case")]
pub enum RecurringDetails {
MandateId(String),
PaymentMethodId(String),
ProcessorPaymentToken(ProcessorPaymentToken),
/// Network transaction ID and Card Details for MIT payments when payment_method_data
/// is not stored in the application
NetworkTransactionIdAndCardDetails(NetworkTransactionIdAndCardDetails),
}
/// Processor payment token for MIT payments where payment_method_data is not available
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)]
pub struct ProcessorPaymentToken {
pub processor_payment_token: String,
#[schema(value_type = Option<String>)]
pub merchant_connector_id: Option<common_utils::id_type::MerchantConnectorAccountId>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, ToSchema, PartialEq, Eq)]
pub struct NetworkTransactionIdAndCardDetails {
/// The card number
#[schema(value_type = String, example = "4242424242424242")]
pub card_number: cards::CardNumber,
/// The card's expiry month
#[schema(value_type = String, example = "24")]
pub card_exp_month: Secret<String>,
/// The card's expiry year
#[schema(value_type = String, example = "24")]
pub card_exp_year: Secret<String>,
/// The card holder's name
#[schema(value_type = String, example = "John Test")]
pub card_holder_name: Option<Secret<String>>,
/// The name of the issuer of card
#[schema(example = "chase")]
pub card_issuer: Option<String>,
/// The card network for the card
#[schema(value_type = Option<CardNetwork>, example = "Visa")]
pub card_network: Option<api_enums::CardNetwork>,
#[schema(example = "CREDIT")]
pub card_type: Option<String>,
#[schema(example = "INDIA")]
pub card_issuing_country: Option<String>,
#[schema(example = "JP_AMEX")]
pub bank_code: Option<String>,
/// The card holder's nick name
#[schema(value_type = Option<String>, example = "John Test")]
pub nick_name: Option<Secret<String>>,
/// The network transaction ID provided by the card network during a CIT (Customer Initiated Transaction),
/// where `setup_future_usage` is set to `off_session`.
#[schema(value_type = String)]
pub network_transaction_id: Secret<String>,
}
impl RecurringDetails {
pub fn is_network_transaction_id_and_card_details_flow(self) -> bool {
matches!(self, Self::NetworkTransactionIdAndCardDetails(_))
}
}
|
crates/api_models/src/mandates.rs
|
api_models
|
full_file
| null | null | null | 1,770
| null | null | null | null | null | null | null |
// File: crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs
// Module: hyperswitch_connectors
// Public functions: 9
// Public structs: 106
use std::{collections::HashMap, fmt::Debug, ops::Deref};
use api_models::{self, enums as api_enums, payments};
use common_enums::{enums, AttemptStatus, PaymentChargeType, StripeChargeType};
use common_types::{
payments::{AcceptanceType, SplitPaymentsRequest},
primitive_wrappers,
};
use common_utils::{
collect_missing_value_keys,
errors::CustomResult,
ext_traits::{ByteSliceExt, Encode, OptionExt as _},
pii::{self, Email},
request::{Method, RequestContent},
types::MinorUnit,
};
use error_stack::ResultExt;
use hyperswitch_domain_models::{
payment_method_data::{
self, BankRedirectData, Card, CardRedirectData, GiftCardData, GooglePayWalletData,
PayLaterData, PaymentMethodData, VoucherData, WalletData,
},
router_data::{
AdditionalPaymentMethodConnectorResponse, ConnectorAuthType, ConnectorResponseData,
ExtendedAuthorizationResponseData, PaymentMethodToken, RouterData,
},
router_flow_types::{Execute, RSync},
router_request_types::{
BrowserInformation, ChargeRefundsOptions, DestinationChargeRefund, DirectChargeRefund,
PaymentsAuthorizeData, PaymentsCancelData, PaymentsCaptureData,
PaymentsIncrementalAuthorizationData, ResponseId, SplitRefundsRequest,
},
router_response_types::{
ConnectorCustomerResponseData, MandateReference, PaymentsResponseData,
PreprocessingResponseId, RedirectForm, RefundsResponseData,
},
types::{
ConnectorCustomerRouterData, PaymentsAuthorizeRouterData, PaymentsCancelRouterData,
PaymentsUpdateMetadataRouterData, RefundsRouterData, SetupMandateRouterData,
TokenizationRouterData,
},
};
use hyperswitch_interfaces::{consts, errors::ConnectorError};
use masking::{ExposeInterface, Mask, Maskable, PeekInterface, Secret};
use serde::{Deserialize, Serialize};
use serde_json::Value;
use time::PrimitiveDateTime;
use url::Url;
use crate::{
constants::headers::STRIPE_COMPATIBLE_CONNECT_ACCOUNT,
utils::{
convert_uppercase, deserialize_zero_minor_amount_as_none, ApplePay,
RouterData as OtherRouterData,
},
};
#[cfg(feature = "payouts")]
pub mod connect;
#[cfg(feature = "payouts")]
pub use self::connect::*;
use crate::{
types::{
RefundsResponseRouterData, ResponseRouterData, SubmitEvidenceRouterData,
UploadFileRouterData,
},
utils::{
get_unimplemented_payment_method_error_message, is_payment_failure, is_refund_failure,
PaymentsAuthorizeRequestData, SplitPaymentData,
},
};
pub mod auth_headers {
pub const STRIPE_API_VERSION: &str = "stripe-version";
pub const STRIPE_VERSION: &str = "2022-11-15";
}
trait GetRequestIncrementalAuthorization {
fn get_request_incremental_authorization(&self) -> Option<bool>;
}
impl GetRequestIncrementalAuthorization for PaymentsAuthorizeData {
fn get_request_incremental_authorization(&self) -> Option<bool> {
Some(self.request_incremental_authorization)
}
}
impl GetRequestIncrementalAuthorization for PaymentsCaptureData {
fn get_request_incremental_authorization(&self) -> Option<bool> {
None
}
}
impl GetRequestIncrementalAuthorization for PaymentsCancelData {
fn get_request_incremental_authorization(&self) -> Option<bool> {
None
}
}
pub struct StripeAuthType {
pub(super) api_key: Secret<String>,
}
impl TryFrom<&ConnectorAuthType> for StripeAuthType {
type Error = error_stack::Report<ConnectorError>;
fn try_from(item: &ConnectorAuthType) -> Result<Self, Self::Error> {
if let ConnectorAuthType::HeaderKey { api_key } = item {
Ok(Self {
api_key: api_key.to_owned(),
})
} else {
Err(ConnectorError::FailedToObtainAuthType.into())
}
}
}
#[derive(Debug, Default, Eq, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum StripeCaptureMethod {
Manual,
#[default]
Automatic,
}
impl From<Option<enums::CaptureMethod>> for StripeCaptureMethod {
fn from(item: Option<enums::CaptureMethod>) -> Self {
match item {
Some(p) => match p {
enums::CaptureMethod::ManualMultiple => Self::Manual,
enums::CaptureMethod::Manual => Self::Manual,
enums::CaptureMethod::Automatic | enums::CaptureMethod::SequentialAutomatic => {
Self::Automatic
}
enums::CaptureMethod::Scheduled => Self::Manual,
},
None => Self::Automatic,
}
}
}
#[derive(Debug, Default, Eq, PartialEq, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum Auth3ds {
#[default]
Automatic,
Any,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum StripeCardNetwork {
CartesBancaires,
Mastercard,
Visa,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(
rename_all = "snake_case",
tag = "mandate_data[customer_acceptance][type]"
)]
pub enum StripeMandateType {
Online {
#[serde(rename = "mandate_data[customer_acceptance][online][ip_address]")]
ip_address: Secret<String, pii::IpAddress>,
#[serde(rename = "mandate_data[customer_acceptance][online][user_agent]")]
user_agent: String,
},
Offline,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeMandateRequest {
#[serde(flatten)]
mandate_type: StripeMandateType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum ExpandableObjects {
LatestCharge,
Customer,
LatestAttempt,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeBrowserInformation {
#[serde(rename = "payment_method_data[ip]")]
pub ip_address: Option<Secret<String, pii::IpAddress>>,
#[serde(rename = "payment_method_data[user_agent]")]
pub user_agent: Option<String>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct PaymentIntentRequest {
pub amount: MinorUnit, //amount in cents, hence passed as integer
pub currency: String,
pub statement_descriptor_suffix: Option<String>,
pub statement_descriptor: Option<String>,
#[serde(flatten)]
pub meta_data: HashMap<String, String>,
pub return_url: String,
pub confirm: bool,
pub payment_method: Option<Secret<String>>,
pub customer: Option<Secret<String>>,
#[serde(flatten)]
pub setup_mandate_details: Option<StripeMandateRequest>,
pub description: Option<String>,
#[serde(flatten)]
pub shipping: Option<StripeShippingAddress>,
#[serde(flatten)]
pub billing: StripeBillingAddress,
#[serde(flatten)]
pub payment_data: Option<StripePaymentMethodData>,
pub capture_method: StripeCaptureMethod,
#[serde(flatten)]
pub payment_method_options: Option<StripePaymentMethodOptions>, // For mandate txns using network_txns_id, needs to be validated
pub setup_future_usage: Option<enums::FutureUsage>,
pub off_session: Option<bool>,
#[serde(rename = "payment_method_types[0]")]
pub payment_method_types: Option<StripePaymentMethodType>,
#[serde(rename = "expand[0]")]
pub expand: Option<ExpandableObjects>,
#[serde(flatten)]
pub browser_info: Option<StripeBrowserInformation>,
#[serde(flatten)]
pub charges: Option<IntentCharges>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct IntentCharges {
pub application_fee_amount: Option<MinorUnit>,
#[serde(
rename = "transfer_data[destination]",
skip_serializing_if = "Option::is_none"
)]
pub destination_account_id: Option<String>,
}
// Field rename is required only in case of serialization as it is passed in the request to the connector.
// Deserialization is happening only in case of webhooks, where fields name should be used as defined in the struct.
// Whenever adding new fields, Please ensure it doesn't break the webhook flow
#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
pub struct StripeMetadata {
// merchant_reference_id
#[serde(rename(serialize = "metadata[order_id]"))]
pub order_id: Option<String>,
// to check whether the order_id is refund_id or payment_id
// before deployment, order id is set to payment_id in refunds but now it is set as refund_id
// it is set as string instead of bool because stripe pass it as string even if we set it as bool
#[serde(rename(serialize = "metadata[is_refund_id_as_reference]"))]
pub is_refund_id_as_reference: Option<String>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct SetupIntentRequest {
pub confirm: bool,
pub usage: Option<enums::FutureUsage>,
pub customer: Option<Secret<String>>,
pub off_session: Option<bool>,
pub return_url: Option<String>,
#[serde(flatten)]
pub payment_data: StripePaymentMethodData,
pub payment_method_options: Option<StripePaymentMethodOptions>, // For mandate txns using network_txns_id, needs to be validated
#[serde(flatten)]
pub meta_data: Option<HashMap<String, String>>,
#[serde(rename = "payment_method_types[0]")]
pub payment_method_types: Option<StripePaymentMethodType>,
#[serde(rename = "expand[0]")]
pub expand: Option<ExpandableObjects>,
#[serde(flatten)]
pub browser_info: Option<StripeBrowserInformation>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeCardData {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_data[card][number]")]
pub payment_method_data_card_number: cards::CardNumber,
#[serde(rename = "payment_method_data[card][exp_month]")]
pub payment_method_data_card_exp_month: Secret<String>,
#[serde(rename = "payment_method_data[card][exp_year]")]
pub payment_method_data_card_exp_year: Secret<String>,
#[serde(rename = "payment_method_data[card][cvc]")]
pub payment_method_data_card_cvc: Option<Secret<String>>,
#[serde(rename = "payment_method_options[card][request_three_d_secure]")]
pub payment_method_auth_type: Option<Auth3ds>,
#[serde(rename = "payment_method_options[card][network]")]
pub payment_method_data_card_preferred_network: Option<StripeCardNetwork>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "payment_method_options[card][request_incremental_authorization]")]
pub request_incremental_authorization: Option<StripeRequestIncrementalAuthorization>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "payment_method_options[card][request_extended_authorization]")]
request_extended_authorization: Option<StripeRequestExtendedAuthorization>,
#[serde(rename = "payment_method_options[card][request_overcapture]")]
pub request_overcapture: Option<StripeRequestOvercaptureBool>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum StripeRequestIncrementalAuthorization {
IfAvailable,
Never,
}
#[derive(Debug, Eq, PartialEq, Serialize, Deserialize, Clone)]
#[serde(rename_all = "snake_case")]
pub enum StripeRequestExtendedAuthorization {
IfAvailable,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum StripeRequestOvercaptureBool {
IfAvailable,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripePayLaterData {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct TokenRequest {
#[serde(flatten)]
pub token_data: StripePaymentMethodData,
}
#[derive(Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct StripeTokenResponse {
pub id: Secret<String>,
pub object: String,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CustomerRequest {
pub description: Option<String>,
pub email: Option<Email>,
pub phone: Option<Secret<String>>,
pub name: Option<Secret<String>>,
pub source: Option<Secret<String>>,
}
#[derive(Debug, Eq, PartialEq, Deserialize, Serialize)]
pub struct StripeCustomerResponse {
pub id: String,
pub description: Option<String>,
pub email: Option<Email>,
pub phone: Option<Secret<String>>,
pub name: Option<Secret<String>>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ChargesRequest {
pub amount: MinorUnit,
pub currency: String,
pub customer: Secret<String>,
pub source: Secret<String>,
#[serde(flatten)]
pub meta_data: Option<HashMap<String, String>>,
}
#[derive(Clone, Debug, Default, Eq, PartialEq, Deserialize, Serialize)]
pub struct ChargesResponse {
pub id: String,
pub amount: MinorUnit,
pub amount_captured: MinorUnit,
pub currency: String,
pub status: StripePaymentStatus,
pub source: StripeSourceResponse,
pub failure_code: Option<String>,
pub failure_message: Option<String>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum StripeBankName {
Eps {
#[serde(rename = "payment_method_data[eps][bank]")]
bank_name: Option<StripeBankNames>,
},
Ideal {
#[serde(rename = "payment_method_data[ideal][bank]")]
ideal_bank_name: Option<StripeBankNames>,
},
Przelewy24 {
#[serde(rename = "payment_method_data[p24][bank]")]
bank_name: Option<StripeBankNames>,
},
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum StripeBankRedirectData {
StripeGiropay(Box<StripeGiropay>),
StripeIdeal(Box<StripeIdeal>),
StripeBancontactCard(Box<StripeBancontactCard>),
StripePrezelewy24(Box<StripePrezelewy24>),
StripeEps(Box<StripeEps>),
StripeBlik(Box<StripeBlik>),
StripeOnlineBankingFpx(Box<StripeOnlineBankingFpx>),
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeGiropay {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeIdeal {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_data[ideal][bank]")]
ideal_bank_name: Option<StripeBankNames>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeBancontactCard {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripePrezelewy24 {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_data[p24][bank]")]
bank_name: Option<StripeBankNames>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeEps {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_data[eps][bank]")]
bank_name: Option<StripeBankNames>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeBlik {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_options[blik][code]")]
pub code: Secret<String>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeOnlineBankingFpx {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct AchTransferData {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_options[customer_balance][bank_transfer][type]")]
pub bank_transfer_type: StripeCreditTransferTypes,
#[serde(rename = "payment_method_types[0]")]
pub payment_method_type: StripePaymentMethodType,
#[serde(rename = "payment_method_options[customer_balance][funding_type]")]
pub balance_funding_type: BankTransferType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct MultibancoTransferData {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripeCreditTransferTypes,
#[serde(rename = "payment_method_types[0]")]
pub payment_method_type: StripeCreditTransferTypes,
#[serde(rename = "payment_method_data[billing_details][email]")]
pub email: Email,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct BacsBankTransferData {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_options[customer_balance][bank_transfer][type]")]
pub bank_transfer_type: BankTransferType,
#[serde(rename = "payment_method_options[customer_balance][funding_type]")]
pub balance_funding_type: BankTransferType,
#[serde(rename = "payment_method_types[0]")]
pub payment_method_type: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct SepaBankTransferData {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_options[customer_balance][bank_transfer][type]")]
pub bank_transfer_type: BankTransferType,
#[serde(rename = "payment_method_options[customer_balance][funding_type]")]
pub balance_funding_type: BankTransferType,
#[serde(rename = "payment_method_types[0]")]
pub payment_method_type: StripePaymentMethodType,
#[serde(
rename = "payment_method_options[customer_balance][bank_transfer][eu_bank_transfer][country]"
)]
pub country: enums::CountryAlpha2,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum StripeCreditTransferSourceRequest {
AchBankTansfer(AchCreditTransferSourceRequest),
MultibancoBankTansfer(MultibancoCreditTransferSourceRequest),
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct AchCreditTransferSourceRequest {
#[serde(rename = "type")]
pub transfer_type: StripeCreditTransferTypes,
#[serde(flatten)]
pub payment_method_data: AchTransferData,
pub currency: enums::Currency,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct MultibancoCreditTransferSourceRequest {
#[serde(rename = "type")]
pub transfer_type: StripeCreditTransferTypes,
#[serde(flatten)]
pub payment_method_data: MultibancoTransferData,
pub currency: enums::Currency,
pub amount: Option<MinorUnit>,
#[serde(rename = "redirect[return_url]")]
pub return_url: Option<String>,
}
// Remove untagged when Deserialize is added
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum StripePaymentMethodData {
CardToken(StripeCardToken),
Card(StripeCardData),
PayLater(StripePayLaterData),
Wallet(StripeWallet),
BankRedirect(StripeBankRedirectData),
BankDebit(StripeBankDebitData),
BankTransfer(StripeBankTransferData),
}
#[derive(Debug, Clone, Default, Eq, PartialEq, Serialize)]
pub struct StripeBillingAddressCardToken {
#[serde(rename = "billing_details[name]")]
pub name: Option<Secret<String>>,
#[serde(rename = "billing_details[email]")]
pub email: Option<Email>,
#[serde(rename = "billing_details[phone]")]
pub phone: Option<Secret<String>>,
#[serde(rename = "billing_details[address][line1]")]
pub address_line1: Option<Secret<String>>,
#[serde(rename = "billing_details[address][line2]")]
pub address_line2: Option<Secret<String>>,
#[serde(rename = "billing_details[address][state]")]
pub state: Option<Secret<String>>,
#[serde(rename = "billing_details[address][city]")]
pub city: Option<String>,
}
// Struct to call the Stripe tokens API to create a PSP token for the card details provided
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeCardToken {
#[serde(rename = "type")]
pub payment_method_type: Option<StripePaymentMethodType>,
#[serde(rename = "card[number]")]
pub token_card_number: cards::CardNumber,
#[serde(rename = "card[exp_month]")]
pub token_card_exp_month: Secret<String>,
#[serde(rename = "card[exp_year]")]
pub token_card_exp_year: Secret<String>,
#[serde(rename = "card[cvc]")]
pub token_card_cvc: Secret<String>,
#[serde(flatten)]
pub billing: StripeBillingAddressCardToken,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(tag = "payment_method_data[type]")]
pub enum BankDebitData {
#[serde(rename = "us_bank_account")]
Ach {
#[serde(rename = "payment_method_data[us_bank_account][account_holder_type]")]
account_holder_type: String,
#[serde(rename = "payment_method_data[us_bank_account][account_number]")]
account_number: Secret<String>,
#[serde(rename = "payment_method_data[us_bank_account][routing_number]")]
routing_number: Secret<String>,
},
#[serde(rename = "sepa_debit")]
Sepa {
#[serde(rename = "payment_method_data[sepa_debit][iban]")]
iban: Secret<String>,
},
#[serde(rename = "au_becs_debit")]
Becs {
#[serde(rename = "payment_method_data[au_becs_debit][account_number]")]
account_number: Secret<String>,
#[serde(rename = "payment_method_data[au_becs_debit][bsb_number]")]
bsb_number: Secret<String>,
},
#[serde(rename = "bacs_debit")]
Bacs {
#[serde(rename = "payment_method_data[bacs_debit][account_number]")]
account_number: Secret<String>,
#[serde(rename = "payment_method_data[bacs_debit][sort_code]")]
sort_code: Secret<String>,
},
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeBankDebitData {
#[serde(flatten)]
pub bank_specific_data: BankDebitData,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct BankTransferData {
pub email: Email,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum StripeBankTransferData {
AchBankTransfer(Box<AchTransferData>),
SepaBankTransfer(Box<SepaBankTransferData>),
BacsBankTransfers(Box<BacsBankTransferData>),
MultibancoBankTransfers(Box<MultibancoTransferData>),
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(untagged)]
pub enum StripeWallet {
ApplepayToken(StripeApplePay),
GooglepayToken(GooglePayToken),
ApplepayPayment(ApplepayPayment),
AmazonpayPayment(AmazonpayPayment),
WechatpayPayment(WechatpayPayment),
AlipayPayment(AlipayPayment),
Cashapp(CashappPayment),
RevolutPay(RevolutpayPayment),
ApplePayPredecryptToken(Box<StripeApplePayPredecrypt>),
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeApplePayPredecrypt {
#[serde(rename = "card[number]")]
number: cards::CardNumber,
#[serde(rename = "card[exp_year]")]
exp_year: Secret<String>,
#[serde(rename = "card[exp_month]")]
exp_month: Secret<String>,
#[serde(rename = "card[cryptogram]")]
cryptogram: Secret<String>,
#[serde(rename = "card[eci]")]
eci: Option<String>,
#[serde(rename = "card[tokenization_method]")]
tokenization_method: String,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct StripeApplePay {
pub pk_token: Secret<String>,
pub pk_token_instrument_name: String,
pub pk_token_payment_network: String,
pub pk_token_transaction_id: Secret<String>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct GooglePayToken {
#[serde(rename = "payment_method_data[type]")]
pub payment_type: StripePaymentMethodType,
#[serde(rename = "payment_method_data[card][token]")]
pub token: Secret<String>,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct ApplepayPayment {
#[serde(rename = "payment_method_data[card][token]")]
pub token: Secret<String>,
#[serde(rename = "payment_method_data[type]")]
pub payment_method_types: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct AmazonpayPayment {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_types: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct RevolutpayPayment {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_types: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct AlipayPayment {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct CashappPayment {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct WechatpayPayment {
#[serde(rename = "payment_method_data[type]")]
pub payment_method_data_type: StripePaymentMethodType,
#[serde(rename = "payment_method_options[wechat_pay][client]")]
pub client: WechatClient,
}
#[derive(Debug, Eq, PartialEq, Serialize, Clone, Copy)]
#[serde(rename_all = "snake_case")]
pub enum WechatClient {
Web,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
pub struct GooglepayPayment {
#[serde(rename = "payment_method_data[card][token]")]
pub token: Secret<String>,
#[serde(rename = "payment_method_data[type]")]
pub payment_method_types: StripePaymentMethodType,
}
// All supported payment_method_types in stripe
// This enum goes in payment_method_types[] field in stripe request body
// https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_types
#[derive(Eq, PartialEq, Serialize, Clone, Debug, Copy)]
#[serde(rename_all = "snake_case")]
pub enum StripePaymentMethodType {
Affirm,
AfterpayClearpay,
Alipay,
#[serde(rename = "amazon_pay")]
AmazonPay,
#[serde(rename = "au_becs_debit")]
Becs,
#[serde(rename = "bacs_debit")]
Bacs,
Bancontact,
Blik,
Card,
CustomerBalance,
Eps,
Giropay,
Ideal,
Klarna,
#[serde(rename = "p24")]
Przelewy24,
#[serde(rename = "sepa_debit")]
Sepa,
Sofort,
#[serde(rename = "us_bank_account")]
Ach,
#[serde(rename = "wechat_pay")]
Wechatpay,
#[serde(rename = "cashapp")]
Cashapp,
RevolutPay,
}
#[derive(Debug, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
#[allow(dead_code)]
pub enum StripeCreditTransferTypes {
#[serde(rename = "us_bank_transfer")]
AchCreditTransfer,
Multibanco,
Blik,
}
impl TryFrom<enums::PaymentMethodType> for StripePaymentMethodType {
type Error = error_stack::Report<ConnectorError>;
fn try_from(value: enums::PaymentMethodType) -> Result<Self, Self::Error> {
match value {
enums::PaymentMethodType::Credit => Ok(Self::Card),
enums::PaymentMethodType::Debit => Ok(Self::Card),
#[cfg(feature = "v2")]
enums::PaymentMethodType::Card => Ok(Self::Card),
enums::PaymentMethodType::Klarna => Ok(Self::Klarna),
enums::PaymentMethodType::Affirm => Ok(Self::Affirm),
enums::PaymentMethodType::AfterpayClearpay => Ok(Self::AfterpayClearpay),
enums::PaymentMethodType::Eps => Ok(Self::Eps),
enums::PaymentMethodType::Giropay => Ok(Self::Giropay),
enums::PaymentMethodType::Ideal => Ok(Self::Ideal),
enums::PaymentMethodType::Sofort => Ok(Self::Sofort),
enums::PaymentMethodType::AmazonPay => Ok(Self::AmazonPay),
enums::PaymentMethodType::ApplePay => Ok(Self::Card),
enums::PaymentMethodType::Ach => Ok(Self::Ach),
enums::PaymentMethodType::Sepa => Ok(Self::Sepa),
enums::PaymentMethodType::Becs => Ok(Self::Becs),
enums::PaymentMethodType::Bacs => Ok(Self::Bacs),
enums::PaymentMethodType::BancontactCard => Ok(Self::Bancontact),
enums::PaymentMethodType::WeChatPay => Ok(Self::Wechatpay),
enums::PaymentMethodType::Blik => Ok(Self::Blik),
enums::PaymentMethodType::AliPay => Ok(Self::Alipay),
enums::PaymentMethodType::Przelewy24 => Ok(Self::Przelewy24),
enums::PaymentMethodType::RevolutPay => Ok(Self::RevolutPay),
// Stripe expects PMT as Card for Recurring Mandates Payments
enums::PaymentMethodType::GooglePay => Ok(Self::Card),
enums::PaymentMethodType::Boleto
| enums::PaymentMethodType::Paysera
| enums::PaymentMethodType::Skrill
| enums::PaymentMethodType::CardRedirect
| enums::PaymentMethodType::CryptoCurrency
| enums::PaymentMethodType::Multibanco
| enums::PaymentMethodType::OnlineBankingFpx
| enums::PaymentMethodType::Paypal
| enums::PaymentMethodType::BhnCardNetwork
| enums::PaymentMethodType::Pix
| enums::PaymentMethodType::UpiCollect
| enums::PaymentMethodType::UpiIntent
| enums::PaymentMethodType::Cashapp
| enums::PaymentMethodType::Bluecode
| enums::PaymentMethodType::Oxxo => Err(ConnectorError::NotImplemented(
get_unimplemented_payment_method_error_message("stripe"),
)
.into()),
enums::PaymentMethodType::AliPayHk
| enums::PaymentMethodType::Atome
| enums::PaymentMethodType::Bizum
| enums::PaymentMethodType::Alma
| enums::PaymentMethodType::ClassicReward
| enums::PaymentMethodType::Dana
| enums::PaymentMethodType::DirectCarrierBilling
| enums::PaymentMethodType::Efecty
| enums::PaymentMethodType::Eft
| enums::PaymentMethodType::Evoucher
| enums::PaymentMethodType::GoPay
| enums::PaymentMethodType::Gcash
| enums::PaymentMethodType::Interac
| enums::PaymentMethodType::KakaoPay
| enums::PaymentMethodType::LocalBankRedirect
| enums::PaymentMethodType::MbWay
| enums::PaymentMethodType::MobilePay
| enums::PaymentMethodType::Momo
| enums::PaymentMethodType::MomoAtm
| enums::PaymentMethodType::OnlineBankingThailand
| enums::PaymentMethodType::OnlineBankingCzechRepublic
| enums::PaymentMethodType::OnlineBankingFinland
| enums::PaymentMethodType::OnlineBankingPoland
| enums::PaymentMethodType::OnlineBankingSlovakia
| enums::PaymentMethodType::OpenBankingUk
| enums::PaymentMethodType::OpenBankingPIS
| enums::PaymentMethodType::PagoEfectivo
| enums::PaymentMethodType::PayBright
| enums::PaymentMethodType::Pse
| enums::PaymentMethodType::RedCompra
| enums::PaymentMethodType::RedPagos
| enums::PaymentMethodType::SamsungPay
| enums::PaymentMethodType::Swish
| enums::PaymentMethodType::TouchNGo
| enums::PaymentMethodType::Trustly
| enums::PaymentMethodType::Twint
| enums::PaymentMethodType::Vipps
| enums::PaymentMethodType::Venmo
| enums::PaymentMethodType::Alfamart
| enums::PaymentMethodType::BcaBankTransfer
| enums::PaymentMethodType::BniVa
| enums::PaymentMethodType::CimbVa
| enums::PaymentMethodType::BriVa
| enums::PaymentMethodType::DanamonVa
| enums::PaymentMethodType::Indomaret
| enums::PaymentMethodType::MandiriVa
| enums::PaymentMethodType::PermataBankTransfer
| enums::PaymentMethodType::PaySafeCard
| enums::PaymentMethodType::Paze
| enums::PaymentMethodType::Givex
| enums::PaymentMethodType::Benefit
| enums::PaymentMethodType::Knet
| enums::PaymentMethodType::SevenEleven
| enums::PaymentMethodType::Lawson
| enums::PaymentMethodType::MiniStop
| enums::PaymentMethodType::FamilyMart
| enums::PaymentMethodType::Seicomart
| enums::PaymentMethodType::PayEasy
| enums::PaymentMethodType::LocalBankTransfer
| enums::PaymentMethodType::InstantBankTransfer
| enums::PaymentMethodType::InstantBankTransferFinland
| enums::PaymentMethodType::InstantBankTransferPoland
| enums::PaymentMethodType::SepaBankTransfer
| enums::PaymentMethodType::Walley
| enums::PaymentMethodType::Fps
| enums::PaymentMethodType::DuitNow
| enums::PaymentMethodType::PromptPay
| enums::PaymentMethodType::VietQr
| enums::PaymentMethodType::IndonesianBankTransfer
| enums::PaymentMethodType::Flexiti
| enums::PaymentMethodType::Mifinity
| enums::PaymentMethodType::Breadpay => Err(ConnectorError::NotImplemented(
get_unimplemented_payment_method_error_message("stripe"),
)
.into()),
}
}
}
#[derive(Debug, Eq, PartialEq, Serialize, Clone)]
#[serde(rename_all = "snake_case")]
pub enum BankTransferType {
GbBankTransfer,
EuBankTransfer,
#[serde(rename = "bank_transfer")]
BankTransfers,
}
#[derive(Debug, Eq, PartialEq, Serialize, Clone)]
#[serde(rename_all = "snake_case")]
pub enum StripeBankNames {
AbnAmro,
ArzteUndApothekerBank,
AsnBank,
AustrianAnadiBankAg,
BankAustria,
BankhausCarlSpangler,
BankhausSchelhammerUndSchatteraAg,
BawagPskAg,
BksBankAg,
BrullKallmusBankAg,
BtvVierLanderBank,
Bunq,
CapitalBankGraweGruppeAg,
CitiHandlowy,
Dolomitenbank,
EasybankAg,
ErsteBankUndSparkassen,
Handelsbanken,
HypoAlpeadriabankInternationalAg,
HypoNoeLbFurNiederosterreichUWien,
HypoOberosterreichSalzburgSteiermark,
HypoTirolBankAg,
HypoVorarlbergBankAg,
HypoBankBurgenlandAktiengesellschaft,
Ing,
Knab,
MarchfelderBank,
OberbankAg,
RaiffeisenBankengruppeOsterreich,
SchoellerbankAg,
SpardaBankWien,
VolksbankGruppe,
VolkskreditbankAg,
VrBankBraunau,
Moneyou,
Rabobank,
Regiobank,
Revolut,
SnsBank,
TriodosBank,
VanLanschot,
PlusBank,
EtransferPocztowy24,
BankiSpbdzielcze,
BankNowyBfgSa,
GetinBank,
Blik,
NoblePay,
#[serde(rename = "ideabank")]
IdeaBank,
|
crates/hyperswitch_connectors/src/connectors/stripe/transformers.rs#chunk0
|
hyperswitch_connectors
|
chunk
| null | null | null | 8,185
| null | null | null | null | null | null | null |
// Struct: RefundSyncResponse
// File: crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct RefundSyncResponse
|
crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
RefundSyncResponse
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// Function: new
// File: crates/router/src/types/domain/user/decision_manager.rs
// Module: router
pub fn new(
token: auth::UserFromSinglePurposeToken,
current_flow: UserFlow,
) -> UserResult<Self>
|
crates/router/src/types/domain/user/decision_manager.rs
|
router
|
function_signature
| null | null | null | 53
|
new
| null | null | null | null | null | null |
// Struct: SerializeStructVariant
// File: crates/masking/src/serde.rs
// Module: masking
// Implementations: 0
pub struct SerializeStructVariant<T: Serializer>
|
crates/masking/src/serde.rs
|
masking
|
struct_definition
|
SerializeStructVariant
| 0
|
[] | 39
| null | null | null | null | null | null | null |
// Implementation: impl api::RefundSync for for Archipel
// File: crates/hyperswitch_connectors/src/connectors/archipel.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::RefundSync for for Archipel
|
crates/hyperswitch_connectors/src/connectors/archipel.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Archipel
|
api::RefundSync for
| 0
| 0
| null | null |
// Implementation: impl BillingConnectorPaymentsSyncFlowRouterData
// File: crates/router/src/core/webhooks/recovery_incoming.rs
// Module: router
// Methods: 2 total (0 public)
impl BillingConnectorPaymentsSyncFlowRouterData
|
crates/router/src/core/webhooks/recovery_incoming.rs
|
router
|
impl_block
| null | null | null | 50
| null |
BillingConnectorPaymentsSyncFlowRouterData
| null | 2
| 0
| null | null |
// Function: get_irrelevant_id
// File: crates/common_utils/src/id_type/payment.rs
// Module: common_utils
// Documentation: Get payment id in the format of irrelevant_payment_id_in_{flow}
pub fn get_irrelevant_id(flow: &str) -> Self
|
crates/common_utils/src/id_type/payment.rs
|
common_utils
|
function_signature
| null | null | null | 56
|
get_irrelevant_id
| null | null | null | null | null | null |
// Struct: SamsungPayTokenizedCard
// File: crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct SamsungPayTokenizedCard
|
crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
SamsungPayTokenizedCard
| 0
|
[] | 53
| null | null | null | null | null | null | null |
// Struct: BankOfAmericaRefundResponse
// File: crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct BankOfAmericaRefundResponse
|
crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
BankOfAmericaRefundResponse
| 0
|
[] | 56
| null | null | null | null | null | null | null |
// Function: generic_find_one_optional
// File: crates/diesel_models/src/query/generics.rs
// Module: diesel_models
pub fn generic_find_one_optional<T, P, R>(
conn: &PgPooledConn,
predicate: P,
) -> StorageResult<Option<R>>
where
T: FilterDsl<P> + HasTable<Table = T> + Table + 'static,
Filter<T, P>: LoadQuery<'static, PgConnection, R> + QueryFragment<Pg> + Send + 'static,
R: Send + 'static,
|
crates/diesel_models/src/query/generics.rs
|
diesel_models
|
function_signature
| null | null | null | 121
|
generic_find_one_optional
| null | null | null | null | null | null |
// Function: update_subscription_entry
// File: crates/diesel_models/src/query/subscription.rs
// Module: diesel_models
pub fn update_subscription_entry(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
id: String,
subscription_update: SubscriptionUpdate,
) -> StorageResult<Self>
|
crates/diesel_models/src/query/subscription.rs
|
diesel_models
|
function_signature
| null | null | null | 74
|
update_subscription_entry
| null | null | null | null | null | null |
// Function: mock_call_to_locker_hs
// File: crates/router/src/core/payment_methods/cards.rs
// Module: router
// Documentation: Mock api for local testing
pub fn mock_call_to_locker_hs(
db: &dyn db::StorageInterface,
card_id: &str,
payload: &payment_methods::StoreLockerReq,
card_cvc: Option<String>,
payment_method_id: Option<String>,
customer_id: Option<&id_type::CustomerId>,
) -> errors::CustomResult<payment_methods::StoreCardResp, errors::VaultError>
|
crates/router/src/core/payment_methods/cards.rs
|
router
|
function_signature
| null | null | null | 119
|
mock_call_to_locker_hs
| null | null | null | null | null | null |
// Struct: StaxTokenResponse
// File: crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct StaxTokenResponse
|
crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
StaxTokenResponse
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// Function: set_metadata
// File: crates/router/src/core/user/dashboard_metadata.rs
// Module: router
pub fn set_metadata(
state: SessionState,
user: UserFromToken,
request: api::SetMetaDataRequest,
_req_state: ReqState,
) -> UserResponse<()>
|
crates/router/src/core/user/dashboard_metadata.rs
|
router
|
function_signature
| null | null | null | 63
|
set_metadata
| null | null | null | null | null | null |
// Function: list_blocklist_entries_for_merchant
// File: crates/router/src/core/blocklist/utils.rs
// Module: router
pub fn list_blocklist_entries_for_merchant(
state: &SessionState,
merchant_id: &common_utils::id_type::MerchantId,
query: api_blocklist::ListBlocklistQuery,
) -> RouterResult<Vec<api_blocklist::BlocklistResponse>>
|
crates/router/src/core/blocklist/utils.rs
|
router
|
function_signature
| null | null | null | 85
|
list_blocklist_entries_for_merchant
| null | null | null | null | null | null |
// Function: call_frm_before_connector_call
// File: crates/router/src/core/fraud_check.rs
// Module: router
pub fn call_frm_before_connector_call<F, Req, D>(
operation: &BoxedOperation<'_, F, Req, D>,
merchant_context: &domain::MerchantContext,
payment_data: &mut D,
state: &SessionState,
frm_info: &mut Option<FrmInfo<F, D>>,
customer: &Option<domain::Customer>,
should_continue_transaction: &mut bool,
should_continue_capture: &mut bool,
) -> RouterResult<Option<FrmConfigsObject>>
where
F: Send + Clone,
D: payments::OperationSessionGetters<F>
+ payments::OperationSessionSetters<F>
+ Send
+ Sync
+ Clone,
|
crates/router/src/core/fraud_check.rs
|
router
|
function_signature
| null | null | null | 173
|
call_frm_before_connector_call
| null | null | null | null | null | null |
// Struct: ConfirmSubscriptionRequest
// File: crates/api_models/src/subscription.rs
// Module: api_models
// Implementations: 2
// Traits: ApiEventMetric
pub struct ConfirmSubscriptionRequest
|
crates/api_models/src/subscription.rs
|
api_models
|
struct_definition
|
ConfirmSubscriptionRequest
| 2
|
[
"ApiEventMetric"
] | 43
| null | null | null | null | null | null | null |
// Struct: PaysafeCard
// File: crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PaysafeCard
|
crates/hyperswitch_connectors/src/connectors/paysafe/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PaysafeCard
| 0
|
[] | 48
| null | null | null | null | null | null | null |
// Function: new
// File: crates/external_services/src/email.rs
// Module: external_services
// Documentation: Create a new Instance of IntermediateString using a string
pub fn new(inner: String) -> Self
|
crates/external_services/src/email.rs
|
external_services
|
function_signature
| null | null | null | 45
|
new
| null | null | null | null | null | null |
// Implementation: impl api::ConnectorAccessToken for for Payu
// File: crates/hyperswitch_connectors/src/connectors/payu.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::ConnectorAccessToken for for Payu
|
crates/hyperswitch_connectors/src/connectors/payu.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 57
| null |
Payu
|
api::ConnectorAccessToken for
| 0
| 0
| null | null |
// Struct: AmazonPayWalletData
// File: crates/hyperswitch_domain_models/src/payment_method_data.rs
// Module: hyperswitch_domain_models
// Implementations: 0
pub struct AmazonPayWalletData
|
crates/hyperswitch_domain_models/src/payment_method_data.rs
|
hyperswitch_domain_models
|
struct_definition
|
AmazonPayWalletData
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Implementation: impl fmt::Display for for BokuPaymentType
// File: crates/hyperswitch_connectors/src/connectors/boku/transformers.rs
// Module: hyperswitch_connectors
// Methods: 1 total (0 public)
impl fmt::Display for for BokuPaymentType
|
crates/hyperswitch_connectors/src/connectors/boku/transformers.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 62
| null |
BokuPaymentType
|
fmt::Display for
| 1
| 0
| null | null |
// Struct: OpayoPaymentsRequest
// File: crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct OpayoPaymentsRequest
|
crates/hyperswitch_connectors/src/connectors/opayo/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
OpayoPaymentsRequest
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// Struct: MifinityPaymentsRequest
// File: crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct MifinityPaymentsRequest
|
crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
MifinityPaymentsRequest
| 0
|
[] | 52
| null | null | null | null | null | null | null |
// Function: save_payout_data_to_locker
// File: crates/router/src/core/payouts/helpers.rs
// Module: router
pub fn save_payout_data_to_locker(
state: &SessionState,
payout_data: &mut PayoutData,
customer_id: &id_type::CustomerId,
payout_method_data: &api::PayoutMethodData,
connector_mandate_details: Option<serde_json::Value>,
merchant_context: &domain::MerchantContext,
) -> RouterResult<()>
|
crates/router/src/core/payouts/helpers.rs
|
router
|
function_signature
| null | null | null | 108
|
save_payout_data_to_locker
| null | null | null | null | null | null |
// Implementation: impl PaymentResourceUpdateStatus
// File: crates/common_enums/src/enums.rs
// Module: common_enums
// Methods: 1 total (1 public)
impl PaymentResourceUpdateStatus
|
crates/common_enums/src/enums.rs
|
common_enums
|
impl_block
| null | null | null | 43
| null |
PaymentResourceUpdateStatus
| null | 1
| 1
| null | null |
// Struct: ThreedsecureioPostAuthenticationRequest
// File: crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct ThreedsecureioPostAuthenticationRequest
|
crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
ThreedsecureioPostAuthenticationRequest
| 0
|
[] | 57
| null | null | null | null | null | null | null |
// Implementation: impl MerchantReferenceIdForCustomer
// File: crates/router/src/core/customers.rs
// Module: router
// Methods: 2 total (0 public)
impl MerchantReferenceIdForCustomer
|
crates/router/src/core/customers.rs
|
router
|
impl_block
| null | null | null | 42
| null |
MerchantReferenceIdForCustomer
| null | 2
| 0
| null | null |
// Struct: GetnetCaptureResponse
// File: crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct GetnetCaptureResponse
|
crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
GetnetCaptureResponse
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// File: crates/router/src/services/jwt.rs
// Module: router
// Public functions: 2
use common_utils::errors::CustomResult;
use error_stack::ResultExt;
use jsonwebtoken::{encode, EncodingKey, Header};
use masking::PeekInterface;
use crate::{configs::Settings, core::errors::UserErrors};
pub fn generate_exp(
exp_duration: std::time::Duration,
) -> CustomResult<std::time::Duration, UserErrors> {
std::time::SystemTime::now()
.checked_add(exp_duration)
.ok_or(UserErrors::InternalServerError)?
.duration_since(std::time::UNIX_EPOCH)
.change_context(UserErrors::InternalServerError)
}
pub async fn generate_jwt<T>(
claims_data: &T,
settings: &Settings,
) -> CustomResult<String, UserErrors>
where
T: serde::ser::Serialize,
{
let jwt_secret = &settings.secrets.get_inner().jwt_secret;
encode(
&Header::default(),
claims_data,
&EncodingKey::from_secret(jwt_secret.peek().as_bytes()),
)
.change_context(UserErrors::InternalServerError)
}
|
crates/router/src/services/jwt.rs
|
router
|
full_file
| null | null | null | 244
| null | null | null | null | null | null | null |
// Implementation: impl api::PaymentSession for for Bitpay
// File: crates/hyperswitch_connectors/src/connectors/bitpay.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentSession for for Bitpay
|
crates/hyperswitch_connectors/src/connectors/bitpay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 57
| null |
Bitpay
|
api::PaymentSession for
| 0
| 0
| null | null |
// Struct: PaymentMethodUpdateInternal
// File: crates/diesel_models/src/payment_method.rs
// Module: diesel_models
// Implementations: 2
pub struct PaymentMethodUpdateInternal
|
crates/diesel_models/src/payment_method.rs
|
diesel_models
|
struct_definition
|
PaymentMethodUpdateInternal
| 2
|
[] | 39
| null | null | null | null | null | null | null |
// Struct: NexixpayMandateResponse
// File: crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct NexixpayMandateResponse
|
crates/hyperswitch_connectors/src/connectors/nexixpay/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
NexixpayMandateResponse
| 0
|
[] | 57
| null | null | null | null | null | null | null |
// Implementation: impl api::Refund for for Bluecode
// File: crates/hyperswitch_connectors/src/connectors/bluecode.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::Refund for for Bluecode
|
crates/hyperswitch_connectors/src/connectors/bluecode.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 57
| null |
Bluecode
|
api::Refund for
| 0
| 0
| null | null |
// Function: create_payment_method_proxy_card_core
// File: crates/router/src/core/payment_methods.rs
// Module: router
pub fn create_payment_method_proxy_card_core(
state: &SessionState,
req: api::PaymentMethodCreate,
merchant_context: &domain::MerchantContext,
profile: &domain::Profile,
merchant_id: &id_type::MerchantId,
customer_id: &id_type::GlobalCustomerId,
payment_method_id: id_type::GlobalPaymentMethodId,
payment_method_billing_address: Option<
Encryptable<hyperswitch_domain_models::address::Address>,
>,
) -> RouterResult<(api::PaymentMethodResponse, domain::PaymentMethod)>
|
crates/router/src/core/payment_methods.rs
|
router
|
function_signature
| null | null | null | 145
|
create_payment_method_proxy_card_core
| null | null | null | null | null | null |
// Function: get_entity_id
// File: crates/router/src/services/email/types.rs
// Module: router
pub fn get_entity_id(&self) -> &str
|
crates/router/src/services/email/types.rs
|
router
|
function_signature
| null | null | null | 34
|
get_entity_id
| null | null | null | null | null | null |
// Implementation: impl GetCaptureMethod for for PaymentsCancelData
// File: crates/hyperswitch_connectors/src/connectors/aci/transformers.rs
// Module: hyperswitch_connectors
// Methods: 1 total (0 public)
impl GetCaptureMethod for for PaymentsCancelData
|
crates/hyperswitch_connectors/src/connectors/aci/transformers.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 60
| null |
PaymentsCancelData
|
GetCaptureMethod for
| 1
| 0
| null | null |
// Function: supports_create_recipient
// File: crates/common_enums/src/connector_enums.rs
// Module: common_enums
pub fn supports_create_recipient(self, payout_method: Option<PayoutType>) -> bool
|
crates/common_enums/src/connector_enums.rs
|
common_enums
|
function_signature
| null | null | null | 47
|
supports_create_recipient
| null | null | null | null | null | null |
FieldType::UserBillingName,
)
.to_tuple(),
RequiredField::BacsBankDebitAccountNumber.to_tuple(),
RequiredField::BacsBankDebitSortCode.to_tuple(),
]),
},
),
]),
),
(
enums::PaymentMethodType::Becs,
connectors(vec![
(
Connector::Stripe,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::new(),
common: HashMap::from([
RequiredField::BillingFirstName(
"billing_first_name",
FieldType::UserBillingName,
)
.to_tuple(),
RequiredField::BillingLastName(
"owner_name",
FieldType::UserBillingName,
)
.to_tuple(),
RequiredField::BecsBankDebitAccountNumber.to_tuple(),
RequiredField::BecsBankDebitBsbNumber.to_tuple(),
RequiredField::BillingEmail.to_tuple(),
]),
},
),
(
Connector::Adyen,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::new(),
common: HashMap::from([
RequiredField::BillingFirstName(
"owner_name",
FieldType::UserBillingName,
)
.to_tuple(),
RequiredField::BillingLastName(
"owner_name",
FieldType::UserBillingName,
)
.to_tuple(),
RequiredField::BecsBankDebitAccountNumber.to_tuple(),
RequiredField::BecsBankDebitSortCode.to_tuple(),
]),
},
),
]),
),
])
}
#[cfg(feature = "v1")]
fn get_bank_transfer_required_fields() -> HashMap<enums::PaymentMethodType, ConnectorFields> {
HashMap::from([
(
enums::PaymentMethodType::Multibanco,
connectors(vec![(
Connector::Stripe,
fields(vec![], vec![RequiredField::BillingEmail], vec![]),
)]),
),
(
enums::PaymentMethodType::LocalBankTransfer,
connectors(vec![(
Connector::Zsl,
fields(
vec![],
vec![
RequiredField::BillingAddressCountries(vec!["CN"]),
RequiredField::BillingAddressCity,
],
vec![],
),
)]),
),
(
enums::PaymentMethodType::Ach,
connectors(vec![(
Connector::Checkbook,
fields(
vec![],
vec![],
vec![
RequiredField::BillingUserFirstName,
RequiredField::BillingUserLastName,
RequiredField::BillingEmail,
RequiredField::Description,
],
),
)]),
),
(
enums::PaymentMethodType::Pix,
connectors(vec![
(
Connector::Itaubank,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::new(),
common: HashMap::from([
RequiredField::PixKey.to_tuple(),
RequiredField::PixCnpj.to_tuple(),
RequiredField::PixCpf.to_tuple(),
RequiredField::BillingUserFirstName.to_tuple(),
RequiredField::BillingUserLastName.to_tuple(),
]),
},
),
(Connector::Adyen, fields(vec![], vec![], vec![])),
(
Connector::Santander,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::new(),
common: HashMap::from([
RequiredField::BillingUserFirstName.to_tuple(),
RequiredField::BillingUserLastName.to_tuple(),
]),
},
),
(
Connector::Bluecode,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::new(),
common: HashMap::from([
RequiredField::BillingUserFirstName.to_tuple(),
RequiredField::BillingUserLastName.to_tuple(),
RequiredField::BillingCountries(vec![
"AT", "BE", "BG", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE",
"GR", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT",
"RO", "SK", "SI", "ES", "SE", "IS", "LI", "NO",
])
.to_tuple(),
RequiredField::BillingAddressCity.to_tuple(),
RequiredField::BillingAddressLine1.to_tuple(),
RequiredField::BillingAddressZip.to_tuple(),
]),
},
),
(
Connector::Facilitapay,
RequiredFieldFinal {
mandate: HashMap::new(),
non_mandate: HashMap::new(),
common: HashMap::from([
RequiredField::PixSourceBankAccountId.to_tuple(),
RequiredField::BillingAddressCountries(vec!["BR"]).to_tuple(),
RequiredField::BillingUserFirstName.to_tuple(),
RequiredField::BillingUserLastName.to_tuple(),
RequiredField::PixCpf.to_tuple(),
]),
},
),
]),
),
(
enums::PaymentMethodType::PermataBankTransfer,
connectors(vec![(
Connector::Adyen,
fields(vec![], billing_email_billing_name(), vec![]),
)]),
),
(
enums::PaymentMethodType::BcaBankTransfer,
connectors(vec![(
Connector::Adyen,
fields(vec![], billing_email_billing_name(), vec![]),
)]),
),
(
enums::PaymentMethodType::BniVa,
connectors(vec![(
Connector::Adyen,
fields(vec![], billing_email_billing_name(), vec![]),
)]),
),
(
enums::PaymentMethodType::BriVa,
connectors(vec![(
Connector::Adyen,
fields(vec![], billing_email_billing_name(), vec![]),
)]),
),
(
enums::PaymentMethodType::CimbVa,
connectors(vec![(
Connector::Adyen,
fields(vec![], billing_email_billing_name(), vec![]),
)]),
),
(
enums::PaymentMethodType::DanamonVa,
connectors(vec![(
Connector::Adyen,
fields(vec![], billing_email_billing_name(), vec![]),
)]),
),
(
enums::PaymentMethodType::MandiriVa,
connectors(vec![(
Connector::Adyen,
fields(vec![], billing_email_billing_name(), vec![]),
)]),
),
(
enums::PaymentMethodType::SepaBankTransfer,
connectors(vec![
(
Connector::Stripe,
fields(
vec![],
vec![],
vec![
RequiredField::BillingEmail,
RequiredField::BillingUserFirstName,
RequiredField::BillingUserLastName,
RequiredField::BillingAddressCountries(vec![
"BE", "DE", "ES", "FR", "IE", "NL",
]),
],
),
),
(
Connector::Trustpay,
fields(
vec![],
vec![],
vec![
RequiredField::Email,
RequiredField::BillingFirstName(
"billing_first_name",
FieldType::UserBillingName,
),
RequiredField::BillingLastName(
"billing_last_name",
FieldType::UserBillingName,
),
RequiredField::BillingAddressLine1,
RequiredField::BillingAddressCity,
RequiredField::BillingAddressZip,
RequiredField::BillingAddressCountries(vec!["ALL"]),
],
),
),
]),
),
(
enums::PaymentMethodType::InstantBankTransfer,
connectors(vec![(
Connector::Trustpay,
fields(
vec![],
vec![],
vec![
RequiredField::Email,
RequiredField::BillingFirstName(
"billing_first_name",
FieldType::UserBillingName,
),
RequiredField::BillingLastName(
"billing_last_name",
FieldType::UserBillingName,
),
RequiredField::BillingAddressLine1,
RequiredField::BillingAddressCity,
RequiredField::BillingAddressZip,
RequiredField::BillingAddressCountries(vec!["ALL"]),
],
),
)]),
),
(
enums::PaymentMethodType::InstantBankTransferFinland,
connectors(vec![(
Connector::Trustpay,
fields(
vec![],
vec![],
vec![
RequiredField::Email,
RequiredField::BillingFirstName(
"billing_first_name",
FieldType::UserBillingName,
),
RequiredField::BillingLastName(
"billing_last_name",
FieldType::UserBillingName,
),
RequiredField::BillingAddressLine1,
RequiredField::BillingAddressCity,
RequiredField::BillingAddressZip,
RequiredField::BillingAddressCountries(vec!["FI"]),
],
),
)]),
),
(
enums::PaymentMethodType::InstantBankTransferPoland,
connectors(vec![(
Connector::Trustpay,
fields(
vec![],
vec![],
vec![
RequiredField::Email,
RequiredField::BillingFirstName(
"billing_first_name",
FieldType::UserBillingName,
),
RequiredField::BillingLastName(
"billing_last_name",
FieldType::UserBillingName,
),
RequiredField::BillingAddressLine1,
RequiredField::BillingAddressCity,
RequiredField::BillingAddressZip,
RequiredField::BillingAddressCountries(vec!["PL"]),
],
),
)]),
),
(
enums::PaymentMethodType::Bacs,
connectors(vec![(
Connector::Stripe,
fields(vec![], vec![], billing_email_name()),
)]),
),
])
}
#[test]
fn test_required_fields_to_json() {
#![allow(clippy::unwrap_used)]
// Test billing fields
let billing_fields = get_billing_required_fields();
// let billing_json = serde_json::to_string_pretty(&billing_fields)?;
// Verify billing fields have expected entries
assert!(billing_fields.contains_key("billing.address.first_name"));
assert!(billing_fields.contains_key("billing.address.last_name"));
assert!(billing_fields.contains_key("billing.address.city"));
assert!(billing_fields.contains_key("billing.address.zip"));
assert!(billing_fields.contains_key("billing.email"));
// Verify specific billing field properties
let billing_first_name = billing_fields.get("billing.address.first_name").unwrap();
assert_eq!(billing_first_name.display_name, "billing_first_name");
assert!(matches!(
billing_first_name.field_type,
FieldType::UserBillingName
));
// Test shipping fields
let shipping_fields = get_shipping_required_fields();
// let shipping_json = serde_json::to_string_pretty(&shipping_fields)?;
// Verify shipping fields have expected entries
assert!(shipping_fields.contains_key("shipping.address.first_name"));
assert!(shipping_fields.contains_key("shipping.address.last_name"));
assert!(shipping_fields.contains_key("shipping.address.city"));
assert!(shipping_fields.contains_key("shipping.address.zip"));
assert!(shipping_fields.contains_key("shipping.email"));
// Verify specific shipping field properties
let shipping_address_line1 = shipping_fields.get("shipping.address.line1").unwrap();
assert_eq!(shipping_address_line1.display_name, "line1");
assert!(matches!(
shipping_address_line1.field_type,
FieldType::UserShippingAddressLine1
));
#[cfg(feature = "v1")]
{
let default_fields = RequiredFields::default();
// let default_json = serde_json::to_string_pretty(&default_fields.0)?;
// Check default fields for payment methods
assert!(default_fields.0.contains_key(&enums::PaymentMethod::Card));
assert!(default_fields.0.contains_key(&enums::PaymentMethod::Wallet));
// Verify card payment method types
if let Some(card_method) = default_fields.0.get(&enums::PaymentMethod::Card) {
assert!(card_method
.0
.contains_key(&enums::PaymentMethodType::Credit));
assert!(card_method.0.contains_key(&enums::PaymentMethodType::Debit));
}
// Verify specific connector fields
if let Some(card_method) = default_fields.0.get(&enums::PaymentMethod::Card) {
if let Some(credit_type) = card_method.0.get(&enums::PaymentMethodType::Credit) {
// Check if Stripe connector exists
assert!(credit_type.fields.contains_key(&Connector::Stripe));
// Verify Stripe required fields
if let Some(stripe_fields) = credit_type.fields.get(&Connector::Stripe) {
// Check that card_basic fields are in "common" fields for Stripe
assert!(stripe_fields
.common
.contains_key("payment_method_data.card.card_number"));
assert!(stripe_fields
.common
.contains_key("payment_method_data.card.card_exp_month"));
assert!(stripe_fields
.common
.contains_key("payment_method_data.card.card_exp_year"));
assert!(stripe_fields
.common
.contains_key("payment_method_data.card.card_cvc"));
}
}
}
// print the result of default required fields as json in new file
serde_json::to_writer_pretty(
std::fs::File::create("default_required_fields.json").unwrap(),
&default_fields,
)
.unwrap();
}
}
|
crates/payment_methods/src/configs/payment_connector_required_fields.rs#chunk3
|
payment_methods
|
chunk
| null | null | null | 2,809
| null | null | null | null | null | null | null |
// Struct: FacilitapayWebhookBody
// File: crates/hyperswitch_connectors/src/connectors/facilitapay/responses.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct FacilitapayWebhookBody
|
crates/hyperswitch_connectors/src/connectors/facilitapay/responses.rs
|
hyperswitch_connectors
|
struct_definition
|
FacilitapayWebhookBody
| 0
|
[] | 57
| null | null | null | null | null | null | null |
// Implementation: impl ConnectorValidation for for Sift
// File: crates/hyperswitch_connectors/src/connectors/sift.rs
// Module: hyperswitch_connectors
// Methods: 2 total (0 public)
impl ConnectorValidation for for Sift
|
crates/hyperswitch_connectors/src/connectors/sift.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 53
| null |
Sift
|
ConnectorValidation for
| 2
| 0
| null | null |
// Struct: RedsysOperationsResponse
// File: crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct RedsysOperationsResponse
|
crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
RedsysOperationsResponse
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// Struct: ParentInfo
// File: crates/api_models/src/user_role.rs
// Module: api_models
// Implementations: 0
pub struct ParentInfo
|
crates/api_models/src/user_role.rs
|
api_models
|
struct_definition
|
ParentInfo
| 0
|
[] | 34
| null | null | null | null | null | null | null |
// Function: server
// File: crates/router/src/routes/app.rs
// Module: router
pub fn server(state: AppState) -> Scope
|
crates/router/src/routes/app.rs
|
router
|
function_signature
| null | null | null | 29
|
server
| null | null | null | null | null | null |
// Implementation: impl ProcessTrackerNew
// File: crates/diesel_models/src/query/process_tracker.rs
// Module: diesel_models
// Methods: 1 total (0 public)
impl ProcessTrackerNew
|
crates/diesel_models/src/query/process_tracker.rs
|
diesel_models
|
impl_block
| null | null | null | 41
| null |
ProcessTrackerNew
| null | 1
| 0
| null | null |
// Struct: VersionData
// File: crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct VersionData
|
crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
VersionData
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Implementation: impl Responder
// File: crates/router/src/routes/payments.rs
// Module: router
// Methods: 0 total (0 public)
impl Responder
|
crates/router/src/routes/payments.rs
|
router
|
impl_block
| null | null | null | 36
| null |
Responder
| null | 0
| 0
| null | null |
// Implementation: impl ConnectorCommon for for Placetopay
// File: crates/hyperswitch_connectors/src/connectors/placetopay.rs
// Module: hyperswitch_connectors
// Methods: 5 total (0 public)
impl ConnectorCommon for for Placetopay
|
crates/hyperswitch_connectors/src/connectors/placetopay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Placetopay
|
ConnectorCommon for
| 5
| 0
| null | null |
// Function: from_bytes
// File: crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
// Module: hyperswitch_connectors
pub fn from_bytes(bytes: &[u8]) -> Self
|
crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
|
hyperswitch_connectors
|
function_signature
| null | null | null | 46
|
from_bytes
| null | null | null | null | null | null |
// Struct: Avs
// File: crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct Avs
|
crates/hyperswitch_connectors/src/connectors/cybersource/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
Avs
| 0
|
[] | 47
| null | null | null | null | null | null | null |
// Implementation: impl api::Refund for for Loonio
// File: crates/hyperswitch_connectors/src/connectors/loonio.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::Refund for for Loonio
|
crates/hyperswitch_connectors/src/connectors/loonio.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 58
| null |
Loonio
|
api::Refund for
| 0
| 0
| null | null |
// Struct: VantivDisputeErrors
// File: crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct VantivDisputeErrors
|
crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
VantivDisputeErrors
| 0
|
[] | 55
| null | null | null | null | null | null | null |
// Function: server
// File: crates/router/src/routes/app.rs
// Module: router
pub fn server(state: AppState) -> Scope
|
crates/router/src/routes/app.rs
|
router
|
function_signature
| null | null | null | 29
|
server
| null | null | null | null | null | null |
impl<T, Req: Clone, Resp: Clone> RouterDataConversion<T, Req, Resp> for VaultConnectorFlowData {
fn from_old_router_data(
old_router_data: &RouterData<T, Req, Resp>,
) -> CustomResult<RouterDataV2<T, Self, Req, Resp>, ConnectorError>
where
Self: Sized,
{
let resource_common_data = Self {
merchant_id: old_router_data.merchant_id.clone(),
};
Ok(RouterDataV2 {
flow: std::marker::PhantomData,
tenant_id: old_router_data.tenant_id.clone(),
resource_common_data,
connector_auth_type: old_router_data.connector_auth_type.clone(),
request: old_router_data.request.clone(),
response: old_router_data.response.clone(),
})
}
fn to_old_router_data(
new_router_data: RouterDataV2<T, Self, Req, Resp>,
) -> CustomResult<RouterData<T, Req, Resp>, ConnectorError>
where
Self: Sized,
{
let router_data = get_default_router_data(
new_router_data.tenant_id.clone(),
"VaultConnector",
new_router_data.request,
new_router_data.response,
);
Ok(RouterData {
connector_auth_type: new_router_data.connector_auth_type.clone(),
..router_data
})
}
}
impl<T, Req: Clone, Resp: Clone> RouterDataConversion<T, Req, Resp> for ExternalVaultProxyFlowData {
fn from_old_router_data(
old_router_data: &RouterData<T, Req, Resp>,
) -> CustomResult<RouterDataV2<T, Self, Req, Resp>, ConnectorError>
where
Self: Sized,
{
let resource_common_data = Self {
merchant_id: old_router_data.merchant_id.clone(),
customer_id: old_router_data.customer_id.clone(),
connector_customer: old_router_data.connector_customer.clone(),
payment_id: old_router_data.payment_id.clone(),
attempt_id: old_router_data.attempt_id.clone(),
status: old_router_data.status,
payment_method: old_router_data.payment_method,
description: old_router_data.description.clone(),
address: old_router_data.address.clone(),
auth_type: old_router_data.auth_type,
connector_meta_data: old_router_data.connector_meta_data.clone(),
amount_captured: old_router_data.amount_captured,
minor_amount_captured: old_router_data.minor_amount_captured,
access_token: old_router_data.access_token.clone(),
session_token: old_router_data.session_token.clone(),
reference_id: old_router_data.reference_id.clone(),
payment_method_token: old_router_data.payment_method_token.clone(),
recurring_mandate_payment_data: old_router_data.recurring_mandate_payment_data.clone(),
preprocessing_id: old_router_data.preprocessing_id.clone(),
payment_method_balance: old_router_data.payment_method_balance.clone(),
connector_api_version: old_router_data.connector_api_version.clone(),
connector_request_reference_id: old_router_data.connector_request_reference_id.clone(),
test_mode: old_router_data.test_mode,
connector_http_status_code: old_router_data.connector_http_status_code,
external_latency: old_router_data.external_latency,
apple_pay_flow: old_router_data.apple_pay_flow.clone(),
connector_response: old_router_data.connector_response.clone(),
payment_method_status: old_router_data.payment_method_status,
};
Ok(RouterDataV2 {
flow: std::marker::PhantomData,
tenant_id: old_router_data.tenant_id.clone(),
resource_common_data,
connector_auth_type: old_router_data.connector_auth_type.clone(),
request: old_router_data.request.clone(),
response: old_router_data.response.clone(),
})
}
fn to_old_router_data(
new_router_data: RouterDataV2<T, Self, Req, Resp>,
) -> CustomResult<RouterData<T, Req, Resp>, ConnectorError>
where
Self: Sized,
{
let Self {
merchant_id,
customer_id,
connector_customer,
payment_id,
attempt_id,
status,
payment_method,
description,
address,
auth_type,
connector_meta_data,
amount_captured,
minor_amount_captured,
access_token,
session_token,
reference_id,
payment_method_token,
recurring_mandate_payment_data,
preprocessing_id,
payment_method_balance,
connector_api_version,
connector_request_reference_id,
test_mode,
connector_http_status_code,
external_latency,
apple_pay_flow,
connector_response,
payment_method_status,
} = new_router_data.resource_common_data;
let mut router_data = get_default_router_data(
new_router_data.tenant_id.clone(),
"external vault proxy",
new_router_data.request,
new_router_data.response,
);
router_data.merchant_id = merchant_id;
router_data.customer_id = customer_id;
router_data.connector_customer = connector_customer;
router_data.payment_id = payment_id;
router_data.attempt_id = attempt_id;
router_data.status = status;
router_data.payment_method = payment_method;
router_data.description = description;
router_data.address = address;
router_data.auth_type = auth_type;
router_data.connector_meta_data = connector_meta_data;
router_data.amount_captured = amount_captured;
router_data.minor_amount_captured = minor_amount_captured;
router_data.access_token = access_token;
router_data.session_token = session_token;
router_data.reference_id = reference_id;
router_data.payment_method_token = payment_method_token;
router_data.recurring_mandate_payment_data = recurring_mandate_payment_data;
router_data.preprocessing_id = preprocessing_id;
router_data.payment_method_balance = payment_method_balance;
router_data.connector_api_version = connector_api_version;
router_data.connector_request_reference_id = connector_request_reference_id;
router_data.test_mode = test_mode;
router_data.connector_http_status_code = connector_http_status_code;
router_data.external_latency = external_latency;
router_data.apple_pay_flow = apple_pay_flow;
router_data.connector_response = connector_response;
router_data.payment_method_status = payment_method_status;
Ok(router_data)
}
}
|
crates/hyperswitch_interfaces/src/conversion_impls.rs#chunk1
|
hyperswitch_interfaces
|
chunk
| null | null | null | 1,306
| null | null | null | null | null | null | null |
// Function: from_config
// File: crates/storage_impl/src/lib.rs
// Module: storage_impl
pub fn from_config(
db_conf: T::Config,
tenant_config: &dyn config::TenantConfig,
encryption_key: StrongSecret<Vec<u8>>,
cache_store: Arc<RedisStore>,
inmemory_cache_stream: &str,
) -> error_stack::Result<Self, StorageError>
|
crates/storage_impl/src/lib.rs
|
storage_impl
|
function_signature
| null | null | null | 86
|
from_config
| null | null | null | null | null | null |
// Struct: CryptopayAuthType
// File: crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct CryptopayAuthType
|
crates/hyperswitch_connectors/src/connectors/cryptopay/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
CryptopayAuthType
| 0
|
[] | 53
| null | null | null | null | null | null | null |
// Struct: WorldlineAuthType
// File: crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct WorldlineAuthType
|
crates/hyperswitch_connectors/src/connectors/worldline/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
WorldlineAuthType
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// Implementation: impl CustomerUpdateInternal
// File: crates/diesel_models/src/customers.rs
// Module: diesel_models
// Methods: 1 total (1 public)
impl CustomerUpdateInternal
|
crates/diesel_models/src/customers.rs
|
diesel_models
|
impl_block
| null | null | null | 40
| null |
CustomerUpdateInternal
| null | 1
| 1
| null | null |
// Struct: RuleRequest
// File: crates/router/src/services/authentication/decision.rs
// Module: router
// Implementations: 0
pub struct RuleRequest
|
crates/router/src/services/authentication/decision.rs
|
router
|
struct_definition
|
RuleRequest
| 0
|
[] | 34
| null | null | null | null | null | null | null |
// File: crates/diesel_models/src/query/reverse_lookup.rs
// Module: diesel_models
// Public functions: 3
use diesel::{associations::HasTable, ExpressionMethods};
use super::generics;
use crate::{
reverse_lookup::{ReverseLookup, ReverseLookupNew},
schema::reverse_lookup::dsl,
PgPooledConn, StorageResult,
};
impl ReverseLookupNew {
pub async fn insert(self, conn: &PgPooledConn) -> StorageResult<ReverseLookup> {
generics::generic_insert(conn, self).await
}
pub async fn batch_insert(
reverse_lookups: Vec<Self>,
conn: &PgPooledConn,
) -> StorageResult<()> {
generics::generic_insert::<_, _, ReverseLookup>(conn, reverse_lookups).await?;
Ok(())
}
}
impl ReverseLookup {
pub async fn find_by_lookup_id(lookup_id: &str, conn: &PgPooledConn) -> StorageResult<Self> {
generics::generic_find_one::<<Self as HasTable>::Table, _, _>(
conn,
dsl::lookup_id.eq(lookup_id.to_owned()),
)
.await
}
}
|
crates/diesel_models/src/query/reverse_lookup.rs
|
diesel_models
|
full_file
| null | null | null | 250
| null | null | null | null | null | null | null |
// Struct: UserRoleUpdateInternal
// File: crates/diesel_models/src/user_role.rs
// Module: diesel_models
// Implementations: 0
pub struct UserRoleUpdateInternal
|
crates/diesel_models/src/user_role.rs
|
diesel_models
|
struct_definition
|
UserRoleUpdateInternal
| 0
|
[] | 37
| null | null | null | null | null | null | null |
// Implementation: impl api::RefundExecute for for Getnet
// File: crates/hyperswitch_connectors/src/connectors/getnet.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::RefundExecute for for Getnet
|
crates/hyperswitch_connectors/src/connectors/getnet.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Getnet
|
api::RefundExecute for
| 0
| 0
| null | null |
// Trait: PaymentFilterAnalytics
// File: crates/analytics/src/payments/filters.rs
// Module: analytics
pub trait PaymentFilterAnalytics: LoadRow<PaymentFilterRow>
|
crates/analytics/src/payments/filters.rs
|
analytics
|
trait_definition
| null | null | null | 38
| null | null |
PaymentFilterAnalytics
| null | null | null | null |
// Implementation: impl ConnectorSpecifications for for Paytm
// File: crates/hyperswitch_connectors/src/connectors/paytm.rs
// Module: hyperswitch_connectors
// Methods: 3 total (0 public)
impl ConnectorSpecifications for for Paytm
|
crates/hyperswitch_connectors/src/connectors/paytm.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 53
| null |
Paytm
|
ConnectorSpecifications for
| 3
| 0
| null | null |
// Struct: AuthReversal
// File: crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct AuthReversal
|
crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
AuthReversal
| 0
|
[] | 51
| null | null | null | null | null | null | null |
// Struct: BillTo
// File: crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct BillTo
|
crates/hyperswitch_connectors/src/connectors/barclaycard/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
BillTo
| 0
|
[] | 47
| null | null | null | null | null | null | null |
// Struct: PaypalVault
// File: crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PaypalVault
|
crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PaypalVault
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Implementation: impl api::Refund for for Nordea
// File: crates/hyperswitch_connectors/src/connectors/nordea.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::Refund for for Nordea
|
crates/hyperswitch_connectors/src/connectors/nordea.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 58
| null |
Nordea
|
api::Refund for
| 0
| 0
| null | null |
// Implementation: impl api::PaymentAuthorize for for Mifinity
// File: crates/hyperswitch_connectors/src/connectors/mifinity.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentAuthorize for for Mifinity
|
crates/hyperswitch_connectors/src/connectors/mifinity.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 60
| null |
Mifinity
|
api::PaymentAuthorize for
| 0
| 0
| null | null |
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
merchant_account: storage::MerchantAccountUpdate,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<domain::MerchantAccount, errors::StorageError> {
self.diesel_store
.update_specific_fields_in_merchant(state, merchant_id, merchant_account, key_store)
.await
}
async fn update_all_merchant_account(
&self,
merchant_account: storage::MerchantAccountUpdate,
) -> CustomResult<usize, errors::StorageError> {
self.diesel_store
.update_all_merchant_account(merchant_account)
.await
}
async fn find_merchant_account_by_publishable_key(
&self,
state: &KeyManagerState,
publishable_key: &str,
) -> CustomResult<(domain::MerchantAccount, domain::MerchantKeyStore), errors::StorageError>
{
self.diesel_store
.find_merchant_account_by_publishable_key(state, publishable_key)
.await
}
#[cfg(feature = "olap")]
async fn list_merchant_accounts_by_organization_id(
&self,
state: &KeyManagerState,
organization_id: &id_type::OrganizationId,
) -> CustomResult<Vec<domain::MerchantAccount>, errors::StorageError> {
self.diesel_store
.list_merchant_accounts_by_organization_id(state, organization_id)
.await
}
async fn delete_merchant_account_by_merchant_id(
&self,
merchant_id: &id_type::MerchantId,
) -> CustomResult<bool, errors::StorageError> {
self.diesel_store
.delete_merchant_account_by_merchant_id(merchant_id)
.await
}
#[cfg(feature = "olap")]
async fn list_multiple_merchant_accounts(
&self,
state: &KeyManagerState,
merchant_ids: Vec<id_type::MerchantId>,
) -> CustomResult<Vec<domain::MerchantAccount>, errors::StorageError> {
self.diesel_store
.list_multiple_merchant_accounts(state, merchant_ids)
.await
}
#[cfg(feature = "olap")]
async fn list_merchant_and_org_ids(
&self,
state: &KeyManagerState,
limit: u32,
offset: Option<u32>,
) -> CustomResult<Vec<(id_type::MerchantId, id_type::OrganizationId)>, errors::StorageError>
{
self.diesel_store
.list_merchant_and_org_ids(state, limit, offset)
.await
}
}
#[async_trait::async_trait]
impl ConnectorAccessToken for KafkaStore {
async fn get_access_token(
&self,
merchant_id: &id_type::MerchantId,
merchant_connector_id: &str,
) -> CustomResult<Option<AccessToken>, errors::StorageError> {
self.diesel_store
.get_access_token(merchant_id, merchant_connector_id)
.await
}
async fn set_access_token(
&self,
merchant_id: &id_type::MerchantId,
merchant_connector_id: &str,
access_token: AccessToken,
) -> CustomResult<(), errors::StorageError> {
self.diesel_store
.set_access_token(merchant_id, merchant_connector_id, access_token)
.await
}
}
#[async_trait::async_trait]
impl FileMetadataInterface for KafkaStore {
async fn insert_file_metadata(
&self,
file: storage::FileMetadataNew,
) -> CustomResult<storage::FileMetadata, errors::StorageError> {
self.diesel_store.insert_file_metadata(file).await
}
async fn find_file_metadata_by_merchant_id_file_id(
&self,
merchant_id: &id_type::MerchantId,
file_id: &str,
) -> CustomResult<storage::FileMetadata, errors::StorageError> {
self.diesel_store
.find_file_metadata_by_merchant_id_file_id(merchant_id, file_id)
.await
}
async fn delete_file_metadata_by_merchant_id_file_id(
&self,
merchant_id: &id_type::MerchantId,
file_id: &str,
) -> CustomResult<bool, errors::StorageError> {
self.diesel_store
.delete_file_metadata_by_merchant_id_file_id(merchant_id, file_id)
.await
}
async fn update_file_metadata(
&self,
this: storage::FileMetadata,
file_metadata: storage::FileMetadataUpdate,
) -> CustomResult<storage::FileMetadata, errors::StorageError> {
self.diesel_store
.update_file_metadata(this, file_metadata)
.await
}
}
#[async_trait::async_trait]
impl MerchantConnectorAccountInterface for KafkaStore {
async fn update_multiple_merchant_connector_accounts(
&self,
merchant_connector_accounts: Vec<(
domain::MerchantConnectorAccount,
storage::MerchantConnectorAccountUpdateInternal,
)>,
) -> CustomResult<(), errors::StorageError> {
self.diesel_store
.update_multiple_merchant_connector_accounts(merchant_connector_accounts)
.await
}
#[cfg(feature = "v1")]
async fn find_merchant_connector_account_by_merchant_id_connector_label(
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
connector: &str,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<domain::MerchantConnectorAccount, errors::StorageError> {
self.diesel_store
.find_merchant_connector_account_by_merchant_id_connector_label(
state,
merchant_id,
connector,
key_store,
)
.await
}
#[cfg(feature = "v1")]
async fn find_merchant_connector_account_by_merchant_id_connector_name(
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
connector_name: &str,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<Vec<domain::MerchantConnectorAccount>, errors::StorageError> {
self.diesel_store
.find_merchant_connector_account_by_merchant_id_connector_name(
state,
merchant_id,
connector_name,
key_store,
)
.await
}
#[cfg(feature = "v1")]
async fn find_merchant_connector_account_by_profile_id_connector_name(
&self,
state: &KeyManagerState,
profile_id: &id_type::ProfileId,
connector_name: &str,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<domain::MerchantConnectorAccount, errors::StorageError> {
self.diesel_store
.find_merchant_connector_account_by_profile_id_connector_name(
state,
profile_id,
connector_name,
key_store,
)
.await
}
async fn list_enabled_connector_accounts_by_profile_id(
&self,
state: &KeyManagerState,
profile_id: &id_type::ProfileId,
key_store: &domain::MerchantKeyStore,
connector_type: common_enums::ConnectorType,
) -> CustomResult<Vec<domain::MerchantConnectorAccount>, errors::StorageError> {
self.diesel_store
.list_enabled_connector_accounts_by_profile_id(
state,
profile_id,
key_store,
connector_type,
)
.await
}
async fn insert_merchant_connector_account(
&self,
state: &KeyManagerState,
t: domain::MerchantConnectorAccount,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<domain::MerchantConnectorAccount, errors::StorageError> {
self.diesel_store
.insert_merchant_connector_account(state, t, key_store)
.await
}
#[cfg(feature = "v1")]
async fn find_by_merchant_connector_account_merchant_id_merchant_connector_id(
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
merchant_connector_id: &id_type::MerchantConnectorAccountId,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<domain::MerchantConnectorAccount, errors::StorageError> {
self.diesel_store
.find_by_merchant_connector_account_merchant_id_merchant_connector_id(
state,
merchant_id,
merchant_connector_id,
key_store,
)
.await
}
#[cfg(feature = "v2")]
async fn find_merchant_connector_account_by_id(
&self,
state: &KeyManagerState,
id: &id_type::MerchantConnectorAccountId,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<domain::MerchantConnectorAccount, errors::StorageError> {
self.diesel_store
.find_merchant_connector_account_by_id(state, id, key_store)
.await
}
async fn find_merchant_connector_account_by_merchant_id_and_disabled_list(
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
get_disabled: bool,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<domain::MerchantConnectorAccounts, errors::StorageError> {
self.diesel_store
.find_merchant_connector_account_by_merchant_id_and_disabled_list(
state,
merchant_id,
get_disabled,
key_store,
)
.await
}
#[cfg(all(feature = "olap", feature = "v2"))]
async fn list_connector_account_by_profile_id(
&self,
state: &KeyManagerState,
profile_id: &id_type::ProfileId,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<Vec<domain::MerchantConnectorAccount>, errors::StorageError> {
self.diesel_store
.list_connector_account_by_profile_id(state, profile_id, key_store)
.await
}
async fn update_merchant_connector_account(
&self,
state: &KeyManagerState,
this: domain::MerchantConnectorAccount,
merchant_connector_account: storage::MerchantConnectorAccountUpdateInternal,
key_store: &domain::MerchantKeyStore,
) -> CustomResult<domain::MerchantConnectorAccount, errors::StorageError> {
self.diesel_store
.update_merchant_connector_account(state, this, merchant_connector_account, key_store)
.await
}
#[cfg(feature = "v1")]
async fn delete_merchant_connector_account_by_merchant_id_merchant_connector_id(
&self,
merchant_id: &id_type::MerchantId,
merchant_connector_id: &id_type::MerchantConnectorAccountId,
) -> CustomResult<bool, errors::StorageError> {
self.diesel_store
.delete_merchant_connector_account_by_merchant_id_merchant_connector_id(
merchant_id,
merchant_connector_id,
)
.await
}
#[cfg(feature = "v2")]
async fn delete_merchant_connector_account_by_id(
&self,
id: &id_type::MerchantConnectorAccountId,
) -> CustomResult<bool, errors::StorageError> {
self.diesel_store
.delete_merchant_connector_account_by_id(id)
.await
}
}
#[async_trait::async_trait]
impl QueueInterface for KafkaStore {
async fn fetch_consumer_tasks(
&self,
stream_name: &str,
group_name: &str,
consumer_name: &str,
) -> CustomResult<Vec<storage::ProcessTracker>, ProcessTrackerError> {
self.diesel_store
.fetch_consumer_tasks(stream_name, group_name, consumer_name)
.await
}
async fn consumer_group_create(
&self,
stream: &str,
group: &str,
id: &RedisEntryId,
) -> CustomResult<(), RedisError> {
self.diesel_store
.consumer_group_create(stream, group, id)
.await
}
async fn acquire_pt_lock(
&self,
tag: &str,
lock_key: &str,
lock_val: &str,
ttl: i64,
) -> CustomResult<bool, RedisError> {
self.diesel_store
.acquire_pt_lock(tag, lock_key, lock_val, ttl)
.await
}
async fn release_pt_lock(&self, tag: &str, lock_key: &str) -> CustomResult<bool, RedisError> {
self.diesel_store.release_pt_lock(tag, lock_key).await
}
async fn stream_append_entry(
&self,
stream: &str,
entry_id: &RedisEntryId,
fields: Vec<(&str, String)>,
) -> CustomResult<(), RedisError> {
self.diesel_store
.stream_append_entry(stream, entry_id, fields)
.await
}
async fn get_key(&self, key: &str) -> CustomResult<Vec<u8>, RedisError> {
self.diesel_store.get_key(key).await
}
}
#[async_trait::async_trait]
impl PaymentAttemptInterface for KafkaStore {
type Error = errors::StorageError;
#[cfg(feature = "v1")]
async fn insert_payment_attempt(
&self,
payment_attempt: storage::PaymentAttemptNew,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
let attempt = self
.diesel_store
.insert_payment_attempt(payment_attempt, storage_scheme)
.await?;
if let Err(er) = self
.kafka_producer
.log_payment_attempt(&attempt, None, self.tenant_id.clone())
.await
{
logger::error!(message="Failed to log analytics event for payment attempt {attempt:?}", error_message=?er)
}
Ok(attempt)
}
#[cfg(feature = "v2")]
async fn insert_payment_attempt(
&self,
key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
payment_attempt: storage::PaymentAttempt,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
let attempt = self
.diesel_store
.insert_payment_attempt(
key_manager_state,
merchant_key_store,
payment_attempt,
storage_scheme,
)
.await?;
if let Err(er) = self
.kafka_producer
.log_payment_attempt(&attempt, None, self.tenant_id.clone())
.await
{
logger::error!(message="Failed to log analytics event for payment attempt {attempt:?}", error_message=?er)
}
Ok(attempt)
}
#[cfg(feature = "v1")]
async fn update_payment_attempt_with_attempt_id(
&self,
this: storage::PaymentAttempt,
payment_attempt: storage::PaymentAttemptUpdate,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
let mut attempt = self
.diesel_store
.update_payment_attempt_with_attempt_id(
this.clone(),
payment_attempt.clone(),
storage_scheme,
)
.await?;
let debit_routing_savings = payment_attempt.get_debit_routing_savings();
attempt.set_debit_routing_savings(debit_routing_savings);
if let Err(er) = self
.kafka_producer
.log_payment_attempt(&attempt, Some(this), self.tenant_id.clone())
.await
{
logger::error!(message="Failed to log analytics event for payment attempt {attempt:?}", error_message=?er)
}
Ok(attempt)
}
#[cfg(feature = "v2")]
async fn update_payment_attempt(
&self,
key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
this: storage::PaymentAttempt,
payment_attempt: storage::PaymentAttemptUpdate,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
let attempt = self
.diesel_store
.update_payment_attempt(
key_manager_state,
merchant_key_store,
this.clone(),
payment_attempt,
storage_scheme,
)
.await?;
if let Err(er) = self
.kafka_producer
.log_payment_attempt(&attempt, Some(this), self.tenant_id.clone())
.await
{
logger::error!(message="Failed to log analytics event for payment attempt {attempt:?}", error_message=?er)
}
Ok(attempt)
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_connector_transaction_id_payment_id_merchant_id(
&self,
connector_transaction_id: &common_utils::types::ConnectorTransactionId,
payment_id: &id_type::PaymentId,
merchant_id: &id_type::MerchantId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_by_connector_transaction_id_payment_id_merchant_id(
connector_transaction_id,
payment_id,
merchant_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_merchant_id_connector_txn_id(
&self,
merchant_id: &id_type::MerchantId,
connector_txn_id: &str,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_by_merchant_id_connector_txn_id(
merchant_id,
connector_txn_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v2")]
async fn find_payment_attempt_by_profile_id_connector_transaction_id(
&self,
key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
profile_id: &id_type::ProfileId,
connector_transaction_id: &str,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_by_profile_id_connector_transaction_id(
key_manager_state,
merchant_key_store,
profile_id,
connector_transaction_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_payment_id_merchant_id_attempt_id(
&self,
payment_id: &id_type::PaymentId,
merchant_id: &id_type::MerchantId,
attempt_id: &str,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_by_payment_id_merchant_id_attempt_id(
payment_id,
merchant_id,
attempt_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_attempt_id_merchant_id(
&self,
attempt_id: &str,
merchant_id: &id_type::MerchantId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_by_attempt_id_merchant_id(attempt_id, merchant_id, storage_scheme)
.await
}
#[cfg(feature = "v2")]
async fn find_payment_attempt_by_id(
&self,
key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
attempt_id: &id_type::GlobalAttemptId,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_by_id(
key_manager_state,
merchant_key_store,
attempt_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v2")]
async fn find_payment_attempts_by_payment_intent_id(
&self,
key_manager_state: &KeyManagerState,
payment_id: &id_type::GlobalPaymentId,
merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> error_stack::Result<Vec<storage::PaymentAttempt>, errors::StorageError> {
self.diesel_store
.find_payment_attempts_by_payment_intent_id(
key_manager_state,
payment_id,
merchant_key_store,
storage_scheme,
)
.await
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_last_successful_attempt_by_payment_id_merchant_id(
&self,
payment_id: &id_type::PaymentId,
merchant_id: &id_type::MerchantId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_last_successful_attempt_by_payment_id_merchant_id(
payment_id,
merchant_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_last_successful_or_partially_captured_attempt_by_payment_id_merchant_id(
&self,
payment_id: &id_type::PaymentId,
merchant_id: &id_type::MerchantId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_last_successful_or_partially_captured_attempt_by_payment_id_merchant_id(
payment_id,
merchant_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v2")]
async fn find_payment_attempt_last_successful_or_partially_captured_attempt_by_payment_id(
&self,
key_manager_state: &KeyManagerState,
merchant_key_store: &domain::MerchantKeyStore,
payment_id: &id_type::GlobalPaymentId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_last_successful_or_partially_captured_attempt_by_payment_id(
key_manager_state,
merchant_key_store,
payment_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_preprocessing_id_merchant_id(
&self,
preprocessing_id: &str,
merchant_id: &id_type::MerchantId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentAttempt, errors::StorageError> {
self.diesel_store
.find_payment_attempt_by_preprocessing_id_merchant_id(
preprocessing_id,
merchant_id,
storage_scheme,
)
.await
}
#[cfg(feature = "v1")]
async fn get_filters_for_payments(
&self,
pi: &[hyperswitch_domain_models::payments::PaymentIntent],
merchant_id: &id_type::MerchantId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<
hyperswitch_domain_models::payments::payment_attempt::PaymentListFilters,
errors::StorageError,
> {
self.diesel_store
.get_filters_for_payments(pi, merchant_id, storage_scheme)
.await
}
#[cfg(feature = "v1")]
async fn get_total_count_of_filtered_payment_attempts(
&self,
merchant_id: &id_type::MerchantId,
active_attempt_ids: &[String],
connector: Option<Vec<api_models::enums::Connector>>,
payment_method: Option<Vec<common_enums::PaymentMethod>>,
payment_method_type: Option<Vec<common_enums::PaymentMethodType>>,
authentication_type: Option<Vec<common_enums::AuthenticationType>>,
merchant_connector_id: Option<Vec<id_type::MerchantConnectorAccountId>>,
card_network: Option<Vec<common_enums::CardNetwork>>,
card_discovery: Option<Vec<common_enums::CardDiscovery>>,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<i64, errors::StorageError> {
self.diesel_store
.get_total_count_of_filtered_payment_attempts(
merchant_id,
active_attempt_ids,
connector,
payment_method,
payment_method_type,
authentication_type,
merchant_connector_id,
card_network,
card_discovery,
storage_scheme,
)
.await
}
#[cfg(feature = "v2")]
async fn get_total_count_of_filtered_payment_attempts(
&self,
merchant_id: &id_type::MerchantId,
active_attempt_ids: &[String],
connector: Option<Vec<api_models::enums::Connector>>,
payment_method_type: Option<Vec<common_enums::PaymentMethod>>,
payment_method_subtype: Option<Vec<common_enums::PaymentMethodType>>,
authentication_type: Option<Vec<common_enums::AuthenticationType>>,
merchant_connector_id: Option<Vec<id_type::MerchantConnectorAccountId>>,
card_network: Option<Vec<common_enums::CardNetwork>>,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<i64, errors::StorageError> {
self.diesel_store
.get_total_count_of_filtered_payment_attempts(
merchant_id,
active_attempt_ids,
connector,
payment_method_type,
payment_method_subtype,
authentication_type,
merchant_connector_id,
card_network,
storage_scheme,
)
.await
}
#[cfg(feature = "v1")]
async fn find_attempts_by_merchant_id_payment_id(
&self,
merchant_id: &id_type::MerchantId,
payment_id: &id_type::PaymentId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Vec<storage::PaymentAttempt>, errors::StorageError> {
self.diesel_store
.find_attempts_by_merchant_id_payment_id(merchant_id, payment_id, storage_scheme)
.await
}
}
#[async_trait::async_trait]
impl PaymentIntentInterface for KafkaStore {
type Error = errors::StorageError;
async fn update_payment_intent(
&self,
state: &KeyManagerState,
this: storage::PaymentIntent,
payment_intent: storage::PaymentIntentUpdate,
key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentIntent, errors::StorageError> {
let intent = self
.diesel_store
.update_payment_intent(
state,
this.clone(),
payment_intent.clone(),
key_store,
storage_scheme,
)
.await?;
if let Err(er) = self
.kafka_producer
.log_payment_intent(
&intent,
Some(this),
self.tenant_id.clone(),
state.add_confirm_value_in_infra_values(payment_intent.is_confirm_operation()),
)
.await
{
logger::error!(message="Failed to add analytics entry for Payment Intent {intent:?}", error_message=?er);
};
Ok(intent)
}
async fn insert_payment_intent(
&self,
state: &KeyManagerState,
new: storage::PaymentIntent,
key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentIntent, errors::StorageError> {
logger::debug!("Inserting PaymentIntent Via KafkaStore");
let intent = self
.diesel_store
.insert_payment_intent(state, new, key_store, storage_scheme)
.await?;
if let Err(er) = self
.kafka_producer
.log_payment_intent(
&intent,
None,
self.tenant_id.clone(),
state.infra_values.clone(),
)
.await
{
logger::error!(message="Failed to add analytics entry for Payment Intent {intent:?}", error_message=?er);
};
Ok(intent)
}
#[cfg(feature = "v1")]
async fn find_payment_intent_by_payment_id_merchant_id(
&self,
state: &KeyManagerState,
payment_id: &id_type::PaymentId,
merchant_id: &id_type::MerchantId,
key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentIntent, errors::StorageError> {
self.diesel_store
.find_payment_intent_by_payment_id_merchant_id(
state,
payment_id,
merchant_id,
key_store,
storage_scheme,
)
.await
}
#[cfg(feature = "v2")]
async fn find_payment_intent_by_id(
&self,
state: &KeyManagerState,
payment_id: &id_type::GlobalPaymentId,
key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<storage::PaymentIntent, errors::StorageError> {
self.diesel_store
.find_payment_intent_by_id(state, payment_id, key_store, storage_scheme)
.await
}
#[cfg(all(feature = "olap", feature = "v1"))]
async fn filter_payment_intent_by_constraints(
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
filters: &hyperswitch_domain_models::payments::payment_intent::PaymentIntentFetchConstraints,
key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Vec<storage::PaymentIntent>, errors::StorageError> {
self.diesel_store
.filter_payment_intent_by_constraints(
state,
merchant_id,
filters,
key_store,
storage_scheme,
)
.await
}
#[cfg(all(feature = "olap", feature = "v1"))]
async fn filter_payment_intents_by_time_range_constraints(
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
time_range: &common_utils::types::TimeRange,
key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Vec<storage::PaymentIntent>, errors::StorageError> {
self.diesel_store
.filter_payment_intents_by_time_range_constraints(
state,
merchant_id,
time_range,
key_store,
storage_scheme,
)
.await
}
#[cfg(feature = "olap")]
async fn get_intent_status_with_count(
&self,
merchant_id: &id_type::MerchantId,
profile_id_list: Option<Vec<id_type::ProfileId>>,
time_range: &common_utils::types::TimeRange,
) -> error_stack::Result<Vec<(common_enums::IntentStatus, i64)>, errors::StorageError> {
self.diesel_store
.get_intent_status_with_count(merchant_id, profile_id_list, time_range)
.await
}
#[cfg(all(feature = "olap", feature = "v1"))]
async fn get_filtered_payment_intents_attempt(
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
constraints: &hyperswitch_domain_models::payments::payment_intent::PaymentIntentFetchConstraints,
key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<
Vec<(
hyperswitch_domain_models::payments::PaymentIntent,
hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt,
)>,
errors::StorageError,
> {
self.diesel_store
.get_filtered_payment_intents_attempt(
state,
merchant_id,
constraints,
key_store,
storage_scheme,
)
.await
}
#[cfg(all(feature = "olap", feature = "v2"))]
async fn get_filtered_payment_intents_attempt(
&self,
state: &KeyManagerState,
merchant_id: &id_type::MerchantId,
constraints: &hyperswitch_domain_models::payments::payment_intent::PaymentIntentFetchConstraints,
key_store: &domain::MerchantKeyStore,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<
Vec<(
hyperswitch_domain_models::payments::PaymentIntent,
Option<hyperswitch_domain_models::payments::payment_attempt::PaymentAttempt>,
)>,
errors::StorageError,
> {
self.diesel_store
.get_filtered_payment_intents_attempt(
state,
merchant_id,
constraints,
key_store,
storage_scheme,
)
.await
}
#[cfg(all(feature = "olap", feature = "v1"))]
async fn get_filtered_active_attempt_ids_for_total_count(
&self,
merchant_id: &id_type::MerchantId,
constraints: &hyperswitch_domain_models::payments::payment_intent::PaymentIntentFetchConstraints,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Vec<String>, errors::StorageError> {
self.diesel_store
.get_filtered_active_attempt_ids_for_total_count(
merchant_id,
constraints,
storage_scheme,
)
.await
}
#[cfg(feature = "v2")]
async fn find_payment_intent_by_merchant_reference_id_profile_id(
&self,
state: &KeyManagerState,
merchant_reference_id: &id_type::PaymentReferenceId,
profile_id: &id_type::ProfileId,
merchant_key_store: &domain::MerchantKeyStore,
storage_scheme: &MerchantStorageScheme,
) -> error_stack::Result<hyperswitch_domain_models::payments::PaymentIntent, errors::StorageError>
{
self.diesel_store
.find_payment_intent_by_merchant_reference_id_profile_id(
state,
merchant_reference_id,
profile_id,
merchant_key_store,
storage_scheme,
)
.await
}
#[cfg(all(feature = "olap", feature = "v2"))]
async fn get_filtered_active_attempt_ids_for_total_count(
&self,
merchant_id: &id_type::MerchantId,
constraints: &hyperswitch_domain_models::payments::payment_intent::PaymentIntentFetchConstraints,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Vec<Option<String>>, errors::StorageError> {
self.diesel_store
.get_filtered_active_attempt_ids_for_total_count(
merchant_id,
constraints,
storage_scheme,
)
.await
}
}
#[async_trait::async_trait]
impl PaymentMethodInterface for KafkaStore {
type Error = errors::StorageError;
#[cfg(feature = "v1")]
async fn find_payment_method(
&self,
state: &KeyManagerState,
key_store: &domain::MerchantKeyStore,
payment_method_id: &str,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<domain::PaymentMethod, errors::StorageError> {
self.diesel_store
.find_payment_method(state, key_store, payment_method_id, storage_scheme)
.await
}
#[cfg(feature = "v2")]
async fn find_payment_method(
&self,
state: &KeyManagerState,
key_store: &domain::MerchantKeyStore,
payment_method_id: &id_type::GlobalPaymentMethodId,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<domain::PaymentMethod, errors::StorageError> {
self.diesel_store
.find_payment_method(state, key_store, payment_method_id, storage_scheme)
.await
}
#[cfg(feature = "v1")]
async fn find_payment_method_by_customer_id_merchant_id_list(
&self,
state: &KeyManagerState,
key_store: &domain::MerchantKeyStore,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
limit: Option<i64>,
) -> CustomResult<Vec<domain::PaymentMethod>, errors::StorageError> {
self.diesel_store
.find_payment_method_by_customer_id_merchant_id_list(
state,
key_store,
customer_id,
merchant_id,
limit,
)
.await
}
#[cfg(feature = "v2")]
async fn find_payment_method_list_by_global_customer_id(
&self,
state: &KeyManagerState,
key_store: &domain::MerchantKeyStore,
id: &id_type::GlobalCustomerId,
limit: Option<i64>,
) -> CustomResult<Vec<domain::PaymentMethod>, errors::StorageError> {
self.diesel_store
.find_payment_method_list_by_global_customer_id(state, key_store, id, limit)
.await
}
#[cfg(feature = "v1")]
async fn find_payment_method_by_customer_id_merchant_id_status(
&self,
state: &KeyManagerState,
key_store: &domain::MerchantKeyStore,
customer_id: &id_type::CustomerId,
merchant_id: &id_type::MerchantId,
status: common_enums::PaymentMethodStatus,
limit: Option<i64>,
storage_scheme: MerchantStorageScheme,
) -> CustomResult<Vec<domain::PaymentMethod>, errors::StorageError> {
self.diesel_store
.find_payment_method_by_customer_id_merchant_id_status(
state,
key_store,
customer_id,
merchant_id,
status,
limit,
storage_scheme,
)
.await
}
|
crates/router/src/db/kafka_store.rs#chunk1
|
router
|
chunk
| null | null | null | 8,184
| null | null | null | null | null | null | null |
// Function: get_customer_user_agent_extended
// File: crates/diesel_models/src/mandate.rs
// Module: diesel_models
// Documentation: Returns customer_user_agent_extended with customer_user_agent as fallback
pub fn get_customer_user_agent_extended(&self) -> Option<String>
|
crates/diesel_models/src/mandate.rs
|
diesel_models
|
function_signature
| null | null | null | 57
|
get_customer_user_agent_extended
| null | null | null | null | null | null |
// Struct: StripebillingErrorResponse
// File: crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct StripebillingErrorResponse
|
crates/hyperswitch_connectors/src/connectors/stripebilling/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
StripebillingErrorResponse
| 0
|
[] | 48
| null | null | null | null | null | null | null |
// Function: organization_update
// File: crates/openapi/src/routes/organization.rs
// Module: openapi
pub fn organization_update()
|
crates/openapi/src/routes/organization.rs
|
openapi
|
function_signature
| null | null | null | 29
|
organization_update
| null | null | null | null | null | null |
// Struct: Authorization
// File: crates/diesel_models/src/authorization.rs
// Module: diesel_models
// Implementations: 0
pub struct Authorization
|
crates/diesel_models/src/authorization.rs
|
diesel_models
|
struct_definition
|
Authorization
| 0
|
[] | 33
| null | null | null | null | null | null | null |
// Function: organization_create
// File: crates/openapi/src/routes/organization.rs
// Module: openapi
pub fn organization_create()
|
crates/openapi/src/routes/organization.rs
|
openapi
|
function_signature
| null | null | null | 29
|
organization_create
| null | null | null | null | null | null |
// Struct: InterpreterError
// File: crates/euclid/src/backend/interpreter/types.rs
// Module: euclid
// Implementations: 1
// Traits: fmt::Display
pub struct InterpreterError
|
crates/euclid/src/backend/interpreter/types.rs
|
euclid
|
struct_definition
|
InterpreterError
| 1
|
[
"fmt::Display"
] | 44
| null | null | null | null | null | null | null |
// Struct: ContextStruct
// File: crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct ContextStruct
|
crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
ContextStruct
| 0
|
[] | 45
| null | null | null | null | null | null | null |
// Struct: Expiry
// File: crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct Expiry
|
crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
Expiry
| 0
|
[] | 46
| null | null | null | null | null | null | null |
// Struct: PaymentConfirmData
// File: crates/hyperswitch_domain_models/src/payments.rs
// Module: hyperswitch_domain_models
// Implementations: 1
pub struct PaymentConfirmData<F>
|
crates/hyperswitch_domain_models/src/payments.rs
|
hyperswitch_domain_models
|
struct_definition
|
PaymentConfirmData
| 1
|
[] | 44
| null | null | null | null | null | null | null |
// Function: trigger_payments_webhook
// File: crates/router/src/utils.rs
// Module: router
pub fn trigger_payments_webhook<F, Op, D>(
merchant_account: domain::MerchantAccount,
business_profile: domain::Profile,
key_store: &domain::MerchantKeyStore,
payment_data: D,
customer: Option<domain::Customer>,
state: &SessionState,
operation: Op,
) -> RouterResult<()>
where
F: Send + Clone + Sync,
Op: Debug,
D: payments_core::OperationSessionGetters<F>,
|
crates/router/src/utils.rs
|
router
|
function_signature
| null | null | null | 123
|
trigger_payments_webhook
| null | null | null | null | null | null |
// Implementation: impl ConnectorSpecifications for for Shift4
// File: crates/hyperswitch_connectors/src/connectors/shift4.rs
// Module: hyperswitch_connectors
// Methods: 3 total (0 public)
impl ConnectorSpecifications for for Shift4
|
crates/hyperswitch_connectors/src/connectors/shift4.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 54
| null |
Shift4
|
ConnectorSpecifications for
| 3
| 0
| null | null |
// Struct: ElavonSyncResponse
// File: crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct ElavonSyncResponse
|
crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
ElavonSyncResponse
| 0
|
[] | 52
| null | null | null | null | null | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.