Skip to content

Commit

Permalink
fix(router): make payment type optional in payments request (#2465)
Browse files Browse the repository at this point in the history
  • Loading branch information
vspecky authored Oct 5, 2023
1 parent bb2ba08 commit b5cc748
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions crates/api_models/src/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,7 @@ pub struct PaymentsRequest {

/// The type of the payment that differentiates between normal and various types of mandate payments
#[schema(value_type = Option<PaymentType>)]
#[serde(default)]
pub payment_type: api_enums::PaymentType,
pub payment_type: Option<api_enums::PaymentType>,
}

#[derive(Default, Debug, Clone, Copy)]
Expand Down
2 changes: 1 addition & 1 deletion crates/router/src/routes/payments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ where
// 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.

match req.payment_type {
match req.payment_type.unwrap_or_default() {
api_models::enums::PaymentType::Normal
| api_models::enums::PaymentType::RecurringMandate
| api_models::enums::PaymentType::NewMandate => payments::payments_core::<
Expand Down

0 comments on commit b5cc748

Please sign in to comment.