Status Retrievals (LEGACY)

Getting notification when a status changes

Response

Version

TXT_GET

Parameters are sent via GET variabeles

TRUE|#verification#

Current

TXT_POST

Parameters are sent via POST variabeles

TRUE|#verification#

Current

JSON_GET

Parameters are sent via GET

  • {
    "result": true,
    "verification": "X34"
    }_

Current

JSON_POST

Parameters are sent via POST variabeles

  • {
    "result": true,
    "verification": "X34"
    }_

Current

Parameters

When calling the exchange / communication URL, PAY. includes a number of POST / GET parameters.

Example exchange call
https://www.domain.com/exchange/?action=pending&order_id=819034534X2b5a00&payment_session_id=819034534&ip_address=1.2.3.4amount=9.99&extra1=order%20123&extra2=klant%20123&extra3=factuur%20123&info=facebook_campaign

The actual call may include more parameters, depending on the selected payment option.

ParameterDescriptionAvailable
actionThe action that has occurred. Click here for more information about the moment of calling.YES
order_idThe order ID with which you can verify the order's current status.YES
payment_session_idThe order’s payment session IDDEPRICATED
ip_addressThe user’s IP addressYES
amountThe amount of the transactionYES
extra1Free variable “extra1” that can be traced in the statistics. This variable may be included when starting the transaction.OPTIONAL
extra2Free variable “extra2” that can be traced in the statistics. This variable may be included when starting the transaction.OPTIONAL
extra3Free variable “extra3” that can be traced in the statistics. This variable may be included when starting the transaction.OPTIONAL
infoFree variable “info” that can be traced in the statistics. This variable may be included when starting the transaction.OPTIONAL

Request calls

The exchange call is invoked when the status of a transaction changes. The moment of invocation is indicated by the 'action' variable. This can vary per payment option and is shown below.

ActionPayment optionDescription
new_pptAllImmediately after a payment is successfully completed.
pendingAllImmediately after starting the payment
cancelAllImmediately after a payment is terminated or expired
refund:addAllImmediately after invoking the refund API or when a refund is created manually via the PAY. Admin Panel.
refund:receivedAllImmediately after a payment has been refunded. Refunds are processed immediately for the payment in arrears, gift card and credit card payment methods. IBAN refunds are placed in a batch and processed by the bank in question at around 10 AM.
refund:sendIBAN payment optionsImmediately after the bank has processed the refund batch. Only applies to IBAN refunds.
refund:stornoIBAN payment optionsA created refund could not be processed. An example is a refund to a revoked/blocked IBAN number
captureBNPL and creditcardImmediately after the authorisation has been switched to a capture. Only applies when autocapture (default) has been turned off.
verifyCreditcardImmediately after we flag a transaction as “suspicious.” This basically means that PAY. does not approve or reject the transaction yet. Its status must first be determined with an additional verification step.
transaction:fraudnoticeCreditcardImmediately after receiving a fraud report for a credit card transaction
chargeback:revertCreditcardImmediately after a credit card chargeback is reversed
chargeback:chargebackCreditcardImmediately after we flag a transaction as “chargeback”. A chargeback is demand by a credit-card provider to make good the loss on a fraudulent or disputed transaction.
incassoaddDirect debitImmediately after PAY. has processed the direct debit
incassosendDirect debitImmediately after the direct debit request has been sent to the bank in question.
incassocollectedDirect debitImmediately after the collected amount has been deposited into PAY.’s account. From that moment, it is also available on your balance.
incassostornoDirect debitImmediately after the collected amount has been recollected from our account. This may occur up to 56 calendar days after reception of the “incassocollected”.

Required response

To verify whether a request was received properly, we expect a response for your server in the TXT format. This response must consist of the word TRUE. If the correct response is not received, PAY. will consider the call failed and the retry scheme will be initiated (if one was set up).

HTTP status code must be 200 for a correct Exchange call, if we receive any other result, we mark the request as failed an the retry sceme will resend the request.

Processing exchange call

It is essential that you process the transaction via the exchange URL, not via the return URL. Not every customer reaches the return URL, because some people close the payment screen immediately after completing the payment. The return URL is therefore only intended to let customers know whether their payment was successful.

Contrary to the return URL, the exchange URL is always called. This is therefore where you can process orders in your back office, e.g. by updating its status in your database, sending an invoice or email, et cetera.

Verifying status
You should always verify the status of a transaction using the order_id parameter, just like in the PHP code example. Do not use the action parameter to determine the transaction’s status, as it may have been changed manually in the URL.

📘

Exchange timing

With many payment methods, the exchange URL is called in the Payment process. If the exchange response within the MAX-exhange-timeout, your platform will know the status before the user get's back on the Return URL. If you fail to respond within 5seconds, we transfer the user back to your shop, and retry the call via the selected retry sceme.

<?php 
# Setup API Url
$strUrl = "https://rest-api.pay.nl/v7/Transaction/info/array_serialize?"; 

# Add arguments
$arrArguments = array();
$arrArguments['transactionId'] = filter_var(
$_GET['order_id']);

# Prepare complete API URL
$strUrl = $strUrl . http_build_query($arrArguments);
$objCurl = curl_init($strUrl);
curl_setopt($objCurl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($objCurl, CURLOPT_USERAGENT, "Pay.nl 
Api Example");
curl_setopt($objCurl, CURLOPT_TIMEOUT, 5
);
curl_setopt($objCurl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($objCurl, "AT-XXXX-XXXX:<your-api-token>");
$strReturnData = curl_exec($objCurl);
curl_close($objCurl);

# Process result
$strMessage = '';
$arrResult = unserialize($strReturnData);
if(isset($arrResult['paymentDetails']['stateName'])) {

    if($arrResult['paymentDetails']['stateName'
] == 'PAID') {
        # Execute code to process the order       

        $strMessage = 'Order processed';
    }
    elseif($arrResult['paymentDetails']['stateName'] == 'CANCEL') {
        # Payment canceled, restock items

        $strMessage = 'Order canceled';
    }
}

echo 'TRUE|'.$strMessage;

Multicore

If you use the multicore, and you do not store the used core endpoint, you can calculate the Core Endpoint based on the generated orderID

CoreOrder ID PrefixExample
pay.nl22225050761Xd45454
fasterpay.nl (fallback core)33165050761Xd45232
achterelkebetaling.nl515165050761Xd45232
payments.nl525225050761Xd4554