$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.
- You build an HTML form whose
actionpoints to$wsComputopHosted.action, and place the remaining values (data,len,merchantID,encryptionType…) as hidden fields. - The customer submits the form and is taken to the Computop payment page.
- Computop processes the payment and redirects the customer back to the shop.
- After the return, you evaluate
paymentCanceled,paymentFailed, anderrorto give the customer appropriate feedback.
Pass encrypted data through unchanged
The fieldsdata, 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
| Variable | Type | Description |
|---|---|---|
action | string | URL of the Computop payment page (as the form’s action). |
data | string | Encrypted payment data. |
len | string | Length of the encrypted data (for validation at Computop). |
encryptionType | string | Encryption type (e.g. "AES"). |
merchantID | string | Merchant ID with Computop. |
payType | string | Payment method (e.g. credit card). |
language | string | Language code for the payment page (e.g. "de"). |
template | string | Name of the Computop template. |
hideSave | string | Controls the display of the save option. |
freeFields | array | Additional free fields. |
| Variable | Type | Description |
|---|---|---|
paymentCanceled | bool | true if the payment was canceled. |
paymentFailed | bool | true if the payment failed. |
error | string | Error message in the event of a payment problem. |
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 theaction 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 (e.g."AES").
$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. In the observed state, the variable contains the text"hideSave" when the option is to be hidden.
$wsComputopHosted.freeFields
Returns additional free fields that are submitted along.$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
Returnstrue if the customer canceled the payment. Use it to return to the payment selection after a cancellation.
$wsComputopHosted.paymentFailed
Returnstrue 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 toaction and stores the encrypted data and the merchant ID as hidden fields. On submission, the customer is taken to the Computop payment page.
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.Depending on the outcome, the customer sees a cancellation, error, or success message.
Related links
- 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.
