feat(router): Return payment_experience in PML for payment (v2) (#8255)

This commit is contained in:
Anurag Thakur
2025-06-05 21:38:58 +05:30
committed by GitHub
parent 4a7c08fbc5
commit 9ce3d73e53
3 changed files with 19 additions and 0 deletions

View File

@ -21693,6 +21693,14 @@
"payment_method_subtype": {
"$ref": "#/components/schemas/PaymentMethodType"
},
"payment_experience": {
"allOf": [
{
"$ref": "#/components/schemas/PaymentExperience"
}
],
"nullable": true
},
"required_fields": {
"allOf": [
{

View File

@ -7605,6 +7605,10 @@ pub struct ResponsePaymentMethodTypesForPayments {
#[schema(example = "klarna", value_type = PaymentMethodType)]
pub payment_method_subtype: common_enums::PaymentMethodType,
/// The payment experience for the payment method
#[schema(value_type = Option<PaymentExperience>)]
pub payment_experience: Option<common_enums::PaymentExperience>,
/// payment method subtype specific information
#[serde(flatten)]
#[schema(value_type = Option<PaymentMethodSubtypeSpecificData>)]

View File

@ -87,6 +87,9 @@ impl FilteredPaymentMethodsEnabled {
payment_method_subtype: payment_methods_enabled
.payment_methods_enabled
.payment_method_subtype,
payment_experience: payment_methods_enabled
.payment_methods_enabled
.payment_experience,
},
)
.collect();
@ -100,6 +103,7 @@ struct RequiredFieldsForEnabledPaymentMethod {
required_field: Option<Vec<api_models::payment_methods::RequiredFieldInfo>>,
payment_method_subtype: common_enums::PaymentMethodType,
payment_method_type: common_enums::PaymentMethod,
payment_experience: Option<common_enums::PaymentExperience>,
}
/// Container to hold the filtered payment methods enabled with required fields
@ -110,6 +114,7 @@ struct RequiredFieldsAndSurchargeForEnabledPaymentMethodType {
required_field: Option<Vec<api_models::payment_methods::RequiredFieldInfo>>,
payment_method_subtype: common_enums::PaymentMethodType,
payment_method_type: common_enums::PaymentMethod,
payment_experience: Option<common_enums::PaymentExperience>,
surcharge: Option<api_models::payment_methods::SurchargeDetailsResponse>,
}
@ -127,6 +132,7 @@ impl RequiredFieldsAndSurchargeForEnabledPaymentMethodTypes {
api_models::payments::ResponsePaymentMethodTypesForPayments {
payment_method_type: payment_methods_enabled.payment_method_type,
payment_method_subtype: payment_methods_enabled.payment_method_subtype,
payment_experience: payment_methods_enabled.payment_experience,
required_fields: payment_methods_enabled.required_field,
surcharge_details: payment_methods_enabled.surcharge,
extra_information: None,
@ -153,6 +159,7 @@ impl RequiredFieldsForEnabledPaymentMethodTypes {
payment_method_type: payment_methods_enabled.payment_method_type,
required_field: payment_methods_enabled.required_field,
payment_method_subtype: payment_methods_enabled.payment_method_subtype,
payment_experience: payment_methods_enabled.payment_experience,
surcharge: None,
},
)