mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
fix(router): make payment type optional in payments request (#2465)
This commit is contained in:
@ -301,8 +301,7 @@ pub struct PaymentsRequest {
|
|||||||
|
|
||||||
/// The type of the payment that differentiates between normal and various types of mandate payments
|
/// The type of the payment that differentiates between normal and various types of mandate payments
|
||||||
#[schema(value_type = Option<PaymentType>)]
|
#[schema(value_type = Option<PaymentType>)]
|
||||||
#[serde(default)]
|
pub payment_type: Option<api_enums::PaymentType>,
|
||||||
pub payment_type: api_enums::PaymentType,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, Clone, Copy)]
|
#[derive(Default, Debug, Clone, Copy)]
|
||||||
|
|||||||
@ -871,7 +871,7 @@ where
|
|||||||
// the operation are flow agnostic, and the flow is only required in the post_update_tracker
|
// the operation are flow agnostic, and the flow is only required in the post_update_tracker
|
||||||
// Thus the flow can be generated just before calling the connector instead of explicitly passing it here.
|
// Thus the flow can be generated just before calling the connector instead of explicitly passing it here.
|
||||||
|
|
||||||
match req.payment_type {
|
match req.payment_type.unwrap_or_default() {
|
||||||
api_models::enums::PaymentType::Normal
|
api_models::enums::PaymentType::Normal
|
||||||
| api_models::enums::PaymentType::RecurringMandate
|
| api_models::enums::PaymentType::RecurringMandate
|
||||||
| api_models::enums::PaymentType::NewMandate => payments::payments_core::<
|
| api_models::enums::PaymentType::NewMandate => payments::payments_core::<
|
||||||
|
|||||||
Reference in New Issue
Block a user