@paydock/client-sdk 1.136.0 → 1.138.1-beta

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/README.md CHANGED
@@ -4267,6 +4267,29 @@ button.onShippingAddressChange(async function(data) {
4267
4267
  });
4268
4268
  ```
4269
4269
 
4270
+ #### No shipping address
4271
+
4272
+ This is the case where no shipping address is required at all in the popup (e.g., digital goods, services, or virtual products, or Shipping Address collected separately by the merchant). The "Send to" UI field will not be shown in the Apple Pay sheet, it will be hidden.
4273
+
4274
+ **Important:**
4275
+ - No shipping address should be provided in the meta object.
4276
+ - Shipping address could be provided in the initial POST `/v1/charges/wallet` endpoint, if collected previously.
4277
+
4278
+ The required meta parameters for this case are:
4279
+ - `required_shipping_contact_fields`: Only include contact fields if needed (phone, email), but NOT `postalAddress`.
4280
+
4281
+ ```javascript
4282
+ meta: {
4283
+ "amount_label": "TOTAL",
4284
+ "country": "AU",
4285
+ "currency": "AUD",
4286
+ "amount": 10,
4287
+ "shipping_editing_mode": "available",
4288
+ "required_shipping_contact_fields": ["phone", "email"],
4289
+ "apple_pay_capabilities": ["credentials_available", "credentials_status_unknown", "credentials_unavailable"]
4290
+ }
4291
+ ```
4292
+
4270
4293
  ### Paypal Wallet Button Express
4271
4294
  A full description of the meta parameters for [PaypalWalletButtonExpress](#PaypalWalletButtonExpress) meta parameters can be found [here](#PaypalWalletMeta). Below you will find a fully working html example.
4272
4295
 
@@ -4490,7 +4513,7 @@ If the determinated value is credentials_status_unknown, the payment possbily sh
4490
4513
  | [merchant_capabilities] | <code>Array.&lt;(&#x27;supports3DS&#x27;\|&#x27;supportsEMV&#x27;\|&#x27;supportsCredit&#x27;\|&#x27;supportsDebit&#x27;)&gt;</code> | Array of capabilities that the merchant supports, influencing the transaction processing features available. |
4491
4514
  | [supported_networks] | <code>Array.&lt;(&#x27;visa&#x27;\|&#x27;masterCard&#x27;\|&#x27;amex&#x27;\|&#x27;chinaUnionPay&#x27;\|&#x27;discover&#x27;\|&#x27;interac&#x27;\|&#x27;jcb&#x27;\|&#x27;privateLabel&#x27;)&gt;</code> | List of payment networks supported by the merchant for ApplePay transactions. |
4492
4515
  | [required_billing_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;name&#x27;\|&#x27;phone&#x27;\|&#x27;postalAddress&#x27;)&gt;</code> | Contact fields required from the user for billing purposes, improving transaction verification and fraud prevention. Phone and email are currently not returned by Apple. |
4493
- | [required_shipping_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;phone&#x27;)&gt;</code> | Shipping contact fields that are mandatory to complete the transaction. Use email and phone to collect from customer wallet in the abscense of billing one. Required for onShippingAddressChange callback. |
4516
+ | [required_shipping_contact_fields] | <code>Array.&lt;(&#x27;email&#x27;\|&#x27;phone&#x27;\|&#x27;postalAddress&#x27;)&gt;</code> | Shipping contact fields that are mandatory to complete the transaction. Use email and phone to collect from customer wallet in the abscense of billing one. Include 'postalAddress' to show shipping address fields collection in the Apple Pay sheet. Required handling of onShippingAddressChange callback. |
4494
4517
  | [supported_countries] | <code>Array.&lt;string&gt;</code> | List of countries where ApplePay is supported by the merchant, restricting usage to specified regions. |
4495
4518
  | [style] | <code>object</code> | Styling configuration for ApplePay buttons displayed during checkout. |
4496
4519
  | [style.button_type] | <code>ApplePayButtonType</code> | Enum type to select the type of ApplePay button (e.g., 'buy', 'donate', etc.), providing user interface customization. |
package/bundles/index.cjs CHANGED
@@ -813,7 +813,7 @@ var Browser = /*#__PURE__*/function () {
813
813
  }, {
814
814
  key: "isSupportPopUp",
815
815
  value: function isSupportPopUp() {
816
- return !this.isFacebook() && !this.isInstagram();
816
+ return !Browser.isFacebook() && !Browser.isInstagram();
817
817
  }
818
818
  }, {
819
819
  key: "getLanguage",
@@ -869,18 +869,18 @@ var Browser = /*#__PURE__*/function () {
869
869
  var M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
870
870
  var tem;
871
871
  if (/trident/i.test(M[1])) {
872
- tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
872
+ tem = /\brv[ :](\d+)/.exec(ua) || [];
873
873
  return {
874
874
  name: 'IE',
875
875
  version: tem[1] || ''
876
876
  };
877
877
  }
878
878
  if (M[1] === 'Chrome') {
879
- tem = ua.match(/\bOPR|Edge\/(\d+)/);
879
+ tem = ua.match(/\b(OPR|Edge)\/(\d+)/);
880
880
  if (tem != null) {
881
881
  return {
882
- name: 'Opera',
883
- version: tem[1]
882
+ name: tem[1] === 'OPR' ? 'Opera' : 'Edge',
883
+ version: tem[2]
884
884
  };
885
885
  }
886
886
  }
@@ -1189,7 +1189,7 @@ SDK.headerKeys = Object.freeze({
1189
1189
  version: 'x-sdk-version',
1190
1190
  type: 'x-sdk-type'
1191
1191
  });
1192
- SDK._version = 'v1.136.0';
1192
+ SDK._version = 'v1.138.1-beta';
1193
1193
 
1194
1194
  function isFunction(value) {
1195
1195
  return typeof value === 'function';
@@ -4413,7 +4413,7 @@ var InstrumentationAgent = /*#__PURE__*/function (_MicroAgent) {
4413
4413
  _classCallCheck(this, InstrumentationAgent);
4414
4414
  _this = _callSuper(this, InstrumentationAgent, [config]);
4415
4415
  _this.call = function (method) {
4416
- if (_this.isAvailable()) {
4416
+ if (_this.isAvailable() && InstrumentationAgent.agent) {
4417
4417
  var _InstrumentationAgent;
4418
4418
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
4419
4419
  args[_key - 1] = arguments[_key];
@@ -4432,21 +4432,28 @@ var InstrumentationAgent = /*#__PURE__*/function (_MicroAgent) {
4432
4432
  }], [{
4433
4433
  key: "instance",
4434
4434
  get: function get() {
4435
+ var _a;
4435
4436
  if (!InstrumentationAgent.initialized) {
4436
4437
  var _getConfig = getConfig(),
4437
4438
  available = _getConfig.available,
4438
4439
  options = _getConfig.options;
4439
4440
  InstrumentationAgent.available = available;
4441
+ InstrumentationAgent.agent = undefined;
4440
4442
  if (available) {
4441
4443
  InstrumentationAgent.agent = new InstrumentationAgent(options);
4442
4444
  InstrumentationAgent.agent.start([Instrument$2.featureName, Instrument.featureName, Instrument$1.featureName]);
4443
4445
  }
4444
4446
  InstrumentationAgent.initialized = true;
4445
4447
  }
4446
- return InstrumentationAgent.agent;
4448
+ return (_a = InstrumentationAgent.agent) !== null && _a !== void 0 ? _a : InstrumentationAgent.noopClient;
4447
4449
  }
4448
4450
  }]);
4449
4451
  }(MicroAgent);
4452
+ InstrumentationAgent.noopClient = {
4453
+ call: function call() {
4454
+ // no-op: instrumentation unavailable (missing/invalid config)
4455
+ }
4456
+ };
4450
4457
 
4451
4458
  var ActionRepository = /*#__PURE__*/function () {
4452
4459
  function ActionRepository() {
@@ -10162,7 +10169,7 @@ var AppleWalletService = /*#__PURE__*/function (_WalletService) {
10162
10169
  });
10163
10170
  };
10164
10171
  _this.onPaymentAuthorized = function (event) {
10165
- var _a;
10172
+ var _a, _b, _c, _d, _e;
10166
10173
  var _event$payment = event.payment,
10167
10174
  token = _event$payment.token,
10168
10175
  billingContact = _event$payment.billingContact,
@@ -10180,8 +10187,8 @@ var AppleWalletService = /*#__PURE__*/function (_WalletService) {
10180
10187
  }), {
10181
10188
  type: token.paymentMethod.type,
10182
10189
  card_scheme: token.paymentMethod.network,
10183
- address_line1: billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines[0],
10184
- address_line2: billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines[1],
10190
+ address_line1: (_b = billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines) === null || _b === void 0 ? void 0 : _b[0],
10191
+ address_line2: (_c = billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines) === null || _c === void 0 ? void 0 : _c[1],
10185
10192
  address_country: billingContact === null || billingContact === void 0 ? void 0 : billingContact.countryCode,
10186
10193
  address_city: billingContact === null || billingContact === void 0 ? void 0 : billingContact.locality,
10187
10194
  address_postcode: billingContact === null || billingContact === void 0 ? void 0 : billingContact.postalCode,
@@ -10195,8 +10202,8 @@ var AppleWalletService = /*#__PURE__*/function (_WalletService) {
10195
10202
  }), _this.hasShippingOptions() && {
10196
10203
  options: _this.meta.shipping_options
10197
10204
  }), {
10198
- address_line1: shippingContact.addressLines[0],
10199
- address_line2: shippingContact.addressLines[1],
10205
+ address_line1: (_d = shippingContact.addressLines) === null || _d === void 0 ? void 0 : _d[0],
10206
+ address_line2: (_e = shippingContact.addressLines) === null || _e === void 0 ? void 0 : _e[1],
10200
10207
  address_country: shippingContact.countryCode,
10201
10208
  address_city: shippingContact.locality,
10202
10209
  address_postcode: shippingContact.postalCode,
@@ -22652,49 +22659,75 @@ var ApplePayWalletButtonExpress = /*#__PURE__*/function (_BaseWalletButton) {
22652
22659
  });
22653
22660
  };
22654
22661
  _this.onPaymentAuthorized = function (event) {
22655
- var _event$payment = event.payment,
22656
- token = _event$payment.token,
22657
- billingContact = _event$payment.billingContact,
22658
- shippingContact = _event$payment.shippingContact;
22659
- _this.executeWalletCapture(_extends(_extends({}, shippingContact && {
22660
- shipping: {
22661
- address_line1: shippingContact.addressLines[0],
22662
- address_line2: shippingContact.addressLines[1],
22663
- address_line3: shippingContact.addressLines[2],
22664
- address_country: shippingContact.countryCode,
22665
- address_city: shippingContact.locality,
22666
- address_postcode: shippingContact.postalCode,
22667
- address_state: shippingContact.administrativeArea,
22668
- contact: {
22669
- phone: shippingContact.phoneNumber,
22670
- email: shippingContact.emailAddress,
22671
- first_name: shippingContact.givenName,
22672
- last_name: shippingContact.familyName
22673
- }
22674
- }
22675
- }), {
22676
- customer: {
22677
- first_name: billingContact === null || billingContact === void 0 ? void 0 : billingContact.givenName,
22678
- last_name: billingContact === null || billingContact === void 0 ? void 0 : billingContact.familyName,
22679
- email: (billingContact === null || billingContact === void 0 ? void 0 : billingContact.emailAddress) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.emailAddress),
22680
- phone: (billingContact === null || billingContact === void 0 ? void 0 : billingContact.phoneNumber) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.phoneNumber),
22681
- payment_source: {
22682
- wallet_type: WALLET_TYPE.APPLE,
22683
- address_line1: billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines[0],
22684
- address_line2: billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines[1],
22685
- address_country: billingContact === null || billingContact === void 0 ? void 0 : billingContact.countryCode,
22686
- address_city: billingContact === null || billingContact === void 0 ? void 0 : billingContact.locality,
22687
- address_postcode: billingContact === null || billingContact === void 0 ? void 0 : billingContact.postalCode,
22688
- address_state: billingContact === null || billingContact === void 0 ? void 0 : billingContact.administrativeArea,
22689
- ref_token: token.paymentData ? JSON.stringify(token.paymentData) : '',
22690
- wallet_express: true
22662
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
22663
+ try {
22664
+ var _event$payment = event.payment,
22665
+ token = _event$payment.token,
22666
+ billingContact = _event$payment.billingContact,
22667
+ shippingContact = _event$payment.shippingContact;
22668
+ var hasShippingFields = !!(((_a = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _a === void 0 ? void 0 : _a.length) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.countryCode) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.postalCode) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.locality) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.administrativeArea));
22669
+ var hasContactFields = !!((shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.phoneNumber) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.emailAddress) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.givenName) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.familyName));
22670
+ _this.executeWalletCapture(_extends(_extends({}, (hasShippingFields || hasContactFields) && {
22671
+ shipping: _extends(_extends(_extends(_extends(_extends(_extends(_extends(_extends({}, ((_b = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _b === void 0 ? void 0 : _b[0]) && {
22672
+ address_line1: (_c = shippingContact.addressLines) === null || _c === void 0 ? void 0 : _c[0]
22673
+ }), ((_d = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _d === void 0 ? void 0 : _d[1]) && {
22674
+ address_line2: (_e = shippingContact.addressLines) === null || _e === void 0 ? void 0 : _e[1]
22675
+ }), ((_f = shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.addressLines) === null || _f === void 0 ? void 0 : _f[2]) && {
22676
+ address_line3: (_g = shippingContact.addressLines) === null || _g === void 0 ? void 0 : _g[2]
22677
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.countryCode) && {
22678
+ address_country: shippingContact.countryCode
22679
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.locality) && {
22680
+ address_city: shippingContact.locality
22681
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.postalCode) && {
22682
+ address_postcode: shippingContact.postalCode
22683
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.administrativeArea) && {
22684
+ address_state: shippingContact.administrativeArea
22685
+ }), hasContactFields && {
22686
+ contact: _extends(_extends(_extends(_extends({}, (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.phoneNumber) && {
22687
+ phone: shippingContact.phoneNumber
22688
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.emailAddress) && {
22689
+ email: shippingContact.emailAddress
22690
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.givenName) && {
22691
+ first_name: shippingContact.givenName
22692
+ }), (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.familyName) && {
22693
+ last_name: shippingContact.familyName
22694
+ })
22695
+ })
22696
+ }), {
22697
+ customer: {
22698
+ first_name: billingContact === null || billingContact === void 0 ? void 0 : billingContact.givenName,
22699
+ last_name: billingContact === null || billingContact === void 0 ? void 0 : billingContact.familyName,
22700
+ email: (billingContact === null || billingContact === void 0 ? void 0 : billingContact.emailAddress) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.emailAddress),
22701
+ phone: (billingContact === null || billingContact === void 0 ? void 0 : billingContact.phoneNumber) || (shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.phoneNumber),
22702
+ payment_source: {
22703
+ wallet_type: WALLET_TYPE.APPLE,
22704
+ address_line1: (_h = billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines) === null || _h === void 0 ? void 0 : _h[0],
22705
+ address_line2: (_j = billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines) === null || _j === void 0 ? void 0 : _j[1],
22706
+ address_country: billingContact === null || billingContact === void 0 ? void 0 : billingContact.countryCode,
22707
+ address_city: billingContact === null || billingContact === void 0 ? void 0 : billingContact.locality,
22708
+ address_postcode: billingContact === null || billingContact === void 0 ? void 0 : billingContact.postalCode,
22709
+ address_state: billingContact === null || billingContact === void 0 ? void 0 : billingContact.administrativeArea,
22710
+ ref_token: token.paymentData ? JSON.stringify(token.paymentData) : '',
22711
+ wallet_express: true
22712
+ }
22691
22713
  }
22692
- }
22693
- })).then(function () {
22694
- _this.paymentSession.completePayment(ApplePaySession.STATUS_SUCCESS);
22695
- })["catch"](function () {
22714
+ })).then(function () {
22715
+ _this.paymentSession.completePayment(ApplePaySession.STATUS_SUCCESS);
22716
+ })["catch"](function () {
22717
+ _this.paymentSession.completePayment(ApplePaySession.STATUS_FAILURE);
22718
+ });
22719
+ } catch (error) {
22720
+ // this ensures thatwe always call completePayment and emit error callback even if there's an uncaught exception
22696
22721
  _this.paymentSession.completePayment(ApplePaySession.STATUS_FAILURE);
22697
- });
22722
+ _this.eventEmitter.emit(EVENT.PAYMENT_ERROR, {
22723
+ event: EVENT.PAYMENT_ERROR,
22724
+ chargeId: (_k = _this.chargeWalletTokenMeta) === null || _k === void 0 ? void 0 : _k.charge.id,
22725
+ data: {
22726
+ message: error instanceof Error ? error.message : 'Payment processing failed',
22727
+ code: 'PAYMENT_AUTHORIZATION_ERROR'
22728
+ }
22729
+ });
22730
+ }
22698
22731
  };
22699
22732
  _this.onCancelPayment = function () {
22700
22733
  return _this.handleCheckoutClose();
@@ -22921,24 +22954,30 @@ var ApplePayWalletButtonExpress = /*#__PURE__*/function (_BaseWalletButton) {
22921
22954
  }, {
22922
22955
  key: "parseShippingContact",
22923
22956
  value: function parseShippingContact() {
22924
- var _a, _b, _c, _d;
22957
+ var _a, _b, _c, _d, _e, _f, _g, _h;
22925
22958
  if (!((_b = (_a = this.chargeWalletTokenMeta) === null || _a === void 0 ? void 0 : _a.charge) === null || _b === void 0 ? void 0 : _b.shipping) && !this.meta.shipping) {
22926
22959
  return {};
22927
22960
  }
22928
22961
  var shipping = ((_d = (_c = this.chargeWalletTokenMeta) === null || _c === void 0 ? void 0 : _c.charge) === null || _d === void 0 ? void 0 : _d.shipping) || this.meta.shipping;
22929
- return _extends(_extends({}, (shipping === null || shipping === void 0 ? void 0 : shipping.contact) && {
22962
+ var shippingFromCharge = !!((_f = (_e = this.chargeWalletTokenMeta) === null || _e === void 0 ? void 0 : _e.charge) === null || _f === void 0 ? void 0 : _f.shipping);
22963
+ var requiresPostalAddress = (_h = (_g = this.meta.required_shipping_contact_fields) === null || _g === void 0 ? void 0 : _g.includes('postalAddress')) !== null && _h !== void 0 ? _h : false;
22964
+ var contact = _extends({}, (shipping === null || shipping === void 0 ? void 0 : shipping.contact) && {
22930
22965
  phoneNumber: shipping.contact.phone,
22931
22966
  emailAddress: shipping.contact.email,
22932
22967
  givenName: shipping.contact.first_name,
22933
22968
  familyName: shipping.contact.last_name
22934
- }), {
22935
- addressLines: [shipping.address_line1, shipping.address_line2, shipping.address_line3].filter(Boolean),
22936
- locality: shipping.address_city,
22937
- postalCode: shipping.address_postcode,
22938
- administrativeArea: shipping.address_state,
22939
- country: shipping.address_country,
22940
- countryCode: shipping.address_country_code ? shipping.address_country_code : shipping.address_country
22941
22969
  });
22970
+ if (requiresPostalAddress || shippingFromCharge) {
22971
+ return _extends(_extends({}, contact), {
22972
+ addressLines: [shipping.address_line1, shipping.address_line2, shipping.address_line3].filter(Boolean),
22973
+ locality: shipping.address_city,
22974
+ postalCode: shipping.address_postcode,
22975
+ administrativeArea: shipping.address_state,
22976
+ country: shipping.address_country,
22977
+ countryCode: shipping.address_country_code ? shipping.address_country_code : shipping.address_country
22978
+ });
22979
+ }
22980
+ return contact;
22942
22981
  }
22943
22982
  }, {
22944
22983
  key: "parseShippingMethod",
@@ -22966,7 +23005,7 @@ var ApplePayWalletButtonExpress = /*#__PURE__*/function (_BaseWalletButton) {
22966
23005
  }, {
22967
23006
  key: "parseShippingContactUpdateEvent",
22968
23007
  value: function parseShippingContactUpdateEvent(data) {
22969
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
23008
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
22970
23009
  return _extends(_extends(_extends({
22971
23010
  contact: {
22972
23011
  phone: (_e = (_d = (_c = (_b = (_a = this.chargeWalletTokenMeta) === null || _a === void 0 ? void 0 : _a.charge) === null || _b === void 0 ? void 0 : _b.shipping) === null || _c === void 0 ? void 0 : _c.contact) === null || _d === void 0 ? void 0 : _d.phone) !== null && _e !== void 0 ? _e : data.shippingContact.phoneNumber,
@@ -22975,9 +23014,9 @@ var ApplePayWalletButtonExpress = /*#__PURE__*/function (_BaseWalletButton) {
22975
23014
  last_name: (_v = (_u = (_t = (_s = (_r = this.chargeWalletTokenMeta) === null || _r === void 0 ? void 0 : _r.charge) === null || _s === void 0 ? void 0 : _s.shipping) === null || _t === void 0 ? void 0 : _t.contact) === null || _u === void 0 ? void 0 : _u.last_name) !== null && _v !== void 0 ? _v : data.shippingContact.familyName
22976
23015
  }
22977
23016
  }, ((_w = data.shippingContact.addressLines) === null || _w === void 0 ? void 0 : _w[0]) && {
22978
- address_line1: data.shippingContact.addressLines[0]
22979
- }), ((_x = data.shippingContact.addressLines) === null || _x === void 0 ? void 0 : _x[1]) && {
22980
- address_line2: data.shippingContact.addressLines[1]
23017
+ address_line1: (_x = data.shippingContact.addressLines) === null || _x === void 0 ? void 0 : _x[0]
23018
+ }), ((_y = data.shippingContact.addressLines) === null || _y === void 0 ? void 0 : _y[1]) && {
23019
+ address_line2: (_z = data.shippingContact.addressLines) === null || _z === void 0 ? void 0 : _z[1]
22981
23020
  }), {
22982
23021
  address_city: data.shippingContact.locality,
22983
23022
  address_postcode: data.shippingContact.postalCode,
@@ -139,12 +139,16 @@ type HttpRequestUrl = string | URL;
139
139
  type AgentPrototype = Pick<(typeof MicroAgent)['prototype'], 'addPageAction' | 'noticeError'>;
140
140
  type AgentMethodNames = keyof AgentPrototype;
141
141
  type AgentMethodParameters<T extends AgentMethodNames> = Parameters<AgentPrototype[T]>;
142
+ type InstrumentationClient = {
143
+ call<T extends AgentMethodNames>(method: T, ...args: AgentMethodParameters<T>): void;
144
+ };
142
145
  declare class InstrumentationAgent extends MicroAgent {
143
146
  private static agent;
144
147
  private static available;
145
148
  private static initialized;
149
+ private static readonly noopClient;
146
150
  private constructor();
147
- static get instance(): InstrumentationAgent;
151
+ static get instance(): InstrumentationClient;
148
152
  isAvailable(): boolean;
149
153
  call: <T extends "addPageAction" | "noticeError">(method: T, ...args: AgentMethodParameters<T>) => void;
150
154
  }
@@ -5014,7 +5018,7 @@ interface ApplePayWalletMeta extends BaseWalletMeta {
5014
5018
  merchant_capabilities?: Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>;
5015
5019
  supported_networks?: Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>;
5016
5020
  required_billing_contact_fields?: Array<'email' | 'name' | 'phone' | 'postalAddress'>;
5017
- required_shipping_contact_fields?: Array<'email' | 'phone'>;
5021
+ required_shipping_contact_fields?: Array<'email' | 'phone' | 'postalAddress'>;
5018
5022
  apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
5019
5023
  supported_countries?: string[];
5020
5024
  style?: {