Skip to main content
With the $wsComputopHosted module, you process payments via the hosted Computop payment page. The module provides all the data you need to redirect the customer to the Computop payment page via form, and reports after the return whether the payment was successful. This page covers providing the form data and evaluating the result. The actual payment processing runs on the Computop side; the configuration of the interface (merchant ID, keys) is done in the payment configuration.

Basic concept

With a hosted payment page, the payment does not take place in the shop but on a page of the payment provider. $wsComputopHosted provides the data with which you redirect the customer there. The flow is always the same: build the form → submit → Computop processes → evaluate the return.
  1. You build an HTML form whose action points to $wsComputopHosted.action, and place the remaining values (data, len, merchantID, encryptionType …) as hidden fields.
  2. The customer submits the form and is taken to the Computop payment page.
  3. Computop processes the payment and redirects the customer back to the shop.
  4. After the return, you evaluate paymentCanceled, paymentFailed, and error to give the customer appropriate feedback.

Pass encrypted data through unchanged

The fields data, len, and encryptionType form the encrypted payment data. You do not calculate anything yourself and do not modify them; you pass the values on to Computop unchanged.

Module overview

Example / excerpt of $wsComputopHosted
JSON output
Note: Conditional variables only appear when they are set: hideSave, prefill, and the data of a stored credit card (PCNr, PCNrBrand, PCNrYear, PCNrMonth, holder). Variables for building the form Variables of a stored credit card (only present when a stored pseudo credit card is selected) Variables for evaluating the result

Templates

The redirect form is typically embedded in the checkout, i.e. on the page from which the customer is redirected to the payment. You evaluate the result variables on the page to which Computop redirects after the payment.

Variables

$wsComputopHosted.action

Returns the URL of the Computop payment page. You use it as the action attribute of the form with which the customer is redirected to the payment.

$wsComputopHosted.data

Returns the encrypted payment data. You submit it as a hidden form field – unchanged (see Basic concept).

$wsComputopHosted.len

Returns the length of the encrypted data. Computop needs this value to validate the submitted data.

$wsComputopHosted.encryptionType

Returns the encryption type used to encrypt data: "Blowfish" or "AES" — depending on what is configured in the Computop settings (default: Blowfish).

$wsComputopHosted.merchantID

Returns the merchant ID with Computop. It is submitted with the form so that Computop can assign the payment to the correct merchant account.

$wsComputopHosted.payType

Returns the payment method (e.g. credit card).

$wsComputopHosted.language

Returns the language code for the payment page. With it, the Computop page appears in the customer’s language.

$wsComputopHosted.template

Returns the name of the Computop template used.

$wsComputopHosted.hideSave

Returns the value for controlling the save option on the Computop payment page. The variable contains the text "hideSave" and is only present when the option is to be hidden — in two cases:
  • The customer is paying with an already stored credit card (see PCNr) — saving again is unnecessary.
  • Saving is not possible because the customer is not logged in or because saving pseudo credit card data is not enabled for the shop.

$wsComputopHosted.prefill

Contains the value "on" when the save option on the Computop payment page should be checked by default (configurable in the Computop configuration). Only present in that case.

$wsComputopHosted.PCNr / PCNrBrand / PCNrYear / PCNrMonth / holder

Return the data of a stored pseudo credit card so that the customer does not have to re-enter their card data. The variables are only present when all preconditions are met:
  • The customer is logged in,
  • saving pseudo credit card data is enabled for the shop,
  • and the customer has selected a stored card during checkout (see $wsCheckout.selectedPseudoCC).
PCNr (pseudo card number) is always set; the other variables only appear when the corresponding value is stored on the card. If PCNr is present, hideSave is also set, since the card has already been saved.

$wsComputopHosted.freeFields

Returns the free checkout fields that are submitted to Computop. Only the free checkout fields whose ID is listed under freeFields in the Computop payment configuration are transmitted.

Properties of a free field

$wsComputopHosted.error

Returns an error message if a problem occurred during the payment. Evaluate it after the return to the payment page to tell the customer the reason.

$wsComputopHosted.paymentCanceled

Returns true if the customer canceled the payment. Use it to return to the payment selection after a cancellation.

$wsComputopHosted.paymentFailed

Returns true if the payment failed. In contrast to a cancellation, the customer attempted the payment, but it was not completed successfully.

Methods

No methods are available for $wsComputopHosted.

Actions

No actions are available for $wsComputopHosted.

Examples

Redirect to the Computop payment page

This example builds the complete redirect form: it points to action and stores the encrypted data and the merchant ID as hidden fields. On submission, the customer is taken to the Computop payment page.
Result
On submission, the customer is redirected to the Computop payment page.

Evaluate the payment result after the return

After Computop has redirected the customer back, check the result and display the appropriate message.
Result
Depending on the outcome, the customer sees a cancellation, error, or success message.

  • Computop Hosted Payments (configuration) – sets up the Computop interface (merchant ID, keys, payment methods). A prerequisite for the module to be populated.
  • $wsCheckout – the checkout from which the redirect to the Computop payment page is initiated; provides the selected stored card via selectedPseudoCC.