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: OrderInformation
// File: crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct OrderInformation
|
crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
OrderInformation
| 0
|
[] | 48
| null | null | null | null | null | null | null |
// Struct: FiuuCardWithNTI
// File: crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct FiuuCardWithNTI
|
crates/hyperswitch_connectors/src/connectors/fiuu/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
FiuuCardWithNTI
| 0
|
[] | 56
| null | null | null | null | null | null | null |
// Implementation: impl ConnectorRedirectResponse for for Braintree
// File: crates/hyperswitch_connectors/src/connectors/braintree.rs
// Module: hyperswitch_connectors
// Methods: 1 total (0 public)
impl ConnectorRedirectResponse for for Braintree
|
crates/hyperswitch_connectors/src/connectors/braintree.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 56
| null |
Braintree
|
ConnectorRedirectResponse for
| 1
| 0
| null | null |
// Function: operation_derive
// File: crates/router_derive/src/lib.rs
// Module: router_derive
pub fn operation_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream
|
crates/router_derive/src/lib.rs
|
router_derive
|
function_signature
| null | null | null | 44
|
operation_derive
| null | null | null | null | null | null |
// Implementation: impl UploadFile for for Adyen
// File: crates/hyperswitch_connectors/src/connectors/adyen.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl UploadFile for for Adyen
|
crates/hyperswitch_connectors/src/connectors/adyen.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 54
| null |
Adyen
|
UploadFile for
| 0
| 0
| null | null |
// File: crates/router/tests/connectors/xendit.rs
// Module: router
use masking::Secret;
use router::{
types::{self, api, storage::enums,
}};
use crate::utils::{self, ConnectorActions};
use test_utils::connector_auth;
#[derive(Clone, Copy)]
struct XenditTest;
impl ConnectorActions for XenditTest {}
impl utils::Connector for XenditTest {
fn get_data(&self) -> api::ConnectorData {
use router::connector::Xendit;
api::ConnectorData {
connector: Box::new(Xendit::new()),
connector_name: types::Connector::Xendit,
get_token: types::api::GetToken::Connector,
merchant_connector_id: None,
}
}
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.xendit
.expect("Missing connector authentication configuration").into(),
)
}
fn get_name(&self) -> String {
"xendit".to_string()
}
}
static CONNECTOR: XenditTest = XenditTest {};
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
// Cards Positive Tests
// Creates a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_only_authorize_payment() {
let response = CONNECTOR
.authorize_payment(payment_method_details(), get_default_payment_info())
.await
.expect("Authorize payment response");
assert_eq!(response.status, enums::AttemptStatus::Authorized);
}
// Captures a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_capture_authorized_payment() {
let response = CONNECTOR
.authorize_and_capture_payment(payment_method_details(), None, get_default_payment_info())
.await
.expect("Capture payment response");
assert_eq!(response.status, enums::AttemptStatus::Charged);
}
// Partially captures a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_partially_capture_authorized_payment() {
let response = CONNECTOR
.authorize_and_capture_payment(
payment_method_details(),
Some(types::PaymentsCaptureData {
amount_to_capture: 50,
..utils::PaymentCaptureType::default().0
}),
get_default_payment_info(),
)
.await
.expect("Capture payment response");
assert_eq!(response.status, enums::AttemptStatus::Charged);
}
// Synchronizes a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_sync_authorized_payment() {
let authorize_response = CONNECTOR
.authorize_payment(payment_method_details(), get_default_payment_info())
.await
.expect("Authorize payment response");
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
let response = CONNECTOR
.psync_retry_till_status_matches(
enums::AttemptStatus::Authorized,
Some(types::PaymentsSyncData {
connector_transaction_id: types::ResponseId::ConnectorTransactionId(
txn_id.unwrap(),
),
..Default::default()
}),
get_default_payment_info(),
)
.await
.expect("PSync response");
assert_eq!(response.status, enums::AttemptStatus::Authorized,);
}
// Voids a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_void_authorized_payment() {
let response = CONNECTOR
.authorize_and_void_payment(
payment_method_details(),
Some(types::PaymentsCancelData {
connector_transaction_id: String::from(""),
cancellation_reason: Some("requested_by_customer".to_string()),
..Default::default()
}),
get_default_payment_info(),
)
.await
.expect("Void payment response");
assert_eq!(response.status, enums::AttemptStatus::Voided);
}
// Refunds a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_refund_manually_captured_payment() {
let response = CONNECTOR
.capture_payment_and_refund(payment_method_details(), None, None, get_default_payment_info())
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Partially refunds a payment using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_partially_refund_manually_captured_payment() {
let response = CONNECTOR
.capture_payment_and_refund(
payment_method_details(),
None,
Some(types::RefundsData {
refund_amount: 50,
..utils::PaymentRefundType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Synchronizes a refund using the manual capture flow (Non 3DS).
#[actix_web::test]
async fn should_sync_manually_captured_refund() {
let refund_response = CONNECTOR
.capture_payment_and_refund(payment_method_details(), None, None, get_default_payment_info())
.await
.unwrap();
let response = CONNECTOR
.rsync_retry_till_status_matches(
enums::RefundStatus::Success,
refund_response.response.unwrap().connector_refund_id,
None,
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Creates a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_make_payment() {
let authorize_response = CONNECTOR.make_payment(payment_method_details(), get_default_payment_info()).await.unwrap();
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
}
// Synchronizes a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_sync_auto_captured_payment() {
let authorize_response = CONNECTOR.make_payment(payment_method_details(), get_default_payment_info()).await.unwrap();
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
assert_ne!(txn_id, None, "Empty connector transaction id");
let response = CONNECTOR
.psync_retry_till_status_matches(
enums::AttemptStatus::Charged,
Some(types::PaymentsSyncData {
connector_transaction_id: types::ResponseId::ConnectorTransactionId(
txn_id.unwrap(),
),
capture_method: Some(enums::CaptureMethod::Automatic),
..Default::default()
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(response.status, enums::AttemptStatus::Charged,);
}
// Refunds a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_refund_auto_captured_payment() {
let response = CONNECTOR
.make_payment_and_refund(payment_method_details(), None, get_default_payment_info())
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Partially refunds a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_partially_refund_succeeded_payment() {
let refund_response = CONNECTOR
.make_payment_and_refund(
payment_method_details(),
Some(types::RefundsData {
refund_amount: 50,
..utils::PaymentRefundType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
refund_response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Creates multiple refunds against a payment using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_refund_succeeded_payment_multiple_times() {
CONNECTOR
.make_payment_and_multiple_refund(
payment_method_details(),
Some(types::RefundsData {
refund_amount: 50,
..utils::PaymentRefundType::default().0
}),
get_default_payment_info(),
)
.await;
}
// Synchronizes a refund using the automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_sync_refund() {
let refund_response = CONNECTOR
.make_payment_and_refund(payment_method_details(), None, get_default_payment_info())
.await
.unwrap();
let response = CONNECTOR
.rsync_retry_till_status_matches(
enums::RefundStatus::Success,
refund_response.response.unwrap().connector_refund_id,
None,
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
// Cards Negative scenarios
// Creates a payment with incorrect CVC.
#[actix_web::test]
async fn should_fail_payment_for_incorrect_cvc() {
let response = CONNECTOR
.make_payment(
Some(types::PaymentsAuthorizeData {
payment_method_data: types::api::PaymentMethodData::Card(api::Card {
card_cvc: Secret::new("12345".to_string()),
..utils::CCardType::default().0
}),
..utils::PaymentAuthorizeType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap_err().message,
"Your card's security code is invalid.".to_string(),
);
}
// Creates a payment with incorrect expiry month.
#[actix_web::test]
async fn should_fail_payment_for_invalid_exp_month() {
let response = CONNECTOR
.make_payment(
Some(types::PaymentsAuthorizeData {
payment_method_data: api::PaymentMethodData::Card(api::Card {
card_exp_month: Secret::new("20".to_string()),
..utils::CCardType::default().0
}),
..utils::PaymentAuthorizeType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap_err().message,
"Your card's expiration month is invalid.".to_string(),
);
}
// Creates a payment with incorrect expiry year.
#[actix_web::test]
async fn should_fail_payment_for_incorrect_expiry_year() {
let response = CONNECTOR
.make_payment(
Some(types::PaymentsAuthorizeData {
payment_method_data: api::PaymentMethodData::Card(api::Card {
card_exp_year: Secret::new("2000".to_string()),
..utils::CCardType::default().0
}),
..utils::PaymentAuthorizeType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap_err().message,
"Your card's expiration year is invalid.".to_string(),
);
}
// Voids a payment using automatic capture flow (Non 3DS).
#[actix_web::test]
async fn should_fail_void_payment_for_auto_capture() {
let authorize_response = CONNECTOR.make_payment(payment_method_details(), get_default_payment_info()).await.unwrap();
assert_eq!(authorize_response.status, enums::AttemptStatus::Charged);
let txn_id = utils::get_connector_transaction_id(authorize_response.response);
assert_ne!(txn_id, None, "Empty connector transaction id");
let void_response = CONNECTOR
.void_payment(txn_id.unwrap(), None, get_default_payment_info())
.await
.unwrap();
assert_eq!(
void_response.response.unwrap_err().message,
"You cannot cancel this PaymentIntent because it has a status of succeeded."
);
}
// Captures a payment using invalid connector payment id.
#[actix_web::test]
async fn should_fail_capture_for_invalid_payment() {
let capture_response = CONNECTOR
.capture_payment("123456789".to_string(), None, get_default_payment_info())
.await
.unwrap();
assert_eq!(
capture_response.response.unwrap_err().message,
String::from("No such payment_intent: '123456789'")
);
}
// Refunds a payment with refund amount higher than payment amount.
#[actix_web::test]
async fn should_fail_for_refund_amount_higher_than_payment_amount() {
let response = CONNECTOR
.make_payment_and_refund(
payment_method_details(),
Some(types::RefundsData {
refund_amount: 150,
..utils::PaymentRefundType::default().0
}),
get_default_payment_info(),
)
.await
.unwrap();
assert_eq!(
response.response.unwrap_err().message,
"Refund amount (₹1.50) is greater than charge amount (₹1.00)",
);
}
// Connector dependent test cases goes here
// [#478]: add unit tests for non 3DS, wallets & webhooks in connector tests
|
crates/router/tests/connectors/xendit.rs
|
router
|
full_file
| null | null | null | 2,914
| null | null | null | null | null | null | null |
// Struct: MifinityErrorResponse
// File: crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct MifinityErrorResponse
|
crates/hyperswitch_connectors/src/connectors/mifinity/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
MifinityErrorResponse
| 0
|
[] | 50
| null | null | null | null | null | null | null |
| "responsetoissuerarbitration" => Ok(common_enums::enums::DisputeStage::PreArbitration),
"retrievalrequest" => Ok(common_enums::enums::DisputeStage::PreDispute),
_ => Err(errors::ConnectorError::NotSupported {
message: format!("Dispute stage {dispute_cycle}",),
connector: "worldpayvantiv",
}
.into()),
}
}
pub fn get_dispute_status(
dispute_cycle: String,
dispute_activities: Vec<Activity>,
) -> Result<common_enums::DisputeStatus, error_stack::Report<errors::ConnectorError>> {
if let Some(activity) = get_last_non_auxiliary_activity_type(dispute_activities) {
match activity.as_ref() {
"Merchant Accept"
| "Issuer Accepted Pre-Arbitration"
| "Vantiv Accept"
| "Sent Credit" => Ok(common_enums::DisputeStatus::DisputeAccepted),
"Merchant Represent"
| "Respond to Dispute"
| "Respond to PreArb"
| "Request Arbitration"
| "Request Pre-Arbitration"
| "Create Arbitration"
| "Record Arbitration"
| "Create Pre-Arbitration"
| "File Arbitration"
| "File Pre-Arbitration"
| "File Visa Pre-Arbitration"
| "Send Representment"
| "Send Response"
| "Arbitration"
| "Arbitration (Mastercard)"
| "Arbitration Chargeback"
| "Issuer Declined Pre-Arbitration"
| "Issuer Arbitration"
| "Request Response to Pre-Arbitration"
| "Vantiv Represent"
| "Vantiv Respond"
| "Auto Represent"
| "Arbitration Ruling" => Ok(common_enums::DisputeStatus::DisputeChallenged),
"Arbitration Lost" | "Unsuccessful Arbitration" | "Unsuccessful Pre-Arbitration" => {
Ok(common_enums::DisputeStatus::DisputeLost)
}
"Arbitration Won"
| "Arbitration Split"
| "Successful Arbitration"
| "Successful Pre-Arbitration" => Ok(common_enums::DisputeStatus::DisputeWon),
"Chargeback Reversal" => Ok(common_enums::DisputeStatus::DisputeCancelled),
"Receive Network Transaction" => Ok(common_enums::DisputeStatus::DisputeOpened),
"Unaccept" | "Unrepresent" => Ok(common_enums::DisputeStatus::DisputeOpened),
unexpected_activity => Err(errors::ConnectorError::UnexpectedResponseError(
bytes::Bytes::from(format!("Dispute Activity: {unexpected_activity})")),
)
.into()),
}
} else {
match connector_utils::normalize_string(dispute_cycle.clone())
.change_context(errors::ConnectorError::RequestEncodingFailed)?
.as_str()
{
"arbitration"
| "arbitrationmastercard"
| "arbitrationsplit"
| "representment"
| "issuerarbitration"
| "prearbitration"
| "responsetoissuerarbitration"
| "arbitrationchargeback" => Ok(api_models::enums::DisputeStatus::DisputeChallenged),
"chargebackreversal" | "issueracceptedprearbitration" | "arbitrationwon" => {
Ok(api_models::enums::DisputeStatus::DisputeWon)
}
"arbitrationlost" | "issuerdeclinedprearbitration" => {
Ok(api_models::enums::DisputeStatus::DisputeLost)
}
"firstchargeback" | "retrievalrequest" | "rapiddisputeresolution" => {
Ok(api_models::enums::DisputeStatus::DisputeOpened)
}
dispute_cycle => Err(errors::ConnectorError::UnexpectedResponseError(
bytes::Bytes::from(format!("Dispute Stage: {dispute_cycle}")),
)
.into()),
}
}
}
fn convert_string_to_primitive_date(
item: Option<String>,
) -> Result<Option<time::PrimitiveDateTime>, error_stack::Report<errors::ConnectorError>> {
item.map(|day| {
let full_datetime_str = format!("{day}T00:00:00");
let format =
time::macros::format_description!("[year]-[month]-[day]T[hour]:[minute]:[second]");
time::PrimitiveDateTime::parse(&full_datetime_str, &format)
})
.transpose()
.change_context(errors::ConnectorError::ParsingFailed)
}
impl TryFrom<ChargebackCase> for DisputeSyncResponse {
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(item: ChargebackCase) -> Result<Self, Self::Error> {
let amount = connector_utils::convert_amount(
&StringMinorUnitForConnector,
item.chargeback_amount,
item.chargeback_currency_type,
)?;
Ok(Self {
object_reference_id: api_models::webhooks::ObjectReferenceId::PaymentId(
api_models::payments::PaymentIdType::ConnectorTransactionId(item.vantiv_cnp_txn_id),
),
amount,
currency: item.chargeback_currency_type,
dispute_stage: get_dispute_stage(item.cycle.clone())?,
dispute_status: get_dispute_status(item.cycle.clone(), item.activity)?,
connector_status: item.cycle.clone(),
connector_dispute_id: item.case_id.clone(),
connector_reason: item.reason_code_description.clone(),
connector_reason_code: item.reason_code.clone(),
challenge_required_by: convert_string_to_primitive_date(item.reply_by_day.clone())?,
created_at: convert_string_to_primitive_date(item.date_received_by_vantiv_cnp.clone())?,
updated_at: None,
})
}
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
pub enum ActivityType {
MerchantAcceptsLiability,
MerchantRepresent,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename = "chargebackUpdateRequest", rename_all = "camelCase")]
pub struct ChargebackUpdateRequest {
#[serde(rename = "@xmlns")]
xmlns: String,
activity_type: ActivityType,
}
impl From<&SubmitEvidenceRouterData> for ChargebackUpdateRequest {
fn from(_item: &SubmitEvidenceRouterData) -> Self {
Self {
xmlns: worldpayvantiv_constants::XML_CHARGEBACK.to_string(),
activity_type: ActivityType::MerchantRepresent,
}
}
}
impl From<&AcceptDisputeRouterData> for ChargebackUpdateRequest {
fn from(_item: &AcceptDisputeRouterData) -> Self {
Self {
xmlns: worldpayvantiv_constants::XML_CHARGEBACK.to_string(),
activity_type: ActivityType::MerchantAcceptsLiability,
}
}
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename = "chargebackDocumentUploadResponse", rename_all = "camelCase")]
pub struct ChargebackDocumentUploadResponse {
#[serde(rename = "@xmlns")]
pub xmlns: String,
pub merchant_id: String,
pub case_id: String,
pub document_id: Option<String>,
pub response_code: WorldpayvantivFileUploadResponseCode,
pub response_message: String,
}
#[derive(Debug, strum::Display, Serialize, Deserialize, PartialEq, Clone, Copy)]
pub enum WorldpayvantivFileUploadResponseCode {
#[serde(rename = "000")]
#[strum(serialize = "000")]
Success,
#[serde(rename = "001")]
#[strum(serialize = "001")]
InvalidMerchant,
#[serde(rename = "002")]
#[strum(serialize = "002")]
FutureUse002,
#[serde(rename = "003")]
#[strum(serialize = "003")]
CaseNotFound,
#[serde(rename = "004")]
#[strum(serialize = "004")]
CaseNotInMerchantQueue,
#[serde(rename = "005")]
#[strum(serialize = "005")]
DocumentAlreadyExists,
#[serde(rename = "006")]
#[strum(serialize = "006")]
InternalError,
#[serde(rename = "007")]
#[strum(serialize = "007")]
FutureUse007,
#[serde(rename = "008")]
#[strum(serialize = "008")]
MaxDocumentLimitReached,
#[serde(rename = "009")]
#[strum(serialize = "009")]
DocumentNotFound,
#[serde(rename = "010")]
#[strum(serialize = "010")]
CaseNotInValidCycle,
#[serde(rename = "011")]
#[strum(serialize = "011")]
ServerBusy,
#[serde(rename = "012")]
#[strum(serialize = "012")]
FileSizeExceedsLimit,
#[serde(rename = "013")]
#[strum(serialize = "013")]
InvalidFileContent,
#[serde(rename = "014")]
#[strum(serialize = "014")]
UnableToConvert,
#[serde(rename = "015")]
#[strum(serialize = "015")]
InvalidImageSize,
#[serde(rename = "016")]
#[strum(serialize = "016")]
MaxDocumentPageCountReached,
}
fn is_file_uploaded(vantiv_file_upload_status: WorldpayvantivFileUploadResponseCode) -> bool {
match vantiv_file_upload_status {
WorldpayvantivFileUploadResponseCode::Success
| WorldpayvantivFileUploadResponseCode::FutureUse002
| WorldpayvantivFileUploadResponseCode::FutureUse007 => true,
WorldpayvantivFileUploadResponseCode::InvalidMerchant
| WorldpayvantivFileUploadResponseCode::CaseNotFound
| WorldpayvantivFileUploadResponseCode::CaseNotInMerchantQueue
| WorldpayvantivFileUploadResponseCode::DocumentAlreadyExists
| WorldpayvantivFileUploadResponseCode::InternalError
| WorldpayvantivFileUploadResponseCode::MaxDocumentLimitReached
| WorldpayvantivFileUploadResponseCode::DocumentNotFound
| WorldpayvantivFileUploadResponseCode::CaseNotInValidCycle
| WorldpayvantivFileUploadResponseCode::ServerBusy
| WorldpayvantivFileUploadResponseCode::FileSizeExceedsLimit
| WorldpayvantivFileUploadResponseCode::InvalidFileContent
| WorldpayvantivFileUploadResponseCode::UnableToConvert
| WorldpayvantivFileUploadResponseCode::InvalidImageSize
| WorldpayvantivFileUploadResponseCode::MaxDocumentPageCountReached => false,
}
}
impl
TryFrom<
ResponseRouterData<
Upload,
ChargebackDocumentUploadResponse,
UploadFileRequestData,
UploadFileResponse,
>,
> for RouterData<Upload, UploadFileRequestData, UploadFileResponse>
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: ResponseRouterData<
Upload,
ChargebackDocumentUploadResponse,
UploadFileRequestData,
UploadFileResponse,
>,
) -> Result<Self, Self::Error> {
let response = if is_file_uploaded(item.response.response_code) {
let provider_file_id = item
.response
.document_id
.ok_or(errors::ConnectorError::MissingConnectorTransactionID)?;
Ok(UploadFileResponse { provider_file_id })
} else {
Err(ErrorResponse {
code: item.response.response_code.to_string(),
message: item.response.response_message.clone(),
reason: Some(item.response.response_message.clone()),
status_code: item.http_code,
attempt_status: None,
connector_transaction_id: None,
network_advice_code: None,
network_decline_code: None,
network_error_message: None,
connector_metadata: None,
})
};
Ok(Self {
response,
..item.data
})
}
}
impl
TryFrom<
ResponseRouterData<
Retrieve,
ChargebackDocumentUploadResponse,
RetrieveFileRequestData,
RetrieveFileResponse,
>,
> for RouterData<Retrieve, RetrieveFileRequestData, RetrieveFileResponse>
{
type Error = error_stack::Report<errors::ConnectorError>;
fn try_from(
item: ResponseRouterData<
Retrieve,
ChargebackDocumentUploadResponse,
RetrieveFileRequestData,
RetrieveFileResponse,
>,
) -> Result<Self, Self::Error> {
Ok(RetrieveFileRouterData {
response: Err(ErrorResponse {
code: item.response.response_code.to_string(),
message: item.response.response_message.clone(),
reason: Some(item.response.response_message.clone()),
status_code: item.http_code,
attempt_status: None,
connector_transaction_id: None,
network_advice_code: None,
network_decline_code: None,
network_error_message: None,
connector_metadata: None,
}),
..item.data.clone()
})
}
}
fn get_last_non_auxiliary_activity_type(activities: Vec<Activity>) -> Option<String> {
let auxiliary_activities: std::collections::HashSet<&'static str> = [
"Add Note",
"Attach Document",
"Attempted Attach Document",
"Delete Document",
"Update Document",
"Move To Error Queue",
"Assign to Vantiv",
"Assign To Merchant",
"Merchant Auto Assign",
"Issuer Recalled",
"Network Decision",
"Request Declined",
"Sent Gift",
"Successful PayPal",
]
.iter()
.copied()
.collect();
let mut last_non_auxiliary_activity = None;
for activity in activities {
let auxiliary_activity = activity
.activity_type
.as_deref()
.map(|activity_type| auxiliary_activities.contains(activity_type))
.unwrap_or(false);
if !auxiliary_activity {
last_non_auxiliary_activity = activity.activity_type.clone()
}
}
last_non_auxiliary_activity
}
|
crates/hyperswitch_connectors/src/connectors/worldpayvantiv/transformers.rs#chunk5
|
hyperswitch_connectors
|
chunk
| null | null | null | 3,152
| null | null | null | null | null | null | null |
// Implementation: impl api::RefundSync for for Affirm
// File: crates/hyperswitch_connectors/src/connectors/affirm.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::RefundSync for for Affirm
|
crates/hyperswitch_connectors/src/connectors/affirm.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 60
| null |
Affirm
|
api::RefundSync for
| 0
| 0
| null | null |
// Implementation: impl ConnectorSpecifications for for Braintree
// File: crates/hyperswitch_connectors/src/connectors/braintree.rs
// Module: hyperswitch_connectors
// Methods: 3 total (0 public)
impl ConnectorSpecifications for for Braintree
|
crates/hyperswitch_connectors/src/connectors/braintree.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 54
| null |
Braintree
|
ConnectorSpecifications for
| 3
| 0
| null | null |
// Struct: WebCheckoutDetails
// File: crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct WebCheckoutDetails
|
crates/hyperswitch_connectors/src/connectors/amazonpay/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
WebCheckoutDetails
| 0
|
[] | 48
| null | null | null | null | null | null | null |
// Struct: StaxPaymentsResponse
// File: crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct StaxPaymentsResponse
|
crates/hyperswitch_connectors/src/connectors/stax/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
StaxPaymentsResponse
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// Struct: PaymentConfirm
// File: crates/router/src/core/payments/operations/payment_confirm.rs
// Module: router
// Implementations: 0
pub struct PaymentConfirm
|
crates/router/src/core/payments/operations/payment_confirm.rs
|
router
|
struct_definition
|
PaymentConfirm
| 0
|
[] | 37
| null | null | null | null | null | null | null |
// Struct: SmtpServer
// File: crates/external_services/src/email/smtp.rs
// Module: external_services
// Implementations: 2
// Traits: EmailClient
pub struct SmtpServer
|
crates/external_services/src/email/smtp.rs
|
external_services
|
struct_definition
|
SmtpServer
| 2
|
[
"EmailClient"
] | 44
| null | null | null | null | null | null | null |
// Implementation: impl PaymentMethodIntentConfirm
// File: crates/api_models/src/payment_methods.rs
// Module: api_models
// Methods: 1 total (1 public)
impl PaymentMethodIntentConfirm
|
crates/api_models/src/payment_methods.rs
|
api_models
|
impl_block
| null | null | null | 41
| null |
PaymentMethodIntentConfirm
| null | 1
| 1
| null | null |
// Struct: PaymentStatus
// File: crates/router/src/core/payments/operations/payment_status.rs
// Module: router
// Implementations: 0
pub struct PaymentStatus
|
crates/router/src/core/payments/operations/payment_status.rs
|
router
|
struct_definition
|
PaymentStatus
| 0
|
[] | 37
| null | null | null | null | null | null | null |
// Struct: Apm
// File: crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct Apm
|
crates/hyperswitch_connectors/src/connectors/globalpay/requests.rs
|
hyperswitch_connectors
|
struct_definition
|
Apm
| 0
|
[] | 44
| null | null | null | null | null | null | null |
// Implementation: impl Barclaycard
// File: crates/hyperswitch_connectors/src/connectors/barclaycard.rs
// Module: hyperswitch_connectors
// Methods: 2 total (2 public)
impl Barclaycard
|
crates/hyperswitch_connectors/src/connectors/barclaycard.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 49
| null |
Barclaycard
| null | 2
| 2
| null | null |
// Function: search_index_to_opensearch_index
// File: crates/analytics/src/opensearch.rs
// Module: analytics
pub fn search_index_to_opensearch_index(&self, index: SearchIndex) -> String
|
crates/analytics/src/opensearch.rs
|
analytics
|
function_signature
| null | null | null | 47
|
search_index_to_opensearch_index
| null | null | null | null | null | null |
// Function: get_primary_details_as_value
// File: crates/api_models/src/admin.rs
// Module: api_models
pub fn get_primary_details_as_value(
&self,
) -> CustomResult<Option<serde_json::Value>, errors::ParsingError>
|
crates/api_models/src/admin.rs
|
api_models
|
function_signature
| null | null | null | 54
|
get_primary_details_as_value
| null | null | null | null | null | null |
// Struct: RefundErrorMessageDistributionRow
// File: crates/analytics/src/refunds/accumulator.rs
// Module: analytics
// Implementations: 0
pub struct RefundErrorMessageDistributionRow
|
crates/analytics/src/refunds/accumulator.rs
|
analytics
|
struct_definition
|
RefundErrorMessageDistributionRow
| 0
|
[] | 41
| null | null | null | null | null | null | null |
// Function: from_bytes
// File: crates/redis_interface/src/types.rs
// Module: redis_interface
pub fn from_bytes(val: Vec<u8>) -> Self
|
crates/redis_interface/src/types.rs
|
redis_interface
|
function_signature
| null | null | null | 35
|
from_bytes
| null | null | null | null | null | null |
// Function: new
// File: crates/external_services/src/hubspot_proxy.rs
// Module: external_services
pub fn new(
country: String,
hubspot_form_id: String,
firstname: Secret<String>,
email: Secret<String>,
company_name: String,
website: String,
) -> Self
|
crates/external_services/src/hubspot_proxy.rs
|
external_services
|
function_signature
| null | null | null | 69
|
new
| null | null | null | null | null | null |
// Struct: VgsTokenResponseItem
// File: crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct VgsTokenResponseItem
|
crates/hyperswitch_connectors/src/connectors/vgs/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
VgsTokenResponseItem
| 0
|
[] | 51
| null | null | null | null | null | null | null |
// Struct: ValidateResult
// File: crates/router/src/core/payments/operations.rs
// Module: router
// Implementations: 0
pub struct ValidateResult
|
crates/router/src/core/payments/operations.rs
|
router
|
struct_definition
|
ValidateResult
| 0
|
[] | 35
| null | null | null | null | null | null | null |
// Struct: Server
// File: crates/scheduler/src/configs/settings.rs
// Module: scheduler
// Implementations: 0
pub struct Server
|
crates/scheduler/src/configs/settings.rs
|
scheduler
|
struct_definition
|
Server
| 0
|
[] | 32
| null | null | null | null | null | null | null |
// Implementation: impl MandateNew
// File: crates/diesel_models/src/query/mandate.rs
// Module: diesel_models
// Methods: 1 total (0 public)
impl MandateNew
|
crates/diesel_models/src/query/mandate.rs
|
diesel_models
|
impl_block
| null | null | null | 42
| null |
MandateNew
| null | 1
| 0
| null | null |
// Implementation: impl ProfileNew
// File: crates/diesel_models/src/query/business_profile.rs
// Module: diesel_models
// Methods: 1 total (0 public)
impl ProfileNew
|
crates/diesel_models/src/query/business_profile.rs
|
diesel_models
|
impl_block
| null | null | null | 39
| null |
ProfileNew
| null | 1
| 0
| null | null |
// Implementation: impl webhooks::IncomingWebhook for for Cashtocode
// File: crates/hyperswitch_connectors/src/connectors/cashtocode.rs
// Module: hyperswitch_connectors
// Methods: 6 total (0 public)
impl webhooks::IncomingWebhook for for Cashtocode
|
crates/hyperswitch_connectors/src/connectors/cashtocode.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 65
| null |
Cashtocode
|
webhooks::IncomingWebhook for
| 6
| 0
| null | null |
// File: crates/common_utils/src/id_type/global_id/refunds.rs
// Module: common_utils
// Public functions: 2
// Public structs: 1
use error_stack::ResultExt;
use crate::errors;
/// A global id that can be used to identify a refund
#[derive(
Debug,
Clone,
Hash,
PartialEq,
Eq,
serde::Serialize,
serde::Deserialize,
diesel::expression::AsExpression,
)]
#[diesel(sql_type = diesel::sql_types::Text)]
pub struct GlobalRefundId(super::GlobalId);
// Database related implementations so that this field can be used directly in the database tables
crate::impl_queryable_id_type!(GlobalRefundId);
impl GlobalRefundId {
/// Get string representation of the id
pub fn get_string_repr(&self) -> &str {
self.0.get_string_repr()
}
/// Generate a new GlobalRefundId from a cell id
pub fn generate(cell_id: &crate::id_type::CellId) -> Self {
let global_id = super::GlobalId::generate(cell_id, super::GlobalEntity::Refund);
Self(global_id)
}
}
// TODO: refactor the macro to include this id use case as well
impl TryFrom<std::borrow::Cow<'static, str>> for GlobalRefundId {
type Error = error_stack::Report<errors::ValidationError>;
fn try_from(value: std::borrow::Cow<'static, str>) -> Result<Self, Self::Error> {
let merchant_ref_id = super::GlobalId::from_string(value).change_context(
errors::ValidationError::IncorrectValueProvided {
field_name: "refund_id",
},
)?;
Ok(Self(merchant_ref_id))
}
}
// TODO: refactor the macro to include this id use case as well
impl<DB> diesel::serialize::ToSql<diesel::sql_types::Text, DB> for GlobalRefundId
where
DB: diesel::backend::Backend,
super::GlobalId: diesel::serialize::ToSql<diesel::sql_types::Text, DB>,
{
fn to_sql<'b>(
&'b self,
out: &mut diesel::serialize::Output<'b, '_, DB>,
) -> diesel::serialize::Result {
self.0.to_sql(out)
}
}
impl<DB> diesel::deserialize::FromSql<diesel::sql_types::Text, DB> for GlobalRefundId
where
DB: diesel::backend::Backend,
super::GlobalId: diesel::deserialize::FromSql<diesel::sql_types::Text, DB>,
{
fn from_sql(value: DB::RawValue<'_>) -> diesel::deserialize::Result<Self> {
super::GlobalId::from_sql(value).map(Self)
}
}
|
crates/common_utils/src/id_type/global_id/refunds.rs
|
common_utils
|
full_file
| null | null | null | 598
| null | null | null | null | null | null | null |
// Implementation: impl AuthenticationConnectorAccountMap
// File: crates/common_types/src/payments.rs
// Module: common_types
// Methods: 2 total (1 public)
impl AuthenticationConnectorAccountMap
|
crates/common_types/src/payments.rs
|
common_types
|
impl_block
| null | null | null | 41
| null |
AuthenticationConnectorAccountMap
| null | 2
| 1
| null | null |
// Module Structure
// File: crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs
// Module: hyperswitch_connectors
// Public submodules:
pub mod transformers;
|
crates/hyperswitch_connectors/src/connectors/juspaythreedsserver.rs
|
hyperswitch_connectors
|
module_structure
| null | null | null | 43
| null | null | null | null | null | 1
| 0
|
// File: crates/analytics/src/health_check.rs
// Module: analytics
use common_utils::errors::CustomResult;
use crate::types::QueryExecutionError;
#[async_trait::async_trait]
pub trait HealthCheck {
async fn deep_health_check(&self) -> CustomResult<(), QueryExecutionError>;
}
|
crates/analytics/src/health_check.rs
|
analytics
|
full_file
| null | null | null | 65
| null | null | null | null | null | null | null |
// Implementation: impl Responder
// File: crates/router/src/routes/routing.rs
// Module: router
// Methods: 0 total (0 public)
impl Responder
|
crates/router/src/routes/routing.rs
|
router
|
impl_block
| null | null | null | 36
| null |
Responder
| null | 0
| 0
| null | null |
// Implementation: impl MessagingInterface for for EventLogger
// File: crates/router/src/events/event_logger.rs
// Module: router
// Methods: 1 total (0 public)
impl MessagingInterface for for EventLogger
|
crates/router/src/events/event_logger.rs
|
router
|
impl_block
| null | null | null | 44
| null |
EventLogger
|
MessagingInterface for
| 1
| 0
| null | null |
// Implementation: impl ConnectorRedirectResponse for for Paypal
// File: crates/hyperswitch_connectors/src/connectors/paypal.rs
// Module: hyperswitch_connectors
// Methods: 1 total (0 public)
impl ConnectorRedirectResponse for for Paypal
|
crates/hyperswitch_connectors/src/connectors/paypal.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 53
| null |
Paypal
|
ConnectorRedirectResponse for
| 1
| 0
| null | null |
// Struct: OpennodePaymentsResponseData
// File: crates/hyperswitch_connectors/src/connectors/opennode/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct OpennodePaymentsResponseData
|
crates/hyperswitch_connectors/src/connectors/opennode/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
OpennodePaymentsResponseData
| 0
|
[] | 53
| null | null | null | null | null | null | null |
// Function: find_by_merchant_id_authentication_id
// File: crates/diesel_models/src/query/authentication.rs
// Module: diesel_models
pub fn find_by_merchant_id_authentication_id(
conn: &PgPooledConn,
merchant_id: &common_utils::id_type::MerchantId,
authentication_id: &common_utils::id_type::AuthenticationId,
) -> StorageResult<Self>
|
crates/diesel_models/src/query/authentication.rs
|
diesel_models
|
function_signature
| null | null | null | 83
|
find_by_merchant_id_authentication_id
| null | null | null | null | null | null |
// Implementation: impl api::Payment for for Gigadat
// File: crates/hyperswitch_connectors/src/connectors/gigadat.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::Payment for for Gigadat
|
crates/hyperswitch_connectors/src/connectors/gigadat.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Gigadat
|
api::Payment for
| 0
| 0
| null | null |
// Struct: ThreedsecureioPostAuthenticationResponse
// File: crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct ThreedsecureioPostAuthenticationResponse
|
crates/hyperswitch_connectors/src/connectors/threedsecureio/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
ThreedsecureioPostAuthenticationResponse
| 0
|
[] | 57
| null | null | null | null | null | null | null |
// Struct: ExternalToken
// File: crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct ExternalToken
|
crates/hyperswitch_connectors/src/connectors/nuvei/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
ExternalToken
| 0
|
[] | 47
| null | null | null | null | null | null | null |
// Implementation: impl ConnectorPreAuthenticationVersionCall for for Gpayments
// File: crates/hyperswitch_connectors/src/connectors/gpayments.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl ConnectorPreAuthenticationVersionCall for for Gpayments
|
crates/hyperswitch_connectors/src/connectors/gpayments.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Gpayments
|
ConnectorPreAuthenticationVersionCall for
| 0
| 0
| null | null |
// Function: get_error_code
// File: crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
// Module: hyperswitch_connectors
pub fn get_error_code(&self) -> String
|
crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
|
hyperswitch_connectors
|
function_signature
| null | null | null | 45
|
get_error_code
| null | null | null | null | null | null |
// Struct: ScoreDataEventResponse
// File: crates/router/src/core/payments/routing/utils.rs
// Module: router
// Implementations: 0
pub struct ScoreDataEventResponse
|
crates/router/src/core/payments/routing/utils.rs
|
router
|
struct_definition
|
ScoreDataEventResponse
| 0
|
[] | 40
| null | null | null | null | null | null | null |
// Implementation: impl api::Refund for for Facilitapay
// File: crates/hyperswitch_connectors/src/connectors/facilitapay.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::Refund for for Facilitapay
|
crates/hyperswitch_connectors/src/connectors/facilitapay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 64
| null |
Facilitapay
|
api::Refund for
| 0
| 0
| null | null |
// Implementation: impl api::MandateSetup for for Gocardless
// File: crates/hyperswitch_connectors/src/connectors/gocardless.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::MandateSetup for for Gocardless
|
crates/hyperswitch_connectors/src/connectors/gocardless.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 64
| null |
Gocardless
|
api::MandateSetup for
| 0
| 0
| null | null |
// Function: get_current_date
// File: crates/router/src/types/storage/revenue_recovery_redis_operation.rs
// Module: router
// Documentation: Get current date in `yyyy-mm-dd` format.
pub fn get_current_date() -> String
|
crates/router/src/types/storage/revenue_recovery_redis_operation.rs
|
router
|
function_signature
| null | null | null | 49
|
get_current_date
| null | null | null | null | null | null |
// Struct: TransactionAuthChargeResponseBody
// File: crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct TransactionAuthChargeResponseBody
|
crates/hyperswitch_connectors/src/connectors/braintree/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
TransactionAuthChargeResponseBody
| 0
|
[] | 50
| null | null | null | null | null | null | null |
// Function: get_idempotent_event_id
// File: crates/router/src/core/webhooks/utils.rs
// Module: router
pub fn get_idempotent_event_id(
primary_object_id: &str,
event_type: types::storage::enums::EventType,
delivery_attempt: types::storage::enums::WebhookDeliveryAttempt,
) -> Result<String, Report<errors::WebhooksFlowError>>
|
crates/router/src/core/webhooks/utils.rs
|
router
|
function_signature
| null | null | null | 85
|
get_idempotent_event_id
| null | null | null | null | null | null |
// Function: apple_pay_certificates_migration
// File: crates/router/src/core/apple_pay_certificates_migration.rs
// Module: router
pub fn apple_pay_certificates_migration(
state: SessionState,
req: &apple_pay_certificates_migration::ApplePayCertificatesMigrationRequest,
) -> CustomResult<
services::ApplicationResponse<
apple_pay_certificates_migration::ApplePayCertificatesMigrationResponse,
>,
errors::ApiErrorResponse,
>
|
crates/router/src/core/apple_pay_certificates_migration.rs
|
router
|
function_signature
| null | null | null | 92
|
apple_pay_certificates_migration
| null | null | null | null | null | null |
// File: crates/storage_impl/src/mock_db/payment_attempt.rs
// Module: storage_impl
use common_utils::errors::CustomResult;
#[cfg(feature = "v2")]
use common_utils::{id_type, types::keymanager::KeyManagerState};
use diesel_models::enums as storage_enums;
#[cfg(feature = "v2")]
use hyperswitch_domain_models::merchant_key_store::MerchantKeyStore;
#[cfg(feature = "v1")]
use hyperswitch_domain_models::payments::payment_attempt::PaymentAttemptNew;
use hyperswitch_domain_models::payments::payment_attempt::{
PaymentAttempt, PaymentAttemptInterface, PaymentAttemptUpdate,
};
use super::MockDb;
use crate::errors::StorageError;
#[cfg(feature = "v1")]
use crate::DataModelExt;
#[async_trait::async_trait]
impl PaymentAttemptInterface for MockDb {
type Error = StorageError;
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_payment_id_merchant_id_attempt_id(
&self,
_payment_id: &common_utils::id_type::PaymentId,
_merchant_id: &common_utils::id_type::MerchantId,
_attempt_id: &str,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(all(feature = "v1", feature = "olap"))]
async fn get_filters_for_payments(
&self,
_pi: &[hyperswitch_domain_models::payments::PaymentIntent],
_merchant_id: &common_utils::id_type::MerchantId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<
hyperswitch_domain_models::payments::payment_attempt::PaymentListFilters,
StorageError,
> {
Err(StorageError::MockDbError)?
}
#[cfg(all(feature = "v1", feature = "olap"))]
async fn get_total_count_of_filtered_payment_attempts(
&self,
_merchant_id: &common_utils::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>>,
_merchanat_connector_id: Option<Vec<common_utils::id_type::MerchantConnectorAccountId>>,
_card_network: Option<Vec<storage_enums::CardNetwork>>,
_card_discovery: Option<Vec<storage_enums::CardDiscovery>>,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<i64, StorageError> {
Err(StorageError::MockDbError)?
}
#[cfg(all(feature = "v2", feature = "olap"))]
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<storage_enums::CardNetwork>>,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<i64, StorageError> {
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_attempt_id_merchant_id(
&self,
_attempt_id: &str,
_merchant_id: &common_utils::id_type::MerchantId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v2")]
async fn find_payment_attempt_by_id(
&self,
_key_manager_state: &KeyManagerState,
_merchant_key_store: &MerchantKeyStore,
_attempt_id: &id_type::GlobalAttemptId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> error_stack::Result<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v2")]
async fn find_payment_attempts_by_payment_intent_id(
&self,
_key_manager_state: &KeyManagerState,
_id: &id_type::GlobalPaymentId,
_merchant_key_store: &MerchantKeyStore,
_storage_scheme: common_enums::MerchantStorageScheme,
) -> error_stack::Result<Vec<PaymentAttempt>, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_preprocessing_id_merchant_id(
&self,
_preprocessing_id: &str,
_merchant_id: &common_utils::id_type::MerchantId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v1")]
async fn find_payment_attempt_by_merchant_id_connector_txn_id(
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_connector_txn_id: &str,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v2")]
async fn find_payment_attempt_by_profile_id_connector_transaction_id(
&self,
_key_manager_state: &KeyManagerState,
_merchant_key_store: &MerchantKeyStore,
_profile_id: &id_type::ProfileId,
_connector_transaction_id: &str,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v1")]
async fn find_attempts_by_merchant_id_payment_id(
&self,
_merchant_id: &common_utils::id_type::MerchantId,
_payment_id: &common_utils::id_type::PaymentId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<Vec<PaymentAttempt>, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v1")]
#[allow(clippy::panic)]
async fn insert_payment_attempt(
&self,
payment_attempt: PaymentAttemptNew,
storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
let mut payment_attempts = self.payment_attempts.lock().await;
let time = common_utils::date_time::now();
let payment_attempt = PaymentAttempt {
payment_id: payment_attempt.payment_id,
merchant_id: payment_attempt.merchant_id,
attempt_id: payment_attempt.attempt_id,
status: payment_attempt.status,
net_amount: payment_attempt.net_amount,
currency: payment_attempt.currency,
save_to_locker: payment_attempt.save_to_locker,
connector: payment_attempt.connector,
error_message: payment_attempt.error_message,
offer_amount: payment_attempt.offer_amount,
payment_method_id: payment_attempt.payment_method_id,
payment_method: payment_attempt.payment_method,
connector_transaction_id: None,
capture_method: payment_attempt.capture_method,
capture_on: payment_attempt.capture_on,
confirm: payment_attempt.confirm,
authentication_type: payment_attempt.authentication_type,
created_at: payment_attempt.created_at.unwrap_or(time),
modified_at: payment_attempt.modified_at.unwrap_or(time),
last_synced: payment_attempt.last_synced,
cancellation_reason: payment_attempt.cancellation_reason,
amount_to_capture: payment_attempt.amount_to_capture,
mandate_id: None,
browser_info: None,
payment_token: None,
error_code: payment_attempt.error_code,
connector_metadata: None,
charge_id: None,
payment_experience: payment_attempt.payment_experience,
payment_method_type: payment_attempt.payment_method_type,
payment_method_data: payment_attempt.payment_method_data,
business_sub_label: payment_attempt.business_sub_label,
straight_through_algorithm: payment_attempt.straight_through_algorithm,
mandate_details: payment_attempt.mandate_details,
preprocessing_step_id: payment_attempt.preprocessing_step_id,
error_reason: payment_attempt.error_reason,
multiple_capture_count: payment_attempt.multiple_capture_count,
connector_response_reference_id: None,
amount_capturable: payment_attempt.amount_capturable,
updated_by: storage_scheme.to_string(),
authentication_data: payment_attempt.authentication_data,
encoded_data: payment_attempt.encoded_data,
merchant_connector_id: payment_attempt.merchant_connector_id,
unified_code: payment_attempt.unified_code,
unified_message: payment_attempt.unified_message,
external_three_ds_authentication_attempted: payment_attempt
.external_three_ds_authentication_attempted,
authentication_connector: payment_attempt.authentication_connector,
authentication_id: payment_attempt.authentication_id,
mandate_data: payment_attempt.mandate_data,
payment_method_billing_address_id: payment_attempt.payment_method_billing_address_id,
fingerprint_id: payment_attempt.fingerprint_id,
client_source: payment_attempt.client_source,
client_version: payment_attempt.client_version,
customer_acceptance: payment_attempt.customer_acceptance,
organization_id: payment_attempt.organization_id,
profile_id: payment_attempt.profile_id,
connector_mandate_detail: payment_attempt.connector_mandate_detail,
request_extended_authorization: payment_attempt.request_extended_authorization,
extended_authorization_applied: payment_attempt.extended_authorization_applied,
capture_before: payment_attempt.capture_before,
card_discovery: payment_attempt.card_discovery,
charges: None,
issuer_error_code: None,
issuer_error_message: None,
processor_merchant_id: payment_attempt.processor_merchant_id,
created_by: payment_attempt.created_by,
setup_future_usage_applied: payment_attempt.setup_future_usage_applied,
routing_approach: payment_attempt.routing_approach,
connector_request_reference_id: payment_attempt.connector_request_reference_id,
debit_routing_savings: None,
network_transaction_id: payment_attempt.network_transaction_id,
is_overcapture_enabled: None,
network_details: payment_attempt.network_details,
is_stored_credential: payment_attempt.is_stored_credential,
};
payment_attempts.push(payment_attempt.clone());
Ok(payment_attempt)
}
#[cfg(feature = "v2")]
#[allow(clippy::panic)]
async fn insert_payment_attempt(
&self,
_key_manager_state: &KeyManagerState,
_merchant_key_store: &MerchantKeyStore,
_payment_attempt: PaymentAttempt,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v1")]
// safety: only used for testing
#[allow(clippy::unwrap_used)]
async fn update_payment_attempt_with_attempt_id(
&self,
this: PaymentAttempt,
payment_attempt: PaymentAttemptUpdate,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
let mut payment_attempts = self.payment_attempts.lock().await;
let item = payment_attempts
.iter_mut()
.find(|item| item.attempt_id == this.attempt_id)
.unwrap();
*item = PaymentAttempt::from_storage_model(
payment_attempt
.to_storage_model()
.apply_changeset(this.to_storage_model()),
);
Ok(item.clone())
}
#[cfg(feature = "v2")]
async fn update_payment_attempt(
&self,
_key_manager_state: &KeyManagerState,
_merchant_key_store: &MerchantKeyStore,
_this: PaymentAttempt,
_payment_attempt: PaymentAttemptUpdate,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[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: &common_utils::id_type::PaymentId,
_merchant_id: &common_utils::id_type::MerchantId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
// [#172]: Implement function for `MockDb`
Err(StorageError::MockDbError)?
}
#[cfg(feature = "v1")]
// safety: only used for testing
#[allow(clippy::unwrap_used)]
async fn find_payment_attempt_last_successful_attempt_by_payment_id_merchant_id(
&self,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
let payment_attempts = self.payment_attempts.lock().await;
Ok(payment_attempts
.iter()
.find(|payment_attempt| {
payment_attempt.payment_id == *payment_id
&& payment_attempt.merchant_id.eq(merchant_id)
})
.cloned()
.unwrap())
}
#[cfg(feature = "v1")]
#[allow(clippy::unwrap_used)]
async fn find_payment_attempt_last_successful_or_partially_captured_attempt_by_payment_id_merchant_id(
&self,
payment_id: &common_utils::id_type::PaymentId,
merchant_id: &common_utils::id_type::MerchantId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
let payment_attempts = self.payment_attempts.lock().await;
Ok(payment_attempts
.iter()
.find(|payment_attempt| {
payment_attempt.payment_id == *payment_id
&& payment_attempt.merchant_id.eq(merchant_id)
&& (payment_attempt.status == storage_enums::AttemptStatus::PartialCharged
|| payment_attempt.status == storage_enums::AttemptStatus::Charged)
})
.cloned()
.unwrap())
}
#[cfg(feature = "v2")]
#[allow(clippy::unwrap_used)]
async fn find_payment_attempt_last_successful_or_partially_captured_attempt_by_payment_id(
&self,
_key_manager_state: &KeyManagerState,
_merchant_key_store: &MerchantKeyStore,
payment_id: &id_type::GlobalPaymentId,
_storage_scheme: storage_enums::MerchantStorageScheme,
) -> CustomResult<PaymentAttempt, StorageError> {
let payment_attempts = self.payment_attempts.lock().await;
Ok(payment_attempts
.iter()
.find(|payment_attempt| {
payment_attempt.payment_id == *payment_id
&& (payment_attempt.status == storage_enums::AttemptStatus::PartialCharged
|| payment_attempt.status == storage_enums::AttemptStatus::Charged)
})
.cloned()
.unwrap())
}
}
|
crates/storage_impl/src/mock_db/payment_attempt.rs
|
storage_impl
|
full_file
| null | null | null | 3,475
| null | null | null | null | null | null | null |
// Struct: PartnerReferralRestApiIntegration
// File: crates/router/src/types/api/connector_onboarding/paypal.rs
// Module: router
// Implementations: 0
pub struct PartnerReferralRestApiIntegration
|
crates/router/src/types/api/connector_onboarding/paypal.rs
|
router
|
struct_definition
|
PartnerReferralRestApiIntegration
| 0
|
[] | 46
| null | null | null | null | null | null | null |
// Struct: PaymentMethodType
// File: crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct PaymentMethodType
|
crates/hyperswitch_connectors/src/connectors/jpmorgan/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
PaymentMethodType
| 0
|
[] | 48
| null | null | null | null | null | null | null |
// Function: get_webhook_response
// File: crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
// Module: hyperswitch_connectors
pub fn get_webhook_response(
body: &[u8],
) -> CustomResult<GetnetWebhookNotificationResponse, errors::ConnectorError>
|
crates/hyperswitch_connectors/src/connectors/getnet/transformers.rs
|
hyperswitch_connectors
|
function_signature
| null | null | null | 67
|
get_webhook_response
| null | null | null | null | null | null |
// Struct: Profile
// File: crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct Profile
|
crates/hyperswitch_connectors/src/connectors/bankofamerica/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
Profile
| 0
|
[] | 46
| null | null | null | null | null | null | null |
// Function: apply_changeset
// File: crates/diesel_models/src/customers.rs
// Module: diesel_models
pub fn apply_changeset(self, source: Customer) -> Customer
|
crates/diesel_models/src/customers.rs
|
diesel_models
|
function_signature
| null | null | null | 38
|
apply_changeset
| null | null | null | null | null | null |
// File: crates/analytics/src/payment_intents/core.rs
// Module: analytics
// Public functions: 3
#![allow(dead_code)]
use std::collections::{HashMap, HashSet};
use api_models::analytics::{
payment_intents::{
MetricsBucketResponse, PaymentIntentDimensions, PaymentIntentMetrics,
PaymentIntentMetricsBucketIdentifier,
},
GetPaymentIntentFiltersRequest, GetPaymentIntentMetricRequest, PaymentIntentFilterValue,
PaymentIntentFiltersResponse, PaymentIntentsAnalyticsMetadata, PaymentIntentsMetricsResponse,
};
use bigdecimal::ToPrimitive;
use common_enums::Currency;
use common_utils::{errors::CustomResult, types::TimeRange};
use currency_conversion::{conversion::convert, types::ExchangeRates};
use error_stack::ResultExt;
use router_env::{
instrument, logger,
tracing::{self, Instrument},
};
use super::{
filters::{get_payment_intent_filter_for_dimension, PaymentIntentFilterRow},
metrics::PaymentIntentMetricRow,
sankey::{get_sankey_data, SankeyRow},
PaymentIntentMetricsAccumulator,
};
use crate::{
enums::AuthInfo,
errors::{AnalyticsError, AnalyticsResult},
metrics,
payment_intents::PaymentIntentMetricAccumulator,
AnalyticsProvider,
};
#[derive(Debug)]
pub enum TaskType {
MetricTask(
PaymentIntentMetrics,
CustomResult<
HashSet<(PaymentIntentMetricsBucketIdentifier, PaymentIntentMetricRow)>,
AnalyticsError,
>,
),
}
#[instrument(skip_all)]
pub async fn get_sankey(
pool: &AnalyticsProvider,
auth: &AuthInfo,
req: TimeRange,
) -> AnalyticsResult<Vec<SankeyRow>> {
match pool {
AnalyticsProvider::Sqlx(_) => Err(AnalyticsError::NotImplemented(
"Sankey not implemented for sqlx",
))?,
AnalyticsProvider::Clickhouse(ckh_pool)
| AnalyticsProvider::CombinedCkh(_, ckh_pool)
| AnalyticsProvider::CombinedSqlx(_, ckh_pool) => {
let sankey_rows = get_sankey_data(ckh_pool, auth, &req)
.await
.change_context(AnalyticsError::UnknownError)?;
Ok(sankey_rows)
}
}
}
#[instrument(skip_all)]
pub async fn get_metrics(
pool: &AnalyticsProvider,
ex_rates: &Option<ExchangeRates>,
auth: &AuthInfo,
req: GetPaymentIntentMetricRequest,
) -> AnalyticsResult<PaymentIntentsMetricsResponse<MetricsBucketResponse>> {
let mut metrics_accumulator: HashMap<
PaymentIntentMetricsBucketIdentifier,
PaymentIntentMetricsAccumulator,
> = HashMap::new();
let mut set = tokio::task::JoinSet::new();
for metric_type in req.metrics.iter().cloned() {
let req = req.clone();
let pool = pool.clone();
let task_span = tracing::debug_span!(
"analytics_payment_intents_metrics_query",
payment_metric = metric_type.as_ref()
);
// TODO: lifetime issues with joinset,
// can be optimized away if joinset lifetime requirements are relaxed
let auth_scoped = auth.to_owned();
set.spawn(
async move {
let data = pool
.get_payment_intent_metrics(
&metric_type,
&req.group_by_names.clone(),
&auth_scoped,
&req.filters,
req.time_series.map(|t| t.granularity),
&req.time_range,
)
.await
.change_context(AnalyticsError::UnknownError);
TaskType::MetricTask(metric_type, data)
}
.instrument(task_span),
);
}
while let Some(task_type) = set
.join_next()
.await
.transpose()
.change_context(AnalyticsError::UnknownError)?
{
match task_type {
TaskType::MetricTask(metric, data) => {
let data = data?;
let attributes = router_env::metric_attributes!(
("metric_type", metric.to_string()),
("source", pool.to_string()),
);
let value = u64::try_from(data.len());
if let Ok(val) = value {
metrics::BUCKETS_FETCHED.record(val, attributes);
logger::debug!("Attributes: {:?}, Buckets fetched: {}", attributes, val);
}
for (id, value) in data {
logger::debug!(bucket_id=?id, bucket_value=?value, "Bucket row for metric {metric}");
let metrics_builder = metrics_accumulator.entry(id).or_default();
match metric {
PaymentIntentMetrics::SuccessfulSmartRetries
| PaymentIntentMetrics::SessionizedSuccessfulSmartRetries => {
metrics_builder
.successful_smart_retries
.add_metrics_bucket(&value)
}
PaymentIntentMetrics::TotalSmartRetries
| PaymentIntentMetrics::SessionizedTotalSmartRetries => metrics_builder
.total_smart_retries
.add_metrics_bucket(&value),
PaymentIntentMetrics::SmartRetriedAmount
| PaymentIntentMetrics::SessionizedSmartRetriedAmount => metrics_builder
.smart_retried_amount
.add_metrics_bucket(&value),
PaymentIntentMetrics::PaymentIntentCount
| PaymentIntentMetrics::SessionizedPaymentIntentCount => metrics_builder
.payment_intent_count
.add_metrics_bucket(&value),
PaymentIntentMetrics::PaymentsSuccessRate
| PaymentIntentMetrics::SessionizedPaymentsSuccessRate => metrics_builder
.payments_success_rate
.add_metrics_bucket(&value),
PaymentIntentMetrics::SessionizedPaymentProcessedAmount
| PaymentIntentMetrics::PaymentProcessedAmount => metrics_builder
.payment_processed_amount
.add_metrics_bucket(&value),
PaymentIntentMetrics::SessionizedPaymentsDistribution => metrics_builder
.payments_distribution
.add_metrics_bucket(&value),
}
}
logger::debug!(
"Analytics Accumulated Results: metric: {}, results: {:#?}",
metric,
metrics_accumulator
);
}
}
}
let mut success = 0;
let mut success_without_smart_retries = 0;
let mut total_smart_retried_amount = 0;
let mut total_smart_retried_amount_in_usd = 0;
let mut total_smart_retried_amount_without_smart_retries = 0;
let mut total_smart_retried_amount_without_smart_retries_in_usd = 0;
let mut total = 0;
let mut total_payment_processed_amount = 0;
let mut total_payment_processed_amount_in_usd = 0;
let mut total_payment_processed_count = 0;
let mut total_payment_processed_amount_without_smart_retries = 0;
let mut total_payment_processed_amount_without_smart_retries_in_usd = 0;
let mut total_payment_processed_count_without_smart_retries = 0;
let query_data: Vec<MetricsBucketResponse> = metrics_accumulator
.into_iter()
.map(|(id, val)| {
let mut collected_values = val.collect();
if let Some(success_count) = collected_values.successful_payments {
success += success_count;
}
if let Some(success_count) = collected_values.successful_payments_without_smart_retries
{
success_without_smart_retries += success_count;
}
if let Some(total_count) = collected_values.total_payments {
total += total_count;
}
if let Some(retried_amount) = collected_values.smart_retried_amount {
let amount_in_usd = if let Some(ex_rates) = ex_rates {
id.currency
.and_then(|currency| {
i64::try_from(retried_amount)
.inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
.ok()
.and_then(|amount_i64| {
convert(ex_rates, currency, Currency::USD, amount_i64)
.inspect_err(|e| {
logger::error!("Currency conversion error: {:?}", e)
})
.ok()
})
})
.map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
.unwrap_or_default()
} else {
None
};
collected_values.smart_retried_amount_in_usd = amount_in_usd;
total_smart_retried_amount += retried_amount;
total_smart_retried_amount_in_usd += amount_in_usd.unwrap_or(0);
}
if let Some(retried_amount) =
collected_values.smart_retried_amount_without_smart_retries
{
let amount_in_usd = if let Some(ex_rates) = ex_rates {
id.currency
.and_then(|currency| {
i64::try_from(retried_amount)
.inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
.ok()
.and_then(|amount_i64| {
convert(ex_rates, currency, Currency::USD, amount_i64)
.inspect_err(|e| {
logger::error!("Currency conversion error: {:?}", e)
})
.ok()
})
})
.map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
.unwrap_or_default()
} else {
None
};
collected_values.smart_retried_amount_without_smart_retries_in_usd = amount_in_usd;
total_smart_retried_amount_without_smart_retries += retried_amount;
total_smart_retried_amount_without_smart_retries_in_usd +=
amount_in_usd.unwrap_or(0);
}
if let Some(amount) = collected_values.payment_processed_amount {
let amount_in_usd = if let Some(ex_rates) = ex_rates {
id.currency
.and_then(|currency| {
i64::try_from(amount)
.inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
.ok()
.and_then(|amount_i64| {
convert(ex_rates, currency, Currency::USD, amount_i64)
.inspect_err(|e| {
logger::error!("Currency conversion error: {:?}", e)
})
.ok()
})
})
.map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
.unwrap_or_default()
} else {
None
};
collected_values.payment_processed_amount_in_usd = amount_in_usd;
total_payment_processed_amount_in_usd += amount_in_usd.unwrap_or(0);
total_payment_processed_amount += amount;
}
if let Some(count) = collected_values.payment_processed_count {
total_payment_processed_count += count;
}
if let Some(amount) = collected_values.payment_processed_amount_without_smart_retries {
let amount_in_usd = if let Some(ex_rates) = ex_rates {
id.currency
.and_then(|currency| {
i64::try_from(amount)
.inspect_err(|e| logger::error!("Amount conversion error: {:?}", e))
.ok()
.and_then(|amount_i64| {
convert(ex_rates, currency, Currency::USD, amount_i64)
.inspect_err(|e| {
logger::error!("Currency conversion error: {:?}", e)
})
.ok()
})
})
.map(|amount| (amount * rust_decimal::Decimal::new(100, 0)).to_u64())
.unwrap_or_default()
} else {
None
};
collected_values.payment_processed_amount_without_smart_retries_in_usd =
amount_in_usd;
total_payment_processed_amount_without_smart_retries_in_usd +=
amount_in_usd.unwrap_or(0);
total_payment_processed_amount_without_smart_retries += amount;
}
if let Some(count) = collected_values.payment_processed_count_without_smart_retries {
total_payment_processed_count_without_smart_retries += count;
}
MetricsBucketResponse {
values: collected_values,
dimensions: id,
}
})
.collect();
let total_success_rate = match (success, total) {
(s, t) if t > 0 => Some(f64::from(s) * 100.0 / f64::from(t)),
_ => None,
};
let total_success_rate_without_smart_retries = match (success_without_smart_retries, total) {
(s, t) if t > 0 => Some(f64::from(s) * 100.0 / f64::from(t)),
_ => None,
};
Ok(PaymentIntentsMetricsResponse {
query_data,
meta_data: [PaymentIntentsAnalyticsMetadata {
total_success_rate,
total_success_rate_without_smart_retries,
total_smart_retried_amount: Some(total_smart_retried_amount),
total_smart_retried_amount_without_smart_retries: Some(
total_smart_retried_amount_without_smart_retries,
),
total_payment_processed_amount: Some(total_payment_processed_amount),
total_payment_processed_amount_without_smart_retries: Some(
total_payment_processed_amount_without_smart_retries,
),
total_smart_retried_amount_in_usd: if ex_rates.is_some() {
Some(total_smart_retried_amount_in_usd)
} else {
None
},
total_smart_retried_amount_without_smart_retries_in_usd: if ex_rates.is_some() {
Some(total_smart_retried_amount_without_smart_retries_in_usd)
} else {
None
},
total_payment_processed_amount_in_usd: if ex_rates.is_some() {
Some(total_payment_processed_amount_in_usd)
} else {
None
},
total_payment_processed_amount_without_smart_retries_in_usd: if ex_rates.is_some() {
Some(total_payment_processed_amount_without_smart_retries_in_usd)
} else {
None
},
total_payment_processed_count: Some(total_payment_processed_count),
total_payment_processed_count_without_smart_retries: Some(
total_payment_processed_count_without_smart_retries,
),
}],
})
}
pub async fn get_filters(
pool: &AnalyticsProvider,
req: GetPaymentIntentFiltersRequest,
merchant_id: &common_utils::id_type::MerchantId,
) -> AnalyticsResult<PaymentIntentFiltersResponse> {
let mut res = PaymentIntentFiltersResponse::default();
for dim in req.group_by_names {
let values = match pool {
AnalyticsProvider::Sqlx(pool) => {
get_payment_intent_filter_for_dimension(dim, merchant_id, &req.time_range, pool)
.await
}
AnalyticsProvider::Clickhouse(pool) => {
get_payment_intent_filter_for_dimension(dim, merchant_id, &req.time_range, pool)
.await
}
AnalyticsProvider::CombinedCkh(sqlx_poll, ckh_pool) => {
let ckh_result = get_payment_intent_filter_for_dimension(
dim,
merchant_id,
&req.time_range,
ckh_pool,
)
.await;
let sqlx_result = get_payment_intent_filter_for_dimension(
dim,
merchant_id,
&req.time_range,
sqlx_poll,
)
.await;
match (&sqlx_result, &ckh_result) {
(Ok(ref sqlx_res), Ok(ref ckh_res)) if sqlx_res != ckh_res => {
router_env::logger::error!(clickhouse_result=?ckh_res, postgres_result=?sqlx_res, "Mismatch between clickhouse & postgres payment intents analytics filters")
},
_ => {}
};
ckh_result
}
AnalyticsProvider::CombinedSqlx(sqlx_poll, ckh_pool) => {
let ckh_result = get_payment_intent_filter_for_dimension(
dim,
merchant_id,
&req.time_range,
ckh_pool,
)
.await;
let sqlx_result = get_payment_intent_filter_for_dimension(
dim,
merchant_id,
&req.time_range,
sqlx_poll,
)
.await;
match (&sqlx_result, &ckh_result) {
(Ok(ref sqlx_res), Ok(ref ckh_res)) if sqlx_res != ckh_res => {
router_env::logger::error!(clickhouse_result=?ckh_res, postgres_result=?sqlx_res, "Mismatch between clickhouse & postgres payment intents analytics filters")
},
_ => {}
};
sqlx_result
}
}
.change_context(AnalyticsError::UnknownError)?
.into_iter()
.filter_map(|fil: PaymentIntentFilterRow| match dim {
PaymentIntentDimensions::PaymentIntentStatus => fil.status.map(|i| i.as_ref().to_string()),
PaymentIntentDimensions::Currency => fil.currency.map(|i| i.as_ref().to_string()),
PaymentIntentDimensions::ProfileId => fil.profile_id,
PaymentIntentDimensions::Connector => fil.connector,
PaymentIntentDimensions::AuthType => fil.authentication_type.map(|i| i.as_ref().to_string()),
PaymentIntentDimensions::PaymentMethod => fil.payment_method,
PaymentIntentDimensions::PaymentMethodType => fil.payment_method_type,
PaymentIntentDimensions::CardNetwork => fil.card_network,
PaymentIntentDimensions::MerchantId => fil.merchant_id,
PaymentIntentDimensions::CardLast4 => fil.card_last_4,
PaymentIntentDimensions::CardIssuer => fil.card_issuer,
PaymentIntentDimensions::ErrorReason => fil.error_reason,
})
.collect::<Vec<String>>();
res.query_data.push(PaymentIntentFilterValue {
dimension: dim,
values,
})
}
Ok(res)
}
|
crates/analytics/src/payment_intents/core.rs
|
analytics
|
full_file
| null | null | null | 3,768
| null | null | null | null | null | null | null |
// Function: collect
// File: crates/analytics/src/disputes/accumulators.rs
// Module: analytics
pub fn collect(self) -> DisputeMetricsBucketValue
|
crates/analytics/src/disputes/accumulators.rs
|
analytics
|
function_signature
| null | null | null | 36
|
collect
| null | null | null | null | null | null |
// File: crates/api_models/src/conditional_configs.rs
// Module: api_models
// Public structs: 4
use common_utils::events;
use euclid::frontend::ast::Program;
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct DecisionManagerRecord {
pub name: String,
pub program: Program<common_types::payments::ConditionalConfigs>,
pub created_at: i64,
pub modified_at: i64,
}
impl events::ApiEventMetric for DecisionManagerRecord {
fn get_api_event_type(&self) -> Option<events::ApiEventsType> {
Some(events::ApiEventsType::Routing)
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(deny_unknown_fields)]
pub struct ConditionalConfigReq {
pub name: Option<String>,
pub algorithm: Option<Program<common_types::payments::ConditionalConfigs>>,
}
#[cfg(feature = "v1")]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct DecisionManagerRequest {
pub name: Option<String>,
pub program: Option<Program<common_types::payments::ConditionalConfigs>>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
#[serde(untagged)]
pub enum DecisionManager {
DecisionManagerv0(ConditionalConfigReq),
DecisionManagerv1(DecisionManagerRequest),
}
impl events::ApiEventMetric for DecisionManager {
fn get_api_event_type(&self) -> Option<events::ApiEventsType> {
Some(events::ApiEventsType::Routing)
}
}
pub type DecisionManagerResponse = DecisionManagerRecord;
#[cfg(feature = "v2")]
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct DecisionManagerRequest {
pub name: String,
pub program: Program<common_types::payments::ConditionalConfigs>,
}
#[cfg(feature = "v2")]
impl events::ApiEventMetric for DecisionManagerRequest {
fn get_api_event_type(&self) -> Option<events::ApiEventsType> {
Some(events::ApiEventsType::Routing)
}
}
|
crates/api_models/src/conditional_configs.rs
|
api_models
|
full_file
| null | null | null | 446
| null | null | null | null | null | null | null |
// Implementation: impl IncomingWebhook for for Worldpay
// File: crates/hyperswitch_connectors/src/connectors/worldpay.rs
// Module: hyperswitch_connectors
// Methods: 9 total (0 public)
impl IncomingWebhook for for Worldpay
|
crates/hyperswitch_connectors/src/connectors/worldpay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 55
| null |
Worldpay
|
IncomingWebhook for
| 9
| 0
| null | null |
// Function: is_refund_event
// File: crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
// Module: hyperswitch_connectors
pub fn is_refund_event(event_code: &CheckoutWebhookEventType) -> bool
|
crates/hyperswitch_connectors/src/connectors/checkout/transformers.rs
|
hyperswitch_connectors
|
function_signature
| null | null | null | 53
|
is_refund_event
| null | null | null | null | null | null |
// Implementation: impl ConnectorSpecifications for for Placetopay
// File: crates/hyperswitch_connectors/src/connectors/placetopay.rs
// Module: hyperswitch_connectors
// Methods: 3 total (0 public)
impl ConnectorSpecifications for for Placetopay
|
crates/hyperswitch_connectors/src/connectors/placetopay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Placetopay
|
ConnectorSpecifications for
| 3
| 0
| null | null |
// Struct: PaymentIntentFilters
// File: crates/api_models/src/analytics/payment_intents.rs
// Module: api_models
// Implementations: 0
pub struct PaymentIntentFilters
|
crates/api_models/src/analytics/payment_intents.rs
|
api_models
|
struct_definition
|
PaymentIntentFilters
| 0
|
[] | 39
| null | null | null | null | null | null | null |
// Function: get_id
// File: crates/diesel_models/src/business_profile.rs
// Module: diesel_models
pub fn get_id(&self) -> &common_utils::id_type::ProfileId
|
crates/diesel_models/src/business_profile.rs
|
diesel_models
|
function_signature
| null | null | null | 41
|
get_id
| null | null | null | null | null | null |
// Function: list_user_authentication_methods
// File: crates/router/src/routes/user.rs
// Module: router
pub fn list_user_authentication_methods(
state: web::Data<AppState>,
req: HttpRequest,
query: web::Query<user_api::GetUserAuthenticationMethodsRequest>,
) -> HttpResponse
|
crates/router/src/routes/user.rs
|
router
|
function_signature
| null | null | null | 63
|
list_user_authentication_methods
| null | null | null | null | null | null |
// Struct: FrmFilterValue
// File: crates/api_models/src/analytics.rs
// Module: api_models
// Implementations: 1
// Traits: ApiEventMetric
pub struct FrmFilterValue
|
crates/api_models/src/analytics.rs
|
api_models
|
struct_definition
|
FrmFilterValue
| 1
|
[
"ApiEventMetric"
] | 43
| null | null | null | null | null | null | null |
// Struct: ElavonRefundRequest
// File: crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct ElavonRefundRequest
|
crates/hyperswitch_connectors/src/connectors/elavon/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
ElavonRefundRequest
| 0
|
[] | 54
| null | null | null | null | null | null | null |
// Function: retrieve_poll_status
// File: crates/router/src/core/poll.rs
// Module: router
pub fn retrieve_poll_status(
state: SessionState,
req: crate::types::api::PollId,
merchant_context: domain::MerchantContext,
) -> RouterResponse<PollResponse>
|
crates/router/src/core/poll.rs
|
router
|
function_signature
| null | null | null | 64
|
retrieve_poll_status
| null | null | null | null | null | null |
// Function: four_digits
// File: crates/cards/src/lib.rs
// Module: cards
pub fn four_digits(&self) -> String
|
crates/cards/src/lib.rs
|
cards
|
function_signature
| null | null | null | 29
|
four_digits
| null | null | null | null | null | null |
// Implementation: impl api::PaymentSession for for Globalpay
// File: crates/hyperswitch_connectors/src/connectors/globalpay.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentSession for for Globalpay
|
crates/hyperswitch_connectors/src/connectors/globalpay.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 57
| null |
Globalpay
|
api::PaymentSession for
| 0
| 0
| null | null |
// Function: customers_retrieve
// File: crates/router/src/routes/customers.rs
// Module: router
pub fn customers_retrieve(
state: web::Data<AppState>,
req: HttpRequest,
path: web::Path<id_type::CustomerId>,
) -> HttpResponse
|
crates/router/src/routes/customers.rs
|
router
|
function_signature
| null | null | null | 58
|
customers_retrieve
| null | null | null | null | null | null |
// Struct: SantanderTime
// File: crates/hyperswitch_connectors/src/connectors/santander/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct SantanderTime
|
crates/hyperswitch_connectors/src/connectors/santander/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
SantanderTime
| 0
|
[] | 48
| null | null | null | null | null | null | null |
// Implementation: impl UploadFile for for Worldpayvantiv
// File: crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl UploadFile for for Worldpayvantiv
|
crates/hyperswitch_connectors/src/connectors/worldpayvantiv.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Worldpayvantiv
|
UploadFile for
| 0
| 0
| null | null |
// Struct: XenditRefundRequest
// File: crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct XenditRefundRequest
|
crates/hyperswitch_connectors/src/connectors/xendit/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
XenditRefundRequest
| 0
|
[] | 54
| null | null | null | null | null | null | null |
// Implementation: impl api::PaymentAuthorize for for Wellsfargopayout
// File: crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentAuthorize for for Wellsfargopayout
|
crates/hyperswitch_connectors/src/connectors/wellsfargopayout.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 67
| null |
Wellsfargopayout
|
api::PaymentAuthorize for
| 0
| 0
| null | null |
// Implementation: impl RedisSettings
// File: crates/redis_interface/src/types.rs
// Module: redis_interface
// Methods: 1 total (1 public)
impl RedisSettings
|
crates/redis_interface/src/types.rs
|
redis_interface
|
impl_block
| null | null | null | 37
| null |
RedisSettings
| null | 1
| 1
| null | null |
// Function: parse_routing_algorithm
// File: crates/api_models/src/routing.rs
// Module: api_models
pub fn parse_routing_algorithm(
value: Option<pii::SecretSerdeValue>,
) -> Result<Option<Self>, error_stack::Report<ParsingError>>
|
crates/api_models/src/routing.rs
|
api_models
|
function_signature
| null | null | null | 57
|
parse_routing_algorithm
| null | null | null | null | null | null |
// Implementation: impl Responder
// File: crates/router/src/routes/routing.rs
// Module: router
// Methods: 0 total (0 public)
impl Responder
|
crates/router/src/routes/routing.rs
|
router
|
impl_block
| null | null | null | 36
| null |
Responder
| null | 0
| 0
| null | null |
// Struct: CoingateConnectorMetadataObject
// File: crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct CoingateConnectorMetadataObject
|
crates/hyperswitch_connectors/src/connectors/coingate/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
CoingateConnectorMetadataObject
| 0
|
[] | 54
| null | null | null | null | null | null | null |
// Struct: DeutschebankThreeDSInitializeResponseChallengeRequired
// File: crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct DeutschebankThreeDSInitializeResponseChallengeRequired
|
crates/hyperswitch_connectors/src/connectors/deutschebank/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
DeutschebankThreeDSInitializeResponseChallengeRequired
| 0
|
[] | 58
| null | null | null | null | null | null | null |
// Function: get_metadata_as_secret
// File: crates/api_models/src/admin.rs
// Module: api_models
pub fn get_metadata_as_secret(
&self,
) -> CustomResult<Option<pii::SecretSerdeValue>, errors::ParsingError>
|
crates/api_models/src/admin.rs
|
api_models
|
function_signature
| null | null | null | 54
|
get_metadata_as_secret
| null | null | null | null | null | null |
// Struct: OnboardingSyncRequest
// File: crates/api_models/src/connector_onboarding.rs
// Module: api_models
// Implementations: 0
pub struct OnboardingSyncRequest
|
crates/api_models/src/connector_onboarding.rs
|
api_models
|
struct_definition
|
OnboardingSyncRequest
| 0
|
[] | 40
| null | null | null | null | null | null | null |
// Implementation: impl api::PaymentAuthorize for for Mpgs
// File: crates/hyperswitch_connectors/src/connectors/mpgs.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::PaymentAuthorize for for Mpgs
|
crates/hyperswitch_connectors/src/connectors/mpgs.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 59
| null |
Mpgs
|
api::PaymentAuthorize for
| 0
| 0
| null | null |
// File: crates/storage_impl/src/redis.rs
// Module: storage_impl
// Public functions: 2
// Public structs: 1
pub mod cache;
pub mod kv_store;
pub mod pub_sub;
use std::sync::{atomic, Arc};
use router_env::tracing::Instrument;
use self::{kv_store::RedisConnInterface, pub_sub::PubSubInterface};
#[derive(Clone)]
pub struct RedisStore {
// Maybe expose the redis_conn via traits instead of the making the field public
pub(crate) redis_conn: Arc<redis_interface::RedisConnectionPool>,
}
impl std::fmt::Debug for RedisStore {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("CacheStore")
.field("redis_conn", &"Redis conn doesn't implement debug")
.finish()
}
}
impl RedisStore {
pub async fn new(
conf: &redis_interface::RedisSettings,
) -> error_stack::Result<Self, redis_interface::errors::RedisError> {
Ok(Self {
redis_conn: Arc::new(redis_interface::RedisConnectionPool::new(conf).await?),
})
}
pub fn set_error_callback(&self, callback: tokio::sync::oneshot::Sender<()>) {
let redis_clone = self.redis_conn.clone();
let _task_handle = tokio::spawn(
async move {
redis_clone.on_error(callback).await;
}
.in_current_span(),
);
}
}
impl RedisConnInterface for RedisStore {
fn get_redis_conn(
&self,
) -> error_stack::Result<
Arc<redis_interface::RedisConnectionPool>,
redis_interface::errors::RedisError,
> {
if self
.redis_conn
.is_redis_available
.load(atomic::Ordering::SeqCst)
{
Ok(self.redis_conn.clone())
} else {
Err(redis_interface::errors::RedisError::RedisConnectionError.into())
}
}
}
|
crates/storage_impl/src/redis.rs
|
storage_impl
|
full_file
| null | null | null | 435
| null | null | null | null | null | null | null |
// Function: execute_payment
// File: crates/router/src/core/revenue_recovery/types.rs
// Module: router
pub fn execute_payment(
state: &SessionState,
_merchant_id: &id_type::MerchantId,
payment_intent: &PaymentIntent,
process: &storage::ProcessTracker,
profile: &domain::Profile,
merchant_context: domain::MerchantContext,
revenue_recovery_payment_data: &storage::revenue_recovery::RevenueRecoveryPaymentData,
revenue_recovery_metadata: &PaymentRevenueRecoveryMetadata,
latest_attempt_id: &id_type::GlobalAttemptId,
) -> RecoveryResult<Self>
|
crates/router/src/core/revenue_recovery/types.rs
|
router
|
function_signature
| null | null | null | 133
|
execute_payment
| null | null | null | null | null | null |
// Struct: ConsumerSettings
// File: crates/scheduler/src/settings.rs
// Module: scheduler
// Implementations: 1
// Traits: Default
pub struct ConsumerSettings
|
crates/scheduler/src/settings.rs
|
scheduler
|
struct_definition
|
ConsumerSettings
| 1
|
[
"Default"
] | 37
| null | null | null | null | null | null | null |
// Struct: AppState
// File: crates/router/src/routes/app.rs
// Module: router
// Implementations: 3
// Traits: scheduler::SchedulerAppState, AppStateInfo
pub struct AppState
|
crates/router/src/routes/app.rs
|
router
|
struct_definition
|
AppState
| 3
|
[
"scheduler::SchedulerAppState",
"AppStateInfo"
] | 41
| null | null | null | null | null | null | null |
// Function: confirm_subscription
// File: crates/router/src/core/subscription.rs
// Module: router
pub fn confirm_subscription(
state: SessionState,
merchant_context: MerchantContext,
profile_id: String,
request: subscription_types::ConfirmSubscriptionRequest,
subscription_id: common_utils::id_type::SubscriptionId,
) -> RouterResponse<subscription_types::ConfirmSubscriptionResponse>
|
crates/router/src/core/subscription.rs
|
router
|
function_signature
| null | null | null | 81
|
confirm_subscription
| null | null | null | null | null | null |
// Function: create_payment_method_core
// File: crates/router/src/core/payment_methods.rs
// Module: router
pub fn create_payment_method_core(
state: &SessionState,
_request_state: &routes::app::ReqState,
req: api::PaymentMethodCreate,
merchant_context: &domain::MerchantContext,
profile: &domain::Profile,
) -> RouterResult<(api::PaymentMethodResponse, domain::PaymentMethod)>
|
crates/router/src/core/payment_methods.rs
|
router
|
function_signature
| null | null | null | 94
|
create_payment_method_core
| null | null | null | null | null | null |
// Function: insert
// File: crates/diesel_models/src/query/unified_translations.rs
// Module: diesel_models
pub fn insert(self, conn: &PgPooledConn) -> StorageResult<UnifiedTranslations>
|
crates/diesel_models/src/query/unified_translations.rs
|
diesel_models
|
function_signature
| null | null | null | 46
|
insert
| null | null | null | null | null | null |
// Implementation: impl StripeApis
// File: crates/router/src/compatibility/stripe.rs
// Module: router
// Methods: 1 total (1 public)
impl StripeApis
|
crates/router/src/compatibility/stripe.rs
|
router
|
impl_block
| null | null | null | 38
| null |
StripeApis
| null | 1
| 1
| null | null |
// Struct: NmiActionBody
// File: crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
// Module: hyperswitch_connectors
// Implementations: 0
pub struct NmiActionBody
|
crates/hyperswitch_connectors/src/connectors/nmi/transformers.rs
|
hyperswitch_connectors
|
struct_definition
|
NmiActionBody
| 0
|
[] | 49
| null | null | null | null | null | null | null |
// Function: get_dispute_evidence_block
// File: crates/router/src/core/disputes/transformers.rs
// Module: router
pub fn get_dispute_evidence_block(
state: &SessionState,
merchant_context: &domain::MerchantContext,
evidence_type: EvidenceType,
file_id: String,
) -> CustomResult<api_models::disputes::DisputeEvidenceBlock, errors::ApiErrorResponse>
|
crates/router/src/core/disputes/transformers.rs
|
router
|
function_signature
| null | null | null | 91
|
get_dispute_evidence_block
| null | null | null | null | null | null |
// Function: custom_revenue_recovery_core
// File: crates/router/src/core/revenue_recovery/api.rs
// Module: router
pub fn custom_revenue_recovery_core(
state: SessionState,
req_state: ReqState,
merchant_context: MerchantContext,
profile: domain::Profile,
request: api_models::payments::RecoveryPaymentsCreate,
) -> RouterResponse<payments_api::RecoveryPaymentsResponse>
|
crates/router/src/core/revenue_recovery/api.rs
|
router
|
function_signature
| null | null | null | 89
|
custom_revenue_recovery_core
| null | null | null | null | null | null |
// Implementation: impl api::MandateSetup for for Stax
// File: crates/hyperswitch_connectors/src/connectors/stax.rs
// Module: hyperswitch_connectors
// Methods: 0 total (0 public)
impl api::MandateSetup for for Stax
|
crates/hyperswitch_connectors/src/connectors/stax.rs
|
hyperswitch_connectors
|
impl_block
| null | null | null | 61
| null |
Stax
|
api::MandateSetup for
| 0
| 0
| null | null |
// Function: dummy_connector_payment_data
// File: crates/router/src/routes/dummy_connector.rs
// Module: router
pub fn dummy_connector_payment_data(
state: web::Data<app::AppState>,
req: actix_web::HttpRequest,
path: web::Path<String>,
) -> impl actix_web::Responder
|
crates/router/src/routes/dummy_connector.rs
|
router
|
function_signature
| null | null | null | 68
|
dummy_connector_payment_data
| null | null | null | null | null | null |
// Implementation: impl EmailData for for ApiKeyExpiryReminder
// File: crates/router/src/services/email/types.rs
// Module: router
// Methods: 1 total (0 public)
impl EmailData for for ApiKeyExpiryReminder
|
crates/router/src/services/email/types.rs
|
router
|
impl_block
| null | null | null | 50
| null |
ApiKeyExpiryReminder
|
EmailData for
| 1
| 0
| null | null |
// Function: payment_methods_session_update_payment_method
// File: crates/router/src/core/payment_methods.rs
// Module: router
pub fn payment_methods_session_update_payment_method(
state: SessionState,
merchant_context: domain::MerchantContext,
profile: domain::Profile,
payment_method_session_id: id_type::GlobalPaymentMethodSessionId,
request: payment_methods::PaymentMethodSessionUpdateSavedPaymentMethod,
) -> RouterResponse<payment_methods::PaymentMethodResponse>
|
crates/router/src/core/payment_methods.rs
|
router
|
function_signature
| null | null | null | 98
|
payment_methods_session_update_payment_method
| null | null | null | null | null | null |
// Function: new
// File: crates/hyperswitch_connectors/src/connectors/fiuu.rs
// Module: hyperswitch_connectors
pub fn new() -> &'static Self
|
crates/hyperswitch_connectors/src/connectors/fiuu.rs
|
hyperswitch_connectors
|
function_signature
| null | null | null | 39
|
new
| null | null | null | null | null | null |
// File: crates/diesel_models/src/enums.rs
// Module: diesel_models
// Public structs: 2
#[doc(hidden)]
pub mod diesel_exports {
pub use super::{
DbApiVersion as ApiVersion, DbAttemptStatus as AttemptStatus,
DbAuthenticationType as AuthenticationType, DbBlocklistDataKind as BlocklistDataKind,
DbCaptureMethod as CaptureMethod, DbCaptureStatus as CaptureStatus,
DbCardDiscovery as CardDiscovery, DbConnectorStatus as ConnectorStatus,
DbConnectorType as ConnectorType, DbCountryAlpha2 as CountryAlpha2, DbCurrency as Currency,
DbDashboardMetadata as DashboardMetadata, DbDeleteStatus as DeleteStatus,
DbDisputeStage as DisputeStage, DbDisputeStatus as DisputeStatus,
DbEventClass as EventClass, DbEventObjectType as EventObjectType, DbEventType as EventType,
DbFraudCheckStatus as FraudCheckStatus, DbFraudCheckType as FraudCheckType,
DbFutureUsage as FutureUsage, DbGenericLinkType as GenericLinkType,
DbIntentStatus as IntentStatus, DbMandateStatus as MandateStatus,
DbMandateType as MandateType, DbMerchantStorageScheme as MerchantStorageScheme,
DbOrderFulfillmentTimeOrigin as OrderFulfillmentTimeOrigin,
DbPaymentMethodIssuerCode as PaymentMethodIssuerCode, DbPaymentSource as PaymentSource,
DbPaymentType as PaymentType, DbPayoutStatus as PayoutStatus, DbPayoutType as PayoutType,
DbProcessTrackerStatus as ProcessTrackerStatus, DbReconStatus as ReconStatus,
DbRefundStatus as RefundStatus, DbRefundType as RefundType, DbRelayStatus as RelayStatus,
DbRelayType as RelayType,
DbRequestIncrementalAuthorization as RequestIncrementalAuthorization,
DbRevenueRecoveryAlgorithmType as RevenueRecoveryAlgorithmType, DbRoleScope as RoleScope,
DbRoutingAlgorithmKind as RoutingAlgorithmKind, DbRoutingApproach as RoutingApproach,
DbScaExemptionType as ScaExemptionType,
DbSuccessBasedRoutingConclusiveState as SuccessBasedRoutingConclusiveState,
DbTokenizationFlag as TokenizationFlag, DbTotpStatus as TotpStatus,
DbTransactionType as TransactionType, DbUserRoleVersion as UserRoleVersion,
DbUserStatus as UserStatus, DbWebhookDeliveryAttempt as WebhookDeliveryAttempt,
};
}
pub use common_enums::*;
use common_utils::pii;
#[cfg(all(feature = "v2", feature = "tokenization_v2"))]
pub use common_utils::tokenization;
use diesel::{deserialize::FromSqlRow, expression::AsExpression, sql_types::Jsonb};
use router_derive::diesel_enum;
use time::PrimitiveDateTime;
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::EnumString,
)]
#[diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum RoutingAlgorithmKind {
Single,
Priority,
VolumeSplit,
Advanced,
Dynamic,
ThreeDsDecisionRule,
}
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::EnumString,
)]
#[diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum EventObjectType {
PaymentDetails,
RefundDetails,
DisputeDetails,
MandateDetails,
PayoutDetails,
}
// Refund
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
)]
#[diesel_enum(storage_type = "db_enum")]
#[strum(serialize_all = "snake_case")]
#[serde(rename_all = "snake_case")]
pub enum RefundType {
InstantRefund,
RegularRefund,
RetryRefund,
}
// Mandate
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
Default,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::EnumString,
)]
#[diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum MandateType {
SingleUse,
#[default]
MultiUse,
}
#[derive(
serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression,
)]
#[diesel(sql_type = Jsonb)]
#[serde(rename_all = "snake_case")]
pub struct MandateDetails {
pub update_mandate_id: Option<String>,
}
common_utils::impl_to_sql_from_sql_json!(MandateDetails);
#[derive(
serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, FromSqlRow, AsExpression,
)]
#[diesel(sql_type = Jsonb)]
#[serde(rename_all = "snake_case")]
pub enum MandateDataType {
SingleUse(MandateAmountData),
MultiUse(Option<MandateAmountData>),
}
common_utils::impl_to_sql_from_sql_json!(MandateDataType);
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq)]
pub struct MandateAmountData {
pub amount: common_utils::types::MinorUnit,
pub currency: Currency,
pub start_date: Option<PrimitiveDateTime>,
pub end_date: Option<PrimitiveDateTime>,
pub metadata: Option<pii::SecretSerdeValue>,
}
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
)]
#[diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum FraudCheckType {
PreFrm,
PostFrm,
}
#[derive(
Clone,
Copy,
Debug,
Default,
Eq,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
)]
#[diesel_enum(storage_type = "text")]
#[strum(serialize_all = "snake_case")]
pub enum FraudCheckLastStep {
#[default]
Processing,
CheckoutOrSale,
TransactionOrRecordRefund,
Fulfillment,
}
#[derive(
Clone,
Copy,
Debug,
Default,
Eq,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
)]
#[diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum UserStatus {
Active,
#[default]
InvitationSent,
}
#[derive(
Clone,
Copy,
Debug,
Eq,
PartialEq,
serde::Deserialize,
serde::Serialize,
strum::Display,
strum::EnumString,
)]
#[router_derive::diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum DashboardMetadata {
ProductionAgreement,
SetupProcessor,
ConfigureEndpoint,
SetupComplete,
FirstProcessorConnected,
SecondProcessorConnected,
ConfiguredRouting,
TestPayment,
IntegrationMethod,
ConfigurationType,
IntegrationCompleted,
StripeConnected,
PaypalConnected,
SpRoutingConfigured,
Feedback,
ProdIntent,
SpTestPayment,
DownloadWoocom,
ConfigureWoocom,
SetupWoocomWebhook,
IsMultipleConfiguration,
IsChangePasswordRequired,
OnboardingSurvey,
ReconStatus,
}
#[derive(
Clone,
Copy,
Debug,
Default,
Eq,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::Display,
strum::EnumString,
)]
#[diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum TotpStatus {
Set,
InProgress,
#[default]
NotSet,
}
#[derive(
Clone,
Copy,
Debug,
Default,
Eq,
PartialEq,
serde::Serialize,
serde::Deserialize,
strum::EnumString,
strum::Display,
)]
#[diesel_enum(storage_type = "db_enum")]
#[serde(rename_all = "snake_case")]
#[strum(serialize_all = "snake_case")]
pub enum UserRoleVersion {
#[default]
V1,
V2,
}
|
crates/diesel_models/src/enums.rs
|
diesel_models
|
full_file
| null | null | null | 1,896
| 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.