id stringlengths 20 153 | type stringclasses 1
value | granularity stringclasses 14
values | content stringlengths 16 84.3k | metadata dict |
|---|---|---|---|---|
hyperswitch_method_hyperswitch_connectors_Bankofamerica_generate_signature | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/bankofamerica.rs
// impl for Bankofamerica
pub fn generate_signature(
&self,
auth: bankofamerica::BankOfAmericaAuthType,
host: String,
resource: &str,
payload: &String,
date: OffsetDateTime,
http_method: Method,
) -> CustomResult<String, errors::ConnectorError> {
let bankofamerica::BankOfAmericaAuthType {
api_key,
merchant_account,
api_secret,
} = auth;
let is_post_method = matches!(http_method, Method::Post);
let digest_str = if is_post_method { "digest " } else { "" };
let headers = format!("host date (request-target) {digest_str}{V_C_MERCHANT_ID}");
let request_target = if is_post_method {
format!("(request-target): post {resource}\ndigest: SHA-256={payload}\n")
} else {
format!("(request-target): get {resource}\n")
};
let signature_string = format!(
"host: {host}\ndate: {date}\n{request_target}{V_C_MERCHANT_ID}: {}",
merchant_account.peek()
);
let key_value = consts::BASE64_ENGINE
.decode(api_secret.expose())
.change_context(errors::ConnectorError::InvalidConnectorConfig {
config: "connector_account_details.api_secret",
})?;
let key = hmac::Key::new(hmac::HMAC_SHA256, &key_value);
let signature_value =
consts::BASE64_ENGINE.encode(hmac::sign(&key, signature_string.as_bytes()).as_ref());
let signature_header = format!(
r#"keyid="{}", algorithm="HmacSHA256", headers="{headers}", signature="{signature_value}""#,
api_key.peek()
);
Ok(signature_header)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Bankofamerica",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate_signature",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Klarna_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/klarna.rs
// impl for Klarna
pub fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Klarna",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Redsys_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys.rs
// impl for Redsys
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Redsys",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Loonio_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/loonio.rs
// impl for Loonio
pub fn new() -> &'static Self {
&Self {
amount_converter: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Loonio",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Stripebilling_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/stripebilling.rs
// impl for Stripebilling
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Stripebilling",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Riskified_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/riskified.rs
// impl for Riskified
pub fn new() -> &'static Self {
&Self {
#[cfg(feature = "frm")]
amount_converter: &StringMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Riskified",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Riskified_generate_authorization_signature | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/riskified.rs
// impl for Riskified
pub fn generate_authorization_signature(
&self,
auth: &riskified::RiskifiedAuthType,
payload: &str,
) -> CustomResult<String, ConnectorError> {
let key = hmac::Key::new(
hmac::HMAC_SHA256,
auth.secret_token.clone().expose().as_bytes(),
);
let signature_value = hmac::sign(&key, payload.as_bytes());
let digest = signature_value.as_ref();
Ok(hex::encode(digest))
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Riskified",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate_authorization_signature",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Archipel_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/archipel.rs
// impl for Archipel
pub const fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Archipel",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Gocardless_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/gocardless.rs
// impl for Gocardless
pub fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Gocardless",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Globalpay_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/globalpay.rs
// impl for Globalpay
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Globalpay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Airwallex_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/airwallex.rs
// impl for Airwallex
pub const fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
amount_converter_to_string_minor: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Airwallex",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Calida_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/calida.rs
// impl for Calida
pub fn new() -> &'static Self {
&Self {
amount_converter: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Calida",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Stripe_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/stripe.rs
// impl for Stripe
pub const fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
amount_converter_webhooks: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Stripe",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Rapyd_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/rapyd.rs
// impl for Rapyd
pub fn new() -> &'static Self {
&Self {
amount_converter: &FloatMajorUnitForConnector,
amount_converter_webhooks: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Rapyd",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Rapyd_generate_signature | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/rapyd.rs
// impl for Rapyd
pub fn generate_signature(
&self,
auth: &rapyd::RapydAuthType,
http_method: &str,
url_path: &str,
body: &str,
timestamp: i64,
salt: &str,
) -> CustomResult<String, errors::ConnectorError> {
let rapyd::RapydAuthType {
access_key,
secret_key,
} = auth;
let to_sign = format!(
"{http_method}{url_path}{salt}{timestamp}{}{}{body}",
access_key.peek(),
secret_key.peek()
);
let key = hmac::Key::new(hmac::HMAC_SHA256, secret_key.peek().as_bytes());
let tag = hmac::sign(&key, to_sign.as_bytes());
let hmac_sign = hex::encode(tag);
let signature_value = BASE64_ENGINE_URL_SAFE.encode(hmac_sign);
Ok(signature_value)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Rapyd",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate_signature",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Opennode_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/opennode.rs
// impl for Opennode
pub fn new() -> &'static Self {
&Self {
amount_convertor: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Opennode",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Shift4_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/shift4.rs
// impl for Shift4
pub fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Shift4",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Tsys_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/tsys.rs
// impl for Tsys
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Tsys",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Hyperwallet_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/hyperwallet.rs
// impl for Hyperwallet
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Hyperwallet",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Cryptopay_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/cryptopay.rs
// impl for Cryptopay
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Cryptopay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Checkout_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/checkout.rs
// impl for Checkout
pub fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
amount_converter_webhooks: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Checkout",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Billwerk_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/billwerk.rs
// impl for Billwerk
pub fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Billwerk",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Nmi_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/nmi.rs
// impl for Nmi
pub const fn new() -> &'static Self {
&Self {
amount_converter: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Nmi",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Ebanx_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/ebanx.rs
// impl for Ebanx
pub fn new() -> &'static Self {
&Self {
#[cfg(feature = "payouts")]
amount_converter: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Ebanx",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Aci_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/aci.rs
// impl for Aci
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Aci",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Zen_get_default_header | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/zen.rs
// impl for Zen
fn get_default_header() -> (String, masking::Maskable<String>) {
("request-id".to_string(), Uuid::new_v4().to_string().into())
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Zen",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_default_header",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Elavon_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/elavon.rs
// impl for Elavon
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Elavon",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Taxjar_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/taxjar.rs
// impl for Taxjar
pub fn new() -> &'static Self {
&Self {
amount_converter: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Taxjar",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Authorizedotnet_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/authorizedotnet.rs
// impl for Authorizedotnet
pub fn new() -> &'static Self {
&Self {
amount_convertor: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Authorizedotnet",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Iatapay_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/iatapay.rs
// impl for Iatapay
pub fn new() -> &'static Self {
&Self {
amount_converter: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Iatapay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Fiservemea_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/fiservemea.rs
// impl for Fiservemea
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Fiservemea",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Fiservemea_generate_authorization_signature | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/fiservemea.rs
// impl for Fiservemea
pub fn generate_authorization_signature(
&self,
auth: fiservemea::FiservemeaAuthType,
request_id: &str,
payload: &str,
timestamp: i128,
) -> CustomResult<String, errors::ConnectorError> {
let fiservemea::FiservemeaAuthType {
api_key,
secret_key,
} = auth;
let raw_signature = format!("{}{request_id}{timestamp}{payload}", api_key.peek());
let key = hmac::Key::new(hmac::HMAC_SHA256, secret_key.expose().as_bytes());
let signature_value = common_utils::consts::BASE64_ENGINE
.encode(hmac::sign(&key, raw_signature.as_bytes()).as_ref());
Ok(signature_value)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Fiservemea",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate_authorization_signature",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Recurly_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/recurly.rs
// impl for Recurly
pub fn new() -> &'static Self {
&Self {}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Recurly",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Recurly_get_signature_elements_from_header | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/recurly.rs
// impl for Recurly
fn get_signature_elements_from_header(
headers: &actix_web::http::header::HeaderMap,
) -> CustomResult<Vec<Vec<u8>>, errors::ConnectorError> {
let security_header = headers
.get("recurly-signature")
.ok_or(errors::ConnectorError::WebhookSignatureNotFound)?;
let security_header_str = security_header
.to_str()
.change_context(errors::ConnectorError::WebhookSignatureNotFound)?;
let header_parts: Vec<Vec<u8>> = security_header_str
.split(',')
.map(|part| part.trim().as_bytes().to_vec())
.collect();
Ok(header_parts)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Recurly",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_signature_elements_from_header",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Wise_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/wise.rs
// impl for Wise
pub fn new() -> &'static Self {
&Self {
#[cfg(feature = "payouts")]
amount_converter: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Wise",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Payload_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/payload.rs
// impl for Payload
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Payload",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Mpgs_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/mpgs.rs
// impl for Mpgs
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Mpgs",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Trustpay_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/trustpay.rs
// impl for Trustpay
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
amount_converter_to_float_major_unit: &FloatMajorUnitForConnector,
amount_converter_to_string_minor_unit: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Trustpay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Placetopay_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/placetopay.rs
// impl for Placetopay
pub fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Placetopay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Checkbook_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/checkbook.rs
// impl for Checkbook
pub fn new() -> &'static Self {
&Self {
amount_converter: &FloatMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Checkbook",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Santander_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/santander.rs
// impl for Santander
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMajorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Santander",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Bamboraapac_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/bamboraapac.rs
// impl for Bamboraapac
pub const fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Bamboraapac",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Gpayments_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/gpayments.rs
// impl for Gpayments
pub fn new() -> &'static Self {
&Self {
_amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Gpayments",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Moneris_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/moneris.rs
// impl for Moneris
pub fn new() -> &'static Self {
&Self {
amount_converter: &MinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Moneris",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_Nexixpay_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/nexixpay.rs
// impl for Nexixpay
pub fn new() -> &'static Self {
&Self {
amount_converter: &StringMinorUnitForConnector,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "Nexixpay",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_TesouroAuthType_get_acceptor_id | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/tesouro/transformers.rs
// impl for TesouroAuthType
fn get_acceptor_id(&self) -> Secret<String> {
self.acceptor_id.clone()
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "TesouroAuthType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_acceptor_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ChargebeeWebhookBody_get_webhook_object_from_body | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs
// impl for ChargebeeWebhookBody
pub fn get_webhook_object_from_body(body: &[u8]) -> CustomResult<Self, errors::ConnectorError> {
let webhook_body = body
.parse_struct::<Self>("ChargebeeWebhookBody")
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
Ok(webhook_body)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ChargebeeWebhookBody",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_webhook_object_from_body",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ChargebeeInvoiceBody_get_invoice_webhook_data_from_body | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/chargebee/transformers.rs
// impl for ChargebeeInvoiceBody
pub fn get_invoice_webhook_data_from_body(
body: &[u8],
) -> CustomResult<Self, errors::ConnectorError> {
let webhook_body = body
.parse_struct::<Self>("ChargebeeInvoiceBody")
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
Ok(webhook_body)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ChargebeeInvoiceBody",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_invoice_webhook_data_from_body",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_PaymentsResponseScheme_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs
// impl for PaymentsResponseScheme
pub fn new(reference: String) -> Self {
Self { reference }
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "PaymentsResponseScheme",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_WorldpayErrorResponse_default | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/worldpay/response.rs
// impl for WorldpayErrorResponse
pub fn default(status_code: u16) -> Self {
match status_code {
code @ 404 => Self {
error_name: format!("{code} Not found"),
message: "Resource not found".to_string(),
validation_errors: None,
},
code => Self {
error_name: code.to_string(),
message: "Unknown error".to_string(),
validation_errors: None,
},
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "WorldpayErrorResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "default",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_FinixErrorResponse_get_message | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs
// impl for FinixErrorResponse
pub fn get_message(&self) -> String {
self.embedded
.as_ref()
.and_then(|embedded| embedded.errors.as_ref())
.and_then(|errors| errors.first())
.and_then(|error| error.message.clone())
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string())
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "FinixErrorResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_message",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_FinixErrorResponse_get_code | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/finix/transformers.rs
// impl for FinixErrorResponse
pub fn get_code(&self) -> String {
self.embedded
.as_ref()
.and_then(|embedded| embedded.errors.as_ref())
.and_then(|errors| errors.first())
.and_then(|error| error.code.clone())
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string())
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "FinixErrorResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_code",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_FinixCreateRefundRequest_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
// impl for FinixCreateRefundRequest
pub fn new(refund_amount: MinorUnit) -> Self {
Self { refund_amount }
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "FinixCreateRefundRequest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_FinixState_is_failure | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
// impl for FinixState
pub fn is_failure(&self) -> bool {
match self {
Self::PENDING | Self::SUCCEEDED => false,
Self::FAILED | Self::CANCELED | Self::UNKNOWN => true,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "FinixState",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "is_failure",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_FinixFlow_get_flow_for_auth | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/finix/transformers/request.rs
// impl for FinixFlow
pub fn get_flow_for_auth(capture_method: CaptureMethod) -> Self {
match capture_method {
CaptureMethod::SequentialAutomatic | CaptureMethod::Automatic => Self::Transfer,
CaptureMethod::Manual | CaptureMethod::ManualMultiple | CaptureMethod::Scheduled => {
Self::Auth
}
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "FinixFlow",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_flow_for_auth",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_NovalnetSyncResponseTransactionData_get_token | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/novalnet/transformers.rs
// impl for NovalnetSyncResponseTransactionData
pub fn get_token(transaction_data: Option<&Self>) -> Option<String> {
if let Some(data) = transaction_data {
match &data.payment_data {
Some(NovalnetResponsePaymentData::Card(card_data)) => {
card_data.token.clone().map(|token| token.expose())
}
Some(NovalnetResponsePaymentData::Paypal(paypal_data)) => {
paypal_data.token.clone().map(|token| token.expose())
}
None => None,
}
} else {
None
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "NovalnetSyncResponseTransactionData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_token",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_CeleroTransactionResponseData_get_mandate_reference | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
// impl for CeleroTransactionResponseData
pub fn get_mandate_reference(&self) -> Box<Option<MandateReference>> {
if self.payment_method_id.is_some() {
Box::new(Some(MandateReference {
connector_mandate_id: None,
payment_method_id: self.payment_method_id.clone(),
mandate_metadata: None,
connector_mandate_request_reference_id: Some(self.id.clone()),
}))
} else {
Box::new(None)
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "CeleroTransactionResponseData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_mandate_reference",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_CeleroErrorDetails_from_transaction_response | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
// impl for CeleroErrorDetails
pub fn from_transaction_response(response: &CeleroCardResponse, msg: String) -> Self {
// Map specific error codes based on common response patterns
let decline_reason = Self::map_processor_error(&response.processor_response_code, &msg);
Self {
error_code: None,
error_message: msg,
processor_response_code: response.processor_response_code.clone(),
decline_reason,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "CeleroErrorDetails",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "from_transaction_response",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_CeleroErrorDetails_from_top_level_error | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
// impl for CeleroErrorDetails
pub fn from_top_level_error(msg: String) -> Self {
// Map specific error codes from top-level API errors
Self {
error_code: None,
error_message: msg,
processor_response_code: None,
decline_reason: None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "CeleroErrorDetails",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "from_top_level_error",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_CeleroErrorDetails_map_processor_error | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/celero/transformers.rs
// impl for CeleroErrorDetails
fn map_processor_error(processor_code: &Option<String>, message: &str) -> Option<String> {
let message_lower = message.to_lowercase();
// Check processor response codes if available
if let Some(code) = processor_code {
match code.as_str() {
"05" => Some("TRANSACTION_DECLINED".to_string()),
"14" => Some("INVALID_CARD_DATA".to_string()),
"51" => Some("INSUFFICIENT_FUNDS".to_string()),
"54" => Some("EXPIRED_CARD".to_string()),
"55" => Some("INCORRECT_CVC".to_string()),
"61" => Some("Exceeds withdrawal amount limit".to_string()),
"62" => Some("TRANSACTION_DECLINED".to_string()),
"65" => Some("Exceeds withdrawal frequency limit".to_string()),
"78" => Some("INVALID_CARD_DATA".to_string()),
"91" => Some("PROCESSING_ERROR".to_string()),
"96" => Some("PROCESSING_ERROR".to_string()),
_ => {
router_env::logger::info!(
"Celero response error code ({:?}) is not mapped to any error state ",
code
);
Some("Transaction failed".to_string())
}
}
} else {
Some(message_lower)
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "CeleroErrorDetails",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "map_processor_error",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_AdditionalData_extract_network_advice_code | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/adyen/transformers.rs
// impl for AdditionalData
pub fn extract_network_advice_code(&self) -> Option<String> {
self.merchant_advice_code.as_ref().and_then(|code| {
let mut parts = code.splitn(2, ':');
let first_part = parts.next()?.trim();
// Ensure there is a second part (meaning ':' was present).
parts.next()?;
Some(first_part.to_string())
})
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "AdditionalData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "extract_network_advice_code",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ipelFlowStatus {
_sta | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs
// impl for ipelFlowStatus {
ew(status: ArchipelPaymentStatus, flow: ArchipelPaymentFlow) -> Self {
Self { status, flow }
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ipelFlowStatus {\n ",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "sta",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ipelErrorMessageWithHttpCode {
_err | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/archipel/transformers.rs
// impl for ipelErrorMessageWithHttpCode {
ew(error_message: ArchipelErrorMessage, http_code: u16) -> Self {
Self {
error_message,
http_code,
}
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ipelErrorMessageWithHttpCode {\n ",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "err",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ResponseCode_value | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs
// impl for ResponseCode
pub fn value(&self) -> Option<&String> {
match self {
Self::Structured { value, .. } => Some(value),
_ => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ResponseCode",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "value",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ResponseCode_description | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs
// impl for ResponseCode
pub fn description(&self) -> Option<&String> {
match self {
Self::Structured { description, .. } => Some(description),
_ => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ResponseCode",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "description",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ResponseCode_as_text | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/peachpayments/transformers.rs
// impl for ResponseCode
pub fn as_text(&self) -> Option<&String> {
match self {
Self::Text(s) => Some(s),
_ => None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ResponseCode",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "as_text",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ThreeDsEligibilityResponse_get_max_acs_protocol_version_if_available | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/unified_authentication_service/transformers.rs
// impl for ThreeDsEligibilityResponse
pub fn get_max_acs_protocol_version_if_available(&self) -> Option<AcsProtocolVersion> {
let max_acs_version =
self.acs_protocol_versions
.as_ref()
.and_then(|acs_protocol_versions| {
acs_protocol_versions
.iter()
.max_by_key(|acs_protocol_versions| acs_protocol_versions.version.clone())
});
max_acs_version.cloned()
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ThreeDsEligibilityResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_max_acs_protocol_version_if_available",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn new(three_d_s_info: RedsysThreeDsInfo) -> Self {
Self {
three_d_s_info,
protocol_version: None,
browser_accept_header: None,
browser_user_agent: None,
browser_java_enabled: None,
browser_javascript_enabled: None,
browser_language: None,
browser_color_depth: None,
browser_screen_height: None,
browser_screen_width: None,
browser_t_z: None,
browser_i_p: None,
three_d_s_server_trans_i_d: None,
notification_u_r_l: None,
three_d_s_comp_ind: None,
cres: None,
billing_data: None,
shipping_data: None,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_add_browser_data | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn add_browser_data(mut self, browser_info: BrowserInformation) -> Result<Self, Error> {
self.browser_accept_header = Some(browser_info.get_accept_header()?);
self.browser_user_agent = Some(browser_info.get_user_agent()?);
self.browser_java_enabled = Some(browser_info.get_java_enabled()?);
self.browser_javascript_enabled = browser_info.get_java_script_enabled().ok();
self.browser_language = Some(browser_info.get_language()?);
self.browser_color_depth = Some(browser_info.get_color_depth()?.to_string());
self.browser_screen_height = Some(browser_info.get_screen_height()?.to_string());
self.browser_screen_width = Some(browser_info.get_screen_width()?.to_string());
self.browser_t_z = Some(browser_info.get_time_zone()?.to_string());
self.browser_i_p = Some(browser_info.get_ip_address()?);
Ok(self)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "add_browser_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_set_three_d_s_server_trans_i_d | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn set_three_d_s_server_trans_i_d(mut self, three_d_s_server_trans_i_d: String) -> Self {
self.three_d_s_server_trans_i_d = Some(three_d_s_server_trans_i_d);
self
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_three_d_s_server_trans_i_d",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_set_protocol_version | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn set_protocol_version(mut self, protocol_version: String) -> Self {
self.protocol_version = Some(protocol_version);
self
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_protocol_version",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_set_notification_u_r_l | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn set_notification_u_r_l(mut self, notification_u_r_l: String) -> Self {
self.notification_u_r_l = Some(notification_u_r_l);
self
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_notification_u_r_l",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_set_three_d_s_comp_ind | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn set_three_d_s_comp_ind(mut self, three_d_s_comp_ind: ThreeDSCompInd) -> Self {
self.three_d_s_comp_ind = Some(three_d_s_comp_ind);
self
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_three_d_s_comp_ind",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_set_three_d_s_cres | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn set_three_d_s_cres(mut self, cres: String) -> Self {
self.cres = Some(cres);
self
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_three_d_s_cres",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_get_state_code | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
fn get_state_code(state: Secret<String>) -> Result<Secret<String>, Error> {
let state = connector_utils::normalize_string(state.expose())
.change_context(errors::ConnectorError::RequestEncodingFailed)?;
let addr_state_value = if state.len() > 3 {
let addr_state = match state.as_str() {
"acoruna" | "lacoruna" | "esc" => Ok("C"),
"alacant" | "esa" | "alicante" => Ok("A"),
"albacete" | "esab" => Ok("AB"),
"almeria" | "esal" => Ok("AL"),
"andalucia" | "esan" => Ok("AN"),
"araba" | "esvi" => Ok("VI"),
"aragon" | "esar" => Ok("AR"),
"asturias" | "eso" => Ok("O"),
"asturiasprincipadode" | "principadodeasturias" | "esas" => Ok("AS"),
"badajoz" | "esba" => Ok("BA"),
"barcelona" | "esb" => Ok("B"),
"bizkaia" | "esbi" => Ok("BI"),
"burgos" | "esbu" => Ok("BU"),
"canarias" | "escn" => Ok("CN"),
"cantabria" | "ess" => Ok("S"),
"castello" | "escs" => Ok("CS"),
"castellon" => Ok("C"),
"castillayleon" | "escl" => Ok("CL"),
"castillalamancha" | "escm" => Ok("CM"),
"cataluna" | "catalunya" | "esct" => Ok("CT"),
"ceuta" | "esce" => Ok("CE"),
"ciudadreal" | "escr" | "ciudad" => Ok("CR"),
"cuenca" | "escu" => Ok("CU"),
"caceres" | "escc" => Ok("CC"),
"cadiz" | "esca" => Ok("CA"),
"cordoba" | "esco" => Ok("CO"),
"euskalherria" | "espv" => Ok("PV"),
"extremadura" | "esex" => Ok("EX"),
"galicia" | "esga" => Ok("GA"),
"gipuzkoa" | "esss" => Ok("SS"),
"girona" | "esgi" | "gerona" => Ok("GI"),
"granada" | "esgr" => Ok("GR"),
"guadalajara" | "esgu" => Ok("GU"),
"huelva" | "esh" => Ok("H"),
"huesca" | "eshu" => Ok("HU"),
"illesbalears" | "islasbaleares" | "espm" => Ok("PM"),
"esib" => Ok("IB"),
"jaen" | "esj" => Ok("J"),
"larioja" | "eslo" => Ok("LO"),
"esri" => Ok("RI"),
"laspalmas" | "palmas" | "esgc" => Ok("GC"),
"leon" => Ok("LE"),
"lleida" | "lerida" | "esl" => Ok("L"),
"lugo" | "eslu" => Ok("LU"),
"madrid" | "esm" => Ok("M"),
"comunidaddemadrid" | "madridcomunidadde" | "esmd" => Ok("MD"),
"melilla" | "esml" => Ok("ML"),
"murcia" | "esmu" => Ok("MU"),
"murciaregionde" | "regiondemurcia" | "esmc" => Ok("MC"),
"malaga" | "esma" => Ok("MA"),
"nafarroa" | "esnc" => Ok("NC"),
"nafarroakoforukomunitatea" | "esna" => Ok("NA"),
"navarra" => Ok("NA"),
"navarracomunidadforalde" | "comunidadforaldenavarra" => Ok("NC"),
"ourense" | "orense" | "esor" => Ok("OR"),
"palencia" | "esp" => Ok("P"),
"paisvasco" => Ok("PV"),
"pontevedra" | "espo" => Ok("PO"),
"salamanca" | "essa" => Ok("SA"),
"santacruzdetenerife" | "estf" => Ok("TF"),
"segovia" | "essg" => Ok("SG"),
"sevilla" | "esse" => Ok("SE"),
"soria" | "esso" => Ok("SO"),
"tarragona" | "est" => Ok("T"),
"teruel" | "este" => Ok("TE"),
"toledo" | "esto" => Ok("TO"),
"valencia" | "esv" => Ok("V"),
"valencianacomunidad" | "esvc" => Ok("VC"),
"valencianacomunitat" => Ok("V"),
"valladolid" | "esva" => Ok("VA"),
"zamora" | "esza" => Ok("ZA"),
"zaragoza" | "esz" => Ok("Z"),
"alava" => Ok("VI"),
"avila" | "esav" => Ok("AV"),
_ => Err(errors::ConnectorError::InvalidDataFormat {
field_name: "address.state",
}),
}?;
addr_state.to_string()
} else {
state.to_string()
};
Ok(Secret::new(addr_state_value))
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_state_code",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_set_billing_data | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn set_billing_data(mut self, address: Option<&Address>) -> Result<Self, Error> {
self.billing_data = address
.and_then(|address| {
address.address.as_ref().map(|address_details| {
let state = address_details
.get_optional_state()
.map(Self::get_state_code)
.transpose();
match state {
Ok(bill_addr_state) => Ok(BillingData {
bill_addr_city: address_details.get_optional_city(),
bill_addr_country: address_details.get_optional_country().map(
|country| {
common_enums::CountryAlpha2::from_alpha2_to_alpha3(country)
.to_string()
},
),
bill_addr_line1: address_details.get_optional_line1(),
bill_addr_line2: address_details.get_optional_line2(),
bill_addr_line3: address_details.get_optional_line3(),
bill_addr_postal_code: address_details.get_optional_zip(),
bill_addr_state,
}),
Err(err) => Err(err),
}
})
})
.transpose()?;
Ok(self)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_billing_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_EmvThreedsData_set_shipping_data | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/redsys/transformers.rs
// impl for EmvThreedsData
pub fn set_shipping_data(mut self, address: Option<&Address>) -> Result<Self, Error> {
self.shipping_data = address
.and_then(|address| {
address.address.as_ref().map(|address_details| {
let state = address_details
.get_optional_state()
.map(Self::get_state_code)
.transpose();
match state {
Ok(ship_addr_state) => Ok(ShippingData {
ship_addr_city: address_details.get_optional_city(),
ship_addr_country: address_details.get_optional_country().map(
|country| {
common_enums::CountryAlpha2::from_alpha2_to_alpha3(country)
.to_string()
},
),
ship_addr_line1: address_details.get_optional_line1(),
ship_addr_line2: address_details.get_optional_line2(),
ship_addr_line3: address_details.get_optional_line3(),
ship_addr_postal_code: address_details.get_optional_zip(),
ship_addr_state,
}),
Err(err) => Err(err),
}
})
})
.transpose()?;
Ok(self)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "EmvThreedsData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "set_shipping_data",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_FacilitapayAuthRequest_from_auth_type | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/facilitapay/transformers.rs
// impl for FacilitapayAuthRequest
fn from_auth_type(auth: &FacilitapayAuthType) -> Self {
Self {
user: FacilitapayCredentials {
username: auth.username.clone(),
password: auth.password.clone(),
},
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "FacilitapayAuthRequest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "from_auth_type",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_DummyConnectors_get_dummy_connector_id | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs
// impl for DummyConnectors
pub fn get_dummy_connector_id(self) -> &'static str {
match self {
Self::PhonyPay => "phonypay",
Self::FauxPay => "fauxpay",
Self::PretendPay => "pretendpay",
Self::StripeTest => "stripe_test",
Self::AdyenTest => "adyen_test",
Self::CheckoutTest => "checkout_test",
Self::PaypalTest => "paypal_test",
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "DummyConnectors",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_dummy_connector_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_DummyConnectorNextAction_get_url | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/dummyconnector/transformers.rs
// impl for DummyConnectorNextAction
fn get_url(&self) -> Option<Url> {
match self {
Self::RedirectToUrl(redirect_to_url) => Some(redirect_to_url.to_owned()),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "DummyConnectorNextAction",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_url",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_TokenioErrorResponse_from_bytes | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
// impl for TokenioErrorResponse
pub fn from_bytes(bytes: &[u8]) -> Self {
// First try to parse as JSON
if let Ok(json_response) = serde_json::from_slice::<Self>(bytes) {
json_response
} else {
// If JSON parsing fails, treat as plain text
let text = String::from_utf8_lossy(bytes).to_string();
Self::Text(text)
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "TokenioErrorResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "from_bytes",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_TokenioErrorResponse_get_message | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
// impl for TokenioErrorResponse
pub fn get_message(&self) -> String {
match self {
Self::Json {
message,
error_code,
} => message
.as_deref()
.or(error_code.as_deref())
.unwrap_or(NO_ERROR_MESSAGE)
.to_string(),
Self::Text(text) => text.clone(),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "TokenioErrorResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_message",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_TokenioErrorResponse_get_error_code | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/tokenio/transformers.rs
// impl for TokenioErrorResponse
pub fn get_error_code(&self) -> String {
match self {
Self::Json { error_code, .. } => {
error_code.as_deref().unwrap_or(NO_ERROR_CODE).to_string()
}
Self::Text(_) => NO_ERROR_CODE.to_string(),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "TokenioErrorResponse",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_error_code",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_RecurlyWebhookBody_get_webhook_object_from_body | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/recurly/transformers.rs
// impl for RecurlyWebhookBody
pub fn get_webhook_object_from_body(body: &[u8]) -> CustomResult<Self, errors::ConnectorError> {
let webhook_body = body
.parse_struct::<Self>("RecurlyWebhookBody")
.change_context(errors::ConnectorError::WebhookBodyDecodingFailed)?;
Ok(webhook_body)
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "RecurlyWebhookBody",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_webhook_object_from_body",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ProphetpayEntryMethod_get_entry_method | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs
// impl for ProphetpayEntryMethod
fn get_entry_method(&self) -> i8 {
match self {
Self::ManualEntry => 1,
Self::CardSwipe => 2,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ProphetpayEntryMethod",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_entry_method",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ProphetpayTokenType_get_token_type | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs
// impl for ProphetpayTokenType
fn get_token_type(&self) -> i8 {
match self {
Self::Normal => 0,
Self::SaleTab => 1,
Self::TemporarySave => 2,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ProphetpayTokenType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_token_type",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ProphetpayCardContext_get_card_context | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs
// impl for ProphetpayCardContext
fn get_card_context(&self) -> i8 {
match self {
Self::NotApplicable => 0,
Self::WebConsumerInitiated => 5,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ProphetpayCardContext",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_card_context",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_ProphetpayActionType_get_action_type | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/prophetpay/transformers.rs
// impl for ProphetpayActionType
fn get_action_type(&self) -> i8 {
match self {
Self::Charge => 1,
Self::Refund => 3,
Self::Inquiry => 7,
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "ProphetpayActionType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_action_type",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_PaypalUpdateOrderRequest_get_inner_value | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// impl for PaypalUpdateOrderRequest
pub fn get_inner_value(self) -> Vec<Operation> {
self.0
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "PaypalUpdateOrderRequest",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_inner_value",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_PaypalConnectorCredentials_get_client_id | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// impl for PaypalConnectorCredentials
pub fn get_client_id(&self) -> Secret<String> {
match self {
Self::StandardIntegration(item) => item.client_id.clone(),
Self::PartnerIntegration(item) => item.client_id.clone(),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "PaypalConnectorCredentials",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_client_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_PaypalConnectorCredentials_get_client_secret | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// impl for PaypalConnectorCredentials
pub fn get_client_secret(&self) -> Secret<String> {
match self {
Self::StandardIntegration(item) => item.client_secret.clone(),
Self::PartnerIntegration(item) => item.client_secret.clone(),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "PaypalConnectorCredentials",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_client_secret",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_PaypalConnectorCredentials_get_payer_id | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// impl for PaypalConnectorCredentials
pub fn get_payer_id(&self) -> Option<Secret<String>> {
match self {
Self::StandardIntegration(_) => None,
Self::PartnerIntegration(item) => Some(item.payer_id.clone()),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "PaypalConnectorCredentials",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payer_id",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_PaypalConnectorCredentials_generate_authorization_value | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// impl for PaypalConnectorCredentials
pub fn generate_authorization_value(&self) -> String {
let auth_id = format!(
"{}:{}",
self.get_client_id().expose(),
self.get_client_secret().expose(),
);
format!("Basic {}", consts::BASE64_ENGINE.encode(auth_id))
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "PaypalConnectorCredentials",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "generate_authorization_value",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_PaypalAuthType_get_credentials | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/paypal/transformers.rs
// impl for PaypalAuthType
pub fn get_credentials(
&self,
) -> CustomResult<&PaypalConnectorCredentials, errors::ConnectorError> {
match self {
Self::TemporaryAuth => Err(errors::ConnectorError::InvalidConnectorConfig {
config: "TemporaryAuth found in connector_account_details",
}
.into()),
Self::AuthWithDetails(credentials) => Ok(credentials),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "PaypalAuthType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_credentials",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_NoonOrderNvp_new | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/noon/transformers.rs
// impl for NoonOrderNvp
pub fn new(metadata: &serde_json::Value) -> Self {
let metadata_as_string = metadata.to_string();
let hash_map: std::collections::BTreeMap<String, serde_json::Value> =
serde_json::from_str(&metadata_as_string).unwrap_or(std::collections::BTreeMap::new());
let inner = hash_map
.into_iter()
.enumerate()
.map(|(index, (hs_key, hs_value))| {
let noon_key = format!("{}", index + 1);
// to_string() function on serde_json::Value returns a string with "" quotes. Noon doesn't allow this. Hence get_value_as_string function
let noon_value = format!("{hs_key}={}", get_value_as_string(&hs_value));
(noon_key, Secret::new(noon_value))
})
.collect();
Self { inner }
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "NoonOrderNvp",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "new",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_WiseHttpStatus_get_status | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/wise/transformers.rs
// impl for WiseHttpStatus
pub fn get_status(&self) -> String {
match self {
Self::String(val) => val.clone(),
Self::Number(val) => val.to_string(),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "WiseHttpStatus",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_status",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_TrustpaymentsAuthType_get_basic_auth_header | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
// impl for TrustpaymentsAuthType
pub fn get_basic_auth_header(&self) -> String {
use base64::Engine;
let credentials = format!(
"{}:{}",
self.username.clone().expose(),
self.password.clone().expose()
);
let encoded = base64::engine::general_purpose::STANDARD.encode(credentials.as_bytes());
format!("Basic {encoded}")
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "TrustpaymentsAuthType",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_basic_auth_header",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_TrustpaymentsPaymentResponseData_get_payment_status | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
// impl for TrustpaymentsPaymentResponseData
pub fn get_payment_status(&self) -> common_enums::AttemptStatus {
match self.errorcode {
TrustpaymentsErrorCode::Success => {
if self.authcode.is_some() {
match &self.settlestatus {
Some(TrustpaymentsSettleStatus::PendingSettlement) => {
// settlestatus "0" = automatic capture, scheduled to settle
common_enums::AttemptStatus::Charged
}
Some(TrustpaymentsSettleStatus::Settled) => {
// settlestatus "1" or "100" = transaction has been settled
common_enums::AttemptStatus::Charged
}
Some(TrustpaymentsSettleStatus::ManualCapture) => {
// settlestatus "2" = suspended, manual capture needed
common_enums::AttemptStatus::Authorized
}
Some(TrustpaymentsSettleStatus::Voided) => {
// settlestatus "3" = transaction has been cancelled
common_enums::AttemptStatus::Voided
}
None => common_enums::AttemptStatus::Authorized,
}
} else {
common_enums::AttemptStatus::Failure
}
}
_ => self.errorcode.get_attempt_status(),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "TrustpaymentsPaymentResponseData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_status",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_TrustpaymentsPaymentResponseData_get_payment_status_for_sync | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
// impl for TrustpaymentsPaymentResponseData
pub fn get_payment_status_for_sync(&self) -> common_enums::AttemptStatus {
match self.errorcode {
TrustpaymentsErrorCode::Success => {
if self.requesttypedescription == "TRANSACTIONQUERY"
&& self.authcode.is_none()
&& self.settlestatus.is_none()
&& self.transactionreference.is_none()
{
common_enums::AttemptStatus::Authorized
} else if self.authcode.is_some() {
match &self.settlestatus {
Some(TrustpaymentsSettleStatus::PendingSettlement) => {
common_enums::AttemptStatus::Authorized
}
Some(TrustpaymentsSettleStatus::Settled) => {
common_enums::AttemptStatus::Charged
}
Some(TrustpaymentsSettleStatus::ManualCapture) => {
common_enums::AttemptStatus::Authorized
}
Some(TrustpaymentsSettleStatus::Voided) => {
common_enums::AttemptStatus::Voided
}
None => common_enums::AttemptStatus::Authorized,
}
} else {
common_enums::AttemptStatus::Pending
}
}
_ => self.errorcode.get_attempt_status(),
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "TrustpaymentsPaymentResponseData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_payment_status_for_sync",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
hyperswitch_method_hyperswitch_connectors_TrustpaymentsPaymentResponseData_get_error_message | clm | method | // hyperswitch/crates/hyperswitch_connectors/src/connectors/trustpayments/transformers.rs
// impl for TrustpaymentsPaymentResponseData
pub fn get_error_message(&self) -> String {
if self.errorcode.is_success() {
"Success".to_string()
} else {
format!("Error {}: {}", self.errorcode, self.errormessage)
}
}
| {
"chunk": null,
"crate": "hyperswitch_connectors",
"enum_name": null,
"file_size": null,
"for_type": "TrustpaymentsPaymentResponseData",
"function_name": null,
"is_async": null,
"is_pub": null,
"lines": null,
"method_name": "get_error_message",
"num_enums": null,
"num_items": null,
"num_structs": null,
"repo": "hyperswitch",
"start_line": null,
"struct_name": null,
"total_crates": null,
"trait_name": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.