Version 1.4 - 08.06.2021

Version 1.3 - 16.02.2021

Version 1.2 - 17.09.2020

Version 1.1 - 23.09.2019

Version 1.0 - initial version


Integration must be done within our test environment first. When this process is finished and approved by our staff, you may go live and start processing with real money.
To start integrating with WebPay Form service you will need the following:
• test merchant account
• HTTP client library if you need to programmatically manage approved transactions through API

If you don’t have a test merchant account, please contact us at su[email protected] and we will open one for you.
Then you can login into your account at with login and password provided.

Payment form

WebPay Form is a simple web service; merchant should collect data consisted of buyer’s profile and order info at his site and submit that data to using HTTP POST method.

IMPORTANT Parametrize URL, in production mode the subdomain will be different.

After a valid request is made to WebPay service, a payment form is presented to the buyer.

Buyer now fills in the card details and submits the form.

Service issues a request for authorization to acquirer bank and redisplays appropriate message if authorization is declined.

If authorization is approved, a redirect is made back to a merchant site.

NOTICE Buyer stays at our side if transaction is declined, form is redisplayed with appropriate message. There is no means to communicate the failure of transaction to merchant at this point.

Optionally, email messages are sent to merchant and/or buyer to notify both sides of successful purchase. This setting is available under merchant account together with custom email templates for outgoing email message.

Transaction Types


Authorization is preferred transaction type for e-commerce. Merchant must capture these transactions within 28 days (or this capture period depends on the bank), in order to transfer the money from buyer’s account to his own. This transaction can also be voided if a buyer cancels the order. Refund can be done after original authorization is captured.


Purchase doesn’t need to be approved; funds are transferred in next settlement between issuer and acquirer banks, usually within one business day. These transactions can be refunded within 180 days.


Approved authorization must be captured for the funds to be transferred form buyer’s card to merchant account. This action can be done through merchant account interface or programmatically through an API call. A lesser amount than an original authorization amount can be captured as well, ie. a merchant can make partial delivery of goods and/or services. Capture must be done within 28 days or it will be automatically voided.


Approved purchases and captures can be refunded within 180 days. This action can be done through merchant account interface or programmatically through an API call. This is required if a merchant cancels the order after transaction is settled, or a buyer is not satisfied with delivered goods and/or services. Refunds can be done with a lesser amount than an original authorization amount.


Approved authorization must be voided within 28 days if merchant cancels the order. This action can be done through merchant account interface or programmatically through an API call.

API settings

API settings can be found under your merchant account. This information is necessary for service to work properly. API settings values reflect a configuration at the merchant site:
• Authenticity token is unique merchant identifier, can be found under merchant settings
• Key is a shared secret used to calculate digest value
• Success URL is an URL at the merchant site where a buyer is redirected after approved authorization.
• Cancel URL is an URL at the merchant site where a buyer is redirected if cancel link is clicked at payment form
• Redirect to success URL should be set to true if merchant parses the data carried in redirect to success URL, ie. a listener will wait for this request and update order status.
• Callback URL should be set under merchant profile if the merchant wants us to send POST request message for each approved authorization

IMPORTANT Parametrize these values for API settings, we strongly advice a merchant to have both, testing and production environments.

Return values

Redirect to success URL is made after transaction is approved and if redirect flag is set in API settings. Data for this transaction is returned back to merchant site in this step. Following variables are set in redirect GET request to success URL:
• acquirer
• amount
• approval_code
• authentication
• cc_type
• ch_full_name
• currency
• custom_params
• enrollment
• language
• masked_pan
• number_of_installments
• order_number
• response_code
• digest (returned digest)

This request may look like this: c64b2f5a0701997c8f9cfe4293706e88203cd911695ab747ce45830e4e3cbf71577c401e476988e4a4e1b0b 5f3ecbc56277394df07fa51fbe05869d1b067a

Returned digest is calculated as SHA512(key+success_url without digest). You must check for this value at merchant application before updating status of transaction because malicious user can forge this URL.

Returned digest is calculated using following formula:

digest = SHA512(key + succesURL(without DIGEST))
digest = SHA512('2345klj')

IMPORTANT Success URL should expire after some sensible amount of time or protected using session.


You can set your callback URL under your merchant profile data if you want us to send a POST request with all the transaction parameters for each approved transaction.
POST request is sent to your endpoint in JSON format.
We expect HTTP 200 OK status response code to terminate the job, otherwise we’ll send the data periodically until we re-ceive 200.
Here is a list of parameters included in callback request:

   "order_info":"order info for a6b62d07cc89aa0",
   "ch_full_name":"John Doe",
   "xid":"fake authenticated xid +=",
   "acsv":"fake authenticated cavv +=",
   "custom_params":"{a:b, c:d}"

Email Notifications

Service can notify merchant and buyer upon successful purchase. Merchant can use this message to track pending transactions and buyer can keep them as reference. Both can be customized under your merchant account.

The following variables are interpolated into body of each email template:

Email template to notify the buyer may look like this:

Thank you for your business! 
Credit Card Owner: ------------------ 
name: FULL_NAME 
phone: PHONE email: EMAIL 
card issuer: CARD_ISSUER
Order Details: ------------------ 
order amount: AMOUNT 
order number: ORDER_NUMBER 
order description: ORDER_INFO 
payment type: CC_TYPE 
date: DATE 
order url: SUCCESS_URL 
Please come again! 
Store adress: DOMAIN 

NOTICE SUCCESS_URL has the same value as URL generated for redirect to success URL after transaction is approved. It should expire after some sensible amount of time or protected using session.

Variables - names, lengths and formats

Here are the definitions of variables which are submitted to WebPay form:

Buyer’s profile

name length format additional info
ch_full_name 3-30 alphanumeric buyer’s full name
ch_address 3-100 alphanumeric buyer’s address
ch_city 3-30 alphanumeric buyer’s city
ch_zip 3-9 alphanumeric buyer’s zip
ch_country 2-3 alphanumeric buyer’s country in alpha2, alpha3 letter code or 3 digit ISO numeric code
ch_phone 3-30 alphanumeric buyer’s phone
ch_email 3-100 alphanumeric buyer’s email

Order details

name length format additional info
order_info 3-100 alphanumeric short description of order being processed
order_number 1-40 alphanumeric unique identifier
amount 3-11 integer amount is in minor units, ie. 10.24 USD is sent as 1024
currency predefined alpha possible values are USD, EUR, BAM or HRK

Processing data

name length format additional info
language predefined alpha used for errors localization, possible values are en, es, ba or hr
transaction_type predefined alpha possible values are authorize, purchase, capture, refund, void
authenticity_token 40 alphanumeric auto generated value for merchant account, can be found under merchant settings
digest 40 alphanumeric SHA512 hash generated from concatenation of key, order_number, amount and currency as strings; key can be found under merchant settings
number_of_installments 1-2 integer range 2-12
moto predefined boolean possible value is true or false; missing variable is equivalent to false

Additional info

name length format additional info
tokenize_pan_offered predefined boolean if true and merchant has secure vault active (tokenization enabled) then save card for future payments will be shown to customer. If customer decided to save the card and transaction is approved we’ll provide pan_token which you can store on your side.
whitelisted_pan_tokens predefined comma separated pan tokens DEPRECATED, check migration guide
supported_payment_methods predefined comma separated payment methods provide this value if customer decides to pay with previously saved card(s) or with new card. If this value is provided and valid (card not expired, token valid etc) then only cvv input will be shown on the payment form. All other information (masked pan, expiry date etc) will be pre filled. Multiple tokens can be sent (separated by comma). In that case, the user will have an option which payment method to use.
tokenize_pan predefined boolean tokenize pan without prompting the user
tokenize_brands predefined comma separated list of card brands provide this value if you want to limit card tokenization to card brand(s). Multiple brands can be sent (separated by comma). Refer to tokenize brands section below.
supported_cc_issuers predefined comma separated card issuers provide this value if you want to limit payment to the card to certain issuer(s)
rules predefined comma separated rules provide this value if you want to apply custom rules
force_installments predefined boolean provide this value if you want to force payment on installments. For more details refer to the force_installments documentation
custom_attributes predefined valid JSON string provide this value if you want to customize form behaviour. Refer to the custom attributes section below for more details.
success_url_override predefined valid HTTPS URL provide this value if you want to override success URL
cancel_url_override predefined valid HTTPS URL provide this value if you want to override cancel URL
callback_url_override predefined valid HTTPS URL provide this value if you want to override callback URL

Migrating from whitelisted_pan_tokens

Simply replace key whitelisted_pan_tokens with a key supported_payment_methods and you are good to go!

Supported Payment Methods

Usually deprecating useful existing functionality comes with reward!

Now it’s possible to set card + saved_card option thus enabling buyer to select one of saved card or rather enter a new card.

Simply replace whitelisted_pan_tokens with supported_payment_methods and you are free to add card option to previously saved cards.

Setting supported payment method as:

will result in:

Supported Card Issuers

To limit payment to the card with certain issuer(s) simply provide comma separated list of supported card issuers for payment.

An example would be:


Transaction is declined if the buyer enters unsupported card (the card issuer is not one of supported issuers).

For full list of supported issuers contact [email protected].

Form Rules

To limit payment with rules simply provide comma separated list of rules for the payment.

An example would be:


Transaction is declined if one of rules is not satisfied.

Currently Rules functionality is in BETA phase. If you are interested in using custom rules please contact us at [email protected]

Force installments

To force payment on installments use force_installments option.

Supported values are: true or 'true'. If you provide false or omit value then default value is false.

Buyer is forced to select one of provided installment options and is unable to pay one-time.


Force installments only work if installments are enabled on merchant profile.

An error is raised if you try to force payment on installments for merchant without enabled installments.

Tokenize brands

tokenize_brands - provide this value if you want to limit card tokenization to card brand(s). Multiple brands can be sent (separated by comma).

This value is used in conjunction with tokenize_pan_offered = true .

Supported brands:


Custom attributes

custom_attributes Provide this value if you want to customize form behaviour. This value (if provided) must be valid json.

Currently we support following keys:


	         "brand": "master",
	         "min_installments": 12,
	         "max_installments": 24
Installments Config

Used to customize installments selection after user’s card number input.

This extension can be used to fulfil contract between merchant and buyer, where buyer can only pay with one of supported card brands (provided in rules list) by selecting installments from min_installments to max_installments defined in installments config.


Installments config example:

	         "brand": "master",
	         "min_installments": 12,
	         "max_installments": 24

Usage example


If you need helping enabling installments contact [email protected]

Example steps

Custom variables

Merchant can also send custom variables if needed. They will be passed back in redirect after approved authorization. Just pack all the data you wish to send in JSON format and submit that under custom_params variable.

Calculating digest

Digest is calculated using following formula:
digest = SHA512(key + order_number + amount +currency)

With the following example data
• key: 2345klj
• order_number: abcdef
• amount: 54321
• currency: EUR

the digest formula gives a result as follows:
digest = SHA512.hexdigest(2345kljabcdef54321EUR) =>


Transaction management through API

WebPay API for capture/refund/void is a REST web service and you will need a HTTP client library (like cURL - All API calls are XML documents POST-ed over HTTPS to our test server at

IMPORTANT Parametrize URL, in production mode the subdomain will be different.

An example of such call using cURL from command line may look like this:
curl -H “Content-Type: application/xml” -H “Accept: application/xml” -k -i -d request_xml

where request_xml is a XML document that contains data necessary for transaction processing and is an URL that responds to certain API call.

IMPORTANT Accept and Content-Type headers must be set to application/xml for all message types.


After an authorization is successfully made, a capture call must be done to settle that authorization.
Capture XML document is POST-ed to where
:order_number has a value from original authorization.

Document example for capture message may look like this:

<?xml version="1.0" encoding="UTF-8"?>

Digest is calculated in the following way:
digest = SHA1(key + order_number + amount + currency)

NOTICE Node names are dasherized version of corresponding variable names, ie. underscores are replaced with dashes.

If all values pass validations at our side, transaction is send to the bank and response is returned. That response may look like this:

	:date=>"Tue, 25 Oct 2011 01:18:37 GMT",
	:content_type=>"application/xml; charset=utf-8",
	:x_runtime=>"1.475305", :transfer_encoding=>"chunked"
<?xml version="1.0" encoding="UTF-8"?>
    <id type="integer">845</id>
    <acquirer>rogach bank</acquirer>
    <amount type="integer">54321</amount>
    <response-message>authorization OK</response-message>
    <created-at type="datetime">2011-10-25T03:18:38+02:00</created-at>

New transaction is generated - 201 Created HTTP status code, and it’s location is set in appropriate HTTP header. A client then must parse a body from HTTP response and extract all values from that XML document. Transaction is approved only and if only status is set to approved. All other fields are standard data carried over payment networks. If issuer declines a transaction, status flag is set to decline. In a case of an error, the flag will be set to invalid.

IMPORTANT Do not rely on any output variable except status to determine success of capture.

NOTICE We highly recommend to our merchants to keep a whole response string and to save all parsed values for easier troubleshooting during the integration phase and production later on. The quality of our support depends on availability of these information.

In case of invalid request, service will also return a response with
406 Not Acceptable HTTP status code and XML document in its body. Each offended variable will be printed out along with brief explanation what went wrong. That response may look like this:

<?xml version="1.0" encoding="UTF-8"?>
    <error>Digest is invalid</error>


Purchase and capture messages can be refunded within 180 days. Request XML for this transaction_type is identical to capture example, but now the document is POST-ed to, where
:order_number has a value from original purchase or capture.
Response has identical structure as capture response and all response fields should be treated in the same way.


Void messages are POST-ed to, where
:order_number has a value from original message (authorization, capture, purchase or refund). They have identical structure as capture or refund messages.
Response has identical structure as capture response and all response fields should be treated in the same way.

Transactions with installments

Form will automatically recognize cards which are eligible for payments in installments. Installment range setup will be defined by the merchant-acquirer agreement.

3-D Secure

WebPay handles 3-D secure processing for you, this kind of integration doesn’t require any additional programming.

Demo client (Test client)

For easier integration we provided a demo client. Turn on the debug mode in API settings under your merchant account to activate the client. A link to client is available upon activation.

Append /success to that link and set as success URL if you want to see how those page could look like.

Look & feel

Custom headers, footer and custom CSS support are currently disabled, due to introduction of new form templates.