@tap-payments/apple-pay-button 0.0.91-development → 0.0.93-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
1
  export declare const ApplePayVersion = 5;
2
2
  export declare const RSA_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8AX++RtxPZFtns4XzXFlDIxPBh0umN4qRXZaKDIlb6a3MknaB7psJWmf2l+e4Cfh9b5tey/+rZqpQ065eXTZfGCAuBLt+fYLQBhLfjRpk8S6hlIzc1Kdjg65uqzMwcTd0p7I4KLwHk1I0oXzuEu53fU1LSZhWp4Mnd6wjVgXAsQIDAQAB\n-----END PUBLIC KEY-----";
3
3
  export declare const MW_BASE_URL = "https://mw-sdk.dev.tap.company/v2/checkout";
4
+ export declare const APPLE_PAY_SCRIPT = "https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js";
@@ -1,3 +1,4 @@
1
1
  export var ApplePayVersion = 5;
2
2
  export var RSA_MW_PUBLIC_KEY = "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8AX++RtxPZFtns4XzXFlDIxPBh0umN4qRXZaKDIlb6a3MknaB7psJWmf2l+e4Cfh9b5tey/+rZqpQ065eXTZfGCAuBLt+fYLQBhLfjRpk8S6hlIzc1Kdjg65uqzMwcTd0p7I4KLwHk1I0oXzuEu53fU1LSZhWp4Mnd6wjVgXAsQIDAQAB\n-----END PUBLIC KEY-----";
3
3
  export var MW_BASE_URL = 'https://mw-sdk.dev.tap.company/v2/checkout';
4
+ export var APPLE_PAY_SCRIPT = 'https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js';
@@ -46,13 +46,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
46
46
  }
47
47
  };
48
48
  import { useCallback, useEffect, useMemo, useState } from 'react';
49
- import { ApplePayVersion, MW_BASE_URL } from '../constants';
49
+ import { APPLE_PAY_SCRIPT, ApplePayVersion, MW_BASE_URL } from '../constants';
50
50
  import { PAYMENT_METHOD_KEY, prepareApplePayRequest, shallRenderApplePay } from '../utils/config';
51
51
  import { IntegrationType } from '../@types';
52
52
  import { useMerchantApplePay } from './useMerchantApplePay';
53
53
  import { getDefaultThemeMode } from '../utils';
54
54
  import appService, { getAxiosGlobalHeaders, setAxiosGlobalHeaders } from '../api';
55
- import { areAllTheObjectStringValuesValid, ChargeCode, getPaymentMethod, getSelectedCurrency, mappingInterface, Scope } from '@tap-payments/acceptance-sdk';
55
+ import { areAllTheObjectStringValuesValid, ChargeCode, getPaymentMethod, getSelectedCurrency, mappingInterface, Scope, useScript } from '@tap-payments/acceptance-sdk';
56
56
  var FALLBACK_MERCHANT_IDENTIFIER = 'merchant.tap.gosell';
57
57
  export var useApplePay = function (_a) {
58
58
  var buttonProps = _a.buttonProps;
@@ -63,6 +63,7 @@ export var useApplePay = function (_a) {
63
63
  var _f = useState(false), success = _f[0], setSuccess = _f[1];
64
64
  var _g = useState(false), loading = _g[0], setLoading = _g[1];
65
65
  var _h = useState(false), isRounded = _h[0], setIsRounded = _h[1];
66
+ useScript(APPLE_PAY_SCRIPT);
66
67
  var mappedProps = __assign(__assign({}, buttonProps), { interface: mappingInterface(buttonProps.interface) });
67
68
  var interfaceObj = mappedProps.interface, merchant = mappedProps.merchant, customer = mappedProps.customer, acceptance = mappedProps.acceptance, scope = mappedProps.scope, debug = mappedProps.debug, onError = mappedProps.onError, onSuccess = mappedProps.onSuccess, onCancel = mappedProps.onCancel, onReady = mappedProps.onReady, metadata = mappedProps.metadata, operator = mappedProps.operator, order = mappedProps.order, onOrderCreated = mappedProps.onOrderCreated, transaction = mappedProps.transaction, post = mappedProps.post, redirect = mappedProps.redirect, integration = mappedProps.integration, features = mappedProps.features;
68
69
  var _j = metadata || {}, profileData = _j.profileData, headers = _j.headers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/apple-pay-button",
3
- "version": "0.0.91-development",
3
+ "version": "0.0.93-development",
4
4
  "description": "Apple Pay Button React Component",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.js",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "license": "ISC",
31
31
  "dependencies": {
32
- "@tap-payments/acceptance-sdk": "0.0.63",
32
+ "@tap-payments/acceptance-sdk": "0.0.64",
33
33
  "@tap-payments/browser-info": "^1.0.2",
34
34
  "@tap-payments/web-error-handing": "^1.0.1",
35
35
  "axios": "^1.2.2",