id stringlengths 11 116 | type stringclasses 1 value | granularity stringclasses 4 values | content stringlengths 16 477k | metadata dict |
|---|---|---|---|---|
fn_clm_hyperswitch_connectors_get_url_-8404843446989730894 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/paystack
// Implementation of Paystack 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!(
"{}{}{}",
self.base_url(connectors),
"/refund/",
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_-8404843446989730894 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/paystack
// Implementation of Paystack 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_-8404843446989730894 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/paystack
// Implementation of Paystack 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_-398917344120583687 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/nomupay
// Inherent implementation for Nomupay
pub fn new() -> &'static Self {
&Self {
#[cfg(feature = "payouts")]
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_try_from_-398917344120583687 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/nomupay
// Implementation of nomupay::NomupayMetadata for TryFrom<Option<&pii::SecretSerdeValue>>
fn try_from(meta_data: Option<&pii::SecretSerdeValue>) -> Result<Self, Self::Error> {
let metadata: Self = utils::to_connector_meta_from_secret::<Self>(meta_data.cloned())
.change_context(errors::ConnectorError::InvalidConnectorConfig {
config: "metadata",
})?;
Ok(metadata)
}
| {
"crate": "hyperswitch_connectors",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 2661,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_build_error_response_-398917344120583687 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/nomupay
// Implementation of Nomupay for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: nomupay::NomupayErrorResponse = res
.response
.parse_struct("NomupayErrorResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
match (
response.status,
response.code,
response.error,
response.status_code,
response.detail,
) {
(Some(status), Some(code), _, _, _) => Ok(ErrorResponse {
status_code: res.status_code,
code: code.to_string(),
message: status,
reason: None,
attempt_status: None,
connector_transaction_id: None,
network_advice_code: None,
network_decline_code: None,
network_error_message: None,
connector_metadata: None,
}),
(None, None, Some(nomupay_inner_error), _, _) => {
match (
nomupay_inner_error.error_description,
nomupay_inner_error.validation_errors,
) {
(Some(error_description), _) => Ok(ErrorResponse {
status_code: res.status_code,
code: nomupay_inner_error.error_code,
message: 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,
}),
(_, Some(validation_errors)) => Ok(ErrorResponse {
status_code: res.status_code,
code: nomupay_inner_error.error_code,
message: validation_errors
.first()
.map(|m| m.message.clone())
.unwrap_or_default(),
reason: Some(
validation_errors
.first()
.map(|m| m.field.clone())
.unwrap_or_default(),
),
attempt_status: None,
connector_transaction_id: None,
network_advice_code: None,
network_decline_code: None,
network_error_message: None,
connector_metadata: None,
}),
(None, None) => Ok(ErrorResponse {
status_code: res.status_code,
code: NO_ERROR_CODE.to_string(),
message: NO_ERROR_MESSAGE.to_string(),
reason: None,
attempt_status: None,
connector_transaction_id: None,
network_advice_code: None,
network_decline_code: None,
network_error_message: None,
connector_metadata: None,
}),
}
}
(None, None, None, Some(status_code), Some(detail)) => Ok(ErrorResponse {
status_code,
code: detail
.get(1)
.map(|d| d.error_type.clone())
.unwrap_or_default(),
message: status_code.to_string(),
reason: None,
attempt_status: None,
connector_transaction_id: None,
network_advice_code: None,
network_decline_code: None,
network_error_message: None,
connector_metadata: None,
}),
_ => Ok(ErrorResponse {
status_code: res.status_code,
code: NO_ERROR_CODE.to_string(),
message: NO_ERROR_MESSAGE.to_string(),
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": 475,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_url_-398917344120583687 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/nomupay
// Implementation of Nomupay for ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData>
fn get_url(
&self,
_req: &PayoutsRouterData<PoFulfill>,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!("{}/v1alpha1/payments", connectors.nomupay.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_build_headers_-398917344120583687 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/nomupay
// Implementation of Nomupay 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 is_post_req = matches!(self.get_http_method(), Method::Post);
let body = self.get_request_body(req, connectors)?;
let auth = nomupay::NomupayAuthType::try_from(&req.connector_auth_type)
.change_context(errors::ConnectorError::FailedToObtainAuthType)?;
let base_url = connectors.nomupay.base_url.as_str();
let path: String = self
.get_url(req, connectors)?
.chars()
.skip(base_url.len())
.collect();
let req_method = if is_post_req { "POST" } else { "GET" };
let sign = get_signature(&req.connector_meta_data, auth, body, req_method, path)?;
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
self.get_content_type().to_string().into(),
)];
header.push((
headers::X_SIGNATURE.to_string(),
masking::Maskable::Normal(sign),
));
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": 398,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_new_-7840631572342081483 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/inespay
// Inherent implementation for Inespay
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_-7840631572342081483 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/inespay
// Implementation of Inespay for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: inespay::InespayErrorResponse = res
.response
.parse_struct("InespayErrorResponse")
.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.status,
message: response.status_desc,
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_-7840631572342081483 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/inespay
// Implementation of Inespay 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!(
"{}{}{}",
self.base_url(connectors),
"/refunds/",
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_-7840631572342081483 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/inespay
// Implementation of Inespay 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_-7840631572342081483 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/inespay
// Implementation of Inespay 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_-2836118968165262011 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dwolla
// Inherent implementation for Dwolla
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_-2836118968165262011 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dwolla
// Implementation of Dwolla for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: dwolla::DwollaErrorResponse = res
.response
.parse_struct("DwollaErrorResponse")
.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
._embedded
.as_ref()
.and_then(|errors_vec| errors_vec.first())
.and_then(|details| details.errors.first())
.and_then(|err_detail| err_detail.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": 453,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_url_-2836118968165262011 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dwolla
// Implementation of Dwolla for ConnectorIntegration<RSync, RefundsData, RefundsResponseData>
fn get_url(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let connector_refund_id = req.request.get_connector_refund_id()?;
Ok(format!(
"{}/transfers/{}",
self.base_url(connectors),
connector_refund_id.clone()
))
}
| {
"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_-2836118968165262011 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dwolla
// Implementation of Dwolla 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_-2836118968165262011 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dwolla
// Implementation of Dwolla for ConnectorCommon
fn common_get_content_type(&self) -> &'static str {
"application/vnd.dwolla.v1.hal+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_-5710173345871266478 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/authipay
// Inherent implementation for Authipay
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_-5710173345871266478 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/authipay
// Implementation of Authipay for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: authipay::AuthipayErrorResponse = res
.response
.parse_struct("AuthipayErrorResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_error_response_body(&response));
let mut error_response = ErrorResponse::from(&response);
// Set status code from the response, or 400 if error code is a "404"
if let Some(error_code) = &response.error.code {
if error_code == "404" {
error_response.status_code = 404;
} else {
error_response.status_code = res.status_code;
}
} else {
error_response.status_code = res.status_code;
}
Ok(error_response)
}
| {
"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_-5710173345871266478 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/authipay
// Implementation of Authipay for ConnectorIntegration<RSync, RefundsData, RefundsResponseData>
fn get_url(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let refund_id = req
.request
.connector_refund_id
.clone()
.ok_or(errors::ConnectorError::RequestEncodingFailed)?;
Ok(format!(
"{}payments/{}",
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": 411,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_build_headers_-5710173345871266478 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/authipay
// Implementation of Authipay 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 timestamp = time::OffsetDateTime::now_utc().unix_timestamp_nanos() / 1_000_000;
let auth: authipay::AuthipayAuthType =
authipay::AuthipayAuthType::try_from(&req.connector_auth_type)?;
let mut auth_header = self.get_auth_header(&req.connector_auth_type)?;
let authipay_req = self.get_request_body(req, connectors)?;
let client_request_id = uuid::Uuid::new_v4().to_string();
let hmac = self
.generate_authorization_signature(
auth,
&client_request_id,
authipay_req.get_inner_value().peek(),
timestamp,
)
.change_context(errors::ConnectorError::RequestEncodingFailed)?;
let mut headers = vec![
(
headers::CONTENT_TYPE.to_string(),
types::PaymentsAuthorizeType::get_content_type(self)
.to_string()
.into(),
),
("Client-Request-Id".to_string(), client_request_id.into()),
("Auth-Token-Type".to_string(), "HMAC".to_string().into()),
(headers::TIMESTAMP.to_string(), timestamp.to_string().into()),
("Message-Signature".to_string(), hmac.into_masked()),
];
headers.append(&mut 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": 392,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_headers_-5710173345871266478 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/authipay
// Implementation of Authipay 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_-7249897206773780324 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/adyen
// Inherent implementation for Adyen
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_-7249897206773780324 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/adyen
// Implementation of Adyen for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: adyen::AdyenErrorResponse = res
.response
.parse_struct("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.message.to_owned(),
reason: Some(response.message),
attempt_status: None,
connector_transaction_id: response.psp_reference,
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_-7249897206773780324 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/adyen
// Implementation of Adyen for ConnectorIntegration<Evidence, SubmitEvidenceRequestData, SubmitEvidenceResponse>
fn get_url(
&self,
req: &SubmitEvidenceRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let endpoint = build_env_specific_endpoint(
connectors.adyen.dispute_base_url.as_str(),
req.test_mode,
&req.connector_meta_data,
)?;
Ok(format!(
"{endpoint}ca/services/DisputeService/v30/supplyDefenseDocument",
))
}
| {
"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_-7249897206773780324 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/adyen
// Implementation of Adyen for ConnectorIntegration<Evidence, SubmitEvidenceRequestData, SubmitEvidenceResponse>
fn get_headers(
&self,
req: &SubmitEvidenceRouterData,
_connectors: &Connectors,
) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> {
let mut header = vec![(
headers::CONTENT_TYPE.to_string(),
SubmitEvidenceType::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_get_request_body_-7249897206773780324 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/adyen
// Implementation of Adyen for ConnectorIntegration<Evidence, SubmitEvidenceRequestData, SubmitEvidenceResponse>
fn get_request_body(
&self,
req: &SubmitEvidenceRouterData,
_connectors: &Connectors,
) -> CustomResult<RequestContent, errors::ConnectorError> {
let connector_req = adyen::Evidence::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_-2179708284326009798 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/chargebee
// Inherent implementation for Chargebee
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_-2179708284326009798 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/chargebee
// Implementation of Chargebee for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: chargebee::ChargebeeErrorResponse = res
.response
.parse_struct("ChargebeeErrorResponse")
.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.api_error_code.clone(),
message: response.api_error_code.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_-2179708284326009798 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/chargebee
// Implementation of Chargebee for ConnectorIntegration<
GetSubscriptionEstimate,
GetSubscriptionEstimateRequest,
GetSubscriptionEstimateResponse,
>
fn get_url(
&self,
req: &GetSubscriptionEstimateRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let metadata: chargebee::ChargebeeMetadata =
utils::to_connector_meta_from_secret(req.connector_meta_data.clone())?;
let site = metadata.site.peek();
let mut base = self.base_url(connectors).to_string();
base = base.replace("{{merchant_endpoint_prefix}}", site);
base = base.replace("$", site);
if base.contains("{{merchant_endpoint_prefix}}") || base.contains('$') {
return Err(errors::ConnectorError::InvalidConnectorConfig {
config: "Chargebee base_url has an unresolved placeholder (expected `$` or `{{merchant_endpoint_prefix}}`).",
}
.into());
}
if !base.ends_with('/') {
base.push('/');
}
Ok(format!("{base}v2/estimates/create_subscription_for_items"))
}
| {
"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_-2179708284326009798 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/chargebee
// Implementation of Chargebee for ConnectorIntegration<
GetSubscriptionEstimate,
GetSubscriptionEstimateRequest,
GetSubscriptionEstimateResponse,
>
fn get_headers(
&self,
req: &GetSubscriptionEstimateRouterData,
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_-2179708284326009798 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/chargebee
// Implementation of Chargebee 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_-2218502836545940881 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/juspaythreedsserver
// Inherent implementation for Juspaythreedsserver
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_-2218502836545940881 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/juspaythreedsserver
// Implementation of Juspaythreedsserver for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: juspaythreedsserver::JuspaythreedsserverErrorResponse = res
.response
.parse_struct("JuspaythreedsserverErrorResponse")
.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_-2218502836545940881 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/juspaythreedsserver
// Implementation of Juspaythreedsserver 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_-2218502836545940881 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/juspaythreedsserver
// Implementation of Juspaythreedsserver 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_-2218502836545940881 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/juspaythreedsserver
// Implementation of Juspaythreedsserver 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_7339411950490738709 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/finix
// Inherent implementation for Finix
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_7339411950490738709 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/finix
// Implementation of Finix for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: finix::FinixErrorResponse =
res.response
.parse_struct("FinixErrorResponse")
.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.get_code(),
message: response.get_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_7339411950490738709 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/finix
// Implementation of Finix for ConnectorIntegration<RSync, RefundsData, RefundsResponseData>
fn get_url(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let refund_id = req
.request
.connector_refund_id
.clone()
.ok_or(errors::ConnectorError::MissingConnectorRefundID)?;
Ok(format!(
"{}/transfers/{}",
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": 411,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_headers_7339411950490738709 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/finix
// Implementation of Finix 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_7339411950490738709 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/finix
// Implementation of Finix 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_7282666624761839069 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/cybersource
// Inherent implementation for Cybersource
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_7282666624761839069 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/cybersource
// Implementation of Cybersource for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: Result<
cybersource::CybersourceErrorResponse,
Report<common_utils::errors::ParsingError>,
> = res.response.parse_struct("Cybersource ErrorResponse");
let error_message = if res.status_code == 401 {
constants::CONNECTOR_UNAUTHORIZED_ERROR
} else {
hyperswitch_interfaces::consts::NO_ERROR_MESSAGE
};
match response {
Ok(transformers::CybersourceErrorResponse::StandardError(response)) => {
event_builder.map(|i| i.set_error_response_body(&response));
router_env::logger::info!(connector_response=?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,
})
}
Ok(transformers::CybersourceErrorResponse::AuthenticationError(response)) => {
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: 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,
})
}
Ok(transformers::CybersourceErrorResponse::NotAvailableError(response)) => {
event_builder.map(|i| i.set_error_response_body(&response));
router_env::logger::info!(connector_response=?response);
let error_response = response
.errors
.iter()
.map(|error_info| {
format!(
"{}: {}",
error_info.error_type.clone().unwrap_or("".to_string()),
error_info.message.clone().unwrap_or("".to_string())
)
})
.collect::<Vec<String>>()
.join(" & ");
Ok(ErrorResponse {
status_code: res.status_code,
code: hyperswitch_interfaces::consts::NO_ERROR_CODE.to_string(),
message: error_response.clone(),
reason: Some(error_response),
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})));
router_env::logger::error!(deserialization_error =? error_msg);
utils::handle_json_response_deserialization_failure(res, "cybersource")
}
}
}
| {
"crate": "hyperswitch_connectors",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 507,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_build_headers_7282666624761839069 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/cybersource
// Implementation of Cybersource 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 cybersource_req = self.get_request_body(req, connectors)?;
let auth = cybersource::CybersourceAuthType::try_from(&req.connector_auth_type)?;
let merchant_account = auth.merchant_account.clone();
let base_url = connectors.cybersource.base_url.as_str();
let cybersource_host =
Url::parse(base_url).change_context(errors::ConnectorError::RequestEncodingFailed)?;
let host = cybersource_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(cybersource_req.get_inner_value().expose().as_bytes());
let http_method = self.get_http_method();
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 | Method::Patch) {
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_7282666624761839069 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/cybersource
// Implementation of Cybersource for ConnectorIntegration<
IncrementalAuthorization,
PaymentsIncrementalAuthorizationData,
PaymentsResponseData,
>
fn get_url(
&self,
req: &PaymentsIncrementalAuthorizationRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let connector_payment_id = req.request.connector_transaction_id.clone();
Ok(format!(
"{}pts/v2/payments/{}",
self.base_url(connectors),
connector_payment_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_7282666624761839069 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/cybersource
// Implementation of Cybersource for ConnectorIntegration<
IncrementalAuthorization,
PaymentsIncrementalAuthorizationData,
PaymentsResponseData,
>
fn get_headers(
&self,
req: &PaymentsIncrementalAuthorizationRouterData,
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_2877803161903515457 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dlocal
// Inherent implementation for Dlocal
pub fn new() -> &'static Self {
&Self {
amount_convertor: &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_2877803161903515457 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dlocal
// Implementation of Dlocal for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: dlocal::DlocalErrorResponse = res
.response
.parse_struct("Dlocal ErrorResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i: &mut ConnectorEvent| 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: response.message,
reason: response.param,
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_2877803161903515457 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dlocal
// Implementation of Dlocal for ConnectorIntegration<RSync, RefundsData, RefundsResponseData>
fn get_url(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let sync_data = dlocal::DlocalRefundsSyncRequest::try_from(req)?;
Ok(format!(
"{}refunds/{}/status",
self.base_url(connectors),
sync_data.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_build_headers_2877803161903515457 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dlocal
// Implementation of Dlocal for ConnectorCommonExt<Flow, Request, Response>
fn build_headers(
&self,
req: &RouterData<Flow, Request, Response>,
connectors: &Connectors,
) -> CustomResult<Vec<(String, Maskable<String>)>, errors::ConnectorError> {
let dlocal_req = self.get_request_body(req, connectors)?;
let date = date_time::date_as_yyyymmddthhmmssmmmz()
.change_context(errors::ConnectorError::RequestEncodingFailed)?;
let auth = dlocal::DlocalAuthType::try_from(&req.connector_auth_type)?;
let sign_req: String = format!(
"{}{}{}",
auth.x_login.peek(),
date,
dlocal_req.get_inner_value().peek().to_owned()
);
let authz = crypto::HmacSha256::sign_message(
&crypto::HmacSha256,
auth.secret.peek().as_bytes(),
sign_req.as_bytes(),
)
.change_context(errors::ConnectorError::RequestEncodingFailed)
.attach_printable("Failed to sign the message")?;
let auth_string: String = format!("V2-HMAC-SHA256, Signature: {}", encode(authz));
let headers = vec![
(
headers::AUTHORIZATION.to_string(),
auth_string.into_masked(),
),
(headers::X_LOGIN.to_string(), auth.x_login.into_masked()),
(
headers::X_TRANS_KEY.to_string(),
auth.x_trans_key.into_masked(),
),
(headers::X_VERSION.to_string(), "2.1".to_string().into()),
(headers::X_DATE.to_string(), date.into()),
(
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": 388,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_headers_2877803161903515457 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/dlocal
// Implementation of Dlocal 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_-3255601430102474584 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/datatrans
// Inherent implementation for Datatrans
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_-3255601430102474584 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/datatrans
// Implementation of Datatrans for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let (cow, _, _) = encoding_rs::ISO_8859_10.decode(&res.response);
let response = cow.as_ref().to_string();
if utils::is_html_response(&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: NO_ERROR_CODE.to_owned(),
message: response.clone(),
reason: Some(response),
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: datatrans::DatatransErrorResponse = res
.response
.parse_struct("DatatransErrorType")
.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.message.clone(),
reason: Some(response.error.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": 461,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_url_-3255601430102474584 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/datatrans
// Implementation of Datatrans for ConnectorIntegration<RSync, RefundsData, RefundsResponseData>
fn get_url(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let connector_refund_id = req.request.get_connector_refund_id()?;
let base_url = self.base_url(connectors);
Ok(format!("{base_url}v1/transactions/{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_-3255601430102474584 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/datatrans
// Implementation of Datatrans 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_-3255601430102474584 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/datatrans
// Implementation of Datatrans 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_-4824965663527130740 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/affirm
// Inherent implementation for Affirm
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_-4824965663527130740 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/affirm
// Implementation of Affirm for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: affirm::AffirmErrorResponse = res
.response
.parse_struct("AffirmErrorResponse")
.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: response.status_code,
code: response.code,
message: response.message,
reason: Some(response.error_type),
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_-4824965663527130740 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/affirm
// Implementation of Affirm for ConnectorIntegration<RSync, RefundsData, RefundsResponseData>
fn get_url(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let endpoint = self.base_url(connectors);
let transaction_id = req.request.connector_transaction_id.clone();
Ok(format!("{endpoint}/v1/transactions/{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_-4824965663527130740 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/affirm
// Implementation of Affirm 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_-4824965663527130740 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/affirm
// Implementation of Affirm 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_-12163220179142721 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/barclaycard
// Inherent implementation for Barclaycard
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_-12163220179142721 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/barclaycard
// Implementation of Barclaycard for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: barclaycard::BarclaycardErrorResponse = res
.response
.parse_struct("BarclaycardErrorResponse")
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
event_builder.map(|i| i.set_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::BarclaycardErrorResponse::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::BarclaycardErrorResponse::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_-12163220179142721 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/barclaycard
// Implementation of Barclaycard 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 barclaycard_req = self.get_request_body(req, connectors)?;
let http_method = self.get_http_method();
let auth = barclaycard::BarclaycardAuthType::try_from(&req.connector_auth_type)?;
let merchant_account = auth.merchant_account.clone();
let base_url = connectors.barclaycard.base_url.as_str();
let barclaycard_host =
Url::parse(base_url).change_context(errors::ConnectorError::RequestEncodingFailed)?;
let host = barclaycard_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(barclaycard_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_-12163220179142721 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/barclaycard
// Implementation of Barclaycard for ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData>
fn get_url(
&self,
_req: &PaymentsCompleteAuthorizeRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!(
"{}pts/v2/payments/",
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_-12163220179142721 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/barclaycard
// Implementation of Barclaycard for ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData>
fn get_headers(
&self,
req: &PaymentsCompleteAuthorizeRouterData,
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_5019484790063631184 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/mollie
// Inherent implementation for Mollie
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_5019484790063631184 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/mollie
// Implementation of Mollie for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: mollie::MollieErrorResponse = res
.response
.parse_struct("MollieErrorResponse")
.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: response.status,
code: response
.title
.unwrap_or_else(|| consts::NO_ERROR_CODE.to_string()),
message: response.detail,
reason: response.field,
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_5019484790063631184 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/mollie
// Implementation of Mollie 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::RequestEncodingFailed)?;
Ok(format!(
"{}payments/{}/refunds/{}",
self.base_url(connectors),
req.request.connector_transaction_id,
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_5019484790063631184 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/mollie
// Implementation of Mollie 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_5019484790063631184 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/mollie
// Implementation of Mollie for ConnectorCommonExt<Flow, Request, Response>
fn build_headers(
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
) -> CustomResult<Vec<(String, masking::Maskable<String>)>, errors::ConnectorError> {
self.get_auth_header(&req.connector_auth_type)
}
| {
"crate": "hyperswitch_connectors",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 370,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_new_-641822946286041073 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/tesouro
// Inherent implementation for Tesouro
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_-641822946286041073 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/tesouro
// Implementation of Tesouro for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let status_code = res.status_code;
let response: Result<tesouro::TesouroGraphQlErrorResponse, _> =
res.response.parse_struct("TesouroGraphQlErrorResponse");
match response {
Ok(response) => {
event_builder.map(|i| i.set_response_body(&response));
router_env::logger::info!(connector_response=?response);
let error = response.errors.first();
let error_extensions = error.and_then(|error_data| error_data.extensions.clone());
Ok(ErrorResponse {
status_code,
code: error_extensions
.as_ref()
.and_then(|ext| ext.code.clone())
.unwrap_or(consts::NO_ERROR_CODE.to_string()),
message: error
.map(|error_data| error_data.message.clone())
.unwrap_or(consts::NO_ERROR_MESSAGE.to_string()),
reason: error_extensions.as_ref().and_then(|ext| ext.reason.clone()),
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": status_code})));
router_env::logger::error!(deserialization_error =? error_msg);
connector_utils::handle_json_response_deserialization_failure(res, "tesouro")
}
}
}
| {
"crate": "hyperswitch_connectors",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 473,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_url_-641822946286041073 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/tesouro
// Implementation of Tesouro for ConnectorIntegration<RSync, RefundsData, RefundsResponseData>
fn get_url(
&self,
_req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
Ok(format!("{}/graphql", self.base_url(connectors).to_owned()))
}
| {
"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_-641822946286041073 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/tesouro
// Implementation of Tesouro 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_-641822946286041073 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/tesouro
// Implementation of Tesouro 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.common_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_build_error_response_4487744853573481538 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/netcetera
// Implementation of Netcetera for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, ConnectorError> {
let response: netcetera::NetceteraErrorResponse = res
.response
.parse_struct("NetceteraErrorResponse")
.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_details.error_code,
message: response.error_details.error_description,
reason: response.error_details.error_detail,
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_4487744853573481538 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/netcetera
// Implementation of Netcetera for ConnectorIntegration<
Authentication,
ConnectorAuthenticationRequestData,
AuthenticationResponseData,
>
fn get_url(
&self,
req: &ConnectorAuthenticationRouterData,
connectors: &Connectors,
) -> CustomResult<String, ConnectorError> {
let base_url = build_endpoint(self.base_url(connectors), &req.connector_meta_data)?;
Ok(format!("{base_url}/3ds/authentication"))
}
| {
"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_4487744853573481538 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/netcetera
// Implementation of Netcetera for ConnectorIntegration<
Authentication,
ConnectorAuthenticationRequestData,
AuthenticationResponseData,
>
fn get_headers(
&self,
req: &ConnectorAuthenticationRouterData,
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_4487744853573481538 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/netcetera
// Implementation of Netcetera 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_4487744853573481538 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/netcetera
// Implementation of Netcetera for ConnectorCommonExt<Flow, Request, Response>
fn build_headers(
&self,
req: &RouterData<Flow, Request, Response>,
_connectors: &Connectors,
) -> CustomResult<Vec<(String, Maskable<String>)>, 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_-4129186666298037914 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/novalnet
// Inherent implementation for Novalnet
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_-4129186666298037914 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/novalnet
// Implementation of Novalnet for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: novalnet::NovalnetErrorResponse = res
.response
.parse_struct("NovalnetErrorResponse")
.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_-4129186666298037914 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/novalnet
// Implementation of Novalnet for ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData>
fn get_url(
&self,
_req: &PaymentsCancelRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let endpoint = self.base_url(connectors);
Ok(format!("{endpoint}/transaction/cancel"))
}
| {
"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_-4129186666298037914 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/novalnet
// Implementation of Novalnet for ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData>
fn get_headers(
&self,
req: &PaymentsCancelRouterData,
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_-4129186666298037914 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/novalnet
// Implementation of Novalnet 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_5800071540613891562 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/peachpayments
// Inherent implementation for Peachpayments
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_5800071540613891562 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/peachpayments
// Implementation of Peachpayments for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: peachpayments::PeachpaymentsErrorResponse = res
.response
.parse_struct("PeachpaymentsErrorResponse")
.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_ref.clone(),
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": 445,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_url_5800071540613891562 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/peachpayments
// Implementation of Peachpayments for ConnectorIntegration<RSync, RefundsData, RefundsResponseData>
fn get_url(
&self,
req: &RefundSyncRouterData,
connectors: &Connectors,
) -> CustomResult<String, errors::ConnectorError> {
let connector_refund_id = req.request.get_connector_refund_id()?;
Ok(format!(
"{}/transactions/{}",
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": 409,
"total_crates": null
} |
fn_clm_hyperswitch_connectors_get_headers_5800071540613891562 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/peachpayments
// Implementation of Peachpayments 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_5800071540613891562 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/peachpayments
// Implementation of Peachpayments 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_-6513017104242681898 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/gigadat
// Inherent implementation for Gigadat
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_-6513017104242681898 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/gigadat
// Implementation of Gigadat for ConnectorCommon
fn build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: gigadat::GigadatErrorResponse = res
.response
.parse_struct("GigadatErrorResponse")
.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.err.clone(),
message: response.err.clone(),
reason: Some(response.err).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_-6513017104242681898 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/gigadat
// Implementation of Gigadat 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/transactions/{}",
connectors.gigadat.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_-6513017104242681898 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/gigadat
// Implementation of Gigadat 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_-6513017104242681898 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/gigadat
// Implementation of Gigadat 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_5847194729830674375 | clm | function | // Repository: hyperswitch
// Crate: hyperswitch_connectors
// Purpose: Payment provider integrations (Stripe, PayPal, etc.)
// Module: crates/hyperswitch_connectors/src/connectors/custombilling
// Inherent implementation for Custombilling
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_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 build_error_response(
&self,
res: Response,
event_builder: Option<&mut ConnectorEvent>,
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
let response: custombilling::CustombillingErrorResponse = res
.response
.parse_struct("CustombillingErrorResponse")
.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
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.