fix: return currency in payment methods list response (#3516)

This commit is contained in:
Hrithikesh
2024-02-05 16:18:55 +05:30
committed by GitHub
parent be22d60dda
commit a9c0d0c554
2 changed files with 6 additions and 0 deletions

View File

@ -641,6 +641,10 @@ pub struct PaymentMethodListResponse {
#[schema(example = "https://www.google.com")]
pub redirect_url: Option<String>,
/// currency of the Payment to be done
#[schema(example = "USD")]
pub currency: Option<api_enums::Currency>,
/// Information about the payment method
#[schema(value_type = Vec<PaymentMethodList>,example = json!(
[

View File

@ -1803,6 +1803,7 @@ pub async fn list_payment_methods(
payment_method_types: bank_transfer_payment_method_types,
});
}
let currency = payment_intent.as_ref().and_then(|pi| pi.currency);
let merchant_surcharge_configs =
if let Some((payment_attempt, payment_intent, business_profile)) = payment_attempt
.as_ref()
@ -1865,6 +1866,7 @@ pub async fn list_payment_methods(
show_surcharge_breakup_screen: merchant_surcharge_configs
.show_surcharge_breakup_screen
.unwrap_or_default(),
currency,
},
))
}