changestatus.cgi
Description
The purpose of changestatus.cgi is to allow changing the status of a specific transaction on the DIBS server, without using the DIBS administration interface. The transaction may have the following status:
- Declined: the transaction failed to be authorised.
- Captured: the transaction was captured.
- Matched: the transaction was matched against an ERP system.
- Pending: the transaction is ready to be captured.
For obvious reasons, it is not possible to change the status of an already captured transaction in order to allow it to be captured again. Transactions may change status in the following manner:
- Captured —> Matched
- Matched —> Captured
- Pending/Declined —> New
- Pending/Declined —> Cancelled
- Pending/Declined —> Captured
Usage
The standard workflow of changestatus.cgi is:
- Transaction information is posted to the URL (see below).
- The information is processed by the DIBS server.
- A response from the DIBS server is sent back to the script that called changestatus.cgi.
Function call
https://login:password@payment.architrade.com/cgi-adm/changestatus.cgi
Input parameters
For security reasons changestatus.cgi must be called using login information (using basic http authorisation). The username and password are identical to the ones used for accessing the DIBS administration interface (create an API user). Besides login information, changestatus.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 |
| 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 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. |
| force | Use this to change status from either Pending or Declined to New, Cancelled or Captured (see below for more information). |
| action | action must take on either: “new”, “matched”, “canceled”, or “captured” depending on the status you want the transaction to have afterwards. |
| [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. |
| [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. |
Force
DIBS is not responsible for any errors to the status that might occur when using the force parameter. Remember to use the transstatus.pml script to check the status of the transactions, before using the force parameter.
Return parameters
The response from changestatus.cgi contains the parameter status. If status=ACCEPTED, the status change was accepted and done. If status=DECLINED, the status change was declined. If the status change was declined, the parameter reason will also be returned.
Parameter | Type | Description |
| status | string | ACCEPTED/DECLINED |
| [reason] | integer | In case of status=DECLINED, the reason parameter returns an integer error code. Please refer to the list of error codes. |
Example
<FORM action="https://login:password@payment.architrade.com/cgi-adm/changestatus.cgi" method=POST>
<input type="hidden" name="merchant" value="12345678">
<input type="hidden" name="amount" value="2000">
<input type="hidden" name="action" value="matched">
<input type="hidden" name="textreply" Value="yes">
</FORM>