feat(events): Add payment cancel events (#4166)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sampras Lopes
2024-04-15 16:05:40 +05:30
committed by GitHub
parent c3c8d09453
commit dea21c65ff
34 changed files with 269 additions and 91 deletions

View File

@ -56,10 +56,11 @@ pub async fn payment_intents_create(
state.into_inner(),
&req,
create_payment_req,
|state, auth, req, _| {
|state, auth, req, req_state| {
let eligible_connectors = req.connector.clone();
payments::payments_core::<api_types::Authorize, api_types::PaymentsResponse, _, _, _,Oss>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentCreate,
@ -116,9 +117,10 @@ pub async fn payment_intents_retrieve(
state.into_inner(),
&req,
payload,
|state, auth, payload, _| {
|state, auth, payload, req_state| {
payments::payments_core::<api_types::PSync, api_types::PaymentsResponse, _, _, _, Oss>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentStatus,
@ -185,9 +187,10 @@ pub async fn payment_intents_retrieve_with_gateway_creds(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth, req, req_state| {
payments::payments_core::<api_types::PSync, payment_types::PaymentsResponse, _, _, _,Oss>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentStatus,
@ -249,10 +252,11 @@ pub async fn payment_intents_update(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth, req, req_state| {
let eligible_connectors = req.connector.clone();
payments::payments_core::<api_types::Authorize, api_types::PaymentsResponse, _, _, _,Oss>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentUpdate,
@ -320,10 +324,11 @@ pub async fn payment_intents_confirm(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth, req, req_state| {
let eligible_connectors = req.connector.clone();
payments::payments_core::<api_types::Authorize, api_types::PaymentsResponse, _, _, _,Oss>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentConfirm,
@ -381,9 +386,10 @@ pub async fn payment_intents_capture(
state.into_inner(),
&req,
payload,
|state, auth, payload, _| {
|state, auth, payload, req_state| {
payments::payments_core::<api_types::Capture, api_types::PaymentsResponse, _, _, _,Oss>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentCapture,
@ -445,9 +451,10 @@ pub async fn payment_intents_cancel(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth, req, req_state| {
payments::payments_core::<api_types::Void, api_types::PaymentsResponse, _, _, _, Oss>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentCancel,

View File

@ -52,7 +52,7 @@ pub async fn setup_intents_create(
state.into_inner(),
&req,
create_payment_req,
|state, auth, req, _| {
|state, auth, req, req_state| {
payments::payments_core::<
api_types::SetupMandate,
api_types::PaymentsResponse,
@ -62,6 +62,7 @@ pub async fn setup_intents_create(
Oss,
>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentCreate,
@ -118,9 +119,10 @@ pub async fn setup_intents_retrieve(
state.into_inner(),
&req,
payload,
|state, auth, payload, _| {
|state, auth, payload, req_state| {
payments::payments_core::<api_types::PSync, api_types::PaymentsResponse, _, _, _, Oss>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentStatus,
@ -183,7 +185,7 @@ pub async fn setup_intents_update(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth, req, req_state| {
payments::payments_core::<
api_types::SetupMandate,
api_types::PaymentsResponse,
@ -193,6 +195,7 @@ pub async fn setup_intents_update(
Oss,
>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentUpdate,
@ -256,7 +259,7 @@ pub async fn setup_intents_confirm(
state.into_inner(),
&req,
payload,
|state, auth, req, _| {
|state, auth, req, req_state| {
payments::payments_core::<
api_types::SetupMandate,
api_types::PaymentsResponse,
@ -266,6 +269,7 @@ pub async fn setup_intents_confirm(
Oss,
>(
state,
req_state,
auth.merchant_account,
auth.key_store,
payments::PaymentConfirm,