Skip to content

Commit

Permalink
ensure 3ds redirects don't cause errors
Browse files Browse the repository at this point in the history
  • Loading branch information
slogsdon committed Jul 27, 2021
1 parent 9909985 commit 421b263
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@ module.exports = function(grunt) {
grunt.registerTask('test', ['test:unit', 'test:functional']);

// Default task.
grunt.registerTask('default', ['jshint', 'jasmine', 'concat', 'uglify']);
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);

};
15 changes: 9 additions & 6 deletions dist/rxp-js.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! rxp-js - v1.4.0 - 2021-05-18
/*! rxp-js - v1.5.0 - 2021-07-27
* The official Realex Payments JS Library
* https://github.com/realexpayments/rxp-js
* Licensed MIT
Expand Down Expand Up @@ -367,15 +367,18 @@ var RealexHpp = (function () {
iFrame.style.transform = "scale(1)";
iFrame.style.backgroundColor = "#ffffff";

if (spinner.parentNode) {
if (spinner && spinner.parentNode) {
spinner.parentNode.removeChild(spinner);
}

closeButton = internal.createCloseButton();
overlayElement.appendChild(closeButton);
closeButton.addEventListener("click", function () {
internal.closeModal(closeButton, iFrame, spinner, overlayElement);
}, true);

if (overlayElement && closeButton) {
overlayElement.appendChild(closeButton);
closeButton.addEventListener("click", function () {
internal.closeModal(closeButton, iFrame, spinner, overlayElement);
}, true);
}
};

var form = internal.createForm(document, token);
Expand Down
4 changes: 2 additions & 2 deletions dist/rxp-js.min.js

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions examples/hpp/json/process-a-payment.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
{
"MERCHANT_ID": "heartlandgpsandbox",
"ACCOUNT": "hpp",
"ACCOUNT": "3dsecure",
"AMOUNT": "1001",
"CURRENCY": "EUR",
"AUTO_SETTLE_FLAG": "1",
"PM_METHODS": "cards"
"PM_METHODS": "cards",

"HPP_CUSTOMER_EMAIL": "[email protected]",
"HPP_CUSTOMER_PHONENUMBER_MOBILE": "44|789456123",
"HPP_BILLING_STREET1": "Flat 123",
"HPP_BILLING_STREET2": "House 456",
"HPP_BILLING_STREET3": "Unit 4",
"HPP_BILLING_CITY": "Halifax",
"HPP_BILLING_POSTALCODE": "W5 9HR",
"HPP_BILLING_COUNTRY": "826",
"HPP_SHIPPING_STREET1": "Apartment 852",
"HPP_SHIPPING_STREET2": "Complex 741",
"HPP_SHIPPING_STREET3": "House 963",
"HPP_SHIPPING_CITY": "Chicago",
"HPP_SHIPPING_STATE": "IL",
"HPP_SHIPPING_POSTALCODE": "50001",
"HPP_SHIPPING_COUNTRY": "840",
"HPP_ADDRESS_MATCH_INDICATOR": "FALSE",
"HPP_CHALLENGE_REQUEST_INDICATOR": "NO_PREFERENCE"
}
13 changes: 8 additions & 5 deletions lib/rxp-hpp.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,18 @@ var RealexHpp = (function () {
iFrame.style.transform = "scale(1)";
iFrame.style.backgroundColor = "#ffffff";

if (spinner.parentNode) {
if (spinner && spinner.parentNode) {
spinner.parentNode.removeChild(spinner);
}

closeButton = internal.createCloseButton();
overlayElement.appendChild(closeButton);
closeButton.addEventListener("click", function () {
internal.closeModal(closeButton, iFrame, spinner, overlayElement);
}, true);

if (overlayElement && closeButton) {
overlayElement.appendChild(closeButton);
closeButton.addEventListener("click", function () {
internal.closeModal(closeButton, iFrame, spinner, overlayElement);
}, true);
}
};

var form = internal.createForm(document, token);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rxp-js",
"description": "The official Realex Payments JS Library",
"version": "1.4.0",
"version": "1.5.0",
"homepage": "https://github.com/realexpayments/rxp-js",
"author": {
"name": "Realex Developer",
Expand Down

0 comments on commit 421b263

Please sign in to comment.