id
stringlengths
11
116
type
stringclasses
1 value
granularity
stringclasses
4 values
content
stringlengths
16
477k
metadata
dict
fn_clm_hyperswitch_connectors_get_url_8897579332535186163
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/phonepe // Implementation of Phonepe for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundSyncRouterData, _connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 413, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_8897579332535186163
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/phonepe // Implementation of Phonepe for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_8897579332535186163
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/phonepe // Implementation of Phonepe for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_-3196051136589977396
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bluesnap // Inherent implementation for Bluesnap pub fn new() -> &'static Self { &Self { amount_converter: &StringMajorUnitForConnector, amount_converter_to_string_minor_unit: &StringMinorUnitForConnector, amount_converter_float_major_unit: &FloatMajorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_-3196051136589977396
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bluesnap // Implementation of Bluesnap for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { logger::debug!(bluesnap_error_response=?res); let response_data: Result< bluesnap::BluesnapErrors, Report<common_utils::errors::ParsingError>, > = res.response.parse_struct("BluesnapErrors"); match response_data { Ok(response) => { event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); let response_error_message = match response { bluesnap::BluesnapErrors::Payment(error_response) => { let error_list = error_response.message.clone(); let option_error_code_message = get_error_code_error_message_based_on_priority( self.clone(), error_list.into_iter().map(|errors| errors.into()).collect(), ); let reason = error_response .message .iter() .map(|error| error.description.clone()) .collect::<Vec<String>>() .join(" & "); ErrorResponse { status_code: res.status_code, code: option_error_code_message .clone() .map(|error_code_message| error_code_message.error_code) .unwrap_or(NO_ERROR_CODE.to_string()), message: option_error_code_message .map(|error_code_message| error_code_message.error_message) .unwrap_or(NO_ERROR_MESSAGE.to_string()), reason: Some(reason), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, } } bluesnap::BluesnapErrors::Auth(error_res) => ErrorResponse { status_code: res.status_code, code: error_res.error_code.clone(), message: error_res.error_name.clone().unwrap_or(error_res.error_code), reason: Some(error_res.error_description), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }, bluesnap::BluesnapErrors::General(error_response) => { let (error_res, attempt_status) = if res.status_code == 403 && error_response.contains(BLUESNAP_TRANSACTION_NOT_FOUND) { ( format!( "{REQUEST_TIMEOUT_PAYMENT_NOT_FOUND} in bluesnap dashboard", ), Some(enums::AttemptStatus::Failure), // when bluesnap throws 403 for payment not found, we update the payment status to failure. ) } else { (error_response.clone(), None) }; ErrorResponse { status_code: res.status_code, code: NO_ERROR_CODE.to_string(), message: error_response, reason: Some(error_res), attempt_status, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, } } }; Ok(response_error_message) } Err(error_msg) => { event_builder.map(|event| event.set_error(serde_json::json!({"error": res.response.escape_ascii().to_string(), "status_code": res.status_code}))); router_env::logger::error!(deserialization_error =? error_msg); handle_json_response_deserialization_failure(res, "bluesnap") } } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 491, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-3196051136589977396
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bluesnap // Implementation of Bluesnap for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { if req.request.payment_amount == req.request.refund_amount { let meta_data: CustomResult< bluesnap::BluesnapConnectorMetaData, errors::ConnectorError, > = to_connector_meta_from_secret(req.connector_meta_data.clone()); match meta_data { // if merchant_id is present, rsync can be made using merchant_transaction_id Ok(data) => get_url_with_merchant_transaction_id( self.base_url(connectors).to_string(), data.merchant_id, req.attempt_id.to_owned(), ), // otherwise rsync is made using connector_transaction_id Err(_) => get_rsync_url_with_connector_refund_id( req, self.base_url(connectors).to_string(), ), } } else { get_rsync_url_with_connector_refund_id(req, self.base_url(connectors).to_string()) } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 431, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-3196051136589977396
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bluesnap // Implementation of Bluesnap for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_build_headers_-3196051136589977396
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bluesnap // Implementation of Bluesnap for ConnectorCommonExt<Flow, Request, Response> fn build_headers( &self, req: &RouterData<Flow, Request, Response>, _connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { let mut header = self.get_auth_header(&req.connector_auth_type)?; header.push(( headers::CONTENT_TYPE.to_string(), self.get_content_type().to_string().into(), )); Ok(header) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 380, "total_crates": null }
fn_clm_hyperswitch_connectors_new_1202055043886670762
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/trustpayments // Inherent implementation for Trustpayments pub fn new() -> &'static Self { &Self { amount_converter: &StringMinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_1202055043886670762
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/trustpayments // Implementation of Trustpayments for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: trustpayments::TrustpaymentsErrorResponse = res .response .parse_struct("TrustpaymentsErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: response.code, message: response.message, reason: response.reason, attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 439, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_1202055043886670762
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/trustpayments // Implementation of Trustpayments for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!("{}/json/", self.base_url(connectors))) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 407, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_1202055043886670762
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/trustpayments // Implementation of Trustpayments for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_1202055043886670762
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/trustpayments // Implementation of Trustpayments for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_1427967601569691016
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/helcim // Inherent implementation for Helcim pub fn new() -> &'static Self { &Self { amount_convertor: &FloatMajorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_1427967601569691016
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/helcim // Implementation of Helcim for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: helcim::HelcimErrorResponse = res .response .parse_struct("HelcimErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); let error_string = match response { transformers::HelcimErrorResponse::Payment(response) => match response.errors { transformers::HelcimErrorTypes::StringType(error) => error, transformers::HelcimErrorTypes::JsonType(error) => error.to_string(), }, transformers::HelcimErrorResponse::General(error_string) => error_string, }; Ok(ErrorResponse { status_code: res.status_code, code: NO_ERROR_CODE.to_owned(), message: error_string.clone(), reason: Some(error_string), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 445, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_1427967601569691016
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/helcim // Implementation of Helcim for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let connector_refund_id = req .request .connector_refund_id .clone() .ok_or(errors::ConnectorError::MissingConnectorRefundID)?; Ok(format!( "{}v2/card-transactions/{connector_refund_id}", self.base_url(connectors) )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 411, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_1427967601569691016
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/helcim // Implementation of Helcim for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, _connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::maskable::Maskable<String>)>, errors::ConnectorError> { let mut header = vec![( headers::CONTENT_TYPE.to_string(), types::RefundSyncType::get_content_type(self) .to_string() .into(), )]; let mut api_key = self.get_auth_header(&req.connector_auth_type)?; header.append(&mut api_key); Ok(header) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 384, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_1427967601569691016
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/helcim // Implementation of Helcim for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_-6627985554760215959
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/celero // Inherent implementation for Celero pub fn new() -> &'static Self { &Self { amount_converter: &MinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_-6627985554760215959
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/celero // Implementation of Celero for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: celero::CeleroErrorResponse = res .response .parse_struct("CeleroErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); // Extract error details from the response let error_details = celero::CeleroErrorDetails::from(response); Ok(ErrorResponse { status_code: res.status_code, code: error_details .error_code .unwrap_or_else(|| "UNKNOWN_ERROR".to_string()), message: error_details.error_message, reason: error_details.decline_reason, attempt_status: None, connector_transaction_id: None, network_decline_code: error_details.processor_response_code.clone(), network_advice_code: None, network_error_message: error_details.processor_response_code, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 447, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-6627985554760215959
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/celero // Implementation of Celero for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { // CeleroCommerce uses search API for refund sync Ok(format!( "{}/api/transaction/search", self.base_url(connectors) )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 407, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-6627985554760215959
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/celero // Implementation of Celero for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_-6627985554760215959
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/celero // Implementation of Celero for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_2939488222307148892
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/plaid // Inherent implementation for Plaid pub fn new() -> &'static Self { &Self { amount_converter: &FloatMajorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_2939488222307148892
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/plaid // Implementation of Plaid for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, ConnectorError> { let response: plaid::PlaidErrorResponse = res.response .parse_struct("PlaidErrorResponse") .change_context(ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: response.error_code.unwrap_or(NO_ERROR_CODE.to_string()), message: response.error_message, reason: response.display_message, attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 443, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_2939488222307148892
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/plaid // Implementation of Plaid for ConnectorIntegration<PostProcessing, PaymentsPostProcessingData, PaymentsResponseData> fn get_url( &self, _req: &PaymentsPostProcessingRouterData, connectors: &Connectors, ) -> CustomResult<String, ConnectorError> { Ok(format!("{}/link/token/create", self.base_url(connectors))) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 407, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_2939488222307148892
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/plaid // Implementation of Plaid for ConnectorIntegration<PostProcessing, PaymentsPostProcessingData, PaymentsResponseData> fn get_headers( &self, req: &PaymentsPostProcessingRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_2939488222307148892
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/plaid // Implementation of Plaid for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_5258023182372694029
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/mifinity // Inherent implementation for Mifinity pub fn new() -> &'static Self { &Self { amount_converter: &StringMajorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_5258023182372694029
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/mifinity // Implementation of Mifinity for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { if res.response.is_empty() { Ok(ErrorResponse { status_code: res.status_code, code: NO_ERROR_CODE.to_string(), message: NO_ERROR_MESSAGE.to_string(), reason: Some(CONNECTOR_UNAUTHORIZED_ERROR.to_string()), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) } else { let response: Result< mifinity::MifinityErrorResponse, Report<common_utils::errors::ParsingError>, > = res.response.parse_struct("MifinityErrorResponse"); match response { Ok(response) => { event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: response .errors .iter() .map(|error| error.error_code.clone()) .collect::<Vec<String>>() .join(" & "), message: response .errors .iter() .map(|error| error.message.clone()) .collect::<Vec<String>>() .join(" & "), reason: Some( response .errors .iter() .map(|error| error.message.clone()) .collect::<Vec<String>>() .join(" & "), ), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) } Err(error_msg) => { event_builder.map(|event| event.set_error(serde_json::json!({"error": res.response.escape_ascii().to_string(), "status_code": res.status_code}))); logger::error!(deserialization_error =? error_msg); crate::utils::handle_json_response_deserialization_failure(res, "mifinity") } } } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 475, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_5258023182372694029
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/mifinity // Implementation of Mifinity for ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fn get_url( &self, _req: &PaymentsCaptureRouterData, _connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::NotImplemented("get_url method".to_string()).into()) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 413, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_5258023182372694029
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/mifinity // Implementation of Mifinity for ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData> fn get_headers( &self, req: &PaymentsCaptureRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_5258023182372694029
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/mifinity // Implementation of Mifinity for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_5286786244472936170
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/worldline // Implementation of Worldline for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: worldline::ErrorResponse = res .response .parse_struct("Worldline ErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); logger::info!(connector_response=?response); let error = response.errors.into_iter().next().unwrap_or_default(); Ok(ErrorResponse { status_code: res.status_code, code: error .code .unwrap_or_else(|| hyperswitch_interfaces::consts::NO_ERROR_CODE.to_string()), message: error .message .unwrap_or_else(|| hyperswitch_interfaces::consts::NO_ERROR_MESSAGE.to_string()), ..Default::default() }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 455, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_5286786244472936170
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/worldline // Implementation of Worldline for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let refund_id = req.request.get_connector_refund_id()?; let base_url = self.base_url(connectors); let auth: worldline::WorldlineAuthType = worldline::WorldlineAuthType::try_from(&req.connector_auth_type)?; let merchant_account_id = auth.merchant_account_id.expose(); Ok(format!( "{base_url}v1/{merchant_account_id}/refunds/{refund_id}/" )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 415, "total_crates": null }
fn_clm_hyperswitch_connectors_build_headers_5286786244472936170
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/worldline // Implementation of Worldline for ConnectorCommonExt<Flow, Request, Response> fn build_headers( &self, req: &RouterData<Flow, Request, Response>, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { let base_url = self.base_url(connectors); let url = Self::get_url(self, req, connectors)?; let endpoint = url.replace(base_url, ""); let http_method = Self::get_http_method(self); let auth = worldline::WorldlineAuthType::try_from(&req.connector_auth_type)?; let date = Self::get_current_date_time()?; let content_type = Self::get_content_type(self); let signed_data: String = self.generate_authorization_token(auth, http_method, content_type, &date, &endpoint)?; Ok(vec![ (headers::DATE.to_string(), date.into()), ( headers::AUTHORIZATION.to_string(), signed_data.into_masked(), ), ( headers::CONTENT_TYPE.to_string(), content_type.to_string().into(), ), ]) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 384, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_5286786244472936170
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/worldline // Implementation of Worldline for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_get_request_body_5286786244472936170
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/worldline // Implementation of Worldline for ConnectorIntegration<Execute, RefundsData, RefundsResponseData> fn get_request_body( &self, req: &RefundsRouterData<Execute>, _connectors: &Connectors, ) -> CustomResult<RequestContent, errors::ConnectorError> { let connector_req = worldline::WorldlineRefundRequest::try_from(req)?; Ok(RequestContent::Json(Box::new(connector_req))) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 299, "total_crates": null }
fn_clm_hyperswitch_connectors_new_9022498684653916491
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bankofamerica // Inherent implementation for Bankofamerica pub fn new() -> &'static Self { &Self { amount_convertor: &StringMajorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_9022498684653916491
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bankofamerica // Implementation of Bankofamerica for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: bankofamerica::BankOfAmericaErrorResponse = res .response .parse_struct("BankOfAmerica ErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); let error_message = if res.status_code == 401 { constants::CONNECTOR_UNAUTHORIZED_ERROR } else { hyperswitch_interfaces::consts::NO_ERROR_MESSAGE }; match response { transformers::BankOfAmericaErrorResponse::StandardError(response) => { let (code, message, reason) = match response.error_information { Some(ref error_info) => { let detailed_error_info = error_info.details.as_ref().map(|details| { details .iter() .map(|det| format!("{} : {}", det.field, det.reason)) .collect::<Vec<_>>() .join(", ") }); ( error_info.reason.clone(), error_info.reason.clone(), transformers::get_error_reason( Some(error_info.message.clone()), detailed_error_info, None, ), ) } None => { let detailed_error_info = response.details.map(|details| { details .iter() .map(|det| format!("{} : {}", det.field, det.reason)) .collect::<Vec<_>>() .join(", ") }); ( response.reason.clone().map_or( hyperswitch_interfaces::consts::NO_ERROR_CODE.to_string(), |reason| reason.to_string(), ), response .reason .map_or(error_message.to_string(), |reason| reason.to_string()), transformers::get_error_reason( response.message, detailed_error_info, None, ), ) } }; Ok(ErrorResponse { status_code: res.status_code, code, message, reason, attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) } transformers::BankOfAmericaErrorResponse::AuthenticationError(response) => { Ok(ErrorResponse { status_code: res.status_code, code: hyperswitch_interfaces::consts::NO_ERROR_CODE.to_string(), message: response.response.rmsg.clone(), reason: Some(response.response.rmsg), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) } } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 485, "total_crates": null }
fn_clm_hyperswitch_connectors_build_headers_9022498684653916491
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bankofamerica // Implementation of Bankofamerica for ConnectorCommonExt<Flow, Request, Response> fn build_headers( &self, req: &RouterData<Flow, Request, Response>, connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> { let date = OffsetDateTime::now_utc(); let boa_req = self.get_request_body(req, connectors)?; let http_method = self.get_http_method(); let auth = bankofamerica::BankOfAmericaAuthType::try_from(&req.connector_auth_type)?; let merchant_account = auth.merchant_account.clone(); let base_url = connectors.bankofamerica.base_url.as_str(); let boa_host = Url::parse(base_url).change_context(errors::ConnectorError::RequestEncodingFailed)?; let host = boa_host .host_str() .ok_or(errors::ConnectorError::RequestEncodingFailed)?; let path: String = self .get_url(req, connectors)? .chars() .skip(base_url.len() - 1) .collect(); let sha256 = self.generate_digest(boa_req.get_inner_value().expose().as_bytes()); let signature = self.generate_signature( auth, host.to_string(), path.as_str(), &sha256, date, http_method, )?; let mut headers = vec![ ( headers::CONTENT_TYPE.to_string(), self.get_content_type().to_string().into(), ), ( headers::ACCEPT.to_string(), "application/hal+json;charset=utf-8".to_string().into(), ), (V_C_MERCHANT_ID.to_string(), merchant_account.into_masked()), ("Date".to_string(), date.to_string().into()), ("Host".to_string(), host.to_string().into()), ("Signature".to_string(), signature.into_masked()), ]; if matches!(http_method, Method::Post | Method::Put) { headers.push(( "Digest".to_string(), format!("SHA-256={sha256}").into_masked(), )); } Ok(headers) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 418, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_9022498684653916491
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bankofamerica // Implementation of Bankofamerica for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let refund_id = req.request.get_connector_refund_id()?; Ok(format!( "{}tss/v2/transactions/{refund_id}", self.base_url(connectors) )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 409, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_9022498684653916491
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bankofamerica // Implementation of Bankofamerica for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_3322035143841405574
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/square // Implementation of Square for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: square::SquareErrorResponse = res .response .parse_struct("SquareErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); let mut reason_list = Vec::new(); for error_iter in response.errors.iter() { if let Some(error) = error_iter.detail.clone() { reason_list.push(error) } } let reason = reason_list.join(" "); Ok(ErrorResponse { status_code: res.status_code, code: response .errors .first() .and_then(|error| error.code.clone()) .unwrap_or(consts::NO_ERROR_CODE.to_string()), message: response .errors .first() .and_then(|error| error.category.clone()) .unwrap_or(consts::NO_ERROR_MESSAGE.to_string()), reason: Some(reason), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 469, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_3322035143841405574
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/square // Implementation of Square for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}v2/refunds/{}", self.base_url(connectors), req.request.get_connector_refund_id()?, )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 407, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_3322035143841405574
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/square // Implementation of Square for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_3322035143841405574
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/square // Implementation of Square for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_build_headers_3322035143841405574
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/square // Implementation of Square for ConnectorCommonExt<Flow, Request, Response> fn build_headers( &self, req: &RouterData<Flow, Request, Response>, _connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> { let mut header = vec![( headers::CONTENT_TYPE.to_string(), PaymentsAuthorizeType::get_content_type(self) .to_string() .into(), )]; let mut api_key = self.get_auth_header(&req.connector_auth_type)?; header.append(&mut api_key); Ok(header) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 372, "total_crates": null }
fn_clm_hyperswitch_connectors_new_-2675295590792874497
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/klarna // Inherent implementation for Klarna pub fn new() -> &'static Self { &Self { amount_converter: &MinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_-2675295590792874497
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/klarna // Implementation of Klarna for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: klarna::KlarnaErrorResponse = res .response .parse_struct("KlarnaErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); // KlarnaErrorResponse will either have error_messages or error_message field Ref: https://docs.klarna.com/api/errors/ let reason = response .error_messages .map(|messages| messages.join(" & ")) .or(response.error_message.clone()); Ok(ErrorResponse { status_code: res.status_code, code: response.error_code, message: response .error_message .unwrap_or(NO_ERROR_MESSAGE.to_string()), reason, attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 451, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-2675295590792874497
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/klarna // Implementation of Klarna for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let order_id = req.request.connector_transaction_id.clone(); let refund_id = req.request.get_connector_refund_id()?; let endpoint = build_region_specific_endpoint(self.base_url(connectors), &req.connector_meta_data)?; Ok(format!( "{endpoint}ordermanagement/v1/orders/{order_id}/refunds/{refund_id}" )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 415, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-2675295590792874497
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/klarna // Implementation of Klarna for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_-2675295590792874497
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/klarna // Implementation of Klarna for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_6539751967422317301
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/redsys // Inherent implementation for Redsys pub fn new() -> &'static Self { &Self { amount_converter: &StringMinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_6539751967422317301
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/redsys // Implementation of Redsys for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: redsys::RedsysErrorResponse = res .response .parse_struct("RedsysErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: response.error_code.clone(), message: response.error_code.clone(), reason: Some(response.error_code.clone()), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 445, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_6539751967422317301
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/redsys // Implementation of Redsys for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}/apl02/services/SerClsWSConsulta", self.base_url(connectors) )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 407, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_6539751967422317301
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/redsys // Implementation of Redsys for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_6539751967422317301
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/redsys // Implementation of Redsys for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_-1444234949027129767
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/loonio // Inherent implementation for Loonio pub fn new() -> &'static Self { &Self { amount_converter: &FloatMajorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_-1444234949027129767
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/loonio // Implementation of Loonio for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: loonio::LoonioErrorResponse = res .response .parse_struct("LoonioErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: response .error_code .clone() .unwrap_or(api_consts::NO_ERROR_CODE.to_string()), message: response.message.clone(), reason: Some(response.message.clone()), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 449, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-1444234949027129767
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/loonio // Implementation of Loonio for ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> fn get_url( &self, req: &PayoutsRouterData<PoSync>, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let transfer_id = req.request.connector_payout_id.to_owned().ok_or( errors::ConnectorError::MissingRequiredField { field_name: "transaction_id", }, )?; Ok(format!( "{}api/v1/transactions/{}/details", connectors.loonio.base_url, transfer_id )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 411, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-1444234949027129767
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/loonio // Implementation of Loonio for ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> fn get_headers( &self, req: &PayoutsRouterData<PoSync>, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_-1444234949027129767
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/loonio // Implementation of Loonio for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_7583870376196867755
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stripebilling // Inherent implementation for Stripebilling pub fn new() -> &'static Self { &Self { amount_converter: &StringMinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_7583870376196867755
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stripebilling // Implementation of Stripebilling for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: stripebilling::StripebillingErrorResponse = res .response .parse_struct("StripebillingErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: response.code, message: response.message, reason: response.reason, attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 439, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_7583870376196867755
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stripebilling // Implementation of Stripebilling for ConnectorIntegration< recovery_router_flows::InvoiceRecordBack, recovery_request_types::InvoiceRecordBackRequest, recovery_response_types::InvoiceRecordBackResponse, > fn get_url( &self, req: &recovery_router_data_types::InvoiceRecordBackRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let invoice_id = req .request .merchant_reference_id .get_string_repr() .to_string(); match req.request.attempt_status { common_enums::AttemptStatus::Charged => Ok(format!( "{}/v1/invoices/{invoice_id}/pay?paid_out_of_band=true", self.base_url(connectors), )), common_enums::AttemptStatus::Failure => Ok(format!( "{}/v1/invoices/{invoice_id}/void", self.base_url(connectors), )), _ => Err(errors::ConnectorError::FailedToObtainIntegrationUrl.into()), } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 413, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_7583870376196867755
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stripebilling // Implementation of Stripebilling for ConnectorIntegration< recovery_router_flows::InvoiceRecordBack, recovery_request_types::InvoiceRecordBackRequest, recovery_response_types::InvoiceRecordBackResponse, > fn get_headers( &self, req: &recovery_router_data_types::InvoiceRecordBackRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_7583870376196867755
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stripebilling // Implementation of Stripebilling for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_-87505049989857885
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/riskified // Inherent implementation for Riskified pub fn new() -> &'static Self { &Self { #[cfg(feature = "frm")] amount_converter: &StringMajorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_-87505049989857885
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/riskified // Implementation of Riskified for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, ConnectorError> { use hyperswitch_interfaces::consts::NO_ERROR_CODE; let response: riskified::ErrorResponse = res .response .parse_struct("ErrorResponse") .change_context(ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, attempt_status: None, code: NO_ERROR_CODE.to_string(), message: response.error.message.clone(), reason: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 443, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-87505049989857885
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/riskified // Implementation of Riskified for ConnectorIntegration<Fulfillment, FraudCheckFulfillmentData, FraudCheckResponseData> fn get_url( &self, _req: &FrmFulfillmentRouterData, connectors: &Connectors, ) -> CustomResult<String, ConnectorError> { Ok(format!("{}{}", self.base_url(connectors), "/fulfill")) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 407, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-87505049989857885
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/riskified // Implementation of Riskified for ConnectorIntegration<Fulfillment, FraudCheckFulfillmentData, FraudCheckResponseData> fn get_headers( &self, req: &FrmFulfillmentRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_build_headers_-87505049989857885
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/riskified // Implementation of Riskified for ConnectorCommonExt<Flow, Request, Response> fn build_headers( &self, req: &RouterData<Flow, Request, Response>, connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, ConnectorError> { let auth: riskified::RiskifiedAuthType = riskified::RiskifiedAuthType::try_from(&req.connector_auth_type)?; let riskified_req = self.get_request_body(req, connectors)?; let binding = riskified_req.get_inner_value(); let payload = binding.peek(); let digest = self .generate_authorization_signature(&auth, payload) .change_context(ConnectorError::RequestEncodingFailed)?; let header = vec![ ( headers::CONTENT_TYPE.to_string(), self.get_content_type().to_string().into(), ), ( "X-RISKIFIED-SHOP-DOMAIN".to_string(), auth.domain_name.clone().into(), ), ( "X-RISKIFIED-HMAC-SHA256".to_string(), Mask::into_masked(digest), ), ( "Accept".to_string(), "application/vnd.riskified.com; version=2".into(), ), ]; Ok(header) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 380, "total_crates": null }
fn_clm_hyperswitch_connectors_new_5114899537469484705
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/archipel // Inherent implementation for Archipel pub const fn new() -> &'static Self { &Self { amount_converter: &MinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_5114899537469484705
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/archipel // Implementation of Archipel for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let archipel_error: CustomResult< archipel::ArchipelErrorMessage, common_utils::errors::ParsingError, > = res.response.parse_struct("ArchipelErrorMessage"); match archipel_error { Ok(err) => { event_builder.map(|i| i.set_error_response_body(&err)); info!(connector_response=?err); Ok(ErrorResponse { status_code: res.status_code, code: err.code, attempt_status: None, connector_transaction_id: None, message: err .description .clone() .unwrap_or(NO_ERROR_MESSAGE.to_string()), reason: err.description, network_decline_code: None, network_advice_code: None, network_error_message: None, connector_metadata: None, }) } Err(error) => { event_builder.map(|event| { event.set_error(serde_json::json!({ "error": res.response.escape_ascii().to_string(), "status_code": res.status_code })) }); error!(deserialization_error=?error); crate::utils::handle_json_response_deserialization_failure(res, "archipel") } } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 449, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_5114899537469484705
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/archipel // Implementation of Archipel for ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> fn get_url( &self, req: &PaymentsCancelRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let base_url = build_env_specific_endpoint(self.base_url(connectors), &req.connector_meta_data)?; Ok(format!( "{}{}{}", base_url, "/cancel/", req.request.connector_transaction_id )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 411, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_5114899537469484705
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/archipel // Implementation of Archipel for ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData> fn get_headers( &self, req: &PaymentsCancelRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_5114899537469484705
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/archipel // Implementation of Archipel for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_7997699730953224444
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/gocardless // Inherent implementation for Gocardless pub fn new() -> &'static Self { &Self { amount_converter: &MinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_7997699730953224444
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/gocardless // Implementation of Gocardless for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: gocardless::GocardlessErrorResponse = res .response .parse_struct("GocardlessErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); let error_iter = response.error.errors.iter(); let mut error_reason: Vec<String> = Vec::new(); for error in error_iter { let reason = error.field.clone().map_or(error.message.clone(), |field| { format!("{} {}", field, error.message) }); error_reason.push(reason) } Ok(ErrorResponse { status_code: res.status_code, code: response.error.code.to_string(), message: response.error.error_type, reason: Some(error_reason.join("; ")), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 455, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_7997699730953224444
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/gocardless // Implementation of Gocardless for ConnectorIntegration<Execute, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundsRouterData<Execute>, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!("{}/refunds", self.base_url(connectors))) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 407, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_7997699730953224444
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/gocardless // Implementation of Gocardless for ConnectorIntegration<Execute, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundsRouterData<Execute>, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_7997699730953224444
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/gocardless // Implementation of Gocardless for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_3860155594867052940
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globalpay // Inherent implementation for Globalpay pub fn new() -> &'static Self { &Self { amount_converter: &StringMinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_3860155594867052940
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globalpay // Implementation of Globalpay for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: transformers::GlobalpayErrorResponse = res .response .parse_struct("Globalpay ErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: response.error_code, message: response.detailed_error_description, reason: None, attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 439, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_3860155594867052940
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globalpay // Implementation of Globalpay for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let refund_id = req.request.get_connector_refund_id()?; Ok(format!( "{}transactions/{}", self.base_url(connectors), refund_id )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 409, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_3860155594867052940
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globalpay // Implementation of Globalpay for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_3860155594867052940
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globalpay // Implementation of Globalpay for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_-187923286586268280
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/airwallex // Inherent implementation for Airwallex pub const fn new() -> &'static Self { &Self { amount_converter: &StringMajorUnitForConnector, amount_converter_to_string_minor: &StringMinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_-187923286586268280
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/airwallex // Implementation of Airwallex for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { logger::debug!(payu_error_response=?res); let response: airwallex::AirwallexErrorResponse = res .response .parse_struct("Airwallex ErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: response.code, message: response.message, reason: response.source, attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 439, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-187923286586268280
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/airwallex // Implementation of Airwallex for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}{}{}", self.base_url(connectors), "/api/v1/pa/refunds/", req.request.get_connector_refund_id()? )) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 407, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-187923286586268280
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/airwallex // Implementation of Airwallex for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_build_headers_-187923286586268280
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/airwallex // Implementation of Airwallex for ConnectorCommonExt<Flow, Request, Response> fn build_headers( &self, req: &RouterData<Flow, Request, Response>, _connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { let mut headers = vec![( headers::CONTENT_TYPE.to_string(), self.get_content_type().to_string().into(), )]; let access_token = req .access_token .clone() .ok_or(errors::ConnectorError::FailedToObtainAuthType)?; let auth_header = ( headers::AUTHORIZATION.to_string(), format!("Bearer {}", access_token.token.peek()).into_masked(), ); headers.push(auth_header); Ok(headers) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 378, "total_crates": null }
fn_clm_hyperswitch_connectors_new_2136112943967853966
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/calida // Inherent implementation for Calida pub fn new() -> &'static Self { &Self { amount_converter: &FloatMajorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_2136112943967853966
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/calida // Implementation of Calida for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: calida::CalidaErrorResponse = res .response .parse_struct("CalidaErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); Ok(ErrorResponse { status_code: res.status_code, code: consts::NO_ERROR_CODE.to_string(), message: response.message.clone(), reason: Some(response.message), attempt_status: None, connector_transaction_id: None, network_advice_code: None, network_decline_code: None, network_error_message: None, connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 443, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_2136112943967853966
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/calida // Implementation of Calida for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundSyncRouterData, _connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Err(errors::ConnectorError::FlowNotSupported { flow: "RSync".to_string(), connector: "Calida".to_string(), } .into()) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 413, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_2136112943967853966
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/calida // Implementation of Calida for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { self.build_headers(req, connectors) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_2136112943967853966
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/calida // Implementation of Calida for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/json" }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 377, "total_crates": null }
fn_clm_hyperswitch_connectors_new_6797239688079958441
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stripe // Inherent implementation for Stripe pub const fn new() -> &'static Self { &Self { amount_converter: &MinorUnitForConnector, amount_converter_webhooks: &StringMinorUnitForConnector, } }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": true, "num_enums": null, "num_structs": null, "num_tables": null, "score": 14463, "total_crates": null }
fn_clm_hyperswitch_connectors_build_error_response_6797239688079958441
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stripe // Implementation of Stripe for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, ConnectorError> { use hyperswitch_interfaces::consts::NO_ERROR_CODE; let response: stripe::StripeConnectErrorResponse = res .response .parse_struct("StripeConnectErrorResponse") .change_context(ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); Ok(ErrorResponse { status_code: res.status_code, code: response .error .code .clone() .unwrap_or_else(|| NO_ERROR_CODE.to_string()), message: response .error .code .unwrap_or_else(|| NO_ERROR_MESSAGE.to_string()), reason: response.error.message, attempt_status: None, connector_transaction_id: response.error.payment_intent.map(|pi| pi.id), network_advice_code: response.error.network_advice_code, network_decline_code: response.error.network_decline_code, network_error_message: response.error.decline_code.or(response.error.advice_code), connector_metadata: None, }) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 453, "total_crates": null }