refactor(connector): airwallex convert init payment to preprocessing (#4842)

This commit is contained in:
Hrithikesh
2024-06-03 16:21:49 +05:30
committed by GitHub
parent 67f017f6f0
commit e5da133fe0
22 changed files with 851 additions and 55 deletions

View File

@ -1885,6 +1885,14 @@ where
dyn api::Connector:
services::api::ConnectorIntegration<F, Req, router_types::PaymentsResponseData>,
{
if !is_operation_complete_authorize(&operation)
&& connector
.connector_name
.is_pre_processing_required_before_authorize()
{
router_data = router_data.preprocessing_steps(state, connector).await?;
return Ok((router_data, should_continue_payment));
}
//TODO: For ACH transfers, if preprocessing_step is not required for connectors encountered in future, add the check
let router_data_and_should_continue_payment = match payment_data.payment_method_data.clone() {
Some(api_models::payments::PaymentMethodData::BankTransfer(data)) => match data.deref() {

View File

@ -928,7 +928,6 @@ impl<const T: u8>
default_imp_for_pre_processing_steps!(
connector::Aci,
connector::Airwallex,
connector::Authorizedotnet,
connector::Bambora,
connector::Billwerk,

View File

@ -322,13 +322,14 @@ pub async fn authorize_preprocessing_steps<F: Clone>(
),
],
);
let authorize_router_data = helpers::router_data_type_conversion::<_, F, _, _, _, _>(
let mut authorize_router_data = helpers::router_data_type_conversion::<_, F, _, _, _, _>(
resp.clone(),
router_data.request.to_owned(),
resp.response,
);
if connector.connector_name == api_models::enums::Connector::Airwallex {
authorize_router_data.reference_id = resp.reference_id;
}
Ok(authorize_router_data)
} else {
Ok(router_data.clone())