mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(router): add request_external_three_ds_authentication flag in payment_method_list_response (#4864)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d413e1a8a5
commit
fcf52973f4
@ -791,6 +791,10 @@ pub struct PaymentMethodListResponse {
|
|||||||
|
|
||||||
#[schema(value_type = Option<PaymentType>)]
|
#[schema(value_type = Option<PaymentType>)]
|
||||||
pub payment_type: Option<api_enums::PaymentType>,
|
pub payment_type: Option<api_enums::PaymentType>,
|
||||||
|
|
||||||
|
/// flag to indicate whether to perform external 3ds authentication
|
||||||
|
#[schema(example = true)]
|
||||||
|
pub request_external_three_ds_authentication: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Eq, PartialEq, Hash, Debug, serde::Deserialize, ToSchema)]
|
#[derive(Eq, PartialEq, Hash, Debug, serde::Deserialize, ToSchema)]
|
||||||
|
|||||||
@ -2572,6 +2572,10 @@ pub async fn list_payment_methods(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
let currency = payment_intent.as_ref().and_then(|pi| pi.currency);
|
let currency = payment_intent.as_ref().and_then(|pi| pi.currency);
|
||||||
|
let request_external_three_ds_authentication = payment_intent
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|intent| intent.request_external_three_ds_authentication)
|
||||||
|
.unwrap_or(false);
|
||||||
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()
|
||||||
@ -2627,6 +2631,7 @@ pub async fn list_payment_methods(
|
|||||||
.show_surcharge_breakup_screen
|
.show_surcharge_breakup_screen
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
currency,
|
currency,
|
||||||
|
request_external_three_ds_authentication,
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13471,7 +13471,8 @@
|
|||||||
"currency",
|
"currency",
|
||||||
"payment_methods",
|
"payment_methods",
|
||||||
"mandate_payment",
|
"mandate_payment",
|
||||||
"show_surcharge_breakup_screen"
|
"show_surcharge_breakup_screen",
|
||||||
|
"request_external_three_ds_authentication"
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"redirect_url": {
|
"redirect_url": {
|
||||||
@ -13518,6 +13519,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"nullable": true
|
"nullable": true
|
||||||
|
},
|
||||||
|
"request_external_three_ds_authentication": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "flag to indicate whether to perform external 3ds authentication",
|
||||||
|
"example": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user