capture.cgi
Description
Second part of any transaction is the capture process. Usually this take place at the time of shipping the goods to the customer, and is normally accessed via the DIBS administration interface. You may, however, apply your own back-end application and use capture.cgi for capturing transactions. The only requirement is that you are able to do HTTPS requests from your server. The use of capture.cgi is particular beneficial when your back-end application is integrated with for instance your ERP system or other administrative software.
Usage
The standard workflow for capture.cgi is:
- The DIBS server processes the information.
- The result is posted back to the script that sent the request.
Note: There is an alternative way to do several captures in one operation. For further details see the section on batch capture.
Function call
https://payment.architrade.com/cgi-bin/capture.cgi
Input parameters
capture.cgi accepts the following input parameters:
Parameter | Description |
| merchant | Shop identification. The Merchant number appears in the e-mail received from DIBS during registration with DIBS or on your contract. Your merchant number can also be retreived by contacting your respective DIBS support department below. Denmark Norway Sweden |
| amount | The smallest unit of an amount, eg. cent for EUR , øre for Danish crowns, Example: 1,00 EUR = 100 or 1,50 EUR =150 |
| orderId | The shop’s order number for this particular puchase. It can be seen later when payment is captured, and will in some instances appear on the customer’s bank statement (both numerals and letters may be used). |
| transact | The unique DIBS identification number for the transaction you want to capture. The transact is returned from a successful authorisation, and is a as minimum 6-digit integer , e.g. transact=123456. |
| [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.
|
| [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. |
| [force] | If force=true is posted, the DIBS server will attempt to capture otherwise expired authorisations (more than 7 days old). This is achieved through an initial re-authorisation of the original transaction, followed by a capture process. Note: You cannot use the split shipment parameters "splitpay" and "close" along with "force". |
| [account] | If multiple departments utilize the company’s acquirer agreement with the acquirer, it may prove practical to keep the transactions separate at DIBS. An ”account number” may be inserted in this field, so as to separate transactions at DIBS. |
| [splitpay] | If set to "true" Split Payment is enabled.
Note: You cannot use the "force" parameter along with "splitpay". |
| [close] | If set to "true" close the Split Payment after capture. |
Return Parameters
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 |
| result | integer | The result is returned as an integer code. If the results=0 the transaction was successfully captured, otherwise an error code is returned. See the section on code lists for a list of error codes. |
| [amountleft] | Remaining amount. | |
| [stransact] | Id of the Split Payment sub transaction | |
| [sorderid] | Original order id postfixed with an auto incremented value. | |
Example
This example shows the call to capture.cgi in the form of a simplified standard HTML form:
<FORM action=https://payment.architrade.com/cgi-bin/capture.cgi method=POST>
<input type="hidden" name="merchant" value="12345678">
<input type="hidden" name="amount" value="2000">
<input type="hidden" name="transact" value="1234567">
<input type="hidden" name="orderid" value="11223344">
<input type="hidden" name="force" Value="yes">
<input type="hidden" name="textreply" Value="yes">
<input type="hidden" name="md5key" Value="cfcd208495d565ef66e7dff9f98764da">
</FORM>