@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.
@@ -255,57 +255,63 @@ export var useApplePay = function (_a) {
255
255
  }
256
256
  });
257
257
  }); };
258
- session_1.onshippingcontactselected = function (_a) {
259
- var shippingContact = _a.shippingContact;
260
- return __awaiter(void 0, void 0, void 0, function () {
261
- var response;
262
- return __generator(this, function (_b) {
263
- switch (_b.label) {
264
- case 0: return [4, (onShippingContactSelected === null || onShippingContactSelected === void 0 ? void 0 : onShippingContactSelected(shippingContact))];
265
- case 1:
266
- response = _b.sent();
267
- if (response) {
268
- session_1.completeShippingContactSelection(response);
269
- }
270
- return [2];
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
- session_1.onpaymentmethodselected = function (_a) {
276
- var paymentMethod = _a.paymentMethod;
277
- return __awaiter(void 0, void 0, void 0, function () {
278
- var response;
279
- return __generator(this, function (_b) {
280
- switch (_b.label) {
281
- case 0: return [4, (onPaymentMethodSelected === null || onPaymentMethodSelected === void 0 ? void 0 : onPaymentMethodSelected(paymentMethod))];
282
- case 1:
283
- response = _b.sent();
284
- if (response) {
285
- session_1.completePaymentMethodSelection(response);
286
- }
287
- return [2];
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
- session_1.oncouponcodechanged = function (_a) {
293
- var couponCode = _a.couponCode;
294
- return __awaiter(void 0, void 0, void 0, function () {
295
- var response;
296
- return __generator(this, function (_b) {
297
- switch (_b.label) {
298
- case 0: return [4, (onCouponChanged === null || onCouponChanged === void 0 ? void 0 : onCouponChanged(couponCode))];
299
- case 1:
300
- response = _b.sent();
301
- if (response) {
302
- session_1.completeCouponCodeChange(response);
303
- }
304
- return [2];
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/apple-pay-button",
3
- "version": "1.0.3-test",
3
+ "version": "1.0.4-test",
4
4
  "description": "Apple Pay Button React Component",
5
5
  "main": "build/index.js",
6
6
  "module": "build/index.js",