Quick Guide For Developers

Quick Guide For Developers

For PHP we provide an example code on GitHub.

1. Invoking QPAY Checkout Page

Browser initiation (default usage)

To initiate the payment process with QENTA Checkout Page send a POST request to: https://api.qenta.com/page/init.php

The browser receives an HTTP response with the header Location and redirects to the Checkout Page.

Server-to-server initiation

Alternatively, the same request can be sent to https://api.qenta.com/page/init-server.php

The response is in the following format:

Example
redirectUrl=https%3A%2F%2Fapi.qenta.com%2Fpage%2F[CustomerID]
[ShopID]_DESKTOP%2Fselect.php%3FSID%3[randomSessionID]
If server-to-server initiation is used then parameters consumerIpAddress and consumerUserAgent are mandatory.

Both requests need to contain the required request parameters and should at least have the highly recommended optional parameters.

In case an error is returned, refer to the error codes listing.

2. Handling The Response

When defining the request parameters, the URLs leading the consumer back to the shop need to be set.

Table 1. Relevant URLs
URL Description

successUrl

Payment was successful

cancelUrl

Payment process was canceled by the consumer

failureUrl

Payment failed, e.g. due to a wrong 3-D Secure Code

pendingUrl

Payment is pending

Define the confirmURL parameter to get a server-to-server communication of the outcome, regardless of whether the customer is being redirected back to the shop.

To prevent fraud, check the authenticity of returned data for pending and successful payments by calculating the fingerprint. That is done by concatenating all response parameter values plus the secret in the order defined in the responseFingerprintOrder parameter without any dividers in between and using the secret as a cryptographic key for the hashing function. The resulting fingerprint has to be identical to the value of the response responseFingerprint parameter.

For a PHP example on how to calculate a fingerprint take a look at our reference implementation at the link QENTA Checkout Client Library.

Submit the same URL for all four parameters and provide the appropriate content after interpreting the payment process results.

3. Backend Operations

Refer to technical implementation for integrating backend operations in general and to each available transaction-based operation.