Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenB committed Nov 14, 2022
2 parents e554c8b + 026dbbe commit 5e568a9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = {
$(document).on('applepay:init', function (e, data) {
const { $container, productData } = data;

if (location.protocol !== 'https:' || !ApplePaySession.supportsVersion(appleSessionVersion)) {
if (!window.ApplePaySession || location.protocol !== 'https:' || !ApplePaySession.supportsVersion(appleSessionVersion)) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@
const httpUtils = require('../utils/http');

const ACTION = window.dw.applepay && window.dw.applepay.action;
const STATUSES = {
Failure: ApplePaySession.STATUS_FAILURE,
InvalidBillingPostalAddress: ApplePaySession.STATUS_INVALID_BILLING_POSTAL_ADDRESS,
InvalidShippingPostalAddress: ApplePaySession.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,
InvalidShippingContact: ApplePaySession.STATUS_INVALID_SHIPPING_CONTACT,
PINRequired: ApplePaySession.STATUS_PIN_REQUIRED,
PINIncorrect: ApplePaySession.STATUS_PIN_INCORRECT,
PINLockout: ApplePaySession.STATUS_PIN_LOCKOUT
};
const AppleSession = require('./applePaySession');


/** Map Apple Pay Session statusses
* @param {string} status - status to be mapped
* @returns {number} AppleSession status
*/
function mapStatus(status) {
const STATUSES = {
Failure: ApplePaySession.STATUS_FAILURE,
InvalidBillingPostalAddress: ApplePaySession.STATUS_INVALID_BILLING_POSTAL_ADDRESS,
InvalidShippingPostalAddress: ApplePaySession.STATUS_INVALID_SHIPPING_POSTAL_ADDRESS,
InvalidShippingContact: ApplePaySession.STATUS_INVALID_SHIPPING_CONTACT,
PINRequired: ApplePaySession.STATUS_PIN_REQUIRED,
PINIncorrect: ApplePaySession.STATUS_PIN_INCORRECT,
PINLockout: ApplePaySession.STATUS_PIN_LOCKOUT
};
if (status && STATUSES[status]) {
return STATUSES[status];
}
Expand Down

0 comments on commit 5e568a9

Please sign in to comment.