mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-03 21:37:41 +08:00
fix: return currency in payment methods list response (#3516)
This commit is contained in:
@ -641,6 +641,10 @@ pub struct PaymentMethodListResponse {
|
|||||||
#[schema(example = "https://www.google.com")]
|
#[schema(example = "https://www.google.com")]
|
||||||
pub redirect_url: Option<String>,
|
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
|
/// Information about the payment method
|
||||||
#[schema(value_type = Vec<PaymentMethodList>,example = json!(
|
#[schema(value_type = Vec<PaymentMethodList>,example = json!(
|
||||||
[
|
[
|
||||||
|
|||||||
@ -1803,6 +1803,7 @@ pub async fn list_payment_methods(
|
|||||||
payment_method_types: bank_transfer_payment_method_types,
|
payment_method_types: bank_transfer_payment_method_types,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
let currency = payment_intent.as_ref().and_then(|pi| pi.currency);
|
||||||
let merchant_surcharge_configs =
|
let merchant_surcharge_configs =
|
||||||
if let Some((payment_attempt, payment_intent, business_profile)) = payment_attempt
|
if let Some((payment_attempt, payment_intent, business_profile)) = payment_attempt
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@ -1865,6 +1866,7 @@ pub async fn list_payment_methods(
|
|||||||
show_surcharge_breakup_screen: merchant_surcharge_configs
|
show_surcharge_breakup_screen: merchant_surcharge_configs
|
||||||
.show_surcharge_breakup_screen
|
.show_surcharge_breakup_screen
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
|
currency,
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user