fix(api_request): make payment_method_data as optional (#4527)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Narayan Bhat
2024-05-03 13:50:17 +05:30
committed by GitHub
parent ecc97bc868
commit 83a1924668
12 changed files with 160 additions and 70 deletions

View File

@ -335,7 +335,9 @@ impl TryFrom<StripePaymentIntentRequest> for payments::PaymentsRequest {
pmd.payment_method_details
.as_ref()
.map(|spmd| payments::PaymentMethodDataRequest {
payment_method_data: payments::PaymentMethodData::from(spmd.to_owned()),
payment_method_data: Some(payments::PaymentMethodData::from(
spmd.to_owned(),
)),
billing: pmd.billing_details.clone().map(payments::Address::from),
})
}),

View File

@ -246,7 +246,9 @@ impl TryFrom<StripeSetupIntentRequest> for payments::PaymentsRequest {
pmd.payment_method_details
.as_ref()
.map(|spmd| payments::PaymentMethodDataRequest {
payment_method_data: payments::PaymentMethodData::from(spmd.to_owned()),
payment_method_data: Some(payments::PaymentMethodData::from(
spmd.to_owned(),
)),
billing: pmd.billing_details.clone().map(payments::Address::from),
})
}),