mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 01:27:31 +08:00
Docs: Updated API - ref for payments (#5172)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com> Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
/// Payments - Create
|
||||
///
|
||||
/// **Creates a payment object when amount and currency are passed.** This API is also used to create a mandate by passing the `mandate_object`.
|
||||
/// **Creates a payment object when amount and currency are passed.**
|
||||
///
|
||||
/// To completely process a payment you will have to create a payment, attach a payment method, confirm and capture funds.
|
||||
/// This API is also used to create a mandate by passing the `mandate_object`.
|
||||
///
|
||||
/// Depending on the user journey you wish to achieve, you may opt to complete all the steps in a single request by attaching a payment method, setting `confirm=true` and `capture_method = automatic` in the *Payments/Create API* request or you could use the following sequence of API requests to achieve the same:
|
||||
/// Depending on the user journey you wish to achieve, you may opt to complete all the steps in a single request **by attaching a payment method, setting `confirm=true` and `capture_method = automatic`** in the *Payments/Create API* request.
|
||||
///
|
||||
/// Otherwise, To completely process a payment you will have to **create a payment, attach a payment method, confirm and capture funds**. For that you could use the following sequence of API requests -
|
||||
///
|
||||
/// 1. Payments - Create
|
||||
///
|
||||
@ -14,7 +16,9 @@
|
||||
///
|
||||
/// 4. Payments - Capture.
|
||||
///
|
||||
/// Use the client secret returned in this API along with your publishable key to make subsequent API calls from your client
|
||||
/// You will require the 'API - Key' from the Hyperswitch dashboard to make the first call, and use the 'client secret' returned in this API along with your 'publishable key' to make subsequent API calls from your client.
|
||||
///
|
||||
/// This page lists the various combinations in which the Payments - Create API can be used and the details about the various fields in the requests and responses.
|
||||
#[utoipa::path(
|
||||
post,
|
||||
path = "/payments",
|
||||
@ -87,7 +91,7 @@
|
||||
"setup_future_usage": "off_session",
|
||||
"mandate_data": {
|
||||
"customer_acceptance": {
|
||||
"acceptance_type": "offline",
|
||||
"acceptance_type": "online",
|
||||
"accepted_at": "1963-05-03T04:07:52.723Z",
|
||||
"online": {
|
||||
"ip_address": "127.0.0.1",
|
||||
@ -102,7 +106,7 @@
|
||||
}
|
||||
},
|
||||
"customer_acceptance": {
|
||||
"acceptance_type": "offline",
|
||||
"acceptance_type": "online",
|
||||
"accepted_at": "1963-05-03T04:07:52.723Z",
|
||||
"online": {
|
||||
"ip_address": "127.0.0.1",
|
||||
@ -143,6 +147,14 @@
|
||||
"card_cvc": "123"
|
||||
}
|
||||
},
|
||||
"customer_acceptance": {
|
||||
"acceptance_type": "online",
|
||||
"accepted_at": "1963-05-03T04:07:52.723Z",
|
||||
"online": {
|
||||
"ip_address": "127.0.0.1",
|
||||
"user_agent": "amet irure esse"
|
||||
}
|
||||
},
|
||||
"setup_future_usage": "off_session"
|
||||
})
|
||||
)
|
||||
@ -312,7 +324,7 @@ pub fn payments_update() {}
|
||||
}
|
||||
},
|
||||
"customer_acceptance": {
|
||||
"acceptance_type": "offline",
|
||||
"acceptance_type": "online",
|
||||
"accepted_at": "1963-05-03T04:07:52.723Z",
|
||||
"online": {
|
||||
"ip_address": "127.0.0.1",
|
||||
|
||||
Reference in New Issue
Block a user