mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 17:19:15 +08:00
refactor(router): Make Gift Card Balance Check API Generic (v2) (#9856)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -557,8 +557,8 @@ Never share your secret api keys. Keep them guarded and secure.
|
||||
api_models::payments::RequestSurchargeDetails,
|
||||
api_models::payments::PaymentRevenueRecoveryMetadata,
|
||||
api_models::payments::BillingConnectorPaymentDetails,
|
||||
api_models::payments::GiftCardBalanceCheckResponse,
|
||||
api_models::payments::PaymentsGiftCardBalanceCheckRequest,
|
||||
api_models::payments::PaymentMethodBalanceCheckResponse,
|
||||
api_models::payments::PaymentMethodBalanceCheckRequest,
|
||||
api_models::enums::PaymentConnectorTransmission,
|
||||
api_models::enums::TriggeredBy,
|
||||
api_models::payments::PaymentAttemptResponse,
|
||||
@ -633,6 +633,7 @@ Never share your secret api keys. Keep them guarded and secure.
|
||||
api_models::ephemeral_key::ClientSecretResponse,
|
||||
api_models::payments::CustomerDetails,
|
||||
api_models::payments::GiftCardData,
|
||||
api_models::payments::BalanceCheckPaymentMethodData,
|
||||
api_models::payments::GiftCardDetails,
|
||||
api_models::payments::BHNGiftCardDetails,
|
||||
api_models::payments::MobilePaymentData,
|
||||
|
||||
@ -1307,13 +1307,13 @@ pub fn list_payment_methods() {}
|
||||
)]
|
||||
pub fn payments_list() {}
|
||||
|
||||
/// Payments - Gift Card Balance Check
|
||||
/// Payments - Payment Method Balance Check
|
||||
///
|
||||
/// Check the balance of the provided gift card. This endpoint also returns whether the gift card balance is enough to cover the entire amount or another payment method is needed
|
||||
/// Check the balance of the provided payment method. Also validates whether the PM currency matches the payment currency
|
||||
#[cfg(feature = "v2")]
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/v2/payments/{id}/check-gift-card-balance",
|
||||
post,
|
||||
path = "/v2/payments/{id}/payment-methods/check-balance",
|
||||
params(
|
||||
("id" = String, Path, description = "The global payment id"),
|
||||
(
|
||||
@ -1323,13 +1323,13 @@ pub fn payments_list() {}
|
||||
),
|
||||
),
|
||||
request_body(
|
||||
content = PaymentsGiftCardBalanceCheckRequest,
|
||||
content = PaymentMethodBalanceCheckRequest,
|
||||
),
|
||||
responses(
|
||||
(status = 200, description = "Get the Gift Card Balance", body = GiftCardBalanceCheckResponse),
|
||||
(status = 200, description = "Get the Payment Method Balance", body = PaymentMethodBalanceCheckResponse),
|
||||
),
|
||||
tag = "Payments",
|
||||
operation_id = "Retrieve Gift Card Balance",
|
||||
operation_id = "Retrieve Payment Method Balance",
|
||||
security(("publishable_key" = []))
|
||||
)]
|
||||
pub fn payment_check_gift_card_balance() {}
|
||||
|
||||
Reference in New Issue
Block a user