feat(events): Add events framework for registering events (#4115)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sampras Lopes
2024-04-10 18:08:40 +05:30
committed by GitHub
parent c99e038a48
commit 3963219e44
53 changed files with 756 additions and 291 deletions

View File

@ -28,7 +28,7 @@ pub async fn create_payment_method_api(
state,
&req,
json_payload.into_inner(),
|state, auth, req| async move {
|state, auth, req, _| async move {
Box::pin(cards::add_payment_method(
state,
req,
@ -61,7 +61,7 @@ pub async fn list_payment_method_api(
state,
&req,
payload,
|state, auth, req| {
|state, auth, req, _| {
cards::list_payment_methods(state, auth.merchant_account, auth.key_store, req)
},
&*auth,
@ -113,7 +113,7 @@ pub async fn list_customer_payment_method_api(
state,
&req,
payload,
|state, auth, req| {
|state, auth, req, _| {
cards::do_list_customer_pm_fetch_customer_if_not_passed(
state,
auth.merchant_account,
@ -169,7 +169,7 @@ pub async fn list_customer_payment_method_api_client(
state,
&req,
payload,
|state, auth, req| {
|state, auth, req, _| {
cards::do_list_customer_pm_fetch_customer_if_not_passed(
state,
auth.merchant_account,
@ -201,7 +201,7 @@ pub async fn payment_method_retrieve_api(
state,
&req,
payload,
|state, auth, pm| cards::retrieve_payment_method(state, pm, auth.key_store),
|state, auth, pm, _| cards::retrieve_payment_method(state, pm, auth.key_store),
&auth::ApiKeyAuth,
api_locking::LockAction::NotApplicable,
))
@ -223,7 +223,7 @@ pub async fn payment_method_update_api(
state,
&req,
json_payload.into_inner(),
|state, auth, payload| {
|state, auth, payload, _| {
cards::update_customer_payment_method(
state,
auth.merchant_account,
@ -253,7 +253,7 @@ pub async fn payment_method_delete_api(
state,
&req,
pm,
|state, auth, req| {
|state, auth, req, _| {
cards::delete_payment_method(state, auth.merchant_account, req, auth.key_store)
},
&auth::ApiKeyAuth,
@ -275,7 +275,7 @@ pub async fn list_countries_currencies_for_connector_payment_method(
state,
&req,
payload,
|state, _auth: auth::AuthenticationData, req| {
|state, _auth: auth::AuthenticationData, req, _| {
cards::list_countries_currencies_for_connector_payment_method(state, req)
},
#[cfg(not(feature = "release"))]
@ -312,7 +312,7 @@ pub async fn default_payment_method_set_api(
state,
&req,
payload,
|_state, auth: auth::AuthenticationData, default_payment_method| {
|_state, auth: auth::AuthenticationData, default_payment_method, _| {
cards::set_default_payment_method(
db,
auth.merchant_account.merchant_id,