mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 02:57:02 +08:00
chore: enable clippy::large_futures lint (#4822)
This commit is contained in:
@ -6,6 +6,7 @@ rustflags = [
|
|||||||
"-Wclippy::expect_used",
|
"-Wclippy::expect_used",
|
||||||
"-Wclippy::index_refutable_slice",
|
"-Wclippy::index_refutable_slice",
|
||||||
"-Wclippy::indexing_slicing",
|
"-Wclippy::indexing_slicing",
|
||||||
|
"-Wclippy::large_futures",
|
||||||
"-Wclippy::match_on_vec_items",
|
"-Wclippy::match_on_vec_items",
|
||||||
"-Wclippy::missing_panics_doc",
|
"-Wclippy::missing_panics_doc",
|
||||||
"-Wclippy::out_of_bounds_indexing",
|
"-Wclippy::out_of_bounds_indexing",
|
||||||
|
|||||||
@ -358,12 +358,12 @@ pub async fn attach_evidence(
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
)?;
|
)?;
|
||||||
let create_file_response = files::files_create_core(
|
let create_file_response = Box::pin(files::files_create_core(
|
||||||
state.clone(),
|
state.clone(),
|
||||||
merchant_account,
|
merchant_account,
|
||||||
key_store,
|
key_store,
|
||||||
attach_evidence_request.create_file_request,
|
attach_evidence_request.create_file_request,
|
||||||
)
|
))
|
||||||
.await?;
|
.await?;
|
||||||
let file_id = match &create_file_response {
|
let file_id = match &create_file_response {
|
||||||
services::ApplicationResponse::Json(res) => res.file_id.clone(),
|
services::ApplicationResponse::Json(res) => res.file_id.clone(),
|
||||||
|
|||||||
@ -563,7 +563,7 @@ where
|
|||||||
frm_routing_algorithm.zip(frm_connector_label)
|
frm_routing_algorithm.zip(frm_connector_label)
|
||||||
{
|
{
|
||||||
if let Some(frm_configs) = frm_configs.clone() {
|
if let Some(frm_configs) = frm_configs.clone() {
|
||||||
let mut updated_frm_info = make_frm_data_and_fraud_check_operation(
|
let mut updated_frm_info = Box::pin(make_frm_data_and_fraud_check_operation(
|
||||||
db,
|
db,
|
||||||
state,
|
state,
|
||||||
merchant_account,
|
merchant_account,
|
||||||
@ -572,7 +572,7 @@ where
|
|||||||
profile_id,
|
profile_id,
|
||||||
frm_configs.clone(),
|
frm_configs.clone(),
|
||||||
customer,
|
customer,
|
||||||
)
|
))
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
if is_frm_enabled {
|
if is_frm_enabled {
|
||||||
|
|||||||
@ -286,7 +286,7 @@ pub async fn get_client_secret_or_add_payment_method(
|
|||||||
let condition = req.card.is_some() || req.bank_transfer.is_some() || req.wallet.is_some();
|
let condition = req.card.is_some() || req.bank_transfer.is_some() || req.wallet.is_some();
|
||||||
|
|
||||||
if condition {
|
if condition {
|
||||||
add_payment_method(state, req, merchant_account, key_store).await
|
Box::pin(add_payment_method(state, req, merchant_account, key_store)).await
|
||||||
} else {
|
} else {
|
||||||
let payment_method_id = generate_id(consts::ID_LENGTH, "pm");
|
let payment_method_id = generate_id(consts::ID_LENGTH, "pm");
|
||||||
|
|
||||||
@ -393,14 +393,14 @@ pub async fn add_payment_method_data(
|
|||||||
match pmd {
|
match pmd {
|
||||||
api_models::payment_methods::PaymentMethodCreateData::Card(card) => {
|
api_models::payment_methods::PaymentMethodCreateData::Card(card) => {
|
||||||
helpers::validate_card_expiry(&card.card_exp_month, &card.card_exp_year)?;
|
helpers::validate_card_expiry(&card.card_exp_month, &card.card_exp_year)?;
|
||||||
let resp = add_card_to_locker(
|
let resp = Box::pin(add_card_to_locker(
|
||||||
&state,
|
&state,
|
||||||
req.clone(),
|
req.clone(),
|
||||||
&card,
|
&card,
|
||||||
&customer_id,
|
&customer_id,
|
||||||
&merchant_account,
|
&merchant_account,
|
||||||
None,
|
None,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError);
|
.change_context(errors::ApiErrorResponse::InternalServerError);
|
||||||
|
|
||||||
@ -555,14 +555,14 @@ pub async fn add_payment_method(
|
|||||||
api_enums::PaymentMethod::Card => match req.card.clone() {
|
api_enums::PaymentMethod::Card => match req.card.clone() {
|
||||||
Some(card) => {
|
Some(card) => {
|
||||||
helpers::validate_card_expiry(&card.card_exp_month, &card.card_exp_year)?;
|
helpers::validate_card_expiry(&card.card_exp_month, &card.card_exp_year)?;
|
||||||
add_card_to_locker(
|
Box::pin(add_card_to_locker(
|
||||||
&state,
|
&state,
|
||||||
req.clone(),
|
req.clone(),
|
||||||
&card,
|
&card,
|
||||||
&customer_id,
|
&customer_id,
|
||||||
merchant_account,
|
merchant_account,
|
||||||
None,
|
None,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||||
.attach_printable("Add Card Failed")
|
.attach_printable("Add Card Failed")
|
||||||
@ -888,14 +888,14 @@ pub async fn update_customer_payment_method(
|
|||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
// Add the updated payment method data to locker
|
// Add the updated payment method data to locker
|
||||||
let (mut add_card_resp, _) = add_card_to_locker(
|
let (mut add_card_resp, _) = Box::pin(add_card_to_locker(
|
||||||
&state,
|
&state,
|
||||||
new_pm.clone(),
|
new_pm.clone(),
|
||||||
&updated_card_details,
|
&updated_card_details,
|
||||||
&pm.customer_id,
|
&pm.customer_id,
|
||||||
&merchant_account,
|
&merchant_account,
|
||||||
Some(pm.locker_id.as_ref().unwrap_or(&pm.payment_method_id)),
|
Some(pm.locker_id.as_ref().unwrap_or(&pm.payment_method_id)),
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||||
.attach_printable("Failed to add updated payment method to locker")?;
|
.attach_printable("Failed to add updated payment method to locker")?;
|
||||||
|
|||||||
@ -660,14 +660,14 @@ pub async fn save_in_locker(
|
|||||||
.clone()
|
.clone()
|
||||||
.get_required_value("customer_id")?;
|
.get_required_value("customer_id")?;
|
||||||
match payment_method_request.card.clone() {
|
match payment_method_request.card.clone() {
|
||||||
Some(card) => payment_methods::cards::add_card_to_locker(
|
Some(card) => Box::pin(payment_methods::cards::add_card_to_locker(
|
||||||
state,
|
state,
|
||||||
payment_method_request,
|
payment_method_request,
|
||||||
&card,
|
&card,
|
||||||
&customer_id,
|
&customer_id,
|
||||||
merchant_account,
|
merchant_account,
|
||||||
None,
|
None,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||||
.attach_printable("Add Card Failed"),
|
.attach_printable("Add Card Failed"),
|
||||||
|
|||||||
@ -726,7 +726,7 @@ pub async fn validate_and_create_refund(
|
|||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
Ok(refund) => {
|
Ok(refund) => {
|
||||||
schedule_refund_execution(
|
Box::pin(schedule_refund_execution(
|
||||||
state,
|
state,
|
||||||
refund.clone(),
|
refund.clone(),
|
||||||
refund_type,
|
refund_type,
|
||||||
@ -736,7 +736,7 @@ pub async fn validate_and_create_refund(
|
|||||||
payment_intent,
|
payment_intent,
|
||||||
creds_identifier,
|
creds_identifier,
|
||||||
charges,
|
charges,
|
||||||
)
|
))
|
||||||
.await?
|
.await?
|
||||||
}
|
}
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
|||||||
@ -1070,7 +1070,7 @@ pub(crate) async fn create_event_and_trigger_outgoing_webhook(
|
|||||||
// may have an actix arbiter
|
// may have an actix arbiter
|
||||||
tokio::spawn(
|
tokio::spawn(
|
||||||
async move {
|
async move {
|
||||||
trigger_webhook_and_raise_event(
|
Box::pin(trigger_webhook_and_raise_event(
|
||||||
state,
|
state,
|
||||||
business_profile,
|
business_profile,
|
||||||
&cloned_key_store,
|
&cloned_key_store,
|
||||||
@ -1079,7 +1079,7 @@ pub(crate) async fn create_event_and_trigger_outgoing_webhook(
|
|||||||
delivery_attempt,
|
delivery_attempt,
|
||||||
Some(content),
|
Some(content),
|
||||||
process_tracker,
|
process_tracker,
|
||||||
)
|
))
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
.in_current_span(),
|
.in_current_span(),
|
||||||
|
|||||||
@ -231,7 +231,7 @@ pub async fn retry_delivery_attempt(
|
|||||||
.change_context(errors::ApiErrorResponse::InternalServerError)
|
.change_context(errors::ApiErrorResponse::InternalServerError)
|
||||||
.attach_printable("Failed to parse webhook event request information")?;
|
.attach_printable("Failed to parse webhook event request information")?;
|
||||||
|
|
||||||
super::trigger_webhook_and_raise_event(
|
Box::pin(super::trigger_webhook_and_raise_event(
|
||||||
state.clone(),
|
state.clone(),
|
||||||
business_profile,
|
business_profile,
|
||||||
&key_store,
|
&key_store,
|
||||||
@ -240,7 +240,7 @@ pub async fn retry_delivery_attempt(
|
|||||||
delivery_attempt,
|
delivery_attempt,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
)
|
))
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
let updated_event = store
|
let updated_event = store
|
||||||
|
|||||||
@ -41,7 +41,7 @@ pub async fn card_iin_info(
|
|||||||
Err(e) => return api::log_and_return_error_response(e),
|
Err(e) => return api::log_and_return_error_response(e),
|
||||||
};
|
};
|
||||||
|
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
Flow::CardsInfo,
|
Flow::CardsInfo,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -49,6 +49,6 @@ pub async fn card_iin_info(
|
|||||||
|state, auth, req, _| cards_info::retrieve_card_info(state, auth.merchant_account, req),
|
|state, auth, req, _| cards_info::retrieve_card_info(state, auth.merchant_account, req),
|
||||||
&*auth,
|
&*auth,
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ pub async fn customers_retrieve(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -61,7 +61,7 @@ pub async fn customers_retrieve(
|
|||||||
|state, auth, req, _| retrieve_customer(state, auth.merchant_account, auth.key_store, req),
|
|state, auth, req, _| retrieve_customer(state, auth.merchant_account, auth.key_store, req),
|
||||||
&*auth,
|
&*auth,
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ pub async fn retrieve_dispute(
|
|||||||
let dispute_id = dispute_types::DisputeId {
|
let dispute_id = dispute_types::DisputeId {
|
||||||
dispute_id: path.into_inner(),
|
dispute_id: path.into_inner(),
|
||||||
};
|
};
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -50,7 +50,7 @@ pub async fn retrieve_dispute(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
/// Disputes - List Disputes
|
/// Disputes - List Disputes
|
||||||
@ -85,7 +85,7 @@ pub async fn retrieve_disputes_list(
|
|||||||
) -> HttpResponse {
|
) -> HttpResponse {
|
||||||
let flow = Flow::DisputesList;
|
let flow = Flow::DisputesList;
|
||||||
let payload = payload.into_inner();
|
let payload = payload.into_inner();
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -97,7 +97,7 @@ pub async fn retrieve_disputes_list(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
/// Disputes - Accept Dispute
|
/// Disputes - Accept Dispute
|
||||||
|
|||||||
@ -36,7 +36,7 @@ pub async fn get_mandate(
|
|||||||
let mandate_id = mandates::MandateId {
|
let mandate_id = mandates::MandateId {
|
||||||
mandate_id: path.into_inner(),
|
mandate_id: path.into_inner(),
|
||||||
};
|
};
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -46,7 +46,7 @@ pub async fn get_mandate(
|
|||||||
},
|
},
|
||||||
&auth::ApiKeyAuth,
|
&auth::ApiKeyAuth,
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
/// Mandates - Revoke Mandate
|
/// Mandates - Revoke Mandate
|
||||||
|
|||||||
@ -112,7 +112,7 @@ pub async fn payments_link_list(
|
|||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
let flow = Flow::PaymentLinkList;
|
let flow = Flow::PaymentLinkList;
|
||||||
let payload = payload.into_inner();
|
let payload = payload.into_inner();
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -120,7 +120,7 @@ pub async fn payments_link_list(
|
|||||||
|state, auth, payload, _| list_payment_link(state, auth.merchant_account, payload),
|
|state, auth, payload, _| list_payment_link(state, auth.merchant_account, payload),
|
||||||
&auth::ApiKeyAuth,
|
&auth::ApiKeyAuth,
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -949,7 +949,7 @@ pub async fn payments_list(
|
|||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
let flow = Flow::PaymentsList;
|
let flow = Flow::PaymentsList;
|
||||||
let payload = payload.into_inner();
|
let payload = payload.into_inner();
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -961,7 +961,7 @@ pub async fn payments_list(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
#[instrument(skip_all, fields(flow = ?Flow::PaymentsList))]
|
#[instrument(skip_all, fields(flow = ?Flow::PaymentsList))]
|
||||||
@ -973,7 +973,7 @@ pub async fn payments_list_by_filter(
|
|||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
let flow = Flow::PaymentsList;
|
let flow = Flow::PaymentsList;
|
||||||
let payload = payload.into_inner();
|
let payload = payload.into_inner();
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -983,7 +983,7 @@ pub async fn payments_list_by_filter(
|
|||||||
},
|
},
|
||||||
&auth::JWTAuth(Permission::PaymentRead),
|
&auth::JWTAuth(Permission::PaymentRead),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
#[instrument(skip_all, fields(flow = ?Flow::PaymentsList))]
|
#[instrument(skip_all, fields(flow = ?Flow::PaymentsList))]
|
||||||
@ -995,7 +995,7 @@ pub async fn get_filters_for_payments(
|
|||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
let flow = Flow::PaymentsList;
|
let flow = Flow::PaymentsList;
|
||||||
let payload = payload.into_inner();
|
let payload = payload.into_inner();
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -1005,7 +1005,7 @@ pub async fn get_filters_for_payments(
|
|||||||
},
|
},
|
||||||
&auth::JWTAuth(Permission::PaymentRead),
|
&auth::JWTAuth(Permission::PaymentRead),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1016,7 +1016,7 @@ pub async fn get_payment_filters(
|
|||||||
req: actix_web::HttpRequest,
|
req: actix_web::HttpRequest,
|
||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
let flow = Flow::PaymentsFilters;
|
let flow = Flow::PaymentsFilters;
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -1026,7 +1026,7 @@ pub async fn get_payment_filters(
|
|||||||
},
|
},
|
||||||
&auth::JWTAuth(Permission::PaymentRead),
|
&auth::JWTAuth(Permission::PaymentRead),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ pub async fn retrieve_poll_status(
|
|||||||
let poll_id = PollId {
|
let poll_id = PollId {
|
||||||
poll_id: path.into_inner(),
|
poll_id: path.into_inner(),
|
||||||
};
|
};
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -41,6 +41,6 @@ pub async fn retrieve_poll_status(
|
|||||||
|state, auth, req, _| poll::retrieve_poll_status(state, req, auth.merchant_account),
|
|state, auth, req, _| poll::retrieve_poll_status(state, req, auth.merchant_account),
|
||||||
&auth::PublishableKeyAuth,
|
&auth::PublishableKeyAuth,
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|||||||
@ -182,7 +182,7 @@ pub async fn refunds_update(
|
|||||||
let flow = Flow::RefundsUpdate;
|
let flow = Flow::RefundsUpdate;
|
||||||
let mut refund_update_req = json_payload.into_inner();
|
let mut refund_update_req = json_payload.into_inner();
|
||||||
refund_update_req.refund_id = path.into_inner();
|
refund_update_req.refund_id = path.into_inner();
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -190,7 +190,7 @@ pub async fn refunds_update(
|
|||||||
|state, auth, req, _| refund_update_core(state, auth.merchant_account, req),
|
|state, auth, req, _| refund_update_core(state, auth.merchant_account, req),
|
||||||
&auth::ApiKeyAuth,
|
&auth::ApiKeyAuth,
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
/// Refunds - List
|
/// Refunds - List
|
||||||
@ -215,7 +215,7 @@ pub async fn refunds_list(
|
|||||||
payload: web::Json<api_models::refunds::RefundListRequest>,
|
payload: web::Json<api_models::refunds::RefundListRequest>,
|
||||||
) -> HttpResponse {
|
) -> HttpResponse {
|
||||||
let flow = Flow::RefundsList;
|
let flow = Flow::RefundsList;
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -227,7 +227,7 @@ pub async fn refunds_list(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ pub async fn refunds_filter_list(
|
|||||||
payload: web::Json<api_models::payments::TimeRange>,
|
payload: web::Json<api_models::payments::TimeRange>,
|
||||||
) -> HttpResponse {
|
) -> HttpResponse {
|
||||||
let flow = Flow::RefundsList;
|
let flow = Flow::RefundsList;
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -265,7 +265,7 @@ pub async fn refunds_filter_list(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ pub async fn refunds_filter_list(
|
|||||||
#[cfg(feature = "olap")]
|
#[cfg(feature = "olap")]
|
||||||
pub async fn get_refunds_filters(state: web::Data<AppState>, req: HttpRequest) -> HttpResponse {
|
pub async fn get_refunds_filters(state: web::Data<AppState>, req: HttpRequest) -> HttpResponse {
|
||||||
let flow = Flow::RefundsFilters;
|
let flow = Flow::RefundsFilters;
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -298,6 +298,6 @@ pub async fn get_refunds_filters(state: web::Data<AppState>, req: HttpRequest) -
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|||||||
@ -259,7 +259,7 @@ pub async fn routing_update_default_config(
|
|||||||
json_payload: web::Json<Vec<routing_types::RoutableConnectorChoice>>,
|
json_payload: web::Json<Vec<routing_types::RoutableConnectorChoice>>,
|
||||||
transaction_type: &enums::TransactionType,
|
transaction_type: &enums::TransactionType,
|
||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
oss_api::server_wrap(
|
Box::pin(oss_api::server_wrap(
|
||||||
Flow::RoutingUpdateDefaultConfig,
|
Flow::RoutingUpdateDefaultConfig,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -281,7 +281,7 @@ pub async fn routing_update_default_config(
|
|||||||
#[cfg(feature = "release")]
|
#[cfg(feature = "release")]
|
||||||
&auth::JWTAuth(Permission::RoutingWrite),
|
&auth::JWTAuth(Permission::RoutingWrite),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ pub async fn routing_retrieve_default_config(
|
|||||||
req: HttpRequest,
|
req: HttpRequest,
|
||||||
transaction_type: &enums::TransactionType,
|
transaction_type: &enums::TransactionType,
|
||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
oss_api::server_wrap(
|
Box::pin(oss_api::server_wrap(
|
||||||
Flow::RoutingRetrieveDefaultConfig,
|
Flow::RoutingRetrieveDefaultConfig,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -309,7 +309,7 @@ pub async fn routing_retrieve_default_config(
|
|||||||
#[cfg(feature = "release")]
|
#[cfg(feature = "release")]
|
||||||
&auth::JWTAuth(Permission::RoutingRead),
|
&auth::JWTAuth(Permission::RoutingRead),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,7 +573,7 @@ pub async fn routing_retrieve_default_config_for_profiles(
|
|||||||
req: HttpRequest,
|
req: HttpRequest,
|
||||||
transaction_type: &enums::TransactionType,
|
transaction_type: &enums::TransactionType,
|
||||||
) -> impl Responder {
|
) -> impl Responder {
|
||||||
oss_api::server_wrap(
|
Box::pin(oss_api::server_wrap(
|
||||||
Flow::RoutingRetrieveDefaultConfig,
|
Flow::RoutingRetrieveDefaultConfig,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -598,7 +598,7 @@ pub async fn routing_retrieve_default_config_for_profiles(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,7 +615,7 @@ pub async fn routing_update_default_config_for_profile(
|
|||||||
updated_config: json_payload.into_inner(),
|
updated_config: json_payload.into_inner(),
|
||||||
profile_id: path.into_inner(),
|
profile_id: path.into_inner(),
|
||||||
};
|
};
|
||||||
oss_api::server_wrap(
|
Box::pin(oss_api::server_wrap(
|
||||||
Flow::RoutingUpdateDefaultConfig,
|
Flow::RoutingUpdateDefaultConfig,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -638,6 +638,6 @@ pub async fn routing_update_default_config_for_profile(
|
|||||||
#[cfg(feature = "release")]
|
#[cfg(feature = "release")]
|
||||||
&auth::JWTAuth(Permission::RoutingWrite),
|
&auth::JWTAuth(Permission::RoutingWrite),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ pub async fn list_initial_webhook_delivery_attempts(
|
|||||||
constraints,
|
constraints,
|
||||||
};
|
};
|
||||||
|
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -48,7 +48,7 @@ pub async fn list_initial_webhook_delivery_attempts(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ pub async fn list_webhook_delivery_attempts(
|
|||||||
initial_attempt_id,
|
initial_attempt_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -87,7 +87,7 @@ pub async fn list_webhook_delivery_attempts(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ pub async fn retry_webhook_delivery_attempt(
|
|||||||
event_id,
|
event_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
api::server_wrap(
|
Box::pin(api::server_wrap(
|
||||||
flow,
|
flow,
|
||||||
state,
|
state,
|
||||||
&req,
|
&req,
|
||||||
@ -126,6 +126,6 @@ pub async fn retry_webhook_delivery_attempt(
|
|||||||
req.headers(),
|
req.headers(),
|
||||||
),
|
),
|
||||||
api_locking::LockAction::NotApplicable,
|
api_locking::LockAction::NotApplicable,
|
||||||
)
|
))
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,7 +114,7 @@ impl ProcessTrackerWorkflow<AppState> for OutgoingWebhookRetryWorkflow {
|
|||||||
.peek()
|
.peek()
|
||||||
.parse_struct("OutgoingWebhookRequestContent")?;
|
.parse_struct("OutgoingWebhookRequestContent")?;
|
||||||
|
|
||||||
webhooks_core::trigger_webhook_and_raise_event(
|
Box::pin(webhooks_core::trigger_webhook_and_raise_event(
|
||||||
state.clone(),
|
state.clone(),
|
||||||
business_profile,
|
business_profile,
|
||||||
&key_store,
|
&key_store,
|
||||||
@ -123,7 +123,7 @@ impl ProcessTrackerWorkflow<AppState> for OutgoingWebhookRetryWorkflow {
|
|||||||
delivery_attempt,
|
delivery_attempt,
|
||||||
None,
|
None,
|
||||||
Some(process),
|
Some(process),
|
||||||
)
|
))
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ impl ProcessTrackerWorkflow<AppState> for OutgoingWebhookRetryWorkflow {
|
|||||||
errors::ProcessTrackerError::EApiErrorResponse
|
errors::ProcessTrackerError::EApiErrorResponse
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
webhooks_core::trigger_webhook_and_raise_event(
|
Box::pin(webhooks_core::trigger_webhook_and_raise_event(
|
||||||
state.clone(),
|
state.clone(),
|
||||||
business_profile,
|
business_profile,
|
||||||
&key_store,
|
&key_store,
|
||||||
@ -177,7 +177,7 @@ impl ProcessTrackerWorkflow<AppState> for OutgoingWebhookRetryWorkflow {
|
|||||||
delivery_attempt,
|
delivery_attempt,
|
||||||
Some(content),
|
Some(content),
|
||||||
Some(process),
|
Some(process),
|
||||||
)
|
))
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
// Resource status has changed since the event was created, finish task
|
// Resource status has changed since the event was created, finish task
|
||||||
|
|||||||
Reference in New Issue
Block a user