feat(euclid): add a new variant in payment type i.e ppt_mandate (#5681)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Prajjwal Kumar
2024-08-27 19:40:01 +05:30
committed by GitHub
parent 716d76c53e
commit 350aeb378c
4 changed files with 59 additions and 6 deletions

View File

@ -208,10 +208,21 @@ where
}
})
}),
payment_type: Some(payment_data.setup_mandate.clone().map_or_else(
|| euclid_enums::PaymentType::NonMandate,
|_| euclid_enums::PaymentType::SetupMandate,
)),
payment_type: Some(
if payment_data.recurring_details.as_ref().is_some_and(|data| {
matches!(
data,
api_models::mandates::RecurringDetails::ProcessorPaymentToken(_)
)
}) {
euclid_enums::PaymentType::PptMandate
} else {
payment_data.setup_mandate.clone().map_or_else(
|| euclid_enums::PaymentType::NonMandate,
|_| euclid_enums::PaymentType::SetupMandate,
)
},
),
};
let payment_method_input = dsl_inputs::PaymentMethodInput {
payment_method: payment_data.payment_attempt.payment_method,