Redirect Checkout

dmihos edited this page Mar 2, 2017 · 11 revisions

Redirect checkout is a simple 3 step process, where you Create the Payment Order, redirect the customer to Viva Payments secure environment and then confirm the transaction. The following guide will walk you through the necessary steps:

1. Creation of the Payment Order

A Payment Order is created every time you want to tell Viva, that you require a certain amount of money from one of your customers. Think of it as a utility bill. You give Viva an order to issue a bill on your behalf. The bill is then sent to your customer and they have to pay a specific amount within a given period of time. Each Payment Order has a unique 12 digit ID also referred to as the Payment Code.

POST /api/orders - Create a Payment Order.
DELETE /api/orders/{id} - Cancel an existing Payment Order.

2. Completion of the Payment Details (Redirection)

Upon the creation of the payment order, redirect the customer to the Viva checkout page:


where {OrderCode} is the payment order created in the previous step. Here the customer will see the checkout form where they can enter their name, card number and all other necessary information to complete the transaction.

Note: To simulate a successful payment on the demo environment, use the card number 4111111111111111 with any valid date and 111 for the CVV2

3. Confirmation of the Transaction

Upon completion of the checkout form, the customer is redirected back to your website. The redirection URLs are defined in your account under the Sources section.

Note that the redirection always happens at the 'Source' level. If you have defined multiple sources on your profile, you need to use the optional parameter 'SourceCode' when creating the order, so that the system selects the appropriate redirection url.

The redirection uses the HTTP GET method and may append the following parameters to the URL:

  • s (int64): The Payment Order unique 12 digit ID
  • t (uuid): The Transaction ID (may not be returned for some failed transactions)
  • Lang (string): The language of the destination page in ISO format (el-GR for Greek, en-US for English)

NOTE: It is highly recommended you always verify the status of a transaction and not blindly depend on whether your success or failure url is called. You can make a GetTransactions call to verify the status of an Order. To get notified for offline payment methods you can make use of the Webhooks notification service.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.