auth.cgi

 

Description

The function auth.cgi performs the first part of a credit card transaction (the authorisation). The authorisation includes e.g. credit- and debit-card control and reservation of the required amount for later capture. auth.cgi can be used straight from a standard HTML form embedded in the website (web shop) using the DIBS payment window, but may also be called directly from one's own script. The latter requires a valid SSL certificate and the ability to perform an HTTPS request, e.g. through the DIBS DOT-NET , DIBS PHP Functions or DIBS Java Bean. Please note, that SSL connections require a PCI certification, as directed by Visa International.

Function call

https://payment.architrade.com/cgi-ssl/auth.cgi

 

Input parameters

The function auth.cgi accepts the following input parameters:

Parameter

Description

merchant

The "merchant" parameter is the shop's DIBS identification number. The merchant number is available in the order confirmation email, and is a 7-digit integer.

amount

The amount to be transferred. The amount must be given in smallest possible unit, e.g. cents 100 = USD 1.

currency

The currency code of the transfer in the ISO4217 form, e.g. 208 for DKK (see list of other ISO4217 currency codes).

cardno

The credit card number. Credit card numbers consist of between 11 and 19 digits depending on the card type.

expmon

Expiry month of the credit card in the format 'mm', e.g. 02 for February.

expyear

Expiry year of the credit card in the format 'yy', e.g. 09 for 2009.

orderid

The shop's order number, which may contain a maximum of 50 characters.

textreply

If this variable is set to be true (e.g. textreply=yes), then the DIBS system returns its answer in simple text format. If you are not using the standard DIBS payment window, e.g. using server-to-server requests, this significantly simplifies parsing the answer from DIBS. You may use either port 80 or port 20080.

[preauth]

The amount value is ignored (although it is mandatory), after which it performs a ticket registration instead of an authorisation. The transaction value returned is the ticket. When using MD5 the "authkey" must be calculated from the string 'transact=xxxxxxxx&preauth=true&currency=yyy'.

[fullreply]

If this variable is set, all variables will be returned (as defined in the DIBS admin). Note: This only works when used together with textreply.

[md5key]

This variable enables a MD5 key control of the parameters received by DIBS. This control confirms that the parameters sent to DIBS have not been tampered with during the transfer. The MD5-key for auth.cgi is calculated as:

MD5(key2 + MD5(key1 + “merchant=<merchant>&orderid=<orderid> &currency=<cur>&amount=<amount>))

where key1 and key2 are shop specific keys available through the DIBS administration interface, and + is the concatenation operator. NB! MD5-key check must also be enabled through the DIBS administration interface in order to work. Further details on MD5-key control.

[cvc]

Card Verification Code. CVC check must be enabled through the DIBS administration interface. NB! The use of CVC codes may require special explanations to the customer. See the DIBS website for information on how to present this information to the user.

[test]

This variable indicates to the DIBS server that the transaction is a test transaction. If 'test=true' is included in the post to the DIBS server, the transaction is handled by a dedicated test server, and is not transferred to the acquirer. See the integration guide on the DIBS website for further explanation. Please note, that during the initial implementation phase, all transactions are automatically regarded as test transactions, regardless of the "test" parameter. Once DIBS has approved the implementation, the "test" parameter must be set when doing further testing. Please contact DIBS support if you require the full test mode to be re-enabled after your payment facility has gone live.

[uniqueoid]

If this parameter is set, the DIBS server checks whether the order number is unique. That is, if a previous transaction contains the same order number, the authorisation is rejected with reason=7. Unless the shop is unable to create unique order numbers, it is strongly recommended to enable uniqueoid. NB! Order numbers must be less than 50 characters.

[ip]

The DIBS system saves the IP number of the computer from which the form was submitted. The IP number is, among other things, used for fraud protection. The "ip" parameter is particularly useful in cases, where the web server's IP number is transfered, rather than that of the user's machine.

[capturenow]

If this parameter is set, the DIBS server tries to capture the transaction immediately following the authorisation (if this was successful). Instant capture is only allowed for shops that sell products that are not physically shipped to the customer, e.g. conference fees, or services on the internet. NB! "capturenow" requires "uniqueoid" to be enabled. Please contact DIBS if you intend to use "capturenow".

[account]

If several departments within a company use the same acquirer contract, it may be beneficial to keep track of the transactions per department. Setting the "account" parameter enables separation of the transactions by department in the DIBS administration interface.

[split]

"split" is used for splitting up a transaction into two or more sub-transactions. This enables part of an order to be paid for when shipped in part. It requires that the amount and currency of the part payments are known at the time of the order, and are posted to the DIBS server as:

split=2&amount1=<amount1>&amount2=<amount2>

i.e., a set of "amount" parameters replaces the original "amount" parameter. If the number of "amount" parameters is inconsistent with the number given in the "split" parameter, the authorisation fails with reason=8. Part transactions will show up in the DIBS administration interface as separate transactions with separat transaction numbers, but with the same order number. In the response from DIBS, the parameter "transact" is replaced with "transact1", "transact2", etc. If you are also using MD5-key control, please note, that the key is calculated using the sum total of the transactions.

[cardtype]

"cardtype" is used when one wishes to limit the type of credit cards the shop accepts. If "cardtype" is set, then only that specific card type will be accepted. All other card types will be rejected with reason=10. See our list of valid cardtypes.

[postype]

"postype" (one 't') is used when one wishes to register the transaction origin. For normal internet transaction it is not required to include "postype", as it is automatically set to SSL. Possible values are:

ssl = internet transactions,
magnetic = magnetic stripe read, and signature is available,
magnosig = magnetic stripe read, and no signature is available,
mail = mail order,
manual = manually entered,
phone = phone order,
signature = card and signature available, manually entered.

[confirm]

This parameter is used for enforcing either the two-stage or the three-stage model. Possible values are:

now = enforce two-stage model.
later = enforce three-stage model (if allowed).

You are always allowed to enforce the two-stage model. However, the three-stage model has some restrictions, such as, it must be a Dankort payment, or the "capturenow" option will override "confirm".

[return_checksum]

If "return_checksum" is sent to the DIBS server, the parameter "checksum" is returned. The parameter is a one-way calculated checksum based on the card number, and will always be the same for each card number. E.g. it can be used to check whether a specific credit card has been used before.

[cavv]

Card authentication verification value. Is used in relation to 3D-secure transactions.

[xid]

Transaction identification number for 3D-secure transactions.

[account_type]

Various Swedish bank cards support transactions both as debit and credit. If such a card is used, and the parameter "account_type=debit" is included, then the transaction will be treated as a debit transaction. Otherwise, if "account_type=credit", it is treated as a credit transaction.

 

Return parameters

The return parameters are dependant on the result of the authorisation. If the transaction was accepted then the return parameters are:

 

Parameter

Type

Description

transact

integer

All transactions are given a unique DIBS identification number. It is at minimum a 6-digit integer, e.g. transact=123456. If "split" is used, then "transact" is replaced by "transact1", "transact2", etc.

status

string

ACCEPTED/DECLINED

[acquirer]

string

Contains the acquirer, e.g. PBS, Teller, Euroline etc. (list of possible values). In order for the DIBS server to return the acquirer, the feature has to be activated through the DIBS administration interface.

[suspect]

boolean

If the DIBS fraud protection finds the transaction to be suspect, the parameter "suspect=true" will be returned. The fraud protection feature needs to be activated through the DIBS administration interface.

[severity]

integer

If the fraud protection is activated and swindle control is part of your agreement with DIBS, then the severity of a suspect authorisation is returned in this parameter. The higher the number, the more suspect the transaction is. DIBS recommends to check all authorisations with severity > 5.

[checksum]

string

Is returned only if "return_checksum" is sent when calling auth.cgi. The checksum is a one-way calculated 32-character string, based on the credit card number. The checksum is used for verifying that the information returned from DIBS. It can be used to check if a specific credit card has been used before.

[orderid]

string

The shop's original order identification number is returned.

[?x=<x>&y=<y>...]

optional

Parameters sent to auth.cgi as part of the accepturl are returned.

All values

not a parameter

In the DIBS administration interface it is possible to enable the return of all parameters sent to auth.cgi, except credit card details.

 

If the authorisation was not accepted the return parameters are:

 

Parameter

Type

Description

status

string

ACCEPTED/DECLINED

reason

integer

If the transaction is rejected, it returns with a reason for the rejection. Please refer to error codes for a list of possible values.

[?x=<x>&y=<y>...]

optional

All parameters sent to the DIBS server, as part of the cancelurl, are returned.

All values

not a parameter

In the DIBS administration interface it is possible to enable the return of all parameters sent to auth.cgi, except credit card details.


Example

 

<FORM action=https://payment.architrade.com/cgi-ssl/auth.cgi method=POST autocomplete="off">
    <input type="hidden" name="merchant" value="4412345">
    <input type="hidden" name="amount" value="2000">
    <input type="hidden" name="currency" value="208">
    <input type="hidden" name="cardno" value="5019100000000000">
    <input type="hidden" name="cvc" value="123">
    <input type="hidden" name="md5key" value="cfcd208495d565ef66e7dff9f98764da">
    <input type="hidden" name="expmon" value="12">
    <input type="hidden" name="expyear" value="05">
    <input type="hidden" name="orderid" value="11223344">
    <input type="hidden" name="test" value="yes">
    <input type="hidden" name="uniqueoid" value="yes">
    <input type="hidden" name="cardtype" value="DK,V-DK,MC(DK),DIN(DK)">
    <input type="hidden" name="textreply" value="no">
</FORM>