feat(router): Add payments get-intent API for v2 (#6396)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Anurag Thakur
2024-10-30 21:26:23 +05:30
committed by GitHub
parent 33bc83fce4
commit c514608594
18 changed files with 571 additions and 196 deletions

View File

@ -123,6 +123,7 @@ Never share your secret api keys. Keep them guarded and secure.
//Routes for payments
routes::payments::payments_create_intent,
routes::payments::payments_get_intent,
routes::payments::payments_confirm_intent,
//Routes for refunds
@ -325,7 +326,7 @@ Never share your secret api keys. Keep them guarded and secure.
api_models::payments::PaymentsSessionRequest,
api_models::payments::PaymentsSessionResponse,
api_models::payments::PaymentsCreateIntentRequest,
api_models::payments::PaymentsCreateIntentResponse,
api_models::payments::PaymentsIntentResponse,
api_models::payments::PazeWalletData,
api_models::payments::AmountDetails,
api_models::payments::SessionToken,

View File

@ -620,7 +620,7 @@ pub fn payments_post_session_tokens() {}
),
),
responses(
(status = 200, description = "Payment created", body = PaymentsCreateIntentResponse),
(status = 200, description = "Payment created", body = PaymentsIntentResponse),
(status = 400, description = "Missing Mandatory fields")
),
tag = "Payments",
@ -630,6 +630,25 @@ pub fn payments_post_session_tokens() {}
#[cfg(feature = "v2")]
pub fn payments_create_intent() {}
/// Payments - Get Intent
///
/// **Get a payment intent object when id is passed in path**
///
/// You will require the 'API - Key' from the Hyperswitch dashboard to make the call.
#[utoipa::path(
get,
path = "/v2/payments/{id}/get-intent",
params (("id" = String, Path, description = "The unique identifier for the Payment Intent")),
responses(
(status = 200, description = "Payment Intent", body = PaymentsIntentResponse),
(status = 404, description = "Payment Intent not found")
),
tag = "Payments",
operation_id = "Get the Payment Intent details",
security(("api_key" = [])),
)]
#[cfg(feature = "v2")]
pub fn payments_get_intent() {}
/// Payments - Confirm Intent
///
/// **Confirms a payment intent object with the payment method data**