diff --git a/CHANGELOG.md b/CHANGELOG.md index a5a91c9..784e207 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,15 @@ - Global Payments logo + Global Payments logo # Changelog -## Latest Version +## Latest Version - v1.5.3 (03/04/24) +#### Enhancements: +- Allow digital wallets payments when the mode is set to lightbox + +## v1.5.2 (06/08/23) #### Enhancements: - Allow the communication from Unified Payments - Update for the code examples - --- diff --git a/dist/rxp-js.js b/dist/rxp-js.js index 25b768c..243961e 100644 --- a/dist/rxp-js.js +++ b/dist/rxp-js.js @@ -1,4 +1,4 @@ -/*! rxp-js - v1.5.2 - 2023-06-08 +/*! rxp-js - v1.5.3 - 2024-03-04 * The official Realex Payments JS Library * https://github.com/realexpayments/rxp-js * Licensed MIT @@ -423,6 +423,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"; @@ -554,6 +555,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. * diff --git a/dist/rxp-js.min.js b/dist/rxp-js.min.js index 601348c..772ed57 100644 Binary files a/dist/rxp-js.min.js and b/dist/rxp-js.min.js differ 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. *