Skip to content

Commit

Permalink
list mandates add field pmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Aprabhat19 committed Jan 18, 2024
1 parent a59f377 commit c9d4467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions crates/api_models/src/mandates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ pub struct MandateResponse {
pub payment_method_id: String,
/// The payment method
pub payment_method: String,
/// The payment method type
pub payment_method_type: Option<String>,
/// The card details for mandate
pub card: Option<MandateCardDetails>,
/// Details about the customer’s acceptance
Expand Down
5 changes: 4 additions & 1 deletion crates/router/src/types/api/mandates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ impl MandateResponseExt for MandateResponse {
} else {
None
};

let payment_method_type = payment_method
.payment_method_type
.map(|pmt| pmt.to_string());
Ok(Self {
mandate_id: mandate.mandate_id,
customer_acceptance: Some(api::payments::CustomerAcceptance {
Expand All @@ -89,6 +91,7 @@ impl MandateResponseExt for MandateResponse {
card,
status: mandate.mandate_status,
payment_method: payment_method.payment_method.to_string(),
payment_method_type,
payment_method_id: mandate.payment_method_id,
})
}
Expand Down

0 comments on commit c9d4467

Please sign in to comment.