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

@ -129,6 +129,7 @@ Never share your secret api keys. Keep them guarded and secure.
routes::payments::list_payment_methods,
routes::payments::payments_list,
routes::payments::payment_check_gift_card_balance,
routes::payments::payments_apply_pm_data,
//Routes for payment methods
routes::payment_method::create_payment_method_api,
@ -559,6 +560,9 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::BillingConnectorPaymentDetails,
api_models::payments::PaymentMethodBalanceCheckResponse,
api_models::payments::PaymentMethodBalanceCheckRequest,
api_models::payments::ApplyPaymentMethodDataRequest,
api_models::payments::ApplyPaymentMethodDataResponse,
api_models::payments::ApplyPaymentMethodDataSurchargeResponseItem,
api_models::enums::PaymentConnectorTransmission,
api_models::enums::TriggeredBy,
api_models::payments::PaymentAttemptResponse,

View File

@ -1313,3 +1313,30 @@ pub fn payments_list() {}
security(("publishable_key" = []))
)]
pub fn payment_check_gift_card_balance() {}
/// Payments - Apply PM Data
///
/// Apply the payment method data and recalculate surcharge
#[cfg(feature = "v2")]
#[utoipa::path(
post,
path = "/v2/payments/{id}/apply-payment-method-data",
params(
("id" = String, Path, description = "The global payment id"),
(
"X-Profile-Id" = String, Header,
description = "Profile ID associated to the payment intent",
example = "pro_abcdefghijklmnop"
),
),
request_body(
content = ApplyPaymentMethodDataRequest,
),
responses(
(status = 200, description = "Get the Payment Method Balance", body = ApplyPaymentMethodDataResponse),
),
tag = "Payments",
operation_id = "Apply Payment Method Data",
security(("publishable_key" = []))
)]
pub fn payments_apply_pm_data() {}