Skip to content

Commit

Permalink
Merge pull request #59 from ahumulescu/feature/lightbox-allow-digital…
Browse files Browse the repository at this point in the history
…-wallets

Allow digital wallets payments when the mode is set to lightbox
  • Loading branch information
securesubmit-buildmaster authored Mar 5, 2024
2 parents 03cf2b8 + 02a6b79 commit 2132b44
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<a href="https://github.com/globalpayments" target="_blank">
<img src="https://developer.globalpay.com/static/media/logo.dab7811d.svg" alt="Global Payments logo" title="Global Payments" align="right" width="225" />
<img src="https://avatars.githubusercontent.com/u/25797248?s=200&v=4" alt="Global Payments logo" title="Global Payments" align="right" width="225" />
</a>

# 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

---
14 changes: 13 additions & 1 deletion dist/rxp-js.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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.
*
Expand Down
Binary file modified dist/rxp-js.min.js
Binary file not shown.
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 2132b44

Please sign in to comment.