@tap-payments/apple-pay-button 1.2.7 → 1.2.8
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.
|
@@ -34,10 +34,8 @@ var ApplePay = React.memo(function (props) {
|
|
|
34
34
|
}, []);
|
|
35
35
|
React.useEffect(function () {
|
|
36
36
|
var lisnterCallback = function (e) {
|
|
37
|
-
var _a;
|
|
38
37
|
e.preventDefault();
|
|
39
38
|
onApplePayButtonClicked();
|
|
40
|
-
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props);
|
|
41
39
|
};
|
|
42
40
|
var applepayButton = document.getElementById('tap-apple-pay-button');
|
|
43
41
|
applepayButton === null || applepayButton === void 0 ? void 0 : applepayButton.addEventListener('click', lisnterCallback);
|
|
@@ -6,5 +6,5 @@ interface UseApplePayReturnProps {
|
|
|
6
6
|
onApplePayButtonClicked: () => Promise<void>;
|
|
7
7
|
abortApplePaySession: () => void;
|
|
8
8
|
}
|
|
9
|
-
export declare const useApplePay: ({ publicKey, merchant, transaction, interface: interfaceObj, customer, onCancel, onError, onSuccess, integration, scope, acceptance, features, metaData, debug, environment, platform, onReady, onMerchantValidation, onShippingMethodSelected, onShippingContactSelected, onPaymentMethodSelected, onCouponChanged }: UseApplePayProps) => UseApplePayReturnProps;
|
|
9
|
+
export declare const useApplePay: ({ publicKey, merchant, transaction, interface: interfaceObj, customer, onCancel, onError, onSuccess, onClick, integration, scope, acceptance, features, metaData, debug, environment, platform, onReady, onMerchantValidation, onShippingMethodSelected, onShippingContactSelected, onPaymentMethodSelected, onCouponChanged }: UseApplePayProps) => UseApplePayReturnProps;
|
|
10
10
|
export {};
|
|
@@ -65,7 +65,7 @@ import { shapeApplePayError } from '../utils';
|
|
|
65
65
|
import { getMerchantCapaplities } from '../utils/defaultValues';
|
|
66
66
|
import { useApplePayScript } from './useApplePayScript';
|
|
67
67
|
export var useApplePay = function (_a) {
|
|
68
|
-
var publicKey = _a.publicKey, merchant = _a.merchant, transaction = _a.transaction, interfaceObj = _a.interface, customer = _a.customer, onCancel = _a.onCancel, onError = _a.onError, onSuccess = _a.onSuccess, integration = _a.integration, scope = _a.scope, acceptance = _a.acceptance, features = _a.features, metaData = _a.metaData, debug = _a.debug, environment = _a.environment, platform = _a.platform, onReady = _a.onReady, onMerchantValidation = _a.onMerchantValidation, onShippingMethodSelected = _a.onShippingMethodSelected, onShippingContactSelected = _a.onShippingContactSelected, onPaymentMethodSelected = _a.onPaymentMethodSelected, onCouponChanged = _a.onCouponChanged;
|
|
68
|
+
var publicKey = _a.publicKey, merchant = _a.merchant, transaction = _a.transaction, interfaceObj = _a.interface, customer = _a.customer, onCancel = _a.onCancel, onError = _a.onError, onSuccess = _a.onSuccess, onClick = _a.onClick, integration = _a.integration, scope = _a.scope, acceptance = _a.acceptance, features = _a.features, metaData = _a.metaData, debug = _a.debug, environment = _a.environment, platform = _a.platform, onReady = _a.onReady, onMerchantValidation = _a.onMerchantValidation, onShippingMethodSelected = _a.onShippingMethodSelected, onShippingContactSelected = _a.onShippingContactSelected, onPaymentMethodSelected = _a.onPaymentMethodSelected, onCouponChanged = _a.onCouponChanged;
|
|
69
69
|
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
|
70
70
|
var _c = useState(null), profileData = _c[0], setProfile = _c[1];
|
|
71
71
|
var _d = useState(false), disabled = _d[0], setDisabled = _d[1];
|
|
@@ -174,10 +174,11 @@ export var useApplePay = function (_a) {
|
|
|
174
174
|
cardBrands = validateSupportedNetworks(paymentMethod.supported_card_brands, acceptance === null || acceptance === void 0 ? void 0 : acceptance.supportedBrands);
|
|
175
175
|
}
|
|
176
176
|
catch (e) {
|
|
177
|
-
onError === null || onError === void 0 ? void 0 : onError([{ description: e.message, code: '
|
|
177
|
+
onError === null || onError === void 0 ? void 0 : onError([{ description: e.message, code: '000' }]);
|
|
178
178
|
return [2];
|
|
179
179
|
}
|
|
180
180
|
try {
|
|
181
|
+
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
181
182
|
request = getApplePayRequest({
|
|
182
183
|
features: features,
|
|
183
184
|
countryCode: profileData.merchant.country_code,
|