Chapter 4. Payment service

Table of Contents

4.1. Introduction
4.2. Form interface
4.2.1. Introduction
4.2.2. Interface versions
4.2.3. Migration guide
4.3. E2
4.3.1. Fields to be sent to payment gateway
4.3.2. Calculating the payment AUTHCODE
4.3.3. Receiving the Payment Receipt with interface version E2
4.3.4. RETURN_AUTHCODE calculation
4.4. Selection and visibility of payment methods
4.4.1. Introduction
4.4.2. Payment method values
4.5. REST interface (BETA)
4.5.1. Introduction
4.5.2. Interface use
4.5.3. Payment creation
4.5.4. Receiving the Payment Receipt
4.5.5. Error handling
4.5.6. Error codes
4.5.7. PHP
4.5.8. Perl
4.6. Payment method selection page embedding
4.6.1. Introduction
4.6.2. Versions
4.6.3. Embedding when using the REST interface
4.6.4. Embedding when using the form interface
4.6.5. Parameters
4.6.6. Localisation
4.7. Payment state queries
4.7.1. State query in HTML
4.7.2. Calculating the AUTHCODE
4.8. Merchant API v1
4.8.1. Service description
4.8.2. Authentication
4.8.3. Accessing the API
4.8.4. Create Refund
4.8.5. Notify URL call
4.8.6. Refund cancellation
4.8.7. Settlements
4.8.8. Settlement details
4.8.9. Payment details
4.8.10. Refund details

4.1. Introduction

Figure 4.1. Payment page

Payment page

Payment service integration is done by either implementing a payment button, or by embedding a selection of payment methods in a web shop to enable the immediate payment of an order. The information of completed payment is instantly relayed back to the web shop.

There are two integration types for implementing the Paytrail payment service.

With the REST interface the payment is created in advance by a XML or JSON request, and the interface responds with a payment token and a URL address. To complete the payment, the customer is redirected to the URL address. The REST interface can thus be used to send a payment link to the customer by e.g. email.

When using the FORM interface, the payment data is created as a form on the web applications page. The consumer sends this form to the payment service. The payment is then completed in the web browser as an immediate result of the customer's actions.

Payment page bypass option for FORM interface allows bypassing the Paytrail payment page and can be used to implement bank payment buttons directly in a web shop.

The payment method page embedding can be used together with either of these implementations to display the payment method selection directly in a web shop. Implementing the embedded payment method selection page is done by adding a short JavaScript call to the page.