Skip to content

Commit

Permalink
Allow digital wallets payments when the mode is set to lightbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ahumulescu committed Feb 20, 2024
1 parent 9345717 commit 41d0e46
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/hpp/json/process-a-payment.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"HPP_CUSTOMER_PHONENUMBER_MOBILE": "44|789456123",
Expand Down
12 changes: 12 additions & 0 deletions lib/rxp-hpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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.
*
Expand Down

0 comments on commit 41d0e46

Please sign in to comment.