Build Your Gateway

Step-by-step guide to create and complete a Gateway payment.

zahls.ch comes into play as soon as your buyer has submitted their data on your website and starts the payment.

Gateway Creation

Please read the API reference for all necessary information.

You will learn about API request basics at zahls.ch and can continue with creating a Gateway.

Payload

In addition to the required data, you are free to choose what you would like to transfer to zahls.ch.
Here are some parameters that might be interesting for you:

ParameterData TypeDescription
successRedirectUrlstringAfter a successful payment, a redirection to this URL is made. Must be encoded.
failedRedirectUrlstringAfter a failed payment, a redirection to this URL is made. Must be encoded.
cancelRedirectUrlstringAfter a cancelled payment, a redirection to this URL is made. Must be encoded.
basketarrayA list of all product items. Used for email notifications and invoices
pmstring[]Restrict the available payment methods with the according identifiers
preAuthorizationbool

Process a tokenization payment

Find out more

reservationbool

Process a pre-authorization payment

Find out more

referenceIdstringThis can be used to assign the zahls.ch transaction to an order later on
fieldsarrayCustomer data goes here
skipResultPageboolSkip the zahls.ch result page Note: If a gateway is created with the skipResultPage flag and then used in an iframe integration, &appview=1 needs to be added to the gateway link
chargeOnAuthorizationboolTokenization - Execute an initial charge immediately
validityintFor how long should your payment gateway be available
subscriptionStateboolSet to true if you want to execute subscriptions
subscriptionIntervalstringSubscription - Payment interval (PHP interval specification)
subscriptionPeriodstringSubscription - Duration (PHP interval specification)
subscriptionCancellationIntervalstringSubscription - How long a cancellation is possible (PHP interval specification)
lookAndFeelProfilestringIf you got multiple Look & Feel profiles, decide which one to use

All Possible Fields

  • title
  • forename
  • surname
  • company
  • street
  • postcode
  • place
  • country
  • delivery_title
  • delivery_forename
  • delivery_surname
  • delivery_company
  • delivery_street
  • delivery_postcode
  • delivery_place
  • delivery_country
  • phone
  • email
  • date_of_birth
  • terms
  • privacy_policy
  • custom_field_1
  • custom_field_2
  • custom_field_3
  • custom_field_4
  • custom_field_5

Examples

fields[forename][value]=John
fields[lastname][value]=Doe
fields[email][value]=john@doe.com
fields[street][value]=Burgstrasse 20
fields[postcode][value]=3600
fields[place][value]=Thun
fields[country][value]=CH

Languages

If multi-language support is enabled in the merchant backend, it is possible to provide multiple language translations in the API for Name and Description attributes.

Each language is identified by an ID:

IDLanguage
1German
2English
3French
4Italian
7Dutch
8Portuguese
9Turkish
10Polish
11Spanish
12Danish
13Swedish
14Norwegian

Examples

# Without translation
fields[custom_field_1][name]=Fieldname 

# With German and English translation
fields[custom_field_1][name][1]=Feldname
fields[custom_field_1][name][2]=Fieldname

Response

After the gateway was created successfully, you will get a link in the response of your request.
Redirect the shopper to this link for processing the payment.

Payment

Your shopper can choose a payment method in the Gateway and process the payment:

After Payment

The shopper is redirected to the matching URL depending on the outcome of the payment process. (success-/cancel-/failedRedirectUrl)

Next Steps

Now you have to perform further steps based on the payment result.