refund.cgi

 

Description

The function refund.cgi cancels a captured transaction and transfers the money back to the card holders account. In order to be able to do refunds a special agreement is required with your acquirer. refund.cgi supports credit card transactions only, thus for internet banking transactions the refund must be done through your bank. To avoid abuse the refund function must be called using login information. The login and password is identical to those used for accessing the DIBS administration interface (create an API user).

 

Usage

  • The function refund.cgi is called with the URL (se below)
  • The request is processed by the DIBS server
  • The response from the DIBS server is sent back to the script that send the refund request

 

Function call

https://login:password@payment.architrade.com/cgi-adm/refund.cgi


Input parameters

The function refund.cgi accepts the following input parameters:

 

Parameter

Description

merchant

The merchant parameter is the shops DIBS identification number. The merchant number is available in the order confirmation email and is a 7-digit integer.

amount

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

currency

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

transact

All transactions are given a unique DIBS identification number, it is a  as minimum 7-digit integer , e.g. transact=1234567.

orderid

The shops order number, which may contain a maximum of 50 characters.

textreply

If this variable is set (e.g. textreply=true) the DIBS server 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 and is recommended.

[md5key]

This variable enables a MD5 key control of the values received by DIBS. This control  confirms that the values sent to DIBS has not been tampered with during the transfer. The MD5 key is calculated as:

MD5(key2 + MD5(key1 + “merchant=<merchant>&orderid=<orderid> &transact=<transact>&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 ).

[account]

If the account parameter was initially used when the payment was made it should also be used here.

 

Return parameters

The function refund.cgi returns one response parameter: result. If result=0 the refund was processed successfully. If the refund was not accepted result relays an error code.


Example

<FORM action="https://login:password@payment.architrade.com/cgi-adm/refund.cgi" method=POST>
    <input type="hidden" name="merchant" value="12345678">
    <input type="hidden" name="amount" value="2000">
    <input type="hidden" name="currency" value="208">
    <input type="hidden" name="orderid" value="11223344">
    <input type="hidden" name="md5key" value="cfcd208495d565ef66e7dff9f98764da">
    <input type="hidden" name="textreply" value="yes">
</FORM>