@tap-payments/apple-pay-button 1.0.3-test → 1.0.4-test
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 +54 -48
- package/package.json +1 -1
|
@@ -255,57 +255,63 @@ export var useApplePay = function (_a) {
|
|
|
255
255
|
}
|
|
256
256
|
});
|
|
257
257
|
}); };
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
258
|
+
if (onShippingContactSelected) {
|
|
259
|
+
session_1.onshippingcontactselected = function (_a) {
|
|
260
|
+
var shippingContact = _a.shippingContact;
|
|
261
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
262
|
+
var response;
|
|
263
|
+
return __generator(this, function (_b) {
|
|
264
|
+
switch (_b.label) {
|
|
265
|
+
case 0: return [4, onShippingContactSelected(shippingContact)];
|
|
266
|
+
case 1:
|
|
267
|
+
response = _b.sent();
|
|
268
|
+
if (response) {
|
|
269
|
+
session_1.completeShippingContactSelection(response);
|
|
270
|
+
}
|
|
271
|
+
return [2];
|
|
272
|
+
}
|
|
273
|
+
});
|
|
272
274
|
});
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
if (onPaymentMethodSelected) {
|
|
278
|
+
session_1.onpaymentmethodselected = function (_a) {
|
|
279
|
+
var paymentMethod = _a.paymentMethod;
|
|
280
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
281
|
+
var response;
|
|
282
|
+
return __generator(this, function (_b) {
|
|
283
|
+
switch (_b.label) {
|
|
284
|
+
case 0: return [4, onPaymentMethodSelected(paymentMethod)];
|
|
285
|
+
case 1:
|
|
286
|
+
response = _b.sent();
|
|
287
|
+
if (response) {
|
|
288
|
+
session_1.completePaymentMethodSelection(response);
|
|
289
|
+
}
|
|
290
|
+
return [2];
|
|
291
|
+
}
|
|
292
|
+
});
|
|
289
293
|
});
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
if (onCouponChanged) {
|
|
297
|
+
session_1.oncouponcodechanged = function (_a) {
|
|
298
|
+
var couponCode = _a.couponCode;
|
|
299
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
300
|
+
var response;
|
|
301
|
+
return __generator(this, function (_b) {
|
|
302
|
+
switch (_b.label) {
|
|
303
|
+
case 0: return [4, onCouponChanged(couponCode)];
|
|
304
|
+
case 1:
|
|
305
|
+
response = _b.sent();
|
|
306
|
+
if (response) {
|
|
307
|
+
session_1.completeCouponCodeChange(response);
|
|
308
|
+
}
|
|
309
|
+
return [2];
|
|
310
|
+
}
|
|
311
|
+
});
|
|
306
312
|
});
|
|
307
|
-
}
|
|
308
|
-
}
|
|
313
|
+
};
|
|
314
|
+
}
|
|
309
315
|
session_1.oncancel = function (event) {
|
|
310
316
|
console.info('oncancel event', event);
|
|
311
317
|
if (onCancel)
|