id stringlengths 11 116 | type stringclasses 1 value | granularity stringclasses 4 values | content stringlengths 16 477k | metadata dict |
|---|---|---|---|---|
fn_clm_router_refund_create_fail_adyen_4400093523496731139 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/refunds
async fn refund_create_fail_adyen() {
let app = Box::pin(mk_service()).await;
let client = AppClient::guest();
let user_client = client.user("321");
let payment_id = common_utils::id_type::PaymentId::generate_test_payment_id_for_sample_data();
let refund: serde_json::Value = user_client.create_refund(&app, &payment_id, 10).await;
assert_eq!(refund.get("error").unwrap().get("message").unwrap(), "Access forbidden, invalid API key was used. Please create your new API key from the Dashboard Settings section.");
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 12,
"total_crates": null
} |
fn_clm_router_payouts_todo_-4543446485115963631 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payouts
async fn payouts_todo() {
Box::pin(utils::setup()).await;
let client = awc::Client::default();
let mut response;
let mut response_body;
let get_endpoints = vec!["retrieve", "accounts"];
let post_endpoints = vec!["create", "update", "reverse", "cancel"];
for endpoint in get_endpoints {
response = client
.get(format!("http://127.0.0.1:8080/payouts/{endpoint}"))
.send()
.await
.unwrap();
response_body = response.body().await;
println!("{endpoint} =:= {response:?} : {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::OK);
}
for endpoint in post_endpoints {
response = client
.post(format!("http://127.0.0.1:8080/payouts/{endpoint}"))
.send()
.await
.unwrap();
response_body = response.body().await;
println!("{endpoint} =:= {response:?} : {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::OK);
}
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 18,
"total_crates": null
} |
fn_clm_router_payments_create_core_adyen_no_redirect_4519398193133285483 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payments
async fn payments_create_core_adyen_no_redirect() {
use hyperswitch_domain_models::merchant_context::{Context, MerchantContext};
use crate::configs::settings::Settings;
let conf = Settings::new().expect("invalid settings");
let tx: oneshot::Sender<()> = oneshot::channel().0;
let app_state = Box::pin(routes::AppState::with_storage(
conf,
StorageImpl::PostgresqlTest,
tx,
Box::new(services::MockApiClient),
))
.await;
let state = Arc::new(app_state)
.get_session_state(
&id_type::TenantId::try_from_string("public".to_string()).unwrap(),
None,
|| {},
)
.unwrap();
let payment_id =
id_type::PaymentId::try_from(Cow::Borrowed("pay_mbabizu24mvu3mela5njyhpit10")).unwrap();
let customer_id = format!("cust_{}", Uuid::new_v4());
let merchant_id = id_type::MerchantId::try_from(Cow::from("juspay_merchant")).unwrap();
let key_manager_state = &(&state).into();
let key_store = state
.store
.get_merchant_key_store_by_merchant_id(
key_manager_state,
&merchant_id,
&state.store.get_master_key().to_vec().into(),
)
.await
.unwrap();
let merchant_account = state
.store
.find_merchant_account_by_merchant_id(key_manager_state, &merchant_id, &key_store)
.await
.unwrap();
let merchant_context = MerchantContext::NormalMerchant(Box::new(Context(
merchant_account.clone(),
key_store.clone(),
)));
let req = api::PaymentsRequest {
payment_id: Some(api::PaymentIdType::PaymentIntentId(payment_id.clone())),
merchant_id: Some(merchant_id.clone()),
amount: Some(MinorUnit::new(6540).into()),
currency: Some(api_enums::Currency::USD),
capture_method: Some(api_enums::CaptureMethod::Automatic),
amount_to_capture: Some(MinorUnit::new(6540)),
capture_on: Some(datetime!(2022-09-10 10:11:12)),
confirm: Some(true),
customer_id: Some(id_type::CustomerId::try_from(Cow::from(customer_id)).unwrap()),
description: Some("Its my first payment request".to_string()),
return_url: Some(url::Url::parse("http://example.com/payments").unwrap()),
setup_future_usage: Some(api_enums::FutureUsage::OnSession),
authentication_type: Some(api_enums::AuthenticationType::NoThreeDs),
payment_method_data: Some(api::PaymentMethodDataRequest {
payment_method_data: Some(api::PaymentMethodData::Card(api::Card {
card_number: "5555 3412 4444 1115".to_string().try_into().unwrap(),
card_exp_month: "03".to_string().into(),
card_exp_year: "2030".to_string().into(),
card_holder_name: Some(masking::Secret::new("JohnDoe".to_string())),
card_cvc: "737".to_string().into(),
card_issuer: None,
card_network: None,
card_type: None,
card_issuing_country: None,
bank_code: None,
nick_name: Some(masking::Secret::new("nick_name".into())),
})),
billing: None,
}),
payment_method: Some(api_enums::PaymentMethod::Card),
shipping: Some(api::Address {
address: None,
phone: None,
email: None,
}),
billing: Some(api::Address {
address: None,
phone: None,
email: None,
}),
statement_descriptor_name: Some("Juspay".to_string()),
statement_descriptor_suffix: Some("Router".to_string()),
..Default::default()
};
let expected_response = services::ApplicationResponse::JsonWithHeaders((
api::PaymentsResponse {
payment_id: payment_id.clone(),
status: api_enums::IntentStatus::Processing,
amount: MinorUnit::new(6540),
amount_capturable: MinorUnit::new(0),
amount_received: None,
client_secret: None,
created: None,
currency: "USD".to_string(),
customer_id: None,
description: Some("Its my first payment request".to_string()),
refunds: None,
mandate_id: None,
merchant_id,
net_amount: MinorUnit::new(6540),
connector: None,
customer: None,
disputes: None,
attempts: None,
captures: None,
mandate_data: None,
setup_future_usage: None,
off_session: None,
capture_on: None,
capture_method: None,
payment_method: None,
payment_method_data: None,
payment_token: None,
shipping: None,
billing: None,
order_details: None,
email: None,
name: None,
phone: None,
return_url: None,
authentication_type: None,
statement_descriptor_name: None,
statement_descriptor_suffix: None,
next_action: None,
cancellation_reason: None,
error_code: None,
error_message: None,
unified_code: None,
unified_message: None,
payment_experience: None,
payment_method_type: None,
connector_label: None,
business_country: None,
business_label: None,
business_sub_label: None,
allowed_payment_method_types: None,
ephemeral_key: None,
manual_retry_allowed: None,
connector_transaction_id: None,
frm_message: None,
metadata: None,
connector_metadata: None,
feature_metadata: None,
reference_id: None,
payment_link: None,
profile_id: None,
surcharge_details: None,
attempt_count: 1,
merchant_decision: None,
merchant_connector_id: None,
incremental_authorization_allowed: None,
authorization_count: None,
incremental_authorizations: None,
external_authentication_details: None,
external_3ds_authentication_attempted: None,
expires_on: None,
fingerprint: None,
browser_info: None,
mit_category: None,
payment_method_id: None,
payment_method_status: None,
updated: None,
split_payments: None,
frm_metadata: None,
merchant_order_reference_id: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
connector_mandate_id: None,
shipping_cost: None,
card_discovery: None,
force_3ds_challenge: None,
force_3ds_challenge_trigger: None,
issuer_error_code: None,
issuer_error_message: None,
is_iframe_redirection_enabled: None,
whole_connector_response: None,
payment_channel: None,
network_transaction_id: None,
enable_partial_authorization: None,
is_overcapture_enabled: None,
enable_overcapture: None,
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
},
vec![],
));
let actual_response = Box::pin(payments::payments_core::<
api::Authorize,
api::PaymentsResponse,
_,
_,
_,
payments::PaymentData<api::Authorize>,
>(
state.clone(),
state.get_req_state(),
merchant_context,
None,
payments::PaymentCreate,
req,
services::AuthFlow::Merchant,
payments::CallConnectorAction::Trigger,
None,
hyperswitch_domain_models::payments::HeaderPayload::default(),
))
.await
.unwrap();
assert_eq!(expected_response, actual_response);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 122,
"total_crates": null
} |
fn_clm_router_payments_create_core_4519398193133285483 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payments
async fn payments_create_core() {
use configs::settings::Settings;
use hyperswitch_domain_models::merchant_context::{Context, MerchantContext};
let conf = Settings::new().expect("invalid settings");
let tx: oneshot::Sender<()> = oneshot::channel().0;
let app_state = Box::pin(routes::AppState::with_storage(
conf,
StorageImpl::PostgresqlTest,
tx,
Box::new(services::MockApiClient),
))
.await;
let merchant_id = id_type::MerchantId::try_from(Cow::from("juspay_merchant")).unwrap();
let state = Arc::new(app_state)
.get_session_state(
&id_type::TenantId::try_from_string("public".to_string()).unwrap(),
None,
|| {},
)
.unwrap();
let key_manager_state = &(&state).into();
let key_store = state
.store
.get_merchant_key_store_by_merchant_id(
key_manager_state,
&merchant_id,
&state.store.get_master_key().to_vec().into(),
)
.await
.unwrap();
let merchant_account = state
.store
.find_merchant_account_by_merchant_id(key_manager_state, &merchant_id, &key_store)
.await
.unwrap();
let merchant_context = MerchantContext::NormalMerchant(Box::new(Context(
merchant_account.clone(),
key_store.clone(),
)));
let payment_id =
id_type::PaymentId::try_from(Cow::Borrowed("pay_mbabizu24mvu3mela5njyhpit10")).unwrap();
let req = api::PaymentsRequest {
payment_id: Some(api::PaymentIdType::PaymentIntentId(payment_id.clone())),
merchant_id: Some(merchant_id.clone()),
amount: Some(MinorUnit::new(6540).into()),
currency: Some(api_enums::Currency::USD),
capture_method: Some(api_enums::CaptureMethod::Automatic),
amount_to_capture: Some(MinorUnit::new(6540)),
capture_on: Some(datetime!(2022-09-10 11:12)),
confirm: Some(true),
customer_id: None,
email: None,
name: None,
description: Some("Its my first payment request".to_string()),
return_url: Some(url::Url::parse("http://example.com/payments").unwrap()),
setup_future_usage: Some(api_enums::FutureUsage::OnSession),
authentication_type: Some(api_enums::AuthenticationType::NoThreeDs),
payment_method_data: Some(api::PaymentMethodDataRequest {
payment_method_data: Some(api::PaymentMethodData::Card(api::Card {
card_number: "4242424242424242".to_string().try_into().unwrap(),
card_exp_month: "10".to_string().into(),
card_exp_year: "35".to_string().into(),
card_holder_name: Some(masking::Secret::new("Arun Raj".to_string())),
card_cvc: "123".to_string().into(),
card_issuer: None,
card_network: None,
card_type: None,
card_issuing_country: None,
bank_code: None,
nick_name: Some(masking::Secret::new("nick_name".into())),
})),
billing: None,
}),
payment_method: Some(api_enums::PaymentMethod::Card),
shipping: Some(api::Address {
address: None,
phone: None,
email: None,
}),
billing: Some(api::Address {
address: None,
phone: None,
email: None,
}),
statement_descriptor_name: Some("Hyperswtich".to_string()),
statement_descriptor_suffix: Some("Hyperswitch".to_string()),
..Default::default()
};
let expected_response = api::PaymentsResponse {
payment_id,
status: api_enums::IntentStatus::Succeeded,
amount: MinorUnit::new(6540),
amount_capturable: MinorUnit::new(0),
amount_received: None,
client_secret: None,
created: None,
currency: "USD".to_string(),
customer_id: None,
description: Some("Its my first payment request".to_string()),
refunds: None,
mandate_id: None,
merchant_id,
net_amount: MinorUnit::new(6540),
connector: None,
customer: None,
disputes: None,
attempts: None,
captures: None,
mandate_data: None,
setup_future_usage: None,
off_session: None,
capture_on: None,
capture_method: None,
payment_method: None,
payment_method_data: None,
payment_token: None,
shipping: None,
billing: None,
order_details: None,
email: None,
name: None,
phone: None,
return_url: None,
authentication_type: None,
statement_descriptor_name: None,
statement_descriptor_suffix: None,
next_action: None,
cancellation_reason: None,
error_code: None,
error_message: None,
unified_code: None,
unified_message: None,
payment_experience: None,
payment_method_type: None,
connector_label: None,
business_country: None,
business_label: None,
business_sub_label: None,
allowed_payment_method_types: None,
ephemeral_key: None,
manual_retry_allowed: None,
connector_transaction_id: None,
frm_message: None,
metadata: None,
connector_metadata: None,
feature_metadata: None,
reference_id: None,
payment_link: None,
profile_id: None,
surcharge_details: None,
attempt_count: 1,
merchant_decision: None,
merchant_connector_id: None,
incremental_authorization_allowed: None,
authorization_count: None,
incremental_authorizations: None,
external_authentication_details: None,
external_3ds_authentication_attempted: None,
expires_on: None,
fingerprint: None,
mit_category: None,
browser_info: None,
payment_method_id: None,
payment_method_status: None,
updated: None,
split_payments: None,
frm_metadata: None,
merchant_order_reference_id: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
connector_mandate_id: None,
shipping_cost: None,
card_discovery: None,
force_3ds_challenge: None,
force_3ds_challenge_trigger: None,
issuer_error_code: None,
issuer_error_message: None,
is_iframe_redirection_enabled: None,
whole_connector_response: None,
payment_channel: None,
network_transaction_id: None,
enable_partial_authorization: None,
is_overcapture_enabled: None,
enable_overcapture: None,
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
};
let expected_response =
services::ApplicationResponse::JsonWithHeaders((expected_response, vec![]));
let actual_response = Box::pin(payments::payments_core::<
api::Authorize,
api::PaymentsResponse,
_,
_,
_,
payments::PaymentData<api::Authorize>,
>(
state.clone(),
state.get_req_state(),
merchant_context,
None,
payments::PaymentCreate,
req,
services::AuthFlow::Merchant,
payments::CallConnectorAction::Trigger,
None,
hyperswitch_domain_models::payments::HeaderPayload::default(),
))
.await
.unwrap();
assert_eq!(expected_response, actual_response);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 116,
"total_crates": null
} |
fn_clm_router_payments_create_stripe_4519398193133285483 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payments
async fn payments_create_stripe() {
Box::pin(utils::setup()).await;
let payment_id = format!("test_{}", Uuid::new_v4());
let api_key = ("API-KEY", "MySecretApiKey");
let request = serde_json::json!({
"payment_id" : payment_id,
"merchant_id" : "jarnura",
"amount" : 1000,
"currency" : "USD",
"amount_to_capture" : 1000,
"confirm" : true,
"customer" : "test_customer",
"customer_email" : "test@gmail.com",
"customer_name" : "Test",
"description" : "stripe",
"return_url" : "https://juspay.in/",
"payment_method_data" : {"card" : {"card_number":"4242424242424242","card_exp_month":"12","card_exp_year":"29","card_holder_name":"JohnDoe","card_cvc":"123"}},
"payment_method" : "card",
"statement_descriptor_name" : "Test Merchant",
"statement_descriptor_suffix" : "US"
});
let refund_req = serde_json::json!({
"amount" : 1000,
"currency" : "USD",
"refund_id" : "refund_123",
"payment_id" : payment_id,
"merchant_id" : "jarnura",
});
let client = awc::Client::default();
let mut create_response = client
.post("http://127.0.0.1:8080/payments/create")
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
let create_response_body = create_response.body().await;
println!("{create_response:?} : {create_response_body:?}");
assert_eq!(create_response.status(), awc::http::StatusCode::OK);
let mut retrieve_response = client
.get("http://127.0.0.1:8080/payments/retrieve")
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
let retrieve_response_body = retrieve_response.body().await;
println!("{retrieve_response:?} =:= {retrieve_response_body:?}");
assert_eq!(retrieve_response.status(), awc::http::StatusCode::OK);
let mut refund_response = client
.post("http://127.0.0.1:8080/refunds/create")
.insert_header(api_key)
.send_json(&refund_req)
.await
.unwrap();
let refund_response_body = refund_response.body().await;
println!("{refund_response:?} =:= {refund_response_body:?}");
assert_eq!(refund_response.status(), awc::http::StatusCode::OK);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 30,
"total_crates": null
} |
fn_clm_router_payments_create_adyen_4519398193133285483 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payments
async fn payments_create_adyen() {
Box::pin(utils::setup()).await;
let payment_id = format!("test_{}", Uuid::new_v4());
let api_key = ("API-KEY", "321");
let request = serde_json::json!({
"payment_id" : payment_id,
"merchant_id" : "jarnura",
"amount" : 1000,
"currency" : "USD",
"amount_to_capture" : 1000,
"confirm" : true,
"customer" : "test_customer",
"customer_email" : "test@gmail.com",
"customer_name" : "Test",
"description" : "adyen",
"return_url" : "https://juspay.in/",
"payment_method_data" : {"card" : {"card_number":"5555 3412 4444 1115","card_exp_month":"03","card_exp_year":"2030","card_holder_name":"JohnDoe","card_cvc":"737"}},
"payment_method" : "card",
"statement_descriptor_name" : "Test Merchant",
"statement_descriptor_suffix" : "US"
});
let refund_req = serde_json::json!({
"amount" : 1000,
"currency" : "USD",
"refund_id" : "refund_123",
"payment_id" : payment_id,
"merchant_id" : "jarnura",
});
let client = awc::Client::default();
let mut create_response = client
.post("http://127.0.0.1:8080/payments/create")
.insert_header(api_key) //API Key must have adyen as first choice
.send_json(&request)
.await
.unwrap();
let create_response_body = create_response.body().await;
println!("{create_response:?} : {create_response_body:?}");
assert_eq!(create_response.status(), awc::http::StatusCode::OK);
let mut retrieve_response = client
.get("http://127.0.0.1:8080/payments/retrieve")
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
let retrieve_response_body = retrieve_response.body().await;
println!("{retrieve_response:?} =:= {retrieve_response_body:?}");
assert_eq!(retrieve_response.status(), awc::http::StatusCode::OK);
let mut refund_response = client
.post("http://127.0.0.1:8080/refunds/create")
.insert_header(api_key)
.send_json(&refund_req)
.await
.unwrap();
let refund_response_body = refund_response.body().await;
println!("{refund_response:?} =:= {refund_response_body:?}");
assert_eq!(refund_response.status(), awc::http::StatusCode::OK);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 30,
"total_crates": null
} |
fn_clm_router_payments_create_fail_4519398193133285483 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payments
async fn payments_create_fail() {
Box::pin(utils::setup()).await;
let payment_id = format!("test_{}", Uuid::new_v4());
let api_key = ("API-KEY", "MySecretApiKey");
let invalid_request = serde_json::json!({
"description" : "stripe",
});
let request = serde_json::json!({
"payment_id" : payment_id,
"merchant_id" : "jarnura",
"amount" : 1000,
"currency" : "USD",
"amount_to_capture" : 1000,
"confirm" : true,
"customer" : "test_customer",
"customer_email" : "test@gmail.com",
"customer_name" : "Test",
"description" : "adyen",
"return_url" : "https://juspay.in/",
"payment_method_data" : {"card" : {"card_number":"5555 3412 4444 1115","card_exp_month":"03","card_exp_year":"2030","card_holder_name":"JohnDoe","card_cvc":"737"}},
"payment_method" : "card",
"statement_descriptor_name" : "Test Merchant",
"statement_descriptor_suffix" : "US"
});
let client = awc::Client::default();
let mut invalid_response = client
.post("http://127.0.0.1:8080/payments/create")
.insert_header(api_key)
.send_json(&invalid_request)
.await
.unwrap();
let invalid_response_body = invalid_response.body().await;
println!("{invalid_response:?} : {invalid_response_body:?}");
assert_eq!(
invalid_response.status(),
awc::http::StatusCode::BAD_REQUEST
);
let mut api_key_response = client
.get("http://127.0.0.1:8080/payments/retrieve")
// .insert_header(api_key)
.send_json(&request)
.await
.unwrap();
let api_key_response_body = api_key_response.body().await;
println!("{api_key_response:?} =:= {api_key_response_body:?}");
assert_eq!(
api_key_response.status(),
awc::http::StatusCode::UNAUTHORIZED
);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 20,
"total_crates": null
} |
fn_clm_router_get_redis_conn_failure_7370173277836217981 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/services
async fn get_redis_conn_failure() {
// Arrange
utils::setup().await;
let (tx, _) = tokio::sync::oneshot::channel();
let app_state = Box::pin(routes::AppState::new(
Settings::default(),
tx,
Box::new(services::MockApiClient),
))
.await;
let state = Arc::new(app_state)
.get_session_state(
&common_utils::id_type::TenantId::try_from_string("public".to_string()).unwrap(),
None,
|| {},
)
.unwrap();
let _ = state.store.get_redis_conn().map(|conn| {
conn.is_redis_available
.store(false, atomic::Ordering::SeqCst)
});
// Act
let _ = state.store.get_redis_conn();
// Assert
// based on #[should_panic] attribute
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 28,
"total_crates": null
} |
fn_clm_router_get_redis_conn_success_7370173277836217981 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/services
async fn get_redis_conn_success() {
// Arrange
Box::pin(utils::setup()).await;
let (tx, _) = tokio::sync::oneshot::channel();
let app_state = Box::pin(routes::AppState::new(
Settings::default(),
tx,
Box::new(services::MockApiClient),
))
.await;
let state = Arc::new(app_state)
.get_session_state(
&common_utils::id_type::TenantId::try_from_string("public".to_string()).unwrap(),
None,
|| {},
)
.unwrap();
// Act
let result = state.store.get_redis_conn();
// Assert
assert!(result.is_ok())
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 24,
"total_crates": null
} |
fn_clm_router_customer_failure_-4565784479602587639 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/customers
async fn customer_failure() {
Box::pin(utils::setup()).await;
let customer_id = format!("customer_{}", uuid::Uuid::new_v4());
let api_key = ("api-key", "MySecretApiKey");
let mut request = serde_json::json!({
"email" : "abcd",
});
let client = awc::Client::default();
let mut response;
let mut response_body;
// insert the customer with invalid email when id not found
response = client
.post("http://127.0.0.1:8080/customers")
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
response_body = response.body().await;
println!("{response:?} : {response_body:?}");
assert_eq!(
response.status(),
awc::http::StatusCode::UNPROCESSABLE_ENTITY
);
// retrieve a customer with customer id which is not in DB
response = client
.post(format!("http://127.0.0.1:8080/customers/{customer_id}"))
.insert_header(api_key)
.send()
.await
.unwrap();
response_body = response.body().await;
println!("{response:?} : {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::BAD_REQUEST);
// update customer id with customer id which is not in DB
response = client
.post(format!("http://127.0.0.1:8080/customers/{customer_id}"))
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
response_body = response.body().await;
println!("{response:?} : {response_body:?}");
assert_eq!(
response.status(),
awc::http::StatusCode::UNPROCESSABLE_ENTITY
);
// delete a customer with customer id which is not in DB
response = client
.delete(format!("http://127.0.0.1:8080/customers/{customer_id}"))
.insert_header(api_key)
.send()
.await
.unwrap();
response_body = response.body().await;
println!("{response:?} : {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::BAD_REQUEST);
// email validation for customer update
request = serde_json::json!({ "customer_id": customer_id });
response = client
.post("http://127.0.0.1:8080/customers")
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
response_body = response.body().await;
println!("{response:?} : {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::OK);
request = serde_json::json!({
"email": "abch"
});
response = client
.post(format!("http://127.0.0.1:8080/customers/{customer_id}"))
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
response_body = response.body().await;
println!("{response:?} : {response_body:?}");
assert_eq!(
response.status(),
awc::http::StatusCode::UNPROCESSABLE_ENTITY
);
// address validation
request = serde_json::json!({
"email": "abch"
});
response = client
.post(format!("http://127.0.0.1:8080/customers/{customer_id}"))
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
response_body = response.body().await;
println!("{response:?} : {response_body:?}");
assert_eq!(
response.status(),
awc::http::StatusCode::UNPROCESSABLE_ENTITY
);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 62,
"total_crates": null
} |
fn_clm_router_customer_success_-4565784479602587639 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/customers
async fn customer_success() {
Box::pin(utils::setup()).await;
let customer_id = format!("customer_{}", uuid::Uuid::new_v4());
let api_key = ("API-KEY", "MySecretApiKey");
let name = "Doe";
let new_name = "new Doe";
let request = serde_json::json!({
"customer_id" : customer_id,
"name" : name,
});
let update_request = serde_json::json!({
"name" : new_name,
});
let client = awc::Client::default();
let mut response;
let mut response_body;
// create customer
response = client
.post("http://127.0.0.1:8080/customers")
.insert_header(api_key)
.send_json(&request)
.await
.unwrap();
response_body = response.body().await;
println!("customer-create: {response:?} : {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::OK);
// retrieve customer
response = client
.get(format!("http://127.0.0.1:8080/customers/{customer_id}"))
.insert_header(api_key)
.send()
.await
.unwrap();
response_body = response.body().await;
println!("customer-retrieve: {response:?} =:= {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::OK);
// update customer
response = client
.post(format!("http://127.0.0.1:8080/customers/{customer_id}"))
.insert_header(api_key)
.send_json(&update_request)
.await
.unwrap();
response_body = response.body().await;
println!("customer-update: {response:?} =:= {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::OK);
// delete customer
response = client
.delete(format!("http://127.0.0.1:8080/customers/{customer_id}"))
.insert_header(api_key)
.send()
.await
.unwrap();
response_body = response.body().await;
println!("customer-delete : {response:?} =:= {response_body:?}");
assert_eq!(response.status(), awc::http::StatusCode::OK);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 38,
"total_crates": null
} |
fn_clm_router_payments_create_core_adyen_no_redirect_8322503122811604733 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payments2
async fn payments_create_core_adyen_no_redirect() {
use router::configs::settings::Settings;
let conf = Settings::new().expect("invalid settings");
use hyperswitch_domain_models::merchant_context::{Context, MerchantContext};
let tx: oneshot::Sender<()> = oneshot::channel().0;
let app_state = Box::pin(routes::AppState::with_storage(
conf,
StorageImpl::PostgresqlTest,
tx,
Box::new(services::MockApiClient),
))
.await;
let state = Arc::new(app_state)
.get_session_state(
&id_type::TenantId::try_from_string("public".to_string()).unwrap(),
None,
|| {},
)
.unwrap();
let customer_id = format!("cust_{}", Uuid::new_v4());
let merchant_id = id_type::MerchantId::try_from(Cow::from("juspay_merchant")).unwrap();
let payment_id =
id_type::PaymentId::try_from(Cow::Borrowed("pay_mbabizu24mvu3mela5njyhpit10")).unwrap();
let key_manager_state = &(&state).into();
let key_store = state
.store
.get_merchant_key_store_by_merchant_id(
key_manager_state,
&merchant_id,
&state.store.get_master_key().to_vec().into(),
)
.await
.unwrap();
let merchant_account = state
.store
.find_merchant_account_by_merchant_id(key_manager_state, &merchant_id, &key_store)
.await
.unwrap();
let merchant_context = MerchantContext::NormalMerchant(Box::new(Context(
merchant_account.clone(),
key_store.clone(),
)));
let req = api::PaymentsRequest {
payment_id: Some(api::PaymentIdType::PaymentIntentId(payment_id.clone())),
merchant_id: Some(merchant_id.clone()),
amount: Some(MinorUnit::new(6540).into()),
currency: Some(api_enums::Currency::USD),
capture_method: Some(api_enums::CaptureMethod::Automatic),
amount_to_capture: Some(MinorUnit::new(6540)),
capture_on: Some(datetime!(2022-09-10 10:11:12)),
confirm: Some(true),
customer_id: Some(id_type::CustomerId::try_from(Cow::from(customer_id)).unwrap()),
description: Some("Its my first payment request".to_string()),
return_url: Some(url::Url::parse("http://example.com/payments").unwrap()),
setup_future_usage: Some(api_enums::FutureUsage::OffSession),
authentication_type: Some(api_enums::AuthenticationType::NoThreeDs),
payment_method_data: Some(api::PaymentMethodDataRequest {
payment_method_data: Some(api::PaymentMethodData::Card(api::Card {
card_number: "5555 3412 4444 1115".to_string().try_into().unwrap(),
card_exp_month: "03".to_string().into(),
card_exp_year: "2030".to_string().into(),
card_holder_name: Some(masking::Secret::new("JohnDoe".to_string())),
card_cvc: "737".to_string().into(),
bank_code: None,
card_issuer: None,
card_network: None,
card_type: None,
card_issuing_country: None,
nick_name: Some(masking::Secret::new("nick_name".into())),
})),
billing: None,
}),
payment_method: Some(api_enums::PaymentMethod::Card),
shipping: Some(api::Address {
address: None,
phone: None,
email: None,
}),
billing: Some(api::Address {
address: None,
phone: None,
email: None,
}),
statement_descriptor_name: Some("Juspay".to_string()),
statement_descriptor_suffix: Some("Router".to_string()),
..Default::default()
};
let expected_response = services::ApplicationResponse::JsonWithHeaders((
api::PaymentsResponse {
payment_id: payment_id.clone(),
status: api_enums::IntentStatus::Processing,
amount: MinorUnit::new(6540),
amount_capturable: MinorUnit::new(0),
amount_received: None,
client_secret: None,
created: None,
currency: "USD".to_string(),
customer_id: None,
description: Some("Its my first payment request".to_string()),
refunds: None,
mandate_id: None,
merchant_id,
net_amount: MinorUnit::new(6540),
connector: None,
customer: None,
disputes: None,
attempts: None,
captures: None,
mandate_data: None,
setup_future_usage: None,
off_session: None,
capture_on: None,
capture_method: None,
payment_method: None,
payment_method_data: None,
payment_token: None,
shipping: None,
billing: None,
order_details: None,
email: None,
name: None,
phone: None,
return_url: None,
authentication_type: None,
statement_descriptor_name: None,
statement_descriptor_suffix: None,
next_action: None,
cancellation_reason: None,
error_code: None,
error_message: None,
unified_code: None,
unified_message: None,
payment_experience: None,
payment_method_type: None,
connector_label: None,
business_country: None,
business_label: None,
business_sub_label: None,
allowed_payment_method_types: None,
ephemeral_key: None,
manual_retry_allowed: None,
connector_transaction_id: None,
frm_message: None,
metadata: None,
connector_metadata: None,
feature_metadata: None,
reference_id: None,
payment_link: None,
profile_id: None,
surcharge_details: None,
attempt_count: 1,
merchant_decision: None,
merchant_connector_id: None,
incremental_authorization_allowed: None,
authorization_count: None,
incremental_authorizations: None,
external_authentication_details: None,
external_3ds_authentication_attempted: None,
expires_on: None,
fingerprint: None,
browser_info: None,
payment_method_id: None,
payment_method_status: None,
updated: None,
split_payments: None,
frm_metadata: None,
merchant_order_reference_id: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
mit_category: None,
connector_mandate_id: None,
shipping_cost: None,
card_discovery: None,
force_3ds_challenge: None,
force_3ds_challenge_trigger: None,
issuer_error_code: None,
issuer_error_message: None,
is_iframe_redirection_enabled: None,
whole_connector_response: None,
payment_channel: None,
network_transaction_id: None,
enable_partial_authorization: None,
is_overcapture_enabled: None,
enable_overcapture: None,
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
},
vec![],
));
let actual_response = Box::pin(payments::payments_core::<
api::Authorize,
api::PaymentsResponse,
_,
_,
_,
payments::PaymentData<api::Authorize>,
>(
state.clone(),
state.get_req_state(),
merchant_context,
None,
payments::PaymentCreate,
req,
services::AuthFlow::Merchant,
payments::CallConnectorAction::Trigger,
None,
hyperswitch_domain_models::payments::HeaderPayload::default(),
))
.await
.unwrap();
assert_eq!(expected_response, actual_response);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 122,
"total_crates": null
} |
fn_clm_router_payments_create_core_8322503122811604733 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payments2
async fn payments_create_core() {
use db::domain::merchant_context;
use hyperswitch_domain_models::merchant_context::{Context, MerchantContext};
use router::configs::settings::Settings;
let conf = Settings::new().expect("invalid settings");
let tx: oneshot::Sender<()> = oneshot::channel().0;
let app_state = Box::pin(routes::AppState::with_storage(
conf,
StorageImpl::PostgresqlTest,
tx,
Box::new(services::MockApiClient),
))
.await;
let merchant_id = id_type::MerchantId::try_from(Cow::from("juspay_merchant")).unwrap();
let state = Arc::new(app_state)
.get_session_state(
&id_type::TenantId::try_from_string("public".to_string()).unwrap(),
None,
|| {},
)
.unwrap();
let key_manager_state = &(&state).into();
let key_store = state
.store
.get_merchant_key_store_by_merchant_id(
key_manager_state,
&merchant_id,
&state.store.get_master_key().to_vec().into(),
)
.await
.unwrap();
let merchant_account = state
.store
.find_merchant_account_by_merchant_id(key_manager_state, &merchant_id, &key_store)
.await
.unwrap();
let merchant_context = MerchantContext::NormalMerchant(Box::new(Context(
merchant_account.clone(),
key_store.clone(),
)));
let payment_id =
id_type::PaymentId::try_from(Cow::Borrowed("pay_mbabizu24mvu3mela5njyhpit10")).unwrap();
let req = api::PaymentsRequest {
payment_id: Some(api::PaymentIdType::PaymentIntentId(payment_id.clone())),
merchant_id: Some(merchant_id.clone()),
amount: Some(MinorUnit::new(6540).into()),
currency: Some(api_enums::Currency::USD),
capture_method: Some(api_enums::CaptureMethod::Automatic),
amount_to_capture: Some(MinorUnit::new(6540)),
capture_on: Some(datetime!(2022-09-10 10:11:12)),
confirm: Some(true),
customer_id: None,
email: None,
name: None,
description: Some("Its my first payment request".to_string()),
return_url: Some(url::Url::parse("http://example.com/payments").unwrap()),
setup_future_usage: None,
authentication_type: Some(api_enums::AuthenticationType::NoThreeDs),
payment_method_data: Some(api::PaymentMethodDataRequest {
payment_method_data: Some(api::PaymentMethodData::Card(api::Card {
card_number: "4242424242424242".to_string().try_into().unwrap(),
card_exp_month: "10".to_string().into(),
card_exp_year: "35".to_string().into(),
card_holder_name: Some(masking::Secret::new("Arun Raj".to_string())),
card_cvc: "123".to_string().into(),
card_issuer: None,
card_network: None,
card_type: None,
card_issuing_country: None,
bank_code: None,
nick_name: Some(masking::Secret::new("nick_name".into())),
})),
billing: None,
}),
payment_method: Some(api_enums::PaymentMethod::Card),
shipping: Some(api::Address {
address: None,
phone: None,
email: None,
}),
billing: Some(api::Address {
address: None,
phone: None,
email: None,
}),
statement_descriptor_name: Some("Hyperswitch".to_string()),
statement_descriptor_suffix: Some("Hyperswitch".to_string()),
..<_>::default()
};
let expected_response = api::PaymentsResponse {
payment_id,
status: api_enums::IntentStatus::Succeeded,
amount: MinorUnit::new(6540),
amount_capturable: MinorUnit::new(0),
amount_received: None,
client_secret: None,
created: None,
currency: "USD".to_string(),
customer_id: None,
description: Some("Its my first payment request".to_string()),
refunds: None,
mandate_id: None,
merchant_id,
net_amount: MinorUnit::new(6540),
connector: None,
customer: None,
disputes: None,
attempts: None,
captures: None,
mandate_data: None,
setup_future_usage: None,
off_session: None,
capture_on: None,
capture_method: None,
payment_method: None,
payment_method_data: None,
payment_token: None,
shipping: None,
billing: None,
order_details: None,
email: None,
name: None,
phone: None,
return_url: None,
authentication_type: None,
statement_descriptor_name: None,
statement_descriptor_suffix: None,
next_action: None,
cancellation_reason: None,
error_code: None,
error_message: None,
unified_code: None,
unified_message: None,
payment_experience: None,
payment_method_type: None,
connector_label: None,
business_country: None,
business_label: None,
business_sub_label: None,
allowed_payment_method_types: None,
ephemeral_key: None,
manual_retry_allowed: None,
connector_transaction_id: None,
frm_message: None,
metadata: None,
connector_metadata: None,
feature_metadata: None,
reference_id: None,
payment_link: None,
profile_id: None,
surcharge_details: None,
attempt_count: 1,
merchant_decision: None,
merchant_connector_id: None,
incremental_authorization_allowed: None,
authorization_count: None,
incremental_authorizations: None,
external_authentication_details: None,
external_3ds_authentication_attempted: None,
expires_on: None,
fingerprint: None,
browser_info: None,
payment_method_id: None,
payment_method_status: None,
updated: None,
split_payments: None,
frm_metadata: None,
merchant_order_reference_id: None,
capture_before: None,
extended_authorization_applied: None,
order_tax_amount: None,
connector_mandate_id: None,
mit_category: None,
shipping_cost: None,
card_discovery: None,
force_3ds_challenge: None,
force_3ds_challenge_trigger: None,
issuer_error_code: None,
issuer_error_message: None,
is_iframe_redirection_enabled: None,
whole_connector_response: None,
payment_channel: None,
network_transaction_id: None,
enable_partial_authorization: None,
is_overcapture_enabled: None,
enable_overcapture: None,
network_details: None,
is_stored_credential: None,
request_extended_authorization: None,
};
let expected_response =
services::ApplicationResponse::JsonWithHeaders((expected_response, vec![]));
let actual_response = Box::pin(payments::payments_core::<
api::Authorize,
api::PaymentsResponse,
_,
_,
_,
payments::PaymentData<api::Authorize>,
>(
state.clone(),
state.get_req_state(),
merchant_context,
None,
payments::PaymentCreate,
req,
services::AuthFlow::Merchant,
payments::CallConnectorAction::Trigger,
None,
hyperswitch_domain_models::payments::HeaderPayload::default(),
))
.await
.unwrap();
assert_eq!(expected_response, actual_response);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 116,
"total_crates": null
} |
fn_clm_router_connector_list_8322503122811604733 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/payments2
fn connector_list() {
let connector_list = types::ConnectorsList {
connectors: vec![String::from("stripe"), "adyen".to_string()],
};
let json = serde_json::to_string(&connector_list).unwrap();
println!("{}", &json);
let newlist: types::ConnectorsList = serde_json::from_str(&json).unwrap();
println!("{newlist:#?}");
assert_eq!(true, true);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4,
"total_crates": null
} |
fn_clm_router_test_flat_struct_467011055089785129 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/macros
fn test_flat_struct() {
#[derive(FlatStruct, Serialize)]
struct User {
address: Address,
}
#[derive(Serialize)]
struct Address {
line1: String,
zip: String,
city: String,
}
let line1 = "1397".to_string();
let zip = "Some street".to_string();
let city = "941222".to_string();
let address = Address {
line1: line1.clone(),
zip: zip.clone(),
city: city.clone(),
};
let user = User { address };
let flat_user_map = user.flat_struct();
let mut required_map = HashMap::new();
required_map.insert("address.line1".to_string(), line1);
required_map.insert("address.zip".to_string(), zip);
required_map.insert("address.city".to_string(), city);
assert_eq!(flat_user_map, required_map);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 28,
"total_crates": null
} |
fn_clm_router_test_validate_schema_467011055089785129 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/macros
fn test_validate_schema() {
#[derive(ValidateSchema)]
struct Payment {
#[schema(min_length = 5, max_length = 12)]
payment_id: String,
#[schema(min_length = 10, max_length = 100)]
description: Option<String>,
#[schema(max_length = 255)]
return_url: Option<Url>,
}
// Valid case
let valid_payment = Payment {
payment_id: "payment_123".to_string(),
description: Some("This is a valid description".to_string()),
return_url: Some("https://example.com/return".parse().unwrap()),
};
assert!(valid_payment.validate().is_ok());
// Invalid: payment_id too short
let invalid_id = Payment {
payment_id: "pay".to_string(),
description: Some("This is a valid description".to_string()),
return_url: Some("https://example.com/return".parse().unwrap()),
};
let err = invalid_id.validate().unwrap_err();
assert!(
err.contains("payment_id must be at least 5 characters long. Received 3 characters")
);
// Invalid: payment_id too long
let invalid_desc = Payment {
payment_id: "payment_12345".to_string(),
description: Some("This is a valid description".to_string()),
return_url: Some("https://example.com/return".parse().unwrap()),
};
let err = invalid_desc.validate().unwrap_err();
assert!(
err.contains("payment_id must be at most 12 characters long. Received 13 characters")
);
// None values should pass validation
let none_values = Payment {
payment_id: "payment_123".to_string(),
description: None,
return_url: None,
};
assert!(none_values.validate().is_ok());
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 28,
"total_crates": null
} |
fn_clm_router_health_check_7858632450891898913 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/health_check
async fn health_check() {
let server = Box::pin(mk_service()).await;
let client = AppClient::guest();
assert_eq!(client.health(&server).await, "health is good");
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 6,
"total_crates": null
} |
fn_clm_router_deserialize_3781596036271945829 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/utils
// Implementation of HNil for Deserialize<'de>
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(serde::de::IgnoredAny)?;
Ok(Self)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 136,
"total_crates": null
} |
fn_clm_router_setup_3781596036271945829 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/utils
pub async fn setup() {
Box::pin(SERVER.get_or_init(spawn_server)).await;
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": true,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 62,
"total_crates": null
} |
fn_clm_router_create_merchant_account_3781596036271945829 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/utils
// Inherent implementation for AppClient<Admin>
pub async fn create_merchant_account<T: DeserializeOwned, S, B>(
&self,
app: &S,
merchant_id: impl Into<Option<String>>,
) -> T
where
S: Service<Request, Response = ServiceResponse<B>, Error = actix_web::Error>,
B: MessageBody,
{
let request = TestRequest::post()
.uri("/accounts")
.append_header(("api-key".to_owned(), self.state.authkey.clone()))
.set_json(mk_merchant_account(merchant_id.into()))
.to_request();
call_and_read_body_json(app, request).await
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": true,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 59,
"total_crates": null
} |
fn_clm_router_create_refund_3781596036271945829 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/utils
// Inherent implementation for AppClient<User>
pub async fn create_refund<T: DeserializeOwned, S, B>(
&self,
app: &S,
payment_id: &common_utils::id_type::PaymentId,
amount: usize,
) -> T
where
S: Service<Request, Response = ServiceResponse<B>, Error = actix_web::Error>,
B: MessageBody,
{
let request = TestRequest::post()
.uri("/refunds")
.append_header(("api-key".to_owned(), self.state.authkey.clone()))
.set_json(mk_refund(payment_id, amount))
.to_request();
call_and_read_body_json(app, request).await
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": true,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 57,
"total_crates": null
} |
fn_clm_router_create_connector_3781596036271945829 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/utils
// Inherent implementation for AppClient<Admin>
pub async fn create_connector<T: DeserializeOwned, S, B>(
&self,
app: &S,
merchant_id: &common_utils::id_type::MerchantId,
connector_name: &str,
api_key: &str,
) -> T
where
S: Service<Request, Response = ServiceResponse<B>, Error = actix_web::Error>,
B: MessageBody,
{
let request = TestRequest::post()
.uri(&format!(
"/account/{}/connectors",
merchant_id.get_string_repr()
))
.append_header(("api-key".to_owned(), self.state.authkey.clone()))
.set_json(mk_connector(connector_name, api_key))
.to_request();
call_and_read_body_json(app, request).await
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": true,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 48,
"total_crates": null
} |
fn_clm_router_payment_method_details_-7773534305349985268 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nexinets
fn payment_method_details() -> Option<PaymentsAuthorizeData> {
Some(PaymentsAuthorizeData {
currency: diesel_models::enums::Currency::EUR,
payment_method_data: domain::PaymentMethodData::Card(domain::Card {
card_number: CardNumber::from_str("374111111111111").unwrap(),
..utils::CCardType::default().0
}),
router_return_url: Some("https://google.com".to_string()),
..utils::PaymentAuthorizeType::default().0
})
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4408,
"total_crates": null
} |
fn_clm_router_get_name_-7773534305349985268 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nexinets
// Implementation of NexinetsTest for utils::Connector
fn get_name(&self) -> String {
"nexinets".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_-7773534305349985268 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nexinets
// Implementation of NexinetsTest for utils::Connector
fn get_data(&self) -> types::api::ConnectorData {
use router::connector::Nexinets;
utils::construct_connector_data_old(
Box::new(&Nexinets),
types::Connector::Nexinets,
types::api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 39,
"total_crates": null
} |
fn_clm_router_should_sync_manually_captured_refund_-7773534305349985268 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nexinets
async fn should_sync_manually_captured_refund() {
let authorize_response = CONNECTOR
.authorize_payment(payment_method_details(), None)
.await
.expect("Authorize payment response");
let txn_id = "".to_string();
let capture_connector_meta = utils::get_connector_metadata(authorize_response.response);
let capture_response = CONNECTOR
.capture_payment(
txn_id.clone(),
Some(types::PaymentsCaptureData {
currency: diesel_models::enums::Currency::EUR,
connector_meta: capture_connector_meta,
..utils::PaymentCaptureType::default().0
}),
None,
)
.await
.expect("Capture payment response");
let capture_txn_id =
utils::get_connector_transaction_id(capture_response.response.clone()).unwrap();
let refund_connector_metadata = utils::get_connector_metadata(capture_response.response);
let refund_response = CONNECTOR
.refund_payment(
capture_txn_id.clone(),
Some(types::RefundsData {
refund_amount: 100,
connector_transaction_id: capture_txn_id.clone(),
currency: diesel_models::enums::Currency::EUR,
connector_metadata: refund_connector_metadata.clone(),
..utils::PaymentRefundType::default().0
}),
None,
)
.await
.unwrap();
let transaction_id = Some(
refund_response
.response
.clone()
.unwrap()
.connector_refund_id,
);
let response = CONNECTOR
.rsync_retry_till_status_matches(
enums::RefundStatus::Success,
refund_response
.response
.clone()
.unwrap()
.connector_refund_id,
Some(types::RefundsData {
connector_refund_id: transaction_id,
connector_transaction_id: capture_txn_id,
connector_metadata: refund_connector_metadata,
..utils::PaymentRefundType::default().0
}),
None,
)
.await
.unwrap();
assert_eq!(
response.response.unwrap().refund_status,
enums::RefundStatus::Success,
);
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 38,
"total_crates": null
} |
fn_clm_router_get_auth_token_-7773534305349985268 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nexinets
// Implementation of NexinetsTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.nexinets
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_-1371658469661012170 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/hyperswitch_vault
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_-1371658469661012170 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/hyperswitch_vault
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_-1371658469661012170 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/hyperswitch_vault
// Implementation of HyperswitchVaultTest for utils::Connector
fn get_name(&self) -> String {
"hyperswitch_vault".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_-1371658469661012170 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/hyperswitch_vault
// Implementation of HyperswitchVaultTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::HyperswitchVault;
utils::construct_connector_data_old(
Box::new(&HyperswitchVault),
types::Connector::HyperswitchVault,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 39,
"total_crates": null
} |
fn_clm_router_get_auth_token_-1371658469661012170 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/hyperswitch_vault
// Implementation of HyperswitchVaultTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.hyperswitch_vault
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_5067625251767644804 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/wellsfargo
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_5067625251767644804 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/wellsfargo
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_5067625251767644804 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/wellsfargo
// Implementation of WellsfargoTest for utils::Connector
fn get_name(&self) -> String {
"wellsfargo".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_5067625251767644804 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/wellsfargo
// Implementation of WellsfargoTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Wellsfargo;
utils::construct_connector_data_old(
Box::new(Wellsfargo::new()),
types::Connector::Wellsfargo,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_5067625251767644804 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/wellsfargo
// Implementation of WellsfargoTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.wellsfargo
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_825569930274205358 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/zsl
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_825569930274205358 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/zsl
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_825569930274205358 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/zsl
// Implementation of ZslTest for utils::Connector
fn get_name(&self) -> String {
"zsl".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_825569930274205358 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/zsl
// Implementation of ZslTest for utils::Connector
fn get_data(&self) -> types::api::ConnectorData {
use router::connector::Zsl;
utils::construct_connector_data_old(
Box::new(&Zsl),
types::Connector::Adyen,
// Added as Dummy connector as template code is added for future usage
types::api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 39,
"total_crates": null
} |
fn_clm_router_get_auth_token_825569930274205358 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/zsl
// Implementation of ZslTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.zsl
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_-2156558104863674486 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/noon
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_-2156558104863674486 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/noon
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
Some(types::PaymentsAuthorizeData {
currency: enums::Currency::AED,
..utils::PaymentAuthorizeType::default().0
})
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4400,
"total_crates": null
} |
fn_clm_router_get_name_-2156558104863674486 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/noon
// Implementation of NoonTest for utils::Connector
fn get_name(&self) -> String {
"noon".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_-2156558104863674486 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/noon
// Implementation of NoonTest for utils::Connector
fn get_data(&self) -> types::api::ConnectorData {
use router::connector::Noon;
utils::construct_connector_data_old(
Box::new(Noon::new()),
types::Connector::Noon,
types::api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_-2156558104863674486 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/noon
// Implementation of NoonTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.noon
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_-1520383564373851262 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/breadpay
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_-1520383564373851262 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/breadpay
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_-1520383564373851262 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/breadpay
// Implementation of BreadpayTest for utils::Connector
fn get_name(&self) -> String {
"breadpay".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_-1520383564373851262 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/breadpay
// Implementation of BreadpayTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Breadpay;
utils::construct_connector_data_old(
Box::new(Breadpay::new()),
types::Connector::Plaid,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_-1520383564373851262 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/breadpay
// Implementation of BreadpayTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.breadpay
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_7959951724437206587 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayvantiv
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_7959951724437206587 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayvantiv
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_7959951724437206587 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayvantiv
// Implementation of WorldpayvantivTest for utils::Connector
fn get_name(&self) -> String {
"Worldpayxml".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_7959951724437206587 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayvantiv
// Implementation of WorldpayvantivTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Worldpayxml;
utils::construct_connector_data_old(
Box::new(Worldpayxml::new()),
types::Connector::Plaid,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_7959951724437206587 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayvantiv
// Implementation of WorldpayvantivTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.worldpayxml
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_3663043073497035211 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/thunes
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_3663043073497035211 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/thunes
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_3663043073497035211 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/thunes
// Implementation of ThunesTest for utils::Connector
fn get_name(&self) -> String {
"thunes".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_3663043073497035211 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/thunes
// Implementation of ThunesTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Thunes;
api::ConnectorData {
connector: Box::new(Thunes::new()),
connector_name: types::Connector::Thunes,
get_token: types::api::GetToken::Connector,
merchant_connector_id: None,
}
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 39,
"total_crates": null
} |
fn_clm_router_get_auth_token_3663043073497035211 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/thunes
// Implementation of ThunesTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.thunes
.expect("Missing connector authentication configuration").into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_-5531724282762100842 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/paysafe
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_-5531724282762100842 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/paysafe
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_-5531724282762100842 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/paysafe
// Implementation of PaysafeTest for utils::Connector
fn get_name(&self) -> String {
"paysafe".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_-5531724282762100842 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/paysafe
// Implementation of PaysafeTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Paysafe;
utils::construct_connector_data_old(
Box::new(Paysafe::new()),
types::Connector::Plaid,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_-5531724282762100842 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/paysafe
// Implementation of PaysafeTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.paysafe
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_2612763478720711260 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nordea
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_2612763478720711260 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nordea
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_2612763478720711260 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nordea
// Implementation of NordeaTest for utils::Connector
fn get_name(&self) -> String {
"nordea".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_2612763478720711260 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nordea
// Implementation of NordeaTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Nordea;
utils::construct_connector_data_old(
Box::new(Nordea::new()),
types::Connector::DummyConnector1,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_2612763478720711260 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/nordea
// Implementation of NordeaTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.nordea
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_359350092866486333 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/amazonpay
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_359350092866486333 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/amazonpay
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_359350092866486333 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/amazonpay
// Implementation of AmazonpayTest for utils::Connector
fn get_name(&self) -> String {
"amazonpay".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_359350092866486333 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/amazonpay
// Implementation of AmazonpayTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Amazonpay;
utils::construct_connector_data_old(
Box::new(Amazonpay::new()),
types::Connector::Plaid,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_359350092866486333 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/amazonpay
// Implementation of AmazonpayTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.amazonpay
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_-8669983768082838890 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/coinbase
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
Some(utils::PaymentInfo {
address: Some(PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
first_name: Some(Secret::new("first".to_string())),
last_name: Some(Secret::new("last".to_string())),
line1: Some(Secret::new("line1".to_string())),
line2: Some(Secret::new("line2".to_string())),
city: Some("city".to_string()),
zip: Some(Secret::new("zip".to_string())),
country: Some(api_models::enums::CountryAlpha2::IN),
..Default::default()
}),
phone: Some(PhoneDetails {
number: Some(Secret::new("9123456789".to_string())),
country_code: Some("+91".to_string()),
}),
email: None,
}),
None,
None,
)),
connector_meta_data: Some(json!({"pricing_type": "fixed_price"})),
..Default::default()
})
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7312,
"total_crates": null
} |
fn_clm_router_payment_method_details_-8669983768082838890 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/coinbase
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
Some(types::PaymentsAuthorizeData {
amount: 1,
currency: enums::Currency::USD,
payment_method_data: domain::PaymentMethodData::Crypto(domain::CryptoData {
pay_currency: None,
network: None,
}),
confirm: true,
statement_descriptor_suffix: None,
statement_descriptor: None,
setup_future_usage: None,
mandate_id: None,
off_session: None,
setup_mandate_details: None,
// capture_method: Some(capture_method),
browser_info: None,
order_details: None,
order_category: None,
email: None,
customer_name: None,
payment_experience: None,
payment_method_type: None,
session_token: None,
enrolled_for_3ds: false,
related_transaction_id: None,
router_return_url: Some(String::from("https://google.com/")),
webhook_url: None,
complete_authorize_url: None,
capture_method: None,
customer_id: None,
surcharge_details: None,
request_incremental_authorization: false,
metadata: None,
authentication_data: None,
customer_acceptance: None,
..utils::PaymentAuthorizeType::default().0
})
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4404,
"total_crates": null
} |
fn_clm_router_get_name_-8669983768082838890 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/coinbase
// Implementation of CoinbaseTest for utils::Connector
fn get_name(&self) -> String {
"coinbase".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_-8669983768082838890 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/coinbase
// Implementation of CoinbaseTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Coinbase;
utils::construct_connector_data_old(
Box::new(Coinbase::new()),
types::Connector::Coinbase,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_-8669983768082838890 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/coinbase
// Implementation of CoinbaseTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.coinbase
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_7116006955414487786 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/payme
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
Some(utils::PaymentInfo {
address: Some(PaymentAddress::new(
None,
Some(Address {
address: Some(AddressDetails {
city: None,
country: None,
line1: None,
line2: None,
line3: None,
zip: None,
state: None,
first_name: Some(Secret::new("John".to_string())),
last_name: Some(Secret::new("Doe".to_string())),
origin_zip: None,
}),
phone: None,
email: None,
}),
None,
None,
)),
auth_type: None,
access_token: None,
connector_meta_data: None,
connector_customer: None,
payment_method_token: None,
#[cfg(feature = "payouts")]
currency: None,
#[cfg(feature = "payouts")]
payout_method_data: None,
})
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7288,
"total_crates": null
} |
fn_clm_router_payment_method_details_7116006955414487786 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/payme
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
Some(types::PaymentsAuthorizeData {
order_details: Some(vec![OrderDetailsWithAmount {
product_name: "iphone 13".to_string(),
quantity: 1,
amount: MinorUnit::new(1000),
product_img_link: None,
requires_shipping: None,
product_id: None,
category: None,
sub_category: None,
brand: None,
product_type: None,
product_tax_code: None,
tax_rate: None,
total_tax_amount: None,
description: None,
sku: None,
upc: None,
commodity_code: None,
unit_of_measure: None,
total_amount: None,
unit_discount_amount: None,
}]),
router_return_url: Some("https://hyperswitch.io".to_string()),
webhook_url: Some("https://hyperswitch.io".to_string()),
email: Some(Email::from_str("test@gmail.com").unwrap()),
payment_method_data: domain::PaymentMethodData::Card(domain::Card {
card_number: cards::CardNumber::from_str("4111111111111111").unwrap(),
card_cvc: Secret::new("123".to_string()),
card_exp_month: Secret::new("10".to_string()),
card_exp_year: Secret::new("2025".to_string()),
..utils::CCardType::default().0
}),
amount: 1000,
..PaymentAuthorizeType::default().0
})
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4424,
"total_crates": null
} |
fn_clm_router_get_name_7116006955414487786 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/payme
// Implementation of PaymeTest for utils::Connector
fn get_name(&self) -> String {
"payme".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_7116006955414487786 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/payme
// Implementation of PaymeTest for utils::Connector
fn get_data(&self) -> types::api::ConnectorData {
use router::connector::Payme;
utils::construct_connector_data_old(
Box::new(Payme::new()),
types::Connector::Payme,
types::api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_7116006955414487786 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/payme
// Implementation of PaymeTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.payme
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_-3953039065837049902 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/xendit
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_-3953039065837049902 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/xendit
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_-3953039065837049902 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/xendit
// Implementation of XenditTest for utils::Connector
fn get_name(&self) -> String {
"xendit".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_-3953039065837049902 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/xendit
// Implementation of XenditTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Xendit;
api::ConnectorData {
connector: Box::new(Xendit::new()),
connector_name: types::Connector::Xendit,
get_token: types::api::GetToken::Connector,
merchant_connector_id: None,
}
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 39,
"total_crates": null
} |
fn_clm_router_get_auth_token_-3953039065837049902 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/xendit
// Implementation of XenditTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.xendit
.expect("Missing connector authentication configuration").into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_6815649753589500338 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayxml
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_6815649753589500338 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayxml
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_6815649753589500338 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayxml
// Implementation of WorldpayxmlTest for utils::Connector
fn get_name(&self) -> String {
"Worldpayxml".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
fn_clm_router_get_data_6815649753589500338 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayxml
// Implementation of WorldpayxmlTest for utils::Connector
fn get_data(&self) -> api::ConnectorData {
use router::connector::Worldpayxml;
utils::construct_connector_data_old(
Box::new(Worldpayxml::new()),
types::Connector::Plaid,
api::GetToken::Connector,
None,
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 41,
"total_crates": null
} |
fn_clm_router_get_auth_token_6815649753589500338 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/worldpayxml
// Implementation of WorldpayxmlTest for utils::Connector
fn get_auth_token(&self) -> types::ConnectorAuthType {
utils::to_connector_auth_type(
connector_auth::ConnectorAuthentication::new()
.worldpayxml
.expect("Missing connector authentication configuration")
.into(),
)
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 32,
"total_crates": null
} |
fn_clm_router_get_default_payment_info_-8012768671191076564 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/boku
fn get_default_payment_info() -> Option<utils::PaymentInfo> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 7278,
"total_crates": null
} |
fn_clm_router_payment_method_details_-8012768671191076564 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/boku
fn payment_method_details() -> Option<types::PaymentsAuthorizeData> {
None
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 4398,
"total_crates": null
} |
fn_clm_router_get_name_-8012768671191076564 | clm | function | // Repository: hyperswitch
// Crate: router
// Purpose: Main application server handling HTTP requests, authentication, and business logic orchestration
// Module: crates/router/tests/connectors/boku
// Implementation of BokuTest for utils::Connector
fn get_name(&self) -> String {
"boku".to_string()
}
| {
"crate": "router",
"file": null,
"file_size": null,
"is_async": false,
"is_pub": false,
"num_enums": null,
"num_structs": null,
"num_tables": null,
"score": 46,
"total_crates": null
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.