mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 13:30:39 +08:00
refactor(connector): airwallex convert init payment to preprocessing (#4842)
This commit is contained in:
@ -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() {
|
||||
|
||||
@ -928,7 +928,6 @@ impl<const T: u8>
|
||||
|
||||
default_imp_for_pre_processing_steps!(
|
||||
connector::Aci,
|
||||
connector::Airwallex,
|
||||
connector::Authorizedotnet,
|
||||
connector::Bambora,
|
||||
connector::Billwerk,
|
||||
|
||||
@ -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())
|
||||
|
||||
Reference in New Issue
Block a user