@tap-payments/apple-pay-button 0.0.59-development → 0.0.60-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.
- package/build/hooks/useApplePay.js +16 -16
- package/package.json +1 -1
|
@@ -52,20 +52,20 @@ import { ApplePayVersion } from '../constants';
|
|
|
52
52
|
import { Scope } from '../@types/enums';
|
|
53
53
|
import { prepareApplePayRequest } from '../utils/config';
|
|
54
54
|
import { useMerchantApplePay } from './useMerchantApplePay';
|
|
55
|
-
import { getApplePayPaymentMethod, getDefaultThemeMode, getDefaultValues, getFullThemeMode } from '../utils';
|
|
55
|
+
import { getApplePayPaymentMethod, getDefaultLocale, getDefaultThemeMode, getDefaultValues, getFullThemeMode } from '../utils';
|
|
56
56
|
export var useApplePay = function (_a) {
|
|
57
|
-
var _b, _c, _d, _e
|
|
57
|
+
var _b, _c, _d, _e;
|
|
58
58
|
var buttonProps = _a.buttonProps;
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
-
var
|
|
66
|
-
var
|
|
67
|
-
var
|
|
68
|
-
var
|
|
59
|
+
var _f = useState(), applePayRequestData = _f[0], setApplePayRequestData = _f[1];
|
|
60
|
+
var _g = useState(), applePayRequestConfiguration = _g[0], setApplePayRequestConfiguration = _g[1];
|
|
61
|
+
var _h = useState(), profileData = _h[0], setProfile = _h[1];
|
|
62
|
+
var _j = useState(false), disabled = _j[0], setDisabled = _j[1];
|
|
63
|
+
var _k = useState(null), tapTheme = _k[0], setTapTheme = _k[1];
|
|
64
|
+
var _l = useState(), tapLocalization = _l[0], setTapLocalization = _l[1];
|
|
65
|
+
var _m = useState(false), error = _m[0], setError = _m[1];
|
|
66
|
+
var _o = useState(false), success = _o[0], setSuccess = _o[1];
|
|
67
|
+
var _p = useState(false), loading = _p[0], setLoading = _p[1];
|
|
68
|
+
var _q = useState(false), isRounded = _q[0], setIsRounded = _q[1];
|
|
69
69
|
var mappedProps = getDefaultValues(buttonProps);
|
|
70
70
|
var environment = mappedProps.environment, 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, headers = mappedProps.headers, operator = mappedProps.operator, order = mappedProps.order, onOrderCreated = mappedProps.onOrderCreated, integration = mappedProps.integration, transaction = mappedProps.transaction, post = mappedProps.post, redirect = mappedProps.redirect;
|
|
71
71
|
var isIframeIntegration = buttonProps.integration === 'iframe';
|
|
@@ -86,8 +86,8 @@ export var useApplePay = function (_a) {
|
|
|
86
86
|
setSuccess: setSuccess,
|
|
87
87
|
setIsRounded: setIsRounded
|
|
88
88
|
});
|
|
89
|
-
var lang = (
|
|
90
|
-
var theme = getDefaultThemeMode((
|
|
89
|
+
var lang = getDefaultLocale((_b = mappedProps.interface) === null || _b === void 0 ? void 0 : _b.locale);
|
|
90
|
+
var theme = getDefaultThemeMode((_c = mappedProps.interface) === null || _c === void 0 ? void 0 : _c.theme);
|
|
91
91
|
var applePayPaymentMethodOptions = useMemo(function () {
|
|
92
92
|
if (!profileData)
|
|
93
93
|
return null;
|
|
@@ -120,8 +120,8 @@ export var useApplePay = function (_a) {
|
|
|
120
120
|
applePayPaymentMethodOptions,
|
|
121
121
|
lang,
|
|
122
122
|
profileData === null || profileData === void 0 ? void 0 : profileData.payment_options.payment_methods,
|
|
123
|
-
(
|
|
124
|
-
(
|
|
123
|
+
(_d = buttonProps.interface) === null || _d === void 0 ? void 0 : _d.colorStyle,
|
|
124
|
+
(_e = buttonProps.interface) === null || _e === void 0 ? void 0 : _e.theme
|
|
125
125
|
]);
|
|
126
126
|
var showLoader = useMemo(function () {
|
|
127
127
|
var _a;
|