mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
fix(payments): populate mandate_data in the response body of the PaymentsCreate endpoint (#1715)
This commit is contained in:
@ -183,6 +183,7 @@ where
|
||||
&operation,
|
||||
payment_data.ephemeral_key,
|
||||
payment_data.sessions_token,
|
||||
payment_data.setup_mandate,
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -273,6 +274,7 @@ pub fn payments_to_payments_response<R, Op>(
|
||||
operation: &Op,
|
||||
ephemeral_key_option: Option<ephemeral_key::EphemeralKey>,
|
||||
session_tokens: Vec<api::SessionToken>,
|
||||
mandate_data: Option<api_models::payments::MandateData>,
|
||||
) -> RouterResponse<api::PaymentsResponse>
|
||||
where
|
||||
Op: Debug,
|
||||
@ -416,6 +418,10 @@ where
|
||||
.and_then(|cus| cus.phone.as_ref().map(|s| s.to_owned())),
|
||||
)
|
||||
.set_mandate_id(mandate_id)
|
||||
.set_mandate_data(
|
||||
mandate_data.map(api::MandateData::from),
|
||||
auth_flow == services::AuthFlow::Merchant,
|
||||
)
|
||||
.set_description(payment_intent.description)
|
||||
.set_refunds(refunds_response) // refunds.iter().map(refund_to_refund_response),
|
||||
.set_disputes(disputes_response)
|
||||
|
||||
Reference in New Issue
Block a user