@tap-payments/apple-pay-button 1.1.3 → 1.1.5
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/@types/index.d.ts
CHANGED
|
@@ -65,6 +65,9 @@ export interface ApplePayButtonProps {
|
|
|
65
65
|
domain: string;
|
|
66
66
|
identifier?: string;
|
|
67
67
|
};
|
|
68
|
+
platform?: {
|
|
69
|
+
id?: string;
|
|
70
|
+
};
|
|
68
71
|
interface?: Interface;
|
|
69
72
|
customer?: Customer;
|
|
70
73
|
acceptance: Acceptance;
|
|
@@ -137,4 +140,7 @@ export interface CheckoutProfileRequest {
|
|
|
137
140
|
id: string;
|
|
138
141
|
};
|
|
139
142
|
};
|
|
143
|
+
platform?: {
|
|
144
|
+
id?: string;
|
|
145
|
+
};
|
|
140
146
|
}
|
package/build/api/app.service.js
CHANGED
|
@@ -207,8 +207,8 @@ var APPService = (function (_super) {
|
|
|
207
207
|
body = {
|
|
208
208
|
validationUrl: validationURL,
|
|
209
209
|
origin: merchantRegisteredDomain,
|
|
210
|
-
merchantIdentifier: merchantIdentifier,
|
|
211
|
-
merchantId: merchant.id,
|
|
210
|
+
merchantIdentifier: String(merchantIdentifier),
|
|
211
|
+
merchantId: String(merchant.id),
|
|
212
212
|
merchantName: merchant.name
|
|
213
213
|
};
|
|
214
214
|
return [4, this.post(this.baseUrl + '/validatemerchant', body)];
|
|
@@ -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, scope, acceptance, features, metaData, debug, environment, onReady, onMerchantValidation, onShippingMethodSelected, onShippingContactSelected, onPaymentMethodSelected, onCouponChanged }: UseApplePayProps) => UseApplePayReturnProps;
|
|
9
|
+
export declare const useApplePay: ({ publicKey, merchant, transaction, interface: interfaceObj, customer, onCancel, onError, onSuccess, scope, acceptance, features, metaData, debug, environment, platform, onReady, onMerchantValidation, onShippingMethodSelected, onShippingContactSelected, onPaymentMethodSelected, onCouponChanged }: UseApplePayProps) => UseApplePayReturnProps;
|
|
10
10
|
export {};
|
|
@@ -63,7 +63,7 @@ import { setAxiosGlobalHeaders } from '../api/httpClient';
|
|
|
63
63
|
import { getApplePayPaymentMethod, getApplePayRequest, validateCurrency, validateSupportedNetworks } from '../utils/config';
|
|
64
64
|
import { getMerchantCapaplities } from '../utils/defaultValues';
|
|
65
65
|
export var useApplePay = function (_a) {
|
|
66
|
-
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, scope = _a.scope, acceptance = _a.acceptance, features = _a.features, metaData = _a.metaData, debug = _a.debug, environment = _a.environment, onReady = _a.onReady, onMerchantValidation = _a.onMerchantValidation, onShippingMethodSelected = _a.onShippingMethodSelected, onShippingContactSelected = _a.onShippingContactSelected, onPaymentMethodSelected = _a.onPaymentMethodSelected, onCouponChanged = _a.onCouponChanged;
|
|
66
|
+
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, 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;
|
|
67
67
|
var _b = useState(false), loading = _b[0], setLoading = _b[1];
|
|
68
68
|
var _c = useState(null), profileData = _c[0], setProfile = _c[1];
|
|
69
69
|
var _d = useState(false), disabled = _d[0], setDisabled = _d[1];
|
|
@@ -121,7 +121,8 @@ export var useApplePay = function (_a) {
|
|
|
121
121
|
quantity: 1,
|
|
122
122
|
requiresShipping: 'no'
|
|
123
123
|
}
|
|
124
|
-
] })
|
|
124
|
+
] }),
|
|
125
|
+
platform: platform
|
|
125
126
|
})];
|
|
126
127
|
case 3:
|
|
127
128
|
data = _h.sent();
|
|
@@ -206,6 +207,7 @@ export var useApplePay = function (_a) {
|
|
|
206
207
|
return [3, 4];
|
|
207
208
|
case 3:
|
|
208
209
|
error_1 = _a.sent();
|
|
210
|
+
setLoading(false);
|
|
209
211
|
onMerchantValidation === null || onMerchantValidation === void 0 ? void 0 : onMerchantValidation('error');
|
|
210
212
|
if (debug)
|
|
211
213
|
console.error('error in onvalidatemerchant', error_1);
|
|
@@ -14,6 +14,9 @@ export declare const getDefaultValues: (mainObject: ApplePayButtonProps) => {
|
|
|
14
14
|
domain: string;
|
|
15
15
|
identifier?: string | undefined;
|
|
16
16
|
};
|
|
17
|
+
platform?: {
|
|
18
|
+
id?: string | undefined;
|
|
19
|
+
} | undefined;
|
|
17
20
|
customer?: import("../@types").Customer | undefined;
|
|
18
21
|
acceptance: import("../@types").Acceptance;
|
|
19
22
|
transaction: import("../@types").Transaction;
|