EDIT: you have to apply for an e-commerce portal test account here and use the assigned merchant id and secret you get once you are approved. That Merchant Id really is invalid.
The global payments SDK seems to send back the data in base64 format for example:
{
"MERCHANT_ID": "TUVSXzRjNWQ0NWIxMThmMjQzMGU5ZDhhNmQ1ZGZiNWQ0YzM0",
"ACCOUNT": "c2VjcmV0",
"CHANNEL": "",
"ORDER_ID": "TURVeU1qZGxPVEF0TXpRM1lpMDBZelkwTFdGaU1qTXRaV0l6TmpNNVlXWTNZV0Zp",
"AMOUNT": "MTAwMw==",
"CURRENCY": "VVNE",
"TIMESTAMP": "MjAyMTAyMTUxOTI5NTQ=",
"AUTO_SETTLE_FLAG": "MQ==",
"COMMENT1": "",
"CUST_NUM": "",
"PAYER_REF": "",
"PMT_REF": "",
"PROD_ID": "",
"SHIPPING_CODE": "NTAwMDE=",
"SHIPPING_CO": "ODQw",
"VAR_REF": "",
"HPP_LANG": "",
"MERCHANT_RESPONSE_URL": "",
"CARD_PAYMENT_BUTTON": "",
"HPP_VERSION": "Mg==",
"SHA1HASH": "ZDAzNjUzMjIzMWFkZDE0YzMyM2ZjNWQyYzY0Njc1NTJhODVlZTkwMw=="
}
You may want to decode the string on your client-side before passing it to the rxp-js handler:
let json = JSON.parse(res.toString());
Object.keys(json).forEach(key => json[key] = atob(json[key]));
RealexHpp.setHppUrl("https://pay.sandbox.realexpayments.com/pay");
// When using full page redirect your Response URL must be an absolute link
RealexHpp.redirect.init("realCheckoutButton","http://localhost:3000/responseUrl",json);