@tap-payments/apple-pay-button 0.0.71-development → 0.0.72-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/api.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare class APPService {
|
|
|
20
20
|
merchant: any;
|
|
21
21
|
payment_options: any;
|
|
22
22
|
}>;
|
|
23
|
-
appleSession(merchant: Pick<MerchantResponse, 'name' | 'id'>, validationURL: string, merchantRegisteredDomain: string, merchantIdentifier: string,
|
|
23
|
+
appleSession(merchant: Pick<MerchantResponse, 'name' | 'id'>, validationURL: string, merchantRegisteredDomain: string, merchantIdentifier: string, domainValidator: string): Promise<any>;
|
|
24
24
|
tapTokenization(applePaymentData: Record<string, string>): Promise<any>;
|
|
25
25
|
createCharge(request: ChargeRequestBody): Promise<any>;
|
|
26
26
|
createAuthorize(request: AuthorizeRequestBody): Promise<any>;
|
package/build/api.js
CHANGED
|
@@ -149,7 +149,7 @@ var APPService = (function () {
|
|
|
149
149
|
enumerable: false,
|
|
150
150
|
configurable: true,
|
|
151
151
|
writable: true,
|
|
152
|
-
value: function (merchant, validationURL, merchantRegisteredDomain, merchantIdentifier,
|
|
152
|
+
value: function (merchant, validationURL, merchantRegisteredDomain, merchantIdentifier, domainValidator) {
|
|
153
153
|
return __awaiter(this, void 0, void 0, function () {
|
|
154
154
|
var body, data;
|
|
155
155
|
return __generator(this, function (_a) {
|
|
@@ -161,7 +161,7 @@ var APPService = (function () {
|
|
|
161
161
|
merchantIdentifier: merchantIdentifier,
|
|
162
162
|
merchantId: merchant.id,
|
|
163
163
|
merchantName: merchant.name,
|
|
164
|
-
|
|
164
|
+
domainValidator: domainValidator
|
|
165
165
|
};
|
|
166
166
|
return [4, axiosInstance.post('/validatemerchant', body)];
|
|
167
167
|
case 1:
|
|
@@ -66,7 +66,7 @@ export var useApplePay = function (_a) {
|
|
|
66
66
|
var _k = useState(false), success = _k[0], setSuccess = _k[1];
|
|
67
67
|
var _l = useState(false), loading = _l[0], setLoading = _l[1];
|
|
68
68
|
var _m = useState(false), isRounded = _m[0], setIsRounded = _m[1];
|
|
69
|
-
var
|
|
69
|
+
var domainValidator = useMemo(function () {
|
|
70
70
|
return (paymentMethodIdentifier !== null && paymentMethodIdentifier !== void 0 ? paymentMethodIdentifier : '').toLowerCase().includes('knet') ? 'knet' : 'tap';
|
|
71
71
|
}, [paymentMethodIdentifier]);
|
|
72
72
|
var mappedProps = __assign(__assign({}, buttonProps), { interface: mapingInterface(buttonProps.interface) });
|
|
@@ -224,7 +224,7 @@ export var useApplePay = function (_a) {
|
|
|
224
224
|
if (debug) {
|
|
225
225
|
console.info("creating merchant session for merchantData: ".concat(JSON.stringify(profileData.merchant), " and validationURL: ").concat(event.validationURL, " and merchant.domain: ").concat(window.location.hostname));
|
|
226
226
|
}
|
|
227
|
-
return [4, appService.appleSession(__assign(__assign({}, profileData.merchant), { id: merchant.id || profileData.merchant.id }), event.validationURL, window.location.hostname, merchant.identifier || merchant.id || profileData.merchant.id,
|
|
227
|
+
return [4, appService.appleSession(__assign(__assign({}, profileData.merchant), { id: merchant.id || profileData.merchant.id }), event.validationURL, window.location.hostname, merchant.identifier || merchant.id || profileData.merchant.id, domainValidator)];
|
|
228
228
|
case 2:
|
|
229
229
|
merchantSession = _a.sent();
|
|
230
230
|
if (debug)
|
|
@@ -390,19 +390,12 @@ export var useApplePay = function (_a) {
|
|
|
390
390
|
var handleClick = useCallback(function () {
|
|
391
391
|
var _a, _b;
|
|
392
392
|
if (isIframeIntegration) {
|
|
393
|
-
(_a = buttonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonProps, __assign(__assign({}, applePayRequestConfiguration), { applePayRequestData: applePayRequestData
|
|
393
|
+
(_a = buttonProps.onClick) === null || _a === void 0 ? void 0 : _a.call(buttonProps, __assign(__assign({}, applePayRequestConfiguration), { applePayRequestData: applePayRequestData }));
|
|
394
394
|
return;
|
|
395
395
|
}
|
|
396
396
|
onApplePayButtonClicked();
|
|
397
397
|
(_b = buttonProps.onClick) === null || _b === void 0 ? void 0 : _b.call(buttonProps);
|
|
398
|
-
}, [
|
|
399
|
-
applePayRequestConfiguration,
|
|
400
|
-
applePayRequestData,
|
|
401
|
-
buttonProps,
|
|
402
|
-
isIframeIntegration,
|
|
403
|
-
onApplePayButtonClicked,
|
|
404
|
-
paymentProcessor
|
|
405
|
-
]);
|
|
398
|
+
}, [applePayRequestConfiguration, applePayRequestData, buttonProps, isIframeIntegration, onApplePayButtonClicked]);
|
|
406
399
|
useEffect(function () {
|
|
407
400
|
initialize(metaData);
|
|
408
401
|
}, []);
|