@tap-payments/apple-pay-button 0.0.47-development → 0.0.48-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.
@@ -14,20 +14,6 @@ declare class APPService extends BaseService {
14
14
  pk: string;
15
15
  domain: string;
16
16
  }): Promise<void>;
17
- getHttpHeaders(): Promise<{
18
- [x: string]: (string | number | boolean | string[] | import("axios").AxiosHeaders | null) | undefined;
19
- head?: import("axios").AxiosHeaders | undefined;
20
- link?: import("axios").AxiosHeaders | undefined;
21
- get?: import("axios").AxiosHeaders | undefined;
22
- delete?: import("axios").AxiosHeaders | undefined;
23
- options?: import("axios").AxiosHeaders | undefined;
24
- post?: import("axios").AxiosHeaders | undefined;
25
- put?: import("axios").AxiosHeaders | undefined;
26
- patch?: import("axios").AxiosHeaders | undefined;
27
- purge?: import("axios").AxiosHeaders | undefined;
28
- unlink?: import("axios").AxiosHeaders | undefined;
29
- common?: import("axios").AxiosHeaders | undefined;
30
- }>;
31
17
  checkoutProfile(request: CheckoutProfileRequest): Promise<{
32
18
  merchant: any;
33
19
  payment_options: any;
@@ -13,17 +13,6 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
- var __assign = (this && this.__assign) || function () {
17
- __assign = Object.assign || function(t) {
18
- for (var s, i = 1, n = arguments.length; i < n; i++) {
19
- s = arguments[i];
20
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
- t[p] = s[p];
22
- }
23
- return t;
24
- };
25
- return __assign.apply(this, arguments);
26
- };
27
16
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
28
17
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29
18
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -204,18 +193,6 @@ var APPService = (function (_super) {
204
193
  });
205
194
  }
206
195
  });
207
- Object.defineProperty(APPService.prototype, "getHttpHeaders", {
208
- enumerable: false,
209
- configurable: true,
210
- writable: true,
211
- value: function () {
212
- return __awaiter(this, void 0, void 0, function () {
213
- return __generator(this, function (_a) {
214
- return [2, __assign({}, httpClient.defaults.headers.common)];
215
- });
216
- });
217
- }
218
- });
219
196
  Object.defineProperty(APPService.prototype, "checkoutProfile", {
220
197
  enumerable: false,
221
198
  configurable: true,
@@ -5,4 +5,18 @@ export declare const MW_BASE_BETA_URL = "https://mw-sdk.beta.tap.company/v2/chec
5
5
  export declare const MW_BASE_SANDBOX_URL = "https://mw-sdk.sandbox.tap.company/v2/checkout";
6
6
  declare const httpClient: import("axios").AxiosInstance;
7
7
  export declare const setAxiosGlobalHeaders: (headers: Record<string, string>) => void;
8
+ export declare const getAxiosGlobalHeaders: () => {
9
+ [x: string]: (string | number | boolean | string[] | import("axios").AxiosHeaders | null) | undefined;
10
+ head?: import("axios").AxiosHeaders | undefined;
11
+ link?: import("axios").AxiosHeaders | undefined;
12
+ get?: import("axios").AxiosHeaders | undefined;
13
+ delete?: import("axios").AxiosHeaders | undefined;
14
+ options?: import("axios").AxiosHeaders | undefined;
15
+ post?: import("axios").AxiosHeaders | undefined;
16
+ put?: import("axios").AxiosHeaders | undefined;
17
+ patch?: import("axios").AxiosHeaders | undefined;
18
+ purge?: import("axios").AxiosHeaders | undefined;
19
+ unlink?: import("axios").AxiosHeaders | undefined;
20
+ common?: import("axios").AxiosHeaders | undefined;
21
+ };
8
22
  export default httpClient;
@@ -30,4 +30,7 @@ httpClient.interceptors.response.use(function (response) {
30
30
  export var setAxiosGlobalHeaders = function (headers) {
31
31
  httpClient.defaults.headers.common = __assign(__assign({}, httpClient.defaults.headers.common), headers);
32
32
  };
33
+ export var getAxiosGlobalHeaders = function () {
34
+ return __assign({}, httpClient.defaults.headers.common);
35
+ };
33
36
  export default httpClient;
@@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
48
  import { useCallback, useEffect, useState } from 'react';
49
49
  import appService from '../api/app.service';
50
50
  import { ApplePayVersion, Scope } from '../constants';
51
- import { setAxiosGlobalHeaders } from '../api/httpClient';
51
+ import { getAxiosGlobalHeaders, setAxiosGlobalHeaders } from '../api/httpClient';
52
52
  import { getApplePayPaymentMethod, getApplePayRequest, validateSupportedNetworks } from '../utils/config';
53
53
  import { getMerchantCapabilities } from '../utils/defaultValues';
54
54
  export var useApplePay = function (_a) {
@@ -143,7 +143,7 @@ export var useApplePay = function (_a) {
143
143
  onOrderCreated === null || onOrderCreated === void 0 ? void 0 : onOrderCreated((_l = (_k = data.payment_options) === null || _k === void 0 ? void 0 : _k.order) === null || _l === void 0 ? void 0 : _l.id);
144
144
  setApplePayRequestConfiguration({
145
145
  BASE_URL: appService.getBaseUrl(),
146
- headers: __assign({}, appService.getHttpHeaders()),
146
+ headers: getAxiosGlobalHeaders(),
147
147
  merchant: data.merchant
148
148
  });
149
149
  return [3, 9];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/apple-pay-button",
3
- "version": "0.0.47-development",
3
+ "version": "0.0.48-development",
4
4
  "description": "Apple Pay Button React Component",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.js",