How to create an API call

Building an API call to Computop Paygate always follows the same sequence:

Libraries for HMAC and Blowfish

Here are some libraries supporting you with HMAC calculation and Blowfish-Encryption: Implementation Sources

(Libraries with AES-Encryption are in progress and coming soon)

Merchant credentials

You will receive your merchant credentials after signing up the contract. 

The merchant credentials consist of:

  • MerchantId: Your MerchantId on Computop Paygate
  • HMAC-password: A password to calculate the MAC-value to protect specific values in the request (e.g. amount, currency) or response (e.g. status, code)
  • Blowfish/AES-password: A password to encrypt your request to Computop Paygate and its response.

(info) You may receive a multiple set of MerchantId's and password's as a MerchantId is used to unite a set of configurations (e.g. paymethods, currencies, services).


We would like to create a payment for 12,34 EUR with english language for the hosted payment page with additional template parameters.

3-D Secure 2.x shall be used in case that the customer selects credit cards (e.g. Mastercard, VISA, American Express), but also other paymethods like PayPal, Direct Debit, Sofort, ... can be selected.

Therefore we need:

  1. MAC calculation to secure amount and currency
  2. put API parameters together - unencrypted
  3. encrypt all API parameters → by this we will get "Data" + "Len" for the API request
  4. add plain parameters to customize Hosted Payment Page using (HPP) with a template, e.g. language="en" for using the HPP with preselected english language
  5. send the API request to the desired endpoint.

MAC calculation

The MAC is calculated always like this: HmacSHA256("PayId*TransID*MerchantID*Amount*Currency", "YourHmacPassword") where:

PayIdReferenced PayIdMay be empty, e.g. for creating an initial payment process or risk management request; is used with subsequent requests like capture/refund.
TransIdYour transactionId to reference / identify your requestYour own reference to identify each request / payment process.

Your MerchantId 

Your MerchantId assigned to you by Computop identifiying this request.

AmountAmount in smallest unit of currency, e.g. 123=1,23 (EUR)Amount of this request; may be empty if not used, e.g. for status inquiries.
CurrencyCurrency of payment process in ISO 4217, e.g. EUR, USD, GBPCurrency of this request; may be empty if not used, e.g. for status inquiries.

Your HMAC-password assigned to you by Computop

Your HMAC-password assigned to a specific MID; if you have different MIDs you will have different HMAC passwords, too.


  • in case that a value is not present just leave it empty, e.g.:
    • with amount/currency, without PayId to initiate a new payment - like in this example: HmacSHA256("*TID-4453732122167114558*yourMerchantId*1234*EUR", "mySecret")
    • with amount/currency, without PayId, without TransId: HmacSHA256("**yourMerchantId*1234*EUR", "mySecret")
    • with PayId, without amount/currency: HmacSHA256("fe3f002e19814eea8aa733ec4fdacafe*TID-4453732122167114558*yourMerchantId**", "mySecret")
  • you will find more details for HMAC-calculation

Raw parameters before encryption

The raw parameters define basic settings for this payment call, e.g. your MerchantId, amount, currency, your reference and URLs for success, failure and notify:


Your MerchantId to identify your request at Computop Paygate


Indicate that 3-D Secure 2.x shall be used;

Specially for 3-D Secure 2.x it is useful to provide additional data (like billing- and shipping-address) to improve frictionless processing (i.e.: payment is authenticated without challenge). These additional data are provided in JSON-structure.


Your request identifier
RefNr=RG123-2021Your payment process reference
Amount=1234The desired amount in smallest currency unit, e.g. 1234 + EUR → 12,34 EUR
Currency=EURand currency
URLSuccess, URLFailure, URLBackURLs for forwarding the customer in case of success, failure, cancel

URL to receive Computop Paygate notifies


Computop Paygate shall respond with encrypted data

Language=enCustomer wants english language
Parameters before encryption

As "=" and "&" are used for building key-value-pairs these characters must not be part of any value.

Do not send empty values, but only keys which are required and really having values.

For credit card processing with 3-D Secure 2.x (EMV 3DS) you must add "MsgVers=2.0"

Hosted Payment Page works like a proxy for the other payment forms (i.e. Credit Card Form (PaySSL), Direct Debit Form (PaySDD), paymethod specific forms (e.g. PayPal))

  • so you have to add "MsgVers=2.0" to enable 3-D Secure 2.x for Credit Card Form (PaySSL)
  • you may supply other key-values for other paymethods (e.g. PayPal)

Encryt parameters into Data/Len (Blowfish)

The raw parameters are encrypted via Blowfish ECB and then hex-encoded. We provide you predefined functions in our toolkits for a quick start.


  • The value for "Len" is the string length of the unencrypted parameter string built in the step before.
  • Blowfish is standard encryption mode of Computop Paygate

To ease your integration we provide predefined functions to help you with Blowfish ECB:

Your languageWhere to find
ASPtxmsCrypto.dll // txmsCrypto.BlowFish
ASP.NETCompuTop.Core.Crypto.dll // CompuTop.Core.Crypto.BlowFish




Here a sample

Unencrypted requestMerchantID=yourMerchantId&MsgVer=2.0&TransID=TID-18724420542167170812&RefNr=RG123-2023&Amount=1234&Currency=EUR&URLSuccess=

Encryt parameters into Data/Len (AES)

The raw parameters are encrypted via AES/CBC/PKCS7 and then hex-encoded.


  • AES 128 / AES 192 / AES 256 are supported and depend on password-length with 16, 24 or 32 Byte
  • AES can be setup by Computop Helpdesk on request
  • Libraries with AES encryption are in progress
  • AES does not require LEN-parameter by technology, but it's still required for Computop Paygate-compatibility
  • AES is used with Initialization Vector (IV) of 16 Bytes. IV is Bin2Hex-encoded and sent plain as part of Data: Data=concat(Bin2Hex(IV), "-", Bin2Hex(encryptedData))
  • The Initialization Vector (IV) is created randomly with each encryption process, is sent in plain text (Bin2Hex-encoded) and required for decryption

To ease your integration here some links to ancryption with AES CBC:

Here a sample

Unencrypted requestMerchantID=yourMerchantId&MsgVer=2.0&TransID=TID-18724420542167170812&RefNr=RG123-2023&Amount=1234&Currency=EUR&URLSuccess=
Note(info) 5b447021b775137d2a4249f271200071 is the Initialization Vector (IV) of 16 Bytes generated with AES encryption converted from Bin to Hex.

Notice: Please note that if you want to switch to AES encryption as a merchant, all requests for all actions must also be encrypted with AES. Please coordinate the changeover with all parties in advance. Batch submission is excluded here as no API encryption is used. In this case, PGP is used for security.

Now putting all together the API request

The API request is then built like:

Basic parameters
e.g. paymentPage.aspx

Selected desired endpoint of Computop Paygate


Your MerchantId to identify your request at Computop Paygate (here additionally as plain value)

Len=<Len>&Data=<Data>Length of the uncrypted parameter string and Data returned by Encryption
Template parameter (plain)
Template=PaymentPageDropDown_v1Template for Hosted Payment Page (HPP)

Template for Credit Card Form (called by HPP)


Template for Direct Debit Form (called by HPP)


Starting laguage for the customer


Some CustomField-Data to display additional information on the HPP depending on the template

Building the API-call

(info) This URL doesn't work and will result in "Unexpected exception", because MerchantId "yourMerchantId" doesn't exist. You will find some working URLs below.

Putting API-call together

The API-call consists of:


Computop Paygate endpoint


Len & DataEncrypted data containing request data
additional paramsAdditional key/values in plain, not encrypted

Sending the API request

A request can be sent either via GET or POST. We recommend to use POST for two reasons:

  • with GET the parameter length is restricted to 2048 bytes depending on the browser, while with POST the request length is limited to 5120 bytes; If you require longer strings please contact Computop Helpdesk
  • via GET the parameters are attached to the URL which can be easily manipulated by a customer - therefore Analytics prevents manipulation using Blowfish/AES encryption

Checking the Paygate response

Server-2-server response

With server-2-server requests a request will respond with a direct response containing

  • a status indicating success or failure of transaction
  • a code (response code) explaining details of transaction along with a description
  • other data like PayId for each payment process
  • and other data depending on the type transaction

Payment page / ansynchronous notification

In case of a redirect payment an ansynchronous notification is sent to your system indicated by a URLnotification.

The response can be either encrypted or in plain text - we recommend an encrypted response.


Please check:

  • just checking whether "URLFailed" or "URLSuccess" has been called is not sufficient and can easily misused
    • Response code: only "code=00000000" indicates a successful and completed action
  • HMAC in Analytics response is valid - to ensure that the message is not manipulated

Some tips on Paygate responses

Some tips on responses

Unexpected exception

Paygate response not containing "code" and "status" a very likely reason is that you simply used

  • a wrong template name or wrong MerchantId. See more details in our documentation for Payment Pages
  • PayId=0000....0000
  • code=8 digit

Paygate detected some error in request and a payment process has not been created.

These payment processes can not be found in Analytics.

An overview of response codes can be found here: Response codes

  • valid PayId
  • code=8 digit

A payment process with PayId has been created but the subsequent systems detected an error.

An overview of response codes can be found here: Response codes

The amount is the first parameter which is checked. The amount must be given in numbers without decimals.

But you may also simply have mixed up your MIDs and Encryption-keys - just doublecheck.

  • valid PayId
  • code=00000000
Payment / process successful and completed
  • valid PayId
  • code=0
Payment / process pending

A few URL calls to play with

Please find some test data to play here: Test Guide. However, the payments may result in error to prevent abuse.

Click and tryCommentsNotes
Click and tryLink to Hosted Payment Page without specific template data to initiate a payment process for 12,34 EURno template data specified
Click and tryThe same data (Len + Data) can be used with Hosted Payment Page using a different template for Hosted Payment Page itself and with specific templates for selected credit card payments and direct debit payments

As we start "Hosted Payment Page" the template refers to a HPP-template and we add template names for subsequent payment forms for credit card and direct debit payments:


We also add some CustomFields to display some additional customer information, just by changing "CustomField3" you can refer to your own logo. ((info) Only available if the "CustomFields" are supported by the templates)

Click and try

The same data (Len + Data) can be used withCredit Card Form (PaySSL)

As we start "PaySSL" the initial template name refers to a specific credit card template named "Cards_v1": 


Just by changing "Template=ct_responsive" you can use a different payment form design

  • No labels