feat(router): add payments create-intent flow for v2 (#6193)

Co-authored-by: hrithikesh026 <hrithikesh.vm@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Hrithikesh <61539176+hrithikesh026@users.noreply.github.com>
This commit is contained in:
Sai Harsha Vardhan
2024-10-17 15:50:47 +05:30
committed by GitHub
parent 9576ee37a6
commit afa803e0f9
64 changed files with 2004 additions and 282 deletions

View File

@ -54,7 +54,7 @@ pub async fn customer_create(
state.into_inner(),
&req,
create_cust_req,
|state, auth, req, _| {
|state, auth: auth::AuthenticationData, req, _| {
customers::create_customer(state, auth.merchant_account, auth.key_store, req)
},
&auth::HeaderAuth(auth::ApiKeyAuth),
@ -92,7 +92,7 @@ pub async fn customer_retrieve(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth: auth::AuthenticationData, req, _| {
customers::retrieve_customer(state, auth.merchant_account, None, auth.key_store, req)
},
&auth::HeaderAuth(auth::ApiKeyAuth),
@ -142,7 +142,7 @@ pub async fn customer_update(
state.into_inner(),
&req,
cust_update_req,
|state, auth, req, _| {
|state, auth: auth::AuthenticationData, req, _| {
customers::update_customer(
state,
auth.merchant_account,
@ -225,7 +225,7 @@ pub async fn list_customer_payment_method_api(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth: auth::AuthenticationData, req, _| {
cards::do_list_customer_pm_fetch_customer_if_not_passed(
state,
auth.merchant_account,

View File

@ -71,7 +71,7 @@ pub async fn payment_intents_create(
state.into_inner(),
&req,
create_payment_req,
|state, auth, req, req_state| {
|state, auth: auth::AuthenticationData, req, req_state| {
let eligible_connectors = req.connector.clone();
payments::payments_core::<
api_types::Authorize,
@ -452,7 +452,7 @@ pub async fn payment_intents_capture(
state.into_inner(),
&req,
payload,
|state, auth, payload, req_state| {
|state, auth: auth::AuthenticationData, payload, req_state| {
payments::payments_core::<
api_types::Capture,
api_types::PaymentsResponse,
@ -581,7 +581,7 @@ pub async fn payment_intent_list(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth: auth::AuthenticationData, req, _| {
payments::list_payments(state, auth.merchant_account, None, auth.key_store, req)
},
&auth::HeaderAuth(auth::ApiKeyAuth),

View File

@ -49,7 +49,7 @@ pub async fn refund_create(
state.into_inner(),
&req,
create_refund_req,
|state, auth, req, _| {
|state, auth: auth::AuthenticationData, req, _| {
refunds::refund_create_core(state, auth.merchant_account, None, auth.key_store, req)
},
&auth::HeaderAuth(auth::ApiKeyAuth),
@ -93,7 +93,7 @@ pub async fn refund_retrieve_with_gateway_creds(
state.into_inner(),
&req,
refund_request,
|state, auth, refund_request, _| {
|state, auth: auth::AuthenticationData, refund_request, _| {
refunds::refund_response_wrapper(
state,
auth.merchant_account,
@ -136,7 +136,7 @@ pub async fn refund_retrieve(
state.into_inner(),
&req,
refund_request,
|state, auth, refund_request, _| {
|state, auth: auth::AuthenticationData, refund_request, _| {
refunds::refund_response_wrapper(
state,
auth.merchant_account,
@ -177,7 +177,9 @@ pub async fn refund_update(
state.into_inner(),
&req,
create_refund_update_req,
|state, auth, req, _| refunds::refund_update_core(state, auth.merchant_account, req),
|state, auth: auth::AuthenticationData, req, _| {
refunds::refund_update_core(state, auth.merchant_account, req)
},
&auth::HeaderAuth(auth::ApiKeyAuth),
api_locking::LockAction::NotApplicable,
))

View File

@ -58,7 +58,7 @@ pub async fn setup_intents_create(
state.into_inner(),
&req,
create_payment_req,
|state, auth, req, req_state| {
|state, auth: auth::AuthenticationData, req, req_state| {
payments::payments_core::<
api_types::SetupMandate,
api_types::PaymentsResponse,