chore: v2 api changes for session token endpoint (#6032)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Hrithikesh
2024-10-07 20:20:26 +05:30
committed by GitHub
parent f4830ebaae
commit 6e355f34a8
10 changed files with 109 additions and 38 deletions

View File

@ -87,6 +87,9 @@ Never share your secret api keys. Keep them guarded and secure.
routes::merchant_account::merchant_account_update,
routes::merchant_account::profiles_list,
// Routes for payments
routes::payments::payments_connector_session,
// Routes for profile
routes::profile::profile_create,
routes::profile::profile_retrieve,

View File

@ -381,12 +381,31 @@ pub fn payments_confirm() {}
)]
pub fn payments_capture() {}
#[cfg(feature = "v1")]
/// Payments - Session token
///
/// Creates a session object or a session token for wallets like Apple Pay, Google Pay, etc. These tokens are used by Hyperswitch's SDK to initiate these wallets' SDK.
#[utoipa::path(
post,
path = "/payments/session_tokens",
request_body=PaymentsSessionRequest,
responses(
(status = 200, description = "Payment session object created or session token was retrieved from wallets", body = PaymentsSessionResponse),
(status = 400, description = "Missing mandatory fields")
),
tag = "Payments",
operation_id = "Create Session tokens for a Payment",
security(("publishable_key" = []))
)]
pub fn payments_connector_session() {}
#[cfg(feature = "v2")]
/// Payments - Session token
///
/// Creates a session object or a session token for wallets like Apple Pay, Google Pay, etc. These tokens are used by Hyperswitch's SDK to initiate these wallets' SDK.
#[utoipa::path(
post,
path = "/payments/session_tokens",
path = "/v2/payments/{payment_id}/create_external_sdk_tokens",
request_body=PaymentsSessionRequest,
responses(
(status = 200, description = "Payment session object created or session token was retrieved from wallets", body = PaymentsSessionResponse),