id
stringlengths
11
116
type
stringclasses
1 value
granularity
stringclasses
4 values
content
stringlengths
16
477k
metadata
dict
fn_clm_hyperswitch_connectors_get_url_5847194729830674375
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/custombilling // Implementation of Custombilling 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_5847194729830674375
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/custombilling // Implementation of Custombilling 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_5847194729830674375
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/custombilling // Implementation of Custombilling 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_-734475190120110413
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/silverflow // Inherent implementation for Silverflow pub fn new() -> &'static Self { &Self }
{ "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_-734475190120110413
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/silverflow // Implementation of Silverflow for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: silverflow::SilverflowErrorResponse = res .response .parse_struct("SilverflowErrorResponse") .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, message: response.error.message, reason: response .error .details .map(|d| format!("Field: {}, Issue: {}", d.field, d.issue)), attempt_status: None, connector_transaction_id: None, network_decline_code: None, network_advice_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": 441, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-734475190120110413
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/silverflow // Implementation of Silverflow for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { // According to Silverflow API documentation, refunds are actions on charges // Endpoint: GET /charges/{chargeKey}/actions/{actionKey} let charge_key = &req.request.connector_transaction_id; let action_key = &req.request.refund_id; Ok(format!( "{}/charges/{}/actions/{}", self.base_url(connectors), charge_key, action_key )) }
{ "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_build_headers_-734475190120110413
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/silverflow // Implementation of Silverflow 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 = vec![ ( headers::CONTENT_TYPE.to_string(), self.get_content_type().to_string().into(), ), ( headers::ACCEPT.to_string(), "application/json".to_string().into(), ), ]; // Add Idempotency-Key for POST requests (Authorize, Capture, Execute, PaymentMethodToken, Void) let flow_type = std::any::type_name::<Flow>(); if flow_type.contains("Authorize") || flow_type.contains("Capture") || flow_type.contains("Execute") || flow_type.contains("PaymentMethodToken") || flow_type.contains("Void") { header.push(( "Idempotency-Key".to_string(), format!("hs_{}", req.payment_id).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": 388, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-734475190120110413
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/silverflow // Implementation of Silverflow 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_new_920818200099673698
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/cashtocode // Inherent implementation for Cashtocode 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_920818200099673698
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/cashtocode // Implementation of Cashtocode for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: cashtocode::CashtocodeErrorResponse = res .response .parse_struct("CashtocodeErrorResponse") .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.to_string(), message: response.error_description.clone(), reason: Some(response.error_description), 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_920818200099673698
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/cashtocode // Implementation of Cashtocode for ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> fn get_url( &self, _req: &PaymentsAuthorizeRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}/merchant/paytokens", connectors.cashtocode.base_url )) }
{ "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_920818200099673698
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/cashtocode // Implementation of Cashtocode for ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData> fn get_headers( &self, req: &PaymentsAuthorizeRouterData, _connectors: &Connectors, ) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> { let mut header = vec![( headers::CONTENT_TYPE.to_string(), PaymentsAuthorizeType::get_content_type(self) .to_owned() .into(), )]; let auth_type = transformers::CashtocodeAuth::try_from(( &req.connector_auth_type, &req.request.currency, ))?; let mut api_key = get_b64_auth_cashtocode(req.request.payment_method_type, &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": 386, "total_crates": null }
fn_clm_hyperswitch_connectors_common_get_content_type_920818200099673698
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/cashtocode // Implementation of Cashtocode 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_8714682444057151923
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stax // Implementation of Stax for ConnectorCommon fn build_error_response( &self, res: Response, _event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { Ok(ErrorResponse { status_code: res.status_code, code: consts::NO_ERROR_CODE.to_string(), message: consts::NO_ERROR_MESSAGE.to_string(), reason: Some( std::str::from_utf8(&res.response) .change_context(errors::ConnectorError::ResponseDeserializationFailed)? .to_owned(), ), 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": 441, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_8714682444057151923
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stax // Implementation of Stax for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}/transaction/{}", 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_8714682444057151923
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stax // Implementation of Stax 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_8714682444057151923
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stax // Implementation of Stax 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_8714682444057151923
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/stax // Implementation of Stax 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 = vec![( headers::CONTENT_TYPE.to_string(), types::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_build_error_response_4693546869000759054
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/prophetpay // Implementation of Prophetpay for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: serde_json::Value = res .response .parse_struct("ProphetPayErrorResponse") .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: NO_ERROR_CODE.to_string(), message: NO_ERROR_MESSAGE.to_string(), reason: Some(response.to_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_4693546869000759054
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/prophetpay // Implementation of Prophetpay for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}hp/api/Transactions/ProcessTransaction", 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_4693546869000759054
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/prophetpay // Implementation of Prophetpay 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_4693546869000759054
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/prophetpay // Implementation of Prophetpay 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_4693546869000759054
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/prophetpay // Implementation of Prophetpay 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 = vec![( headers::CONTENT_TYPE.to_string(), self.get_content_type().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_7915051341783689439
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bambora // Inherent implementation for Bambora 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_7915051341783689439
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bambora // Implementation of Bambora for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: bambora::BamboraErrorResponse = res .response .parse_struct("BamboraErrorResponse") .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.to_string(), message: serde_json::to_string(&response.details) .unwrap_or(hyperswitch_interfaces::consts::NO_ERROR_MESSAGE.to_string()), 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": 447, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_7915051341783689439
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bambora // Implementation of Bambora for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let _connector_payment_id = req.request.connector_transaction_id.clone(); let connector_refund_id = req.request.get_connector_refund_id()?; Ok(format!( "{}/v1/payments/{}", self.base_url(connectors), 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": 411, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_7915051341783689439
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bambora // Implementation of Bambora 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_7915051341783689439
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/bambora // Implementation of Bambora 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_-7616559063427764862
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/wellsfargopayout // Inherent implementation for Wellsfargopayout 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_-7616559063427764862
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/wellsfargopayout // Implementation of Wellsfargopayout for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, ConnectorError> { let response: wellsfargopayout::WellsfargopayoutErrorResponse = res .response .parse_struct("WellsfargopayoutErrorResponse") .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.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_-7616559063427764862
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/wellsfargopayout // Implementation of Wellsfargopayout for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundSyncRouterData, _connectors: &Connectors, ) -> CustomResult<String, ConnectorError> { Err(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_-7616559063427764862
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/wellsfargopayout // Implementation of Wellsfargopayout for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, 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_-7616559063427764862
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/wellsfargopayout // Implementation of Wellsfargopayout 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_7511685446757860253
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/forte // Inherent implementation for Forte 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_7511685446757860253
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/forte // Implementation of Forte for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: forte::ForteErrorResponse = res .response .parse_struct("Forte ErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_error_response_body(&response)); router_env::logger::info!(connector_response=?response); let message = response.response.response_desc; let code = response .response .response_code .unwrap_or_else(|| NO_ERROR_CODE.to_string()); Ok(ErrorResponse { status_code: res.status_code, code, message, 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": 443, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_7511685446757860253
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/forte // Implementation of Forte for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let auth: forte::ForteAuthType = forte::ForteAuthType::try_from(&req.connector_auth_type)?; Ok(format!( "{}/organizations/{}/locations/{}/transactions/{}", self.base_url(connectors), auth.organization_id.peek(), auth.location_id.peek(), 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": 409, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_7511685446757860253
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/forte // Implementation of Forte 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_7511685446757860253
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/forte // Implementation of Forte 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 content_type = ConnectorCommon::common_get_content_type(self); let mut common_headers = self.get_auth_header(&req.connector_auth_type)?; common_headers.push(( headers::CONTENT_TYPE.to_string(), content_type.to_string().into(), )); Ok(common_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": 380, "total_crates": null }
fn_clm_hyperswitch_connectors_new_9164176229467487171
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/nuvei // Inherent implementation for Nuvei pub fn new() -> &'static Self { &Self { amount_convertor: &StringMajorUnitForConnector, amount_converter_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_get_url_9164176229467487171
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/nuvei // Implementation of Nuvei for ConnectorIntegration<Execute, RefundsData, RefundsResponseData> fn get_url( &self, _req: &RefundsRouterData<Execute>, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}ppp/api/v1/refundTransaction.do", ConnectorCommon::base_url(self, 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_9164176229467487171
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/nuvei // Implementation of Nuvei 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_9164176229467487171
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/nuvei // Implementation of Nuvei 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_9164176229467487171
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/nuvei // Implementation of Nuvei 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 headers = vec![( headers::CONTENT_TYPE.to_string(), self.get_content_type().to_string().into(), )]; 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": 368, "total_crates": null }
fn_clm_hyperswitch_connectors_new_-3876535084981128677
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/coingate // Inherent implementation for Coingate 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_-3876535084981128677
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/coingate // Implementation of Coingate for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: coingate::CoingateErrorResponse = res .response .parse_struct("CoingateErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; event_builder.map(|i| i.set_response_body(&response)); router_env::logger::info!(connector_response=?response); let reason = match &response.errors { Some(errors) => errors.join(" & "), None => response.reason.clone(), }; Ok(ErrorResponse { status_code: res.status_code, code: response.message.to_string(), message: response.message.clone(), 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": 447, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-3876535084981128677
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/coingate // Implementation of Coingate 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 id = req.request.get_connector_refund_id()?; Ok(format!( "{}/api/v2/orders/{order_id}/refunds/{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_-3876535084981128677
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/coingate // Implementation of Coingate 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_-3876535084981128677
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/coingate // Implementation of Coingate for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/x-www-form-urlencoded" }
{ "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_-5290036428895210146
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/jpmorgan // Inherent implementation for Jpmorgan 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_-5290036428895210146
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/jpmorgan // Implementation of Jpmorgan for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: JpmorganErrorResponse = res .response .parse_struct("JpmorganErrorResponse") .change_context(errors::ConnectorError::ResponseDeserializationFailed)?; router_env::logger::info!(connector_response=?response); event_builder.map(|i| i.set_response_body(&response)); let response_message = response .response_message .as_ref() .map_or_else(|| consts::NO_ERROR_MESSAGE.to_string(), ToString::to_string); Ok(ErrorResponse { status_code: res.status_code, code: response.response_code, 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": 447, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_-5290036428895210146
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/jpmorgan // Implementation of Jpmorgan for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let tid = req.request.connector_transaction_id.clone(); Ok(format!("{}/refunds/{}", self.base_url(connectors), tid)) }
{ "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_build_headers_-5290036428895210146
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/jpmorgan // Implementation of Jpmorgan 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 headers = vec![( headers::CONTENT_TYPE.to_string(), self.get_content_type().to_string().into(), )]; let auth_header = ( headers::AUTHORIZATION.to_string(), format!( "Bearer {}", req.access_token .clone() .ok_or(errors::ConnectorError::FailedToObtainAuthType)? .token .peek() ) .into_masked(), ); let request_id = ( headers::REQUEST_ID.to_string(), req.connector_request_reference_id .clone() .to_string() .into_masked(), ); let merchant_id = ( headers::MERCHANT_ID.to_string(), req.merchant_id.get_string_repr().to_string().into_masked(), ); headers.push(auth_header); headers.push(request_id); headers.push(merchant_id); 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": 394, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-5290036428895210146
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/jpmorgan // Implementation of Jpmorgan 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_new_9691602338000364
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/payu // Inherent implementation for Payu 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_9691602338000364
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/payu // Implementation of Payu for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: payu::PayuErrorResponse = res .response .parse_struct("Payu 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.status.status_code, message: response.status.status_desc, reason: response.status.code_literal, 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_9691602338000364
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/payu // Implementation of Payu for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}{}{}{}", self.base_url(connectors), "api/v2_1/orders/", req.request.connector_transaction_id, "/refunds" )) }
{ "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_9691602338000364
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/payu // Implementation of Payu 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_9691602338000364
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/payu // Implementation of Payu 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_-6795880332847626607
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paybox // Inherent implementation for Paybox 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_-6795880332847626607
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paybox // Implementation of Paybox for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: paybox::PayboxErrorResponse = res .response .parse_struct("PayboxErrorResponse") .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_-6795880332847626607
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paybox // Implementation of Paybox for ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData> fn get_url( &self, _req: &PaymentsCompleteAuthorizeRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(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": 411, "total_crates": null }
fn_clm_hyperswitch_connectors_get_headers_-6795880332847626607
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paybox // Implementation of Paybox for ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData> fn get_headers( &self, req: &PaymentsCompleteAuthorizeRouterData, 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_-6795880332847626607
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paybox // Implementation of Paybox for ConnectorCommon fn common_get_content_type(&self) -> &'static str { "application/x-www-form-urlencoded" }
{ "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_3250922101033509675
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/unified_authentication_service // Inherent implementation for UnifiedAuthenticationService 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_3250922101033509675
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/unified_authentication_service // Implementation of UnifiedAuthenticationService for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: unified_authentication_service::UnifiedAuthenticationServiceErrorResponse = res.response .parse_struct("UnifiedAuthenticationServiceErrorResponse") .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.clone(), message: NO_ERROR_MESSAGE.to_owned(), reason: Some(response.error), 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_3250922101033509675
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/unified_authentication_service // Implementation of UnifiedAuthenticationService for ConnectorIntegration<Authenticate, UasAuthenticationRequestData, UasAuthenticationResponseData> fn get_url( &self, _req: &UasAuthenticationRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}authentication_initiation", 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_3250922101033509675
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/unified_authentication_service // Implementation of UnifiedAuthenticationService for ConnectorIntegration<Authenticate, UasAuthenticationRequestData, UasAuthenticationResponseData> fn get_headers( &self, req: &UasAuthenticationRouterData, 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_3250922101033509675
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/unified_authentication_service // Implementation of UnifiedAuthenticationService 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_-1629205681136532890
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/dummyconnector // Inherent implementation for DummyConnector<T> 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_-1629205681136532890
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/dummyconnector // Implementation of DummyConnector<T> for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, ConnectorError> { let response: transformers::DummyConnectorErrorResponse = res .response .parse_struct("DummyConnectorErrorResponse") .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, code: response.error.code, message: response.error.message, reason: response.error.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_-1629205681136532890
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/dummyconnector // Implementation of DummyConnector<T> for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, ConnectorError> { let refund_id = req.request.get_connector_refund_id()?; Ok(format!( "{}/refunds/{}", 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_-1629205681136532890
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/dummyconnector // Implementation of DummyConnector<T> for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_headers( &self, req: &RefundSyncRouterData, 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_-1629205681136532890
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/dummyconnector // Implementation of DummyConnector<T> 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_-7064631320867895708
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/katapult // Inherent implementation for Katapult 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_-7064631320867895708
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/katapult // Implementation of Katapult for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: katapult::KatapultErrorResponse = res .response .parse_struct("KatapultErrorResponse") .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_-7064631320867895708
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/katapult // Implementation of Katapult 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_-7064631320867895708
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/katapult // Implementation of Katapult 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_-7064631320867895708
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/katapult // Implementation of Katapult 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_-8275539584359296424
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paytm // Inherent implementation for Paytm 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_-8275539584359296424
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paytm // Implementation of Paytm for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: paytm::PaytmErrorResponse = res.response .parse_struct("PaytmErrorResponse") .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_-8275539584359296424
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paytm // Implementation of Paytm 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_-8275539584359296424
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paytm // Implementation of Paytm 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_-8275539584359296424
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paytm // Implementation of Paytm 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_5612985194800590808
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paypal // Inherent implementation for Paypal pub fn new() -> &'static Self { &Self { amount_converter: &StringMajorUnitForConnector, 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_5612985194800590808
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paypal // Implementation of Paypal for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: paypal::PaypalPaymentErrorResponse = res .response .parse_struct("Paypal 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_reason = response .details .clone() .map(|error_details| { error_details .iter() .try_fold(String::new(), |mut acc, error| { if let Some(description) = &error.description { write!(acc, "description - {description} ;") .change_context( errors::ConnectorError::ResponseDeserializationFailed, ) .attach_printable("Failed to concatenate error details") .map(|_| acc) } else { Ok(acc) } }) }) .transpose()?; let reason = match error_reason { Some(err_reason) => err_reason .is_empty() .then(|| response.message.to_owned()) .or(Some(err_reason)), None => Some(response.message.to_owned()), }; let errors_list = response.details.unwrap_or_default(); let option_error_code_message = connector_utils::get_error_code_error_message_based_on_priority( self.clone(), errors_list .into_iter() .map(|errors| errors.into()) .collect(), ); Ok(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, attempt_status: None, connector_transaction_id: response.debug_id, 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": 495, "total_crates": null }
fn_clm_hyperswitch_connectors_get_url_5612985194800590808
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paypal // Implementation of Paypal for ConnectorIntegration< VerifyWebhookSource, VerifyWebhookSourceRequestData, VerifyWebhookSourceResponseData, > fn get_url( &self, _req: &RouterData< VerifyWebhookSource, VerifyWebhookSourceRequestData, VerifyWebhookSourceResponseData, >, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { Ok(format!( "{}v1/notifications/verify-webhook-signature", 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_5612985194800590808
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paypal // Implementation of Paypal for ConnectorIntegration< VerifyWebhookSource, VerifyWebhookSourceRequestData, VerifyWebhookSourceResponseData, > fn get_headers( &self, req: &RouterData< VerifyWebhookSource, VerifyWebhookSourceRequestData, VerifyWebhookSourceResponseData, >, _connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> { let auth = paypal::PaypalAuthType::try_from(&req.connector_auth_type)?; let credentials = auth.get_credentials()?; let auth_val = credentials.generate_authorization_value(); Ok(vec![ ( headers::CONTENT_TYPE.to_string(), VerifyWebhookSourceType::get_content_type(self) .to_string() .into(), ), (headers::AUTHORIZATION.to_string(), auth_val.into_masked()), ]) }
{ "crate": "hyperswitch_connectors", "file": null, "file_size": null, "is_async": false, "is_pub": false, "num_enums": null, "num_structs": null, "num_tables": null, "score": 386, "total_crates": null }
fn_clm_hyperswitch_connectors_build_headers_5612985194800590808
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/paypal // Implementation of Paypal for ConnectorCommonExt<Flow, Request, Response> fn build_headers( &self, req: &RouterData<Flow, Request, Response>, _connectors: &Connectors, ) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> { let access_token = req .access_token .clone() .ok_or(errors::ConnectorError::FailedToObtainAuthType)?; let key = &req.connector_request_reference_id; let auth = paypal::PaypalAuthType::try_from(&req.connector_auth_type)?; let mut headers = vec![ ( headers::CONTENT_TYPE.to_string(), self.get_content_type().to_string().into(), ), ( headers::AUTHORIZATION.to_string(), format!("Bearer {}", access_token.token.peek()).into_masked(), ), ( auth_headers::PREFER.to_string(), "return=representation".to_string().into(), ), ( auth_headers::PAYPAL_REQUEST_ID.to_string(), key.to_string().into_masked(), ), ]; if let Ok(paypal::PaypalConnectorCredentials::PartnerIntegration(credentials)) = auth.get_credentials() { let auth_assertion_header = construct_auth_assertion_header(&credentials.payer_id, &credentials.client_id); headers.extend(vec![ ( auth_headers::PAYPAL_AUTH_ASSERTION.to_string(), auth_assertion_header.to_string().into_masked(), ), ( auth_headers::PAYPAL_PARTNER_ATTRIBUTION_ID.to_string(), "HyperSwitchPPCP_SP".to_string().into(), ), ]) } else { headers.extend(vec![( auth_headers::PAYPAL_PARTNER_ATTRIBUTION_ID.to_string(), "HyperSwitchlegacy_Ecom".to_string().into(), )]) } 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": 382, "total_crates": null }
fn_clm_hyperswitch_connectors_new_5196118588414572757
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/sift // Inherent implementation for Sift 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_5196118588414572757
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/sift // Implementation of Sift for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: sift::SiftErrorResponse = res .response .parse_struct("SiftErrorResponse") .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_5196118588414572757
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/sift // Implementation of Sift 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_5196118588414572757
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/sift // Implementation of Sift 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_5196118588414572757
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/sift // Implementation of Sift 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_-4314461729441015956
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globepay // Inherent implementation for Globepay 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_-4314461729441015956
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globepay // Implementation of Globepay for ConnectorCommon fn build_error_response( &self, res: Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: globepay::GlobepayErrorResponse = res .response .parse_struct("GlobepayErrorResponse") .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.return_code.to_string(), message: consts::NO_ERROR_MESSAGE.to_string(), reason: Some(response.return_msg), 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_-4314461729441015956
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globepay // Implementation of Globepay for ConnectorIntegration<RSync, RefundsData, RefundsResponseData> fn get_url( &self, req: &RefundSyncRouterData, connectors: &Connectors, ) -> CustomResult<String, errors::ConnectorError> { let query_params = get_globlepay_query_params(&req.connector_auth_type)?; Ok(format!( "{}api/v1.0/gateway/partners/{}/orders/{}/refunds/{}{query_params}", self.base_url(connectors), get_partner_code(&req.connector_auth_type)?, req.payment_id, req.request.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_-4314461729441015956
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globepay // Implementation of Globepay 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_-4314461729441015956
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/globepay // Implementation of Globepay 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_3931166209721572365
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/fiserv // Inherent implementation for Fiserv 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_3931166209721572365
clm
function
// Repository: hyperswitch // Crate: hyperswitch_connectors // Purpose: Payment provider integrations (Stripe, PayPal, etc.) // Module: crates/hyperswitch_connectors/src/connectors/fiserv // Implementation of Fiserv for ConnectorCommon fn build_error_response( &self, res: types::Response, event_builder: Option<&mut ConnectorEvent>, ) -> CustomResult<ErrorResponse, errors::ConnectorError> { let response: fiserv::ErrorResponse = res .response .parse_struct("Fiserv 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_details_opt = response.error.as_ref().and_then(|v| v.first()); let (code, message, reason) = if let Some(first_error) = error_details_opt { let code = first_error .code .clone() .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()); let message = first_error .message .clone() .unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()); let reason = first_error.additional_info.clone(); (code, message, reason) } else { ( consts::NO_ERROR_CODE.to_string(), consts::NO_ERROR_MESSAGE.to_string(), None, ) }; Ok(ErrorResponse { code, message, reason, status_code: res.status_code, 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": 463, "total_crates": null }