diff --git a/examples/hpp/json/process-a-payment.json b/examples/hpp/json/process-a-payment.json index 65f9409..ab7c127 100644 --- a/examples/hpp/json/process-a-payment.json +++ b/examples/hpp/json/process-a-payment.json @@ -1,10 +1,9 @@ { "MERCHANT_ID": "heartlandgpsandbox", - "ACCOUNT": "3dsecure", - "AMOUNT": "1001", + "ACCOUNT": "hpp", + "AMOUNT": "1000", "CURRENCY": "EUR", "AUTO_SETTLE_FLAG": "1", - "PM_METHODS": "cards", "HPP_CUSTOMER_EMAIL": "test@example.com", "HPP_CUSTOMER_PHONENUMBER_MOBILE": "44|789456123", diff --git a/lib/rxp-hpp.js b/lib/rxp-hpp.js index c658b82..1e470f5 100644 --- a/lib/rxp-hpp.js +++ b/lib/rxp-hpp.js @@ -419,6 +419,7 @@ var RealexHpp = (function () { iFrame.setAttribute("frameBorder", "0"); iFrame.setAttribute("width", "360px"); iFrame.setAttribute("seamless", "seamless"); + iFrame.setAttribute("allow", "payment " + internal.getBaseUrl(hppUrl)); iFrame.style.zIndex = "10001"; iFrame.style.position = "absolute"; @@ -550,6 +551,17 @@ var RealexHpp = (function () { return internal.getUrlParser(url).hostname; }, + /** + * Gets the base URL from a URL. Used to set the 'allow payment' attribute. + * + * @param {string} url + * @returns the base URL of the provided URL + */ + getBaseUrl: function (url) { + var urlParser = internal.getUrlParser(url); + return urlParser.protocol + '//' + urlParser.hostname; + }, + /** * Checks if the origin is HPP. *