feat(core): accept gateway credentials in the request body in payments and refunds (#766)

This commit is contained in:
Abhishek
2023-03-21 14:37:41 +05:30
committed by GitHub
parent d302b286b8
commit cb188f92a6
35 changed files with 748 additions and 130 deletions

View File

@ -50,6 +50,7 @@ async fn payments_incoming_webhook_flow<W: api::OutgoingWebhookType>(
force_sync: true,
connector: None,
param: None,
merchant_connector_details: None,
},
services::AuthFlow::Merchant,
consume_or_trigger_flow,
@ -157,15 +158,22 @@ async fn refunds_incoming_webhook_flow<W: api::OutgoingWebhookType>(
)
})?
} else {
refunds::refund_retrieve_core(&state, merchant_account.clone(), refund_id.to_owned())
.await
.change_context(errors::WebhooksFlowError::RefundsCoreFailed)
.attach_printable_lazy(|| {
format!(
"Failed while updating refund: refund_id: {}",
refund_id.to_owned()
)
})?
refunds::refund_retrieve_core(
&state,
merchant_account.clone(),
api_models::refunds::RefundsRetrieveRequest {
refund_id: refund_id.to_owned(),
merchant_connector_details: None,
},
)
.await
.change_context(errors::WebhooksFlowError::RefundsCoreFailed)
.attach_printable_lazy(|| {
format!(
"Failed while updating refund: refund_id: {}",
refund_id.to_owned()
)
})?
};
let event_type: enums::EventType = updated_refund
.refund_status