@tap-payments/apple-pay-button 0.0.46-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,9 +14,6 @@ declare class APPService extends BaseService {
|
|
|
14
14
|
pk: string;
|
|
15
15
|
domain: string;
|
|
16
16
|
}): Promise<void>;
|
|
17
|
-
getHttpHeaders(): Promise<import("axios").HeadersDefaults & {
|
|
18
|
-
[key: string]: string | number | boolean | string[] | import("axios").AxiosHeaders | null;
|
|
19
|
-
}>;
|
|
20
17
|
checkoutProfile(request: CheckoutProfileRequest): Promise<{
|
|
21
18
|
merchant: any;
|
|
22
19
|
payment_options: any;
|
package/build/api/app.service.js
CHANGED
|
@@ -193,18 +193,6 @@ var APPService = (function (_super) {
|
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
});
|
|
196
|
-
Object.defineProperty(APPService.prototype, "getHttpHeaders", {
|
|
197
|
-
enumerable: false,
|
|
198
|
-
configurable: true,
|
|
199
|
-
writable: true,
|
|
200
|
-
value: function () {
|
|
201
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
202
|
-
return __generator(this, function (_a) {
|
|
203
|
-
return [2, httpClient.defaults.headers];
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
196
|
Object.defineProperty(APPService.prototype, "checkoutProfile", {
|
|
209
197
|
enumerable: false,
|
|
210
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;
|
package/build/api/httpClient.js
CHANGED
|
@@ -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:
|
|
146
|
+
headers: getAxiosGlobalHeaders(),
|
|
147
147
|
merchant: data.merchant
|
|
148
148
|
});
|
|
149
149
|
return [3, 9];
|