Payment-Start-v2-old: Difference between revisions
Stankovicsa (talk | contribs) No edit summary |
|||
(20 intermediate revisions by 6 users not shown) | |||
Line 2: | Line 2: | ||
{{TableOfContents}} | {{TableOfContents}} | ||
{{NotificationBox|title=WARNING|text=The structure of this API call has been changed due to 3D Secure / PSD2 regulations! You can access the new structure here: [[Payment-Start-v2]]|color=#FF0000}} | |||
{{api_callmethod | {{api_callmethod | ||
Line 38: | Line 40: | ||
** "Immediate" | ** "Immediate" | ||
** "Reservation" | ** "Reservation" | ||
|| The type of the payment, which can be either immediate | ** "DelayedCapture" | ||
|| The type of the payment, which can be either immediate, money reservation or delayed capture. Reservation means that the shop has a time window to finish the payment (even though the money transaction still takes place immediately). Reservation amounts can be modified during this time window unless the new amount is lower than the original. | |||
Click here to learn more about reservation payments: [[Reservation_payment|Reservation payments]] | Click here to learn more about reservation payments: [[Reservation_payment|Reservation payments]] | ||
Click here to learn more about delayed capture payments: [[Delayed_Capture|Delayed capture]] | |||
|- | |- | ||
| ReservationPeriod || TimeSpan (d | | ReservationPeriod || TimeSpan (d.hh:mm:ss) || | ||
* Required only if PaymentType is "Reservation" | * Required only if PaymentType is "Reservation" | ||
* Minimum value: one minute | * Minimum value: one minute | ||
Line 52: | Line 56: | ||
|- | |- | ||
| PaymentWindow || TimeSpan (d | | DelayedCapturePeriod || TimeSpan (d.hh:mm:ss) || | ||
* Required only if PaymentType is "DelayedCapture" | |||
* Minimum value: one minute | |||
* Maximum value: 21 days | |||
|| This is the time window that allows the shop to complete (finalize) the payment. If this does not happen within the time window, the system releases the payment amount. The maximum time window depends on the country of the shop: 21 for Hungarian shops, 7 for everybody else | |||
|- | |||
| PaymentWindow || TimeSpan (d.hh:mm:ss) || | |||
* Optional | * Optional | ||
* Minimum value: one minute | * Minimum value: one minute | ||
* Maximum value: one week | * Maximum value: one week | ||
* Default value: 30 minutes | * Default value: 30 minutes | ||
|| Time window for the payment to be completed. The payer must execute the payment before this elapses, or else the payment will expire and can no longer be completed. | || Time window for the payment to be completed by the payer. The payer must execute the payment before this elapses, or else the payment will expire and can no longer be completed. | ||
|- | |- | ||
Line 104: | Line 116: | ||
| PayerHint || string || | | PayerHint || string || | ||
* Optional | * Optional | ||
* If provided, must be valid email format | |||
* Maximum length: 256 characters | * Maximum length: 256 characters | ||
|| The shop can optionally supply an e-mail address as a hint on who should complete the payment. This can be used if the shop is certain about that the payer has an active Barion wallet or the shop would like to help the guest payer with filling in the email field for her/him. If provided, the Barion Smart Gateway automatically fills out the e-mail address field in the Barion wallet login form and the guest payer form, speeding up the payment process. | || The shop can optionally supply an e-mail address as a hint on who should complete the payment. This can be used if the shop is certain about that the payer has an active Barion wallet or the shop would like to help the guest payer with filling in the email field for her/him. If provided, the Barion Smart Gateway automatically fills out the e-mail address field in the Barion wallet login form and the guest payer form, speeding up the payment process. | ||
Line 112: | Line 125: | ||
* Required | * Required | ||
* Maximum length: 2000 characters | * Maximum length: 2000 characters | ||
|| The URL where the payer should be redirected after the payment is completed or cancelled. The payment identifier is added to the query string part of this URL in the <code> | || The URL where the payer should be redirected after the payment is completed or cancelled. The payment identifier is added to the query string part of this URL in the <code>paymentId</code> parameter. If not provided, the system will use the redirect URL assigned to the shop that started the payment. | ||
|- | |- | ||
Line 119: | Line 132: | ||
* Required | * Required | ||
* Maximum length: 2000 characters | * Maximum length: 2000 characters | ||
|| The URL where the Barion system sends a request whenever there is a change in the state of the payment. The payment identifier is added to the query string part of this URL in the <code> | || The URL where the Barion system sends a request whenever there is a change in the state of the payment. The payment identifier is added to the query string part of this URL in the <code>paymentId</code> parameter. Click here to learn more about the callback mechanism: [[Callback_mechanism|Payment callback mechanism (IPN)]] | ||
|- | |- | ||
Line 153: | Line 166: | ||
** "fr-FR" (French) | ** "fr-FR" (French) | ||
** "hu-HU" (Hungarian) | ** "hu-HU" (Hungarian) | ||
** "sk-SK" ( | ** "sk-SK" (Slovak) | ||
** "sl-SI" (Slovenian) | ** "sl-SI" (Slovenian) | ||
|| This indicates in which language the Barion Smart Gateway should display for the payer upon redirect. | || This indicates in which language the Barion Smart Gateway should display for the payer upon redirect. | ||
|- | |- | ||
Line 167: | Line 179: | ||
** "HUF" (Hungarian forint) | ** "HUF" (Hungarian forint) | ||
** "USD" (U.S. dollar) | ** "USD" (U.S. dollar) | ||
|| The currency of the payment. Must be supplied in ISO 4217 format. This affects all transactions included in the payment; it is not possible to define multiple transactions in different currencies. | || The currency of the payment. Must be supplied in ISO 4217 format. This affects all transactions included in the payment; it is not possible to define multiple transactions in different currencies. If no currency is provided, the default value is HUF. You must have a wallet in the given currency. | ||
|- | |||
| PayerPhoneNumber || string || | |||
* Optional | |||
* Max length: 30 characters | |||
* Expected format: 36701231234 | |||
* Required for using bank transfer payment | |||
|| The phone number of the payer. Must be set to enable [[Bank_Transfer_Payment|bank transfer payment]]. | |||
|} | |} | ||
Line 194: | Line 214: | ||
* If '''InitiateRecurrence''' was <code>true</code>, and a new authorized payment was successfully created, this will be <code>None</code> (because no actual token charge took place yet) | * If '''InitiateRecurrence''' was <code>true</code>, and a new authorized payment was successfully created, this will be <code>None</code> (because no actual token charge took place yet) | ||
* If '''InitiateRecurrence''' was <code>false</code>, but a previously authorized payment identifier was supplied in '''RecurrenceId''', the system will try to charge the funding source associated with the authorized payment. If this charge is successful, the result is <code>Successful</code>. If the system could not charge the funding | * If '''InitiateRecurrence''' was <code>false</code>, but a previously authorized payment identifier was supplied in '''RecurrenceId''', the system will try to charge the funding source associated with the authorized payment. If this charge is successful, the result is <code>Successful</code>. If the system could not charge the funding source, the result is <code>Failed</code>. If the given identifier is invalid or does not exist, the result is <code>NotFound</code>. | ||
|- | |- |
Latest revision as of 11:10, 1 February 2022
Barion API: Initialize a new payment
POST | /v2/Payment/Start |
---|
The /payment/start
API endpoint is used to create a new payment in the Barion system.
Prerequisites before use:
v2 This API endpoint is available in API v2 only.
Use cases
This API endpoint is designed to be used in the following scenarios:
Input properties
Property name | Property type | Limitations and constraints | Description |
---|---|---|---|
POSKey | Guid |
|
The secret API key of the shop, generated by Barion. This lets the shop to authenticate through the Barion API, but does not provide access to the account owning the shop itself. |
PaymentType | string |
|
The type of the payment, which can be either immediate, money reservation or delayed capture. Reservation means that the shop has a time window to finish the payment (even though the money transaction still takes place immediately). Reservation amounts can be modified during this time window unless the new amount is lower than the original.
Click here to learn more about reservation payments: Reservation payments Click here to learn more about delayed capture payments: Delayed capture |
ReservationPeriod | TimeSpan (d.hh:mm:ss) |
|
Only makes sense at reservation payments. This is the time window that allows the shop to finish (finalize) the payment. If this does not happen within the time window, the system refunds the payment amount to the payer. |
DelayedCapturePeriod | TimeSpan (d.hh:mm:ss) |
|
This is the time window that allows the shop to complete (finalize) the payment. If this does not happen within the time window, the system releases the payment amount. The maximum time window depends on the country of the shop: 21 for Hungarian shops, 7 for everybody else |
PaymentWindow | TimeSpan (d.hh:mm:ss) |
|
Time window for the payment to be completed by the payer. The payer must execute the payment before this elapses, or else the payment will expire and can no longer be completed. |
GuestCheckOut | bool |
|
Flag indicating wether the payment can be completed without a registered Barion wallet. Guest checkout can only be done with bank cards, and the payer must supply a valid e-mail address - this is necessary for fraud control. |
InitiateRecurrence | bool |
|
This flag indicates that the shop would like to initialize a token payment. This means that the shop is authorized to charge the funding source of the payer in the future without redirecting her/him to the Barion Smart Gateway. It can be used for one-click and susbscription payment scenarios.
Click here to learn more about token payments: Token_payment |
RecurrenceId | string |
|
A string used to identify a given authorized payment. Its purpose is determined by the value of the InitiateRecurrence property.
|
FundingSources | string[] |
|
An array of strings containing the allowed funding sources that can be used to complete the payment. "Balance" means that the payer can only use their Barion wallet balance, while "All" means the payment can be completed with either a Barion wallet or a bank card.
Note: There is no option to disallow payment by balance, since that would deny Barion Wallet users with a balance the ability to pay. There is an option to exclude cards, but not balance. Note: this must be supplied as an array, because more funding source types are planned in the future. |
PaymentRequestId | string |
|
The unique identifier for the payment generated by the shop. This is so the shop can track its own payment identifiers. It is also useful for bookkeeping purposes since this shows up in the monthly account statement and the transaction history export, making identification of payments easier for the shop. |
PayerHint | string |
|
The shop can optionally supply an e-mail address as a hint on who should complete the payment. This can be used if the shop is certain about that the payer has an active Barion wallet or the shop would like to help the guest payer with filling in the email field for her/him. If provided, the Barion Smart Gateway automatically fills out the e-mail address field in the Barion wallet login form and the guest payer form, speeding up the payment process. |
RedirectUrl | string |
|
The URL where the payer should be redirected after the payment is completed or cancelled. The payment identifier is added to the query string part of this URL in the paymentId parameter. If not provided, the system will use the redirect URL assigned to the shop that started the payment.
|
CallbackUrl | string |
|
The URL where the Barion system sends a request whenever there is a change in the state of the payment. The payment identifier is added to the query string part of this URL in the paymentId parameter. Click here to learn more about the callback mechanism: Payment callback mechanism (IPN)
|
Transactions | PaymentTransaction[] |
|
An array of payment transactions contained in the payment. A payment must contain at least one such transaction. See the PaymentTransaction page for the appropriate structure and syntax.
Defining multiple transactions allow the payment initiator to distribute the payment amount between multiple shops. See the following page to learn more: Facilitated payments |
OrderNumber | string |
|
The order number generated by the shop. This is to aid the shop in identifying a given payment in their own system. This also shows up in generated monthly account statements and transaction history exports, so it also helps with bookkeeping. |
ShippingAddress | ShippingAddress |
|
The shipping address associated with the payment, if applicable. Providing this is recommended, because it helps the automatic anti-fraud analysis get more accurate results. See the ShippingAddress page for the appropriate structure and syntax. |
Locale | string |
|
This indicates in which language the Barion Smart Gateway should display for the payer upon redirect. |
Currency | string |
|
The currency of the payment. Must be supplied in ISO 4217 format. This affects all transactions included in the payment; it is not possible to define multiple transactions in different currencies. If no currency is provided, the default value is HUF. You must have a wallet in the given currency. |
PayerPhoneNumber | string |
|
The phone number of the payer. Must be set to enable bank transfer payment. |
Output properties
Property name | Property type | Description |
---|---|---|
PaymentId | Guid | The identifier of the newly initialized payment, generated by the Barion system. |
PaymentRequestId | string | The payment identifier supplied by the API caller in the request. |
Status | PaymentStatus | The status of the payment in the Barion system. |
QRUrl | string | URL for a QR code representing the payment. This is useful in physical real life situations where the payer uses a mobile device. |
RecurrenceResult | RecurrenceResult | Indicates the result of an authorized payment scenario. The result depends on the values of the InitiateRecurrence and RecurrenceId properties supplied in the request.
|
Transactions | ProcessedTransaction[] | An array containing all transactions associated with the payment. If the Barion system deducts fees from the shop after payments, this also contains these additional fee transactions beside the payment transactions that were sent in the request. |
GatewayUrl | string | The URL of the Barion Smart Gateway (including the payment identifier), where the API caller should redirect the payer. |
CallbackUrl | string | The URL (including the payment identifier) where the Barion system will send a request to whenever there is a change in the state of the payment. If an explicit URL was not supplied, this will be the callback URL associated with the shop that started the payment. |
RedirectUrl | string | The URL (including the payment identifier) where the payer gets redirected to after the payment is completed or cancelled. If an explicit URL was not supplied, this will be the redirect URL associated with the shop that started the payment. |