Skip to content

Commit

Permalink
refactor: stripe mandate
Browse files Browse the repository at this point in the history
  • Loading branch information
swangi-kumari committed Dec 20, 2024
1 parent db70b06 commit 7599a17
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions crates/router/src/core/payments/transformers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2597,10 +2597,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::PaymentsAuthoriz
payment_method_data: (payment_method_data.get_required_value("payment_method_data")?),
setup_future_usage: payment_data.payment_intent.setup_future_usage,
mandate_id: payment_data.mandate_id.clone(),
off_session: payment_data
.mandate_id
.as_ref()
.and(payment_data.payment_intent.off_session),
off_session: payment_data.mandate_id.as_ref().map(|_| true),
setup_mandate_details: payment_data.setup_mandate.clone(),
confirm: payment_data.payment_attempt.confirm,
statement_descriptor_suffix: payment_data.payment_intent.statement_descriptor_suffix,
Expand Down Expand Up @@ -3206,10 +3203,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::SetupMandateRequ
.get_required_value("payment_method_data")?),
statement_descriptor_suffix: payment_data.payment_intent.statement_descriptor_suffix,
setup_future_usage: payment_data.payment_intent.setup_future_usage,
off_session: payment_data
.mandate_id
.as_ref()
.and(payment_data.payment_intent.off_session),
off_session: payment_data.mandate_id.as_ref().map(|_| true),
mandate_id: payment_data.mandate_id.clone(),
setup_mandate_details: payment_data.setup_mandate,
customer_acceptance: payment_data.customer_acceptance,
Expand Down Expand Up @@ -3324,10 +3318,7 @@ impl<F: Clone> TryFrom<PaymentAdditionalData<'_, F>> for types::CompleteAuthoriz
Ok(Self {
setup_future_usage: payment_data.payment_intent.setup_future_usage,
mandate_id: payment_data.mandate_id.clone(),
off_session: payment_data
.mandate_id
.as_ref()
.and(payment_data.payment_intent.off_session),
off_session: payment_data.mandate_id.as_ref().map(|_| true),
setup_mandate_details: payment_data.setup_mandate.clone(),
confirm: payment_data.payment_attempt.confirm,
statement_descriptor_suffix: payment_data.payment_intent.statement_descriptor_suffix,
Expand Down

0 comments on commit 7599a17

Please sign in to comment.