Commerce Postfinance
Last updated on
21 January 2019
Provides Commerce integration for the Postfinance payment gateway.
This payment gateway redirects to Postfinance where the user is able to pay with all activated payment methods, such asPostfinance Card, Visa, Mastercard, Twint and many more.
Installation
Install with Composer:
composer require drupal/commerce_postfinance:^2.0
Enable the module in Drupal and create a new payment gateway of type Postfinance (Redirect to Postfinance).
Configuration
The module offers the following configuration options:
- PSPID The ID of the test- or production environment, obtained by Postfinance.
- SHA-IN passphrase The passphrase used to calculate the SHA signature for the payment request. Must be equal with the SHA-IN passphrase in the Postfinance backend.
- SHA-OUT passphrase The passphrase used to calculate the SHA signature for the payment response. Must be equal with the SHA-OUT passphrase in the Postfinance backend.
- Hashing algorithm The hashing algorithm used to calculate the SHA-IN and SHA-OUT signatures. Must correspond to the algorithm selected in the Postfinance backend. Choose between
SHA-1,SHA-256orSHA-512. - Charset Influences the payment request url. Choose
UTF-8(recommended) orISO 8859 1. - Catalog url A node representing the catalog page of the shop.
Postfinance Backoffice
This section describes how to configure the Postfinance Backoffice. Log into the Backoffice (PROD or TEST environment) and navigate to Configuration > Technical Information.
Global security parameters
- The hash algorithm must correspond to the one selected in Drupal.
- The character encoding must correspond to the one selected in Drupal.
- Make sure to select "Each parameter followed by the passphrase" to compose the hash string.

Data and origin verification
- Enter your domains making the payment requests, separated by a colon.
- Enter the SHA-IN passphrase, must be identical with the SHA-IN passphrase configured in Drupal.
Transaction feedback
HTTP redirection in the browser
- Leave the Accept/Decline/Exception/Cancel urls empty, they are sent with the payment request from Drupal.
- Make sure to check "I would like to receive transaction feedback parameters on the redirection URLs".

Direct HTTP server-to-server request
- Timing of the request: Select "Always deferred (not immediately after the payment).
- Enter the URL's for the IPN call to Drupal, use the same URL for successful and failed payment status: https://yourshop.com/payment/notify/
<PAYMENT-GATEWAY-ID>. Replace<PAYMENT-GATEWAY-ID>with the Drupal machine name of the Postfinance payment gateway. You can find the machine name by navigating to the payment gateway in Drupal. - Use "POST" as request method.

All transaction submission modes
- Enter the SHA-OUT passphrase, must be the same as configured in Drupal.
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion