PayPal API

With the HTTP API for Request payment, you can start and check payments. Use the HTTP API when you want to send requests to DigiWallet from your shop or app and when the DigiWallet PHP SDK can not be used.

Payment in 2 steps:

  1. Start the payment via DigiWallet by calling an URL with all the details of the payment. DigiWallet gives you the link for the payment and a transaction ID. (Start API) ;
  2. The status of the payment will be reported and the visitor will be returned to your site. You can check the status of the payment with the "Check API" (Check API) ;

Start API Request payment

Before starting the payment, you have to call the Start API. You will get a paymentlink and a transaction ID (for in your database).

Call the next URL with GET or POST:

https://transaction.digiwallet.nl/paypal/start

With the following parameters (* = required):

Variable Explanation Example
ver* API version, this is version 1 1
rtlo* Shop ID (also known as subaccount or layoutcode) to which the payment has to be made 93393
amount* Amount in eurocents: Minimum 84 , Maximum 1000000 1000
description* Description of the transaction: this will apear on the customer's bank statement. Use only letters or numbers, max. 32 characters Webshop order #1234
reporturl Report URL: is called after payment (server-to-server), by means of a POST. Check here if the payment was indeed completed and process the order further. This script is also invoked if the customer were to accidentally close the browser. If parameters are sent:
  • eventType: event type that triggered the callback, possible values are: paymentPerformed, paymentCanceled, paymentExpired
  • paymentID: order number
  • acquirerID: acquirer order number
  • amount: amount in cents
  • paymentDateTime: the date and time the payment was actually performed
  • eventDateTime: YYYY-MM-DD H:i:S datetime of the event
To secure that the status return is coming from DigiWallet you should always call to Check API . The output of the report URL will not be visible to the customer. The customer is redirected to the return- or cancel URL.
https://www.myshop.nl /reportOrder
returnurl* Return URL: this page is where your customer will be referred to after a (successful) payment. To this URL shall the transaction number in the variable trxid be given.
Example: https://www.myshop.nl/thankYouPage?trxid=30626804185492
https://www.myshop.nl /thankYouPage
cancelurl Cancel URL: The URL where the visitor is sent to after cancelling the payment. If this is not completed, then after a cancelled payment there will be referenced to the return URL. https://www.myshop.nl /orderCancelled
country Countrycode according to ISO 3166-1 Default value is: NL NL
currency Currency code according to ISO 4217 Default value is: EUR EUR
userip IP address of the customer. 213.76.8.33
email Email address of the customer. test@example.com
test Whether to run in test mode or not.
Note that running in test mode still generates a real-money transaction, but it doesn't need to be successfully completed to get a success response from the Check API.
"1" or "0"


You will then get result in the following:

resultaatcode   transactienummer | bank-url

Example

000000 PAY-XXXXXXXXXXXXXXXXXXXXXXXX|https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-XYXYXYXYXYXYXYXYX
You can then save transactienummer in your database and send the visitor to the bank-url through a redirect.


Possible result codes:

Result code Description
000000 Payment is prepared
DW_SE_0029 No contract on this layoutcode There is either no contract on this layoutcode or it is not active, mail to sales@targetmedia.eu
DW_XE_0003 Validation failed, details: JSON-encoded array One or more fields failed to validate, you can decode the JSON array for a detailed analysis.
DW_IE_0001 Unknown internal error Unknown internal error, mail to techsupport@targetmedia.eu to be sorted out

Check in case of errors if the parameters are correctly taken from the documentation. If this seems to be the case. Please contact DigiWallet and mention the error message.

Check API Request payment status


Based on the transaction number you can check if the payment is actually made. After payment, the report URL underwater is invoked by the DigiWallet server. It also mentions the payment status, but for safety reasons we strongly recommend to always ask the status from DigiWallet.

Invoke the following URL with a GET or POST:

https://transaction.digiwallet.nl/paypal/check

The following parameters (* = required):

Variable Explanation Example
rtlo* Shop ID (layoutcode) 93393
trxid* Transaction number 30626804185492


If the payment is successfully completed, you will receive as answer :

000000 OK


If the payment is not successfully completed or the transaction is unknown :

Error code Description
DW_SE_0020 Transaction has not been completed, try again later Transaction has not yet been completed, try again later
DW_SE_0023 Transaction could not be processed The transaction could not be processed
DW_IE_0001 Unknown internal error Unknown internal error, mail to techsupport@targetmedia.eu to be sorted out