feat(router): Add /apply-payment-method-data endpoint (v2)

This commit is contained in:
Anurag Thakur
2025-10-16 08:25:06 +05:30
parent 03a7cd2ef7
commit b85f94bfe3
13 changed files with 351 additions and 5 deletions

View File

@ -206,6 +206,13 @@ impl ApiEventMetric for payments::PaymentMethodBalanceCheckResponse {
}
}
#[cfg(feature = "v2")]
impl ApiEventMetric for payments::ApplyPaymentMethodDataResponse {
fn get_api_event_type(&self) -> Option<ApiEventsType> {
None
}
}
#[cfg(feature = "v2")]
impl ApiEventMetric for PaymentsRequest {
fn get_api_event_type(&self) -> Option<ApiEventsType> {

View File

@ -3156,6 +3156,28 @@ pub enum BalanceCheckPaymentMethodData {
GiftCard(GiftCardData),
}
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone, ToSchema)]
pub struct ApplyPaymentMethodDataRequest {
pub payment_methods: Vec<BalanceCheckPaymentMethodData>,
}
#[derive(Debug, serde::Serialize, Clone, ToSchema)]
pub struct ApplyPaymentMethodDataResponse {
pub remaining_amount: MinorUnit,
pub requires_additional_pm_data: bool,
pub surcharge_details: Option<Vec<ApplyPaymentMethodDataSurchargeResponseItem>>,
}
#[derive(Debug, serde::Serialize, Clone, ToSchema)]
pub struct ApplyPaymentMethodDataSurchargeResponseItem {
#[schema(value_type = PaymentMethod)]
pub payment_method_type: api_enums::PaymentMethod,
#[schema(value_type = PaymentMethodType)]
pub payment_method_subtype: api_enums::PaymentMethodType,
#[schema(value_type = Option<SurchargeDetailsResponse>)]
pub surcharge_details: Option<payment_methods::SurchargeDetailsResponse>,
}
#[derive(serde::Deserialize, serde::Serialize, Debug, Clone, ToSchema, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub struct BHNGiftCardDetails {