require 'paynl'
# Set configuration
Paynl::Config::setApiToken('e41f83b246b706291ea9ad798ccfd9f0fee5e0ab')
Paynl::Config::setServiceId('SL-3490-4320')
data = Paynl::Transaction.new
result = data.getTransaction(transactionId)
if Paynl::Helper::transactionIsPaid(result) or Paynl::Helper::transactionIsPending(result)
# redirect user to thank you page
else
# it has not been paid yet, so redirect user back to checkout
end

var Paynl = require('paynl-sdk');
# Set configuration
Paynl.Config.setApiToken('e41f83b246b706291ea9ad798ccfd9f0fee5e0ab');
Paynl.Config.setServiceId('SL-3490-4320');
# Verify the transaction status
Paynl.Transaction.get('715844054X85729e').subscribe(
function(result){
// some examples of what you can do with the result
if (result.isPaid()) {
console.log('The transaction is paid');
}
if (result.isCanceled()) {
console.log('Tranasaction is canceled, restock the items');
}
},
function(error){
console.error(error);
}
)