@paydock/client-sdk 1.11.13-beta → 1.77.3

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.
Files changed (61) hide show
  1. package/README.md +760 -1018
  2. package/bundles/widget.umd.js +43 -44
  3. package/bundles/widget.umd.min.js +1 -1
  4. package/lib/api/api-base.d.ts +1 -1
  5. package/lib/api/api-base.js +2 -24
  6. package/lib/api/api-base.js.map +1 -1
  7. package/lib/canvas-3ds/services/standalone3ds-service.js +2 -2
  8. package/lib/canvas-3ds/services/standalone3ds-service.js.map +1 -1
  9. package/lib/checkout-button/checkout-button.js +1 -1
  10. package/lib/checkout-button/checkout-button.js.map +1 -1
  11. package/lib/checkout-button/index.d.ts +3 -1
  12. package/lib/checkout-button/index.js +3 -1
  13. package/lib/checkout-button/index.js.map +1 -1
  14. package/lib/checkout-button/runner.d.ts +1 -1
  15. package/lib/checkout-button/runner.js +2 -27
  16. package/lib/checkout-button/runner.js.map +1 -1
  17. package/lib/checkout-button/zipmoney.runner.d.ts +1 -1
  18. package/lib/checkout-button/zipmoney.runner.js +2 -27
  19. package/lib/checkout-button/zipmoney.runner.js.map +1 -1
  20. package/lib/components/dispatcher.d.ts +1 -1
  21. package/lib/components/dispatcher.js +2 -27
  22. package/lib/components/dispatcher.js.map +1 -1
  23. package/lib/components/http-core.js +2 -27
  24. package/lib/components/http-core.js.map +1 -1
  25. package/lib/components/link.d.ts +1 -1
  26. package/lib/components/link.js +2 -27
  27. package/lib/components/link.js.map +1 -1
  28. package/lib/components/param.d.ts +3 -1
  29. package/lib/components/param.js.map +1 -1
  30. package/lib/components/popup.js +1 -1
  31. package/lib/components/popup.js.map +1 -1
  32. package/lib/{components → configs/env}/env.d.ts +9 -0
  33. package/lib/configs/env/env.js +129 -0
  34. package/lib/configs/env/env.js.map +1 -0
  35. package/lib/payment-source-widget/payment-source-widget.d.ts +1 -1
  36. package/lib/payment-source-widget/payment-source-widget.js +1 -1
  37. package/lib/wallet-buttons/apple.wallet-service.js +2 -13
  38. package/lib/wallet-buttons/apple.wallet-service.js.map +1 -1
  39. package/lib/wallet-buttons/google.wallet-service.js +7 -5
  40. package/lib/wallet-buttons/google.wallet-service.js.map +1 -1
  41. package/lib/wallet-buttons/wallet-service.js +2 -2
  42. package/lib/wallet-buttons/wallet-service.js.map +1 -1
  43. package/lib/widget/configuration.d.ts +3 -1
  44. package/lib/widget/configuration.js +5 -28
  45. package/lib/widget/configuration.js.map +1 -1
  46. package/lib/widget/html-multi-widget.d.ts +2 -1
  47. package/lib/widget/html-multi-widget.js +2 -1
  48. package/lib/widget/html-multi-widget.js.map +1 -1
  49. package/lib/widget/html-widget.d.ts +3 -1
  50. package/lib/widget/html-widget.js +3 -1
  51. package/lib/widget/html-widget.js.map +1 -1
  52. package/lib/widget/index.d.ts +0 -7
  53. package/lib/widget/index.js +0 -7
  54. package/lib/widget/index.js.map +1 -1
  55. package/lib/widget/meta.d.ts +7 -0
  56. package/lib/widget/meta.js +8 -0
  57. package/lib/widget/meta.js.map +1 -0
  58. package/package.json +3 -1
  59. package/slate.md +17 -16
  60. package/lib/components/env.js +0 -77
  61. package/lib/components/env.js.map +0 -1
@@ -244,9 +244,12 @@
244
244
  STAGING_15: 'staging_15',
245
245
  STAGING_CBA: 'staging_cba',
246
246
  SANDBOX_CBA: 'sandbox_cba',
247
+ PREPROD_CBA: 'preproduction_cba',
247
248
  PROD_CBA: 'production_cba'
248
249
  };
249
- var KOVENA_ENV = [ENV.SANDBOX_KOVENA, ENV.SANDBOX_DEMO_KOVENA];
250
+ var WIDGET_URL = [{ env: ENV.SANDBOX, url: 'https://widget-sandbox.' }, { env: ENV.SANDBOX_KOVENA, url: 'https://widget-sandbox.' }, { env: ENV.SANDBOX_DEMO, url: 'https://widget-sandbox-demo.' }, { env: ENV.SANDBOX_DEMO_KOVENA, url: 'https://widget-sandbox-demo.' }, { env: ENV.PROD, url: 'https://widget.' }, { env: ENV.STAGING, url: 'https://widsta.' }, { env: ENV.STAGING_1, url: 'https://widsta-1.' }, { env: ENV.STAGING_2, url: 'https://widsta-2.' }, { env: ENV.STAGING_3, url: 'https://widsta-3.' }, { env: ENV.STAGING_4, url: 'https://widsta-4.' }, { env: ENV.STAGING_5, url: 'https://widsta-5.' }, { env: ENV.STAGING_6, url: 'https://widsta-6.' }, { env: ENV.STAGING_7, url: 'https://widsta-7.' }, { env: ENV.STAGING_8, url: 'https://widsta-8.' }, { env: ENV.STAGING_9, url: 'https://widsta-9.' }, { env: ENV.STAGING_10, url: 'https://widsta-10.' }, { env: ENV.STAGING_11, url: 'https://widsta-11.' }, { env: ENV.STAGING_12, url: 'https://widsta-12.' }, { env: ENV.STAGING_13, url: 'https://widsta-13.' }, { env: ENV.STAGING_14, url: 'https://widsta-14.' }, { env: ENV.STAGING_15, url: 'https://widsta-15.' }, { env: ENV.STAGING_CBA, url: 'https://widget.staging.powerboard.' }, { env: ENV.SANDBOX_CBA, url: 'https://widget-sandbox-cba.' }, { env: ENV.PREPROD_CBA, url: 'https://widget.preproduction.powerboard.' }, { env: ENV.PROD_CBA, url: 'https://widget.powerboard.' }];
251
+ var API_URL = [{ env: ENV.SANDBOX, url: 'https://api-sandbox.' }, { env: ENV.PROD, url: 'https://api.' }, { env: ENV.STAGING, url: 'https://apista.' }, { env: ENV.STAGING_1, url: 'https://apista-1.' }, { env: ENV.STAGING_2, url: 'https://apista-2.' }, { env: ENV.STAGING_3, url: 'https://apista-3.' }, { env: ENV.STAGING_4, url: 'https://apista-4.' }, { env: ENV.STAGING_5, url: 'https://apista-5.' }, { env: ENV.STAGING_6, url: 'https://apista-6.' }, { env: ENV.STAGING_7, url: 'https://apista-7.' }, { env: ENV.STAGING_8, url: 'https://apista-8.' }, { env: ENV.STAGING_9, url: 'https://apista-9.' }, { env: ENV.STAGING_10, url: 'https://apista-10.' }, { env: ENV.STAGING_11, url: 'https://apista-11.' }, { env: ENV.STAGING_12, url: 'https://apista-12.' }, { env: ENV.STAGING_13, url: 'https://apista-13.' }, { env: ENV.STAGING_14, url: 'https://apista-14.' }, { env: ENV.STAGING_15, url: 'https://apista-15.' }, { env: ENV.STAGING_CBA, url: 'https://api.staging.powerboard.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PREPROD_CBA, url: 'https://api.preproduction.powerboard.' }, { env: ENV.PROD_CBA, url: 'https://api.powerboard.' }];
252
+ var ADDITIONAL_ENV = [ENV.SANDBOX_KOVENA, ENV.SANDBOX_DEMO_KOVENA];
250
253
  var REGEX_ALIAS = '^([a-zA-Z0-9](?:(?:[a-zA-Z0-9-.]*(?!-)\\.(?![-.]))*[a-zA-Z0-9]+)?)$';
251
254
  var DEFAULT_ENV = ENV.SANDBOX;
252
255
  var DEFAULT_ALIAS = {
@@ -268,7 +271,7 @@
268
271
  if (!this.isValidMode(this.configs, env)) throw new Error('unknown env: ' + env);
269
272
  this.env = env;
270
273
  if (alias && !alias.match(REGEX_ALIAS)) throw new Error('invalid: ' + alias);
271
- if (alias) this.alias = alias;else if (KOVENA_ENV.indexOf(this.env) !== -1) this.alias = DEFAULT_ALIAS.KOVENA;else this.alias = DEFAULT_ALIAS.PAYDOCK;
274
+ if (alias) this.alias = alias;else if (ADDITIONAL_ENV.indexOf(this.env) !== -1) this.alias = DEFAULT_ALIAS.KOVENA;else this.alias = DEFAULT_ALIAS.PAYDOCK;
272
275
  }
273
276
  }, {
274
277
  key: 'getEnv',
@@ -369,17 +372,17 @@
369
372
  this.params = {};
370
373
  this.widgetId = Uuid.generate();
371
374
  this.linkResource = linkResource;
372
- this.env = new Env([{ env: ENV.SANDBOX_KOVENA, url: 'https://widget-sandbox.' }, { env: ENV.SANDBOX_DEMO, url: 'https://widget-sandbox-demo.' }, { env: ENV.SANDBOX_DEMO_KOVENA, url: 'https://widget-sandbox-demo.' }, { env: ENV.SANDBOX, url: 'https://widget-sandbox.' }, { env: ENV.PROD, url: 'https://widget.' }, { env: ENV.STAGING, url: 'https://widsta.' }, { env: ENV.STAGING_1, url: 'https://widsta-1.' }, { env: ENV.STAGING_2, url: 'https://widsta-2.' }, { env: ENV.STAGING_3, url: 'https://widsta-3.' }, { env: ENV.STAGING_4, url: 'https://widsta-4.' }, { env: ENV.STAGING_5, url: 'https://widsta-5.' }, { env: ENV.STAGING_6, url: 'https://widsta-6.' }, { env: ENV.STAGING_7, url: 'https://widsta-7.' }, { env: ENV.STAGING_8, url: 'https://widsta-8.' }, { env: ENV.STAGING_9, url: 'https://widsta-9.' }, { env: ENV.STAGING_10, url: 'https://widsta-10.' }, { env: ENV.STAGING_11, url: 'https://widsta-11.' }, { env: ENV.STAGING_12, url: 'https://widsta-12.' }, { env: ENV.STAGING_13, url: 'https://widsta-13.' }, { env: ENV.STAGING_14, url: 'https://widsta-14.' }, { env: ENV.STAGING_15, url: 'https://widsta-15.' }, { env: ENV.STAGING_CBA, url: 'https://widget-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://widget-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://widget-cba.' }]);
375
+ this.env = new Env(WIDGET_URL);
373
376
  this.setParams({ widget_id: this.widgetId });
374
377
  }
375
378
 
376
379
  createClass(Link, [{
377
- key: "getNetUrl",
380
+ key: 'getNetUrl',
378
381
  value: function getNetUrl() {
379
382
  return this.env.getConf().url + this.linkResource;
380
383
  }
381
384
  }, {
382
- key: "getUrl",
385
+ key: 'getUrl',
383
386
  value: function getUrl() {
384
387
  var url = this.getNetUrl();
385
388
  var params = this.getParams();
@@ -389,12 +392,12 @@
389
392
  return url;
390
393
  }
391
394
  }, {
392
- key: "setParams",
395
+ key: 'setParams',
393
396
  value: function setParams(params) {
394
397
  this.params = _extends({}, this.params, params);
395
398
  }
396
399
  }, {
397
- key: "concatParams",
400
+ key: 'concatParams',
398
401
  value: function concatParams(params) {
399
402
  for (var key in params) {
400
403
  if (!params.hasOwnProperty(key) || !params[key].length) continue;
@@ -403,22 +406,22 @@
403
406
  }
404
407
  }
405
408
  }, {
406
- key: "getParams",
409
+ key: 'getParams',
407
410
  value: function getParams() {
408
411
  return this.params;
409
412
  }
410
413
  }, {
411
- key: "setEnv",
414
+ key: 'setEnv',
412
415
  value: function setEnv(env, alias) {
413
416
  this.env.setEnv(env, alias);
414
417
  }
415
418
  }, {
416
- key: "getEnv",
419
+ key: 'getEnv',
417
420
  value: function getEnv() {
418
421
  return this.env.getEnv();
419
422
  }
420
423
  }, {
421
- key: "getBaseUrl",
424
+ key: 'getBaseUrl',
422
425
  value: function getBaseUrl() {
423
426
  return this.env.getConf().url;
424
427
  }
@@ -573,7 +576,9 @@
573
576
  *
574
577
  * var config = new Configuration('gatewayId', 'bank_account', 'paymentSource'); // extend
575
578
  *
576
- * @param {string} [gatewayID=default] - gateway ID. By default or if put 'default', it will use the selected default gateway
579
+ * var config = new Configuration('not_configured'); // without gateway
580
+ *
581
+ * @param {string} [gatewayID=default] - gateway ID. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token.
577
582
  * @param {string} paymentType - Type of payment source which shows in widget form. Available parameters [PAYMENT_TYPE]{@link PAYMENT_TYPE}
578
583
  * @param {string} purpose - Param which describes payment purpose. By default uses Available parameters [PURPOSE]{@link PURPOSE}
579
584
  **/
@@ -586,7 +591,7 @@
586
591
 
587
592
  if (ObjectHelper.values(PAYMENT_TYPE).indexOf(paymentType) === -1) throw new Error('unsupported payment type');else if (paymentType === PAYMENT_TYPE.CHECKOUT) throw new Error('Payment type "checkout" is deprecated. Use CheckoutButton for this type of payments https://www.npmjs.com/package/@paydock/client-sdk#checkout-button');
588
593
  if (ObjectHelper.values(PURPOSE).indexOf(purpose) === -1) throw new Error('unsupported purpose');
589
- this.env = new Env([{ env: ENV.SANDBOX_KOVENA, url: 'https://api-sandbox.' }, { env: ENV.SANDBOX_DEMO, url: 'https://api-sandbox-demo.' }, { env: ENV.SANDBOX_DEMO_KOVENA, url: 'https://api-sandbox-demo.' }, { env: ENV.SANDBOX, url: 'https://api-sandbox.' }, { env: ENV.PROD, url: 'https://api.' }, { env: ENV.STAGING, url: 'https://apista.' }, { env: ENV.STAGING_1, url: 'https://apista-1.' }, { env: ENV.STAGING_2, url: 'https://apista-2.' }, { env: ENV.STAGING_3, url: 'https://apista-3.' }, { env: ENV.STAGING_4, url: 'https://apista-4.' }, { env: ENV.STAGING_5, url: 'https://apista-5.' }, { env: ENV.STAGING_6, url: 'https://apista-6.' }, { env: ENV.STAGING_7, url: 'https://apista-7.' }, { env: ENV.STAGING_8, url: 'https://apista-8.' }, { env: ENV.STAGING_9, url: 'https://apista-9.' }, { env: ENV.STAGING_10, url: 'https://apista-10.' }, { env: ENV.STAGING_11, url: 'https://apista-11.' }, { env: ENV.STAGING_12, url: 'https://apista-12.' }, { env: ENV.STAGING_13, url: 'https://apista-13.' }, { env: ENV.STAGING_14, url: 'https://apista-14.' }, { env: ENV.STAGING_15, url: 'https://apista-15.' }, { env: ENV.STAGING_CBA, url: 'https://api-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://api-cba.' }]);
594
+ this.env = new Env(API_URL);
590
595
  this.configs = {
591
596
  purpose: purpose,
592
597
  meta: {},
@@ -1881,7 +1886,8 @@
1881
1886
  * var widget = new MultiWidget('#widget', 'publicKey', new Configuration('gatewayId')); With Configuration
1882
1887
  *
1883
1888
  * var widget = new MultiWidget('#widget', 'publicKey',[ With Configurations
1884
- * Configuration() // default gateway_id,
1889
+ * Configuration(), // default gateway_id,
1890
+ * Configuration('not_configured'), // without gateway,
1885
1891
  * Configuration('gatewayId'),
1886
1892
  * Configuration('gatewayId', 'bank_account')
1887
1893
  * ]);
@@ -2241,9 +2247,11 @@
2241
2247
  *
2242
2248
  * var widget = new HtmlWidget('#widget', 'publicKey', 'gatewayID', 'bank_account', 'payment_source'); // extend
2243
2249
  *
2250
+ * var widget = new HtmlWidget('#widget', 'publicKey', 'not_configured'); // without gateway
2251
+ *
2244
2252
  * @param {string} selector - Selector of html element. Container for widget
2245
2253
  * @param {string} publicKey - PayDock users public key
2246
- * @param {string} [gatewayID=default] - ID of a gateway connected to PayDock. By default or if put 'default', it will use the selected default gateway
2254
+ * @param {string} [gatewayID=default] - ID of a gateway connected to PayDock. By default or if put 'default', it will use the selected default gateway. If put 'not_configured', it won’t use gateway to create downstream token.
2247
2255
  * @param {string} [paymentType=card] - Type of payment source which shows in widget form. Available parameters : “card”, “bank_account”.
2248
2256
  * @param {string} [purpose=payment_source] - Purpose of widget form. Available parameters: ‘payment_source’, ‘card_payment_source_with_cvv’, ‘card_payment_source_without_cvv’
2249
2257
  **/
@@ -2386,7 +2394,7 @@
2386
2394
  function HttpCore() {
2387
2395
  classCallCheck(this, HttpCore);
2388
2396
 
2389
- this.env = new Env([{ env: ENV.SANDBOX_KOVENA, url: 'https://api-sandbox.' }, { env: ENV.SANDBOX_DEMO, url: 'https://api-sandbox-demo.' }, { env: ENV.SANDBOX_DEMO_KOVENA, url: 'https://api-sandbox-demo.' }, { env: ENV.SANDBOX, url: 'https://api-sandbox.' }, { env: ENV.PROD, url: 'https://api.' }, { env: ENV.STAGING, url: 'https://apista.' }, { env: ENV.STAGING_1, url: 'https://apista-1.' }, { env: ENV.STAGING_2, url: 'https://apista-2.' }, { env: ENV.STAGING_3, url: 'https://apista-3.' }, { env: ENV.STAGING_4, url: 'https://apista-4.' }, { env: ENV.STAGING_5, url: 'https://apista-5.' }, { env: ENV.STAGING_6, url: 'https://apista-6.' }, { env: ENV.STAGING_7, url: 'https://apista-7.' }, { env: ENV.STAGING_8, url: 'https://apista-8.' }, { env: ENV.STAGING_9, url: 'https://apista-9.' }, { env: ENV.STAGING_10, url: 'https://apista-10.' }, { env: ENV.STAGING_11, url: 'https://apista-11.' }, { env: ENV.STAGING_12, url: 'https://apista-12.' }, { env: ENV.STAGING_13, url: 'https://apista-13.' }, { env: ENV.STAGING_14, url: 'https://apista-14.' }, { env: ENV.STAGING_15, url: 'https://apista-15.' }, { env: ENV.STAGING_CBA, url: 'https://api-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://api-cba.' }]);
2397
+ this.env = new Env(API_URL);
2390
2398
  }
2391
2399
 
2392
2400
  createClass(HttpCore, [{
@@ -2913,7 +2921,7 @@
2913
2921
  this.background.onTrigger(TRIGGER$1.CLOSE, function () {
2914
2922
  return _this.stop();
2915
2923
  });
2916
- this.widgetEnv = new Env([{ env: ENV.SANDBOX, url: 'https://widget-sandbox.' }, { env: ENV.SANDBOX_KOVENA, url: 'https://widget-sandbox.' }, { env: ENV.SANDBOX_DEMO, url: 'https://widget-sandbox-demo.' }, { env: ENV.SANDBOX_DEMO_KOVENA, url: 'https://widget-sandbox-demo.' }, { env: ENV.PROD, url: 'https://widget.' }, { env: ENV.STAGING, url: 'https://widsta.' }, { env: ENV.STAGING_1, url: 'https://widsta-1.' }, { env: ENV.STAGING_2, url: 'https://widsta-2.' }, { env: ENV.STAGING_3, url: 'https://widsta-3.' }, { env: ENV.STAGING_4, url: 'https://widsta-4.' }, { env: ENV.STAGING_5, url: 'https://widsta-5.' }, { env: ENV.STAGING_6, url: 'https://widsta-6.' }, { env: ENV.STAGING_7, url: 'https://widsta-7.' }, { env: ENV.STAGING_8, url: 'https://widsta-8.' }, { env: ENV.STAGING_9, url: 'https://widsta-9.' }, { env: ENV.STAGING_10, url: 'https://widsta-10.' }, { env: ENV.STAGING_11, url: 'https://widsta-11.' }, { env: ENV.STAGING_12, url: 'https://widsta-12.' }, { env: ENV.STAGING_13, url: 'https://widsta-13.' }, { env: ENV.STAGING_14, url: 'https://widsta-14.' }, { env: ENV.STAGING_15, url: 'https://widsta-15.' }, { env: ENV.STAGING_CBA, url: 'https://widget-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://widget-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://widget-cba.' }]);
2924
+ this.widgetEnv = new Env(WIDGET_URL);
2917
2925
  }
2918
2926
 
2919
2927
  createClass(Runner, [{
@@ -4013,7 +4021,7 @@
4013
4021
  _this.checkout = null;
4014
4022
  _this.runs = false;
4015
4023
  _this.eventEmitter = new EventEmitter();
4016
- _this.echoEnv = new Env([{ env: ENV.SANDBOX, url: 'https://api-sandbox.' }, { env: ENV.SANDBOX_KOVENA, url: 'https://api-sandbox.' }, { env: ENV.SANDBOX_DEMO, url: 'https://api-sandbox-demo.' }, { env: ENV.SANDBOX_DEMO_KOVENA, url: 'https://api-sandbox-demo.' }, { env: ENV.PROD, url: 'https://api.' }, { env: ENV.STAGING, url: 'https://apista.' }, { env: ENV.STAGING_1, url: 'https://apista-1.' }, { env: ENV.STAGING_2, url: 'https://apista-2.' }, { env: ENV.STAGING_3, url: 'https://apista-3.' }, { env: ENV.STAGING_4, url: 'https://apista-4.' }, { env: ENV.STAGING_5, url: 'https://apista-5.' }, { env: ENV.STAGING_6, url: 'https://apista-6.' }, { env: ENV.STAGING_7, url: 'https://apista-7.' }, { env: ENV.STAGING_8, url: 'https://apista-8.' }, { env: ENV.STAGING_9, url: 'https://apista-9.' }, { env: ENV.STAGING_10, url: 'https://apista-10.' }, { env: ENV.STAGING_11, url: 'https://apista-11.' }, { env: ENV.STAGING_12, url: 'https://apista-12.' }, { env: ENV.STAGING_13, url: 'https://apista-13.' }, { env: ENV.STAGING_14, url: 'https://apista-14.' }, { env: ENV.STAGING_15, url: 'https://apista-15.' }, { env: ENV.STAGING_CBA, url: 'https://api-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://api-cba.' }]);
4024
+ _this.echoEnv = new Env(API_URL);
4017
4025
  return _this;
4018
4026
  }
4019
4027
 
@@ -4178,11 +4186,11 @@
4178
4186
  classCallCheck(this, Dispatcher);
4179
4187
 
4180
4188
  this.messageSource = messageSource;
4181
- this.env = new Env([{ env: ENV.SANDBOX, url: 'https://widget-sandbox.' }, { env: ENV.SANDBOX_KOVENA, url: 'https://widget-sandbox.' }, { env: ENV.SANDBOX_DEMO, url: 'https://widget-sandbox-demo.' }, { env: ENV.SANDBOX_DEMO_KOVENA, url: 'https://widget-sandbox-demo.' }, { env: ENV.PROD, url: 'https://widget.' }, { env: ENV.STAGING, url: 'https://widsta.' }, { env: ENV.STAGING_1, url: 'https://widsta-1.' }, { env: ENV.STAGING_2, url: 'https://widsta-2.' }, { env: ENV.STAGING_3, url: 'https://widsta-3.' }, { env: ENV.STAGING_4, url: 'https://widsta-4.' }, { env: ENV.STAGING_5, url: 'https://widsta-5.' }, { env: ENV.STAGING_6, url: 'https://widsta-6.' }, { env: ENV.STAGING_7, url: 'https://widsta-7.' }, { env: ENV.STAGING_8, url: 'https://widsta-8.' }, { env: ENV.STAGING_9, url: 'https://widsta-9.' }, { env: ENV.STAGING_10, url: 'https://widsta-10.' }, { env: ENV.STAGING_11, url: 'https://widsta-11.' }, { env: ENV.STAGING_12, url: 'https://widsta-12.' }, { env: ENV.STAGING_13, url: 'https://widsta-13.' }, { env: ENV.STAGING_14, url: 'https://widsta-14.' }, { env: ENV.STAGING_15, url: 'https://widsta-15.' }, { env: ENV.STAGING_CBA, url: 'https://widget-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://widget-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://widget-cba.' }]);
4189
+ this.env = new Env(WIDGET_URL);
4182
4190
  }
4183
4191
 
4184
4192
  createClass(Dispatcher, [{
4185
- key: "restartDispatcher",
4193
+ key: 'restartDispatcher',
4186
4194
  value: function restartDispatcher() {
4187
4195
  var dispatcher = document.getElementById(DISPATCHER_ELEMENT_ID);
4188
4196
  if (dispatcher) dispatcher.parentNode.removeChild(dispatcher);
@@ -4193,7 +4201,7 @@
4193
4201
  document.body.appendChild(iFrame);
4194
4202
  }
4195
4203
  }, {
4196
- key: "on",
4204
+ key: 'on',
4197
4205
  value: function on(name, cb) {
4198
4206
  var _this = this;
4199
4207
 
@@ -4207,7 +4215,7 @@
4207
4215
  });
4208
4216
  }
4209
4217
  }, {
4210
- key: "setEnv",
4218
+ key: 'setEnv',
4211
4219
  value: function setEnv(env, alias) {
4212
4220
  this.env.setEnv(env, alias);
4213
4221
  this.restartDispatcher();
@@ -5093,7 +5101,7 @@
5093
5101
 
5094
5102
  this.publicKey = publicKey;
5095
5103
  this.meta = meta;
5096
- this.env = ENV.SANDBOX;
5104
+ this.env = DEFAULT_ENV;
5097
5105
  this.eventEmitter = new EventEmitter();
5098
5106
  this.initializeChildWallets();
5099
5107
  }
@@ -5729,21 +5737,10 @@
5729
5737
 
5730
5738
  _this.latestShippingData.shippingContact = shippingContact;
5731
5739
  var shippingOptionMethod = (_a = _this.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.type;
5740
+ var cardNameFromShippingContact = [shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.givenName, shippingContact === null || shippingContact === void 0 ? void 0 : shippingContact.familyName].join(' ').trim();
5732
5741
  _this.eventEmitter.emit(WALLET_EVENT.PAYMENT_METHOD_SELECTED, {
5733
5742
  data: _extends({ customer: {
5734
- payment_source: {
5735
- wallet_type: WALLET_TYPE.APPLE,
5736
- card_name: token.paymentMethod.displayName,
5737
- type: token.paymentMethod.type,
5738
- card_scheme: token.paymentMethod.network,
5739
- address_line1: billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines[0],
5740
- address_line2: billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines[1],
5741
- address_country: billingContact === null || billingContact === void 0 ? void 0 : billingContact.countryCode,
5742
- address_city: billingContact === null || billingContact === void 0 ? void 0 : billingContact.locality,
5743
- address_postcode: billingContact === null || billingContact === void 0 ? void 0 : billingContact.postalCode,
5744
- address_state: billingContact === null || billingContact === void 0 ? void 0 : billingContact.administrativeArea,
5745
- ref_token: token.paymentData ? JSON.stringify(token.paymentData) : ''
5746
- }
5743
+ payment_source: _extends(_extends({ wallet_type: WALLET_TYPE.APPLE }, cardNameFromShippingContact && { card_name: cardNameFromShippingContact }), { type: token.paymentMethod.type, card_scheme: token.paymentMethod.network, address_line1: billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines[0], address_line2: billingContact === null || billingContact === void 0 ? void 0 : billingContact.addressLines[1], address_country: billingContact === null || billingContact === void 0 ? void 0 : billingContact.countryCode, address_city: billingContact === null || billingContact === void 0 ? void 0 : billingContact.locality, address_postcode: billingContact === null || billingContact === void 0 ? void 0 : billingContact.postalCode, address_state: billingContact === null || billingContact === void 0 ? void 0 : billingContact.administrativeArea, ref_token: token.paymentData ? JSON.stringify(token.paymentData) : '' })
5747
5744
  } }, _this.meta.request_shipping && shippingContact && {
5748
5745
  shipping: _extends(_extends(_extends({}, shippingOptionMethod && { method: shippingOptionMethod }), _this.hasShippingOptions() && { options: _this.meta.shipping_options }), { address_line1: shippingContact.addressLines[0], address_line2: shippingContact.addressLines[1], address_country: shippingContact.countryCode, address_city: shippingContact.locality, address_postcode: shippingContact.postalCode, address_state: shippingContact.administrativeArea, contact: {
5749
5746
  first_name: shippingContact.givenName,
@@ -6193,15 +6190,17 @@
6193
6190
  var shippingAddressLine2 = (_h = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _h === void 0 ? void 0 : _h.address2;
6194
6191
  var shippingOptionMethod = (_j = this.selectedShippingOption) === null || _j === void 0 ? void 0 : _j.type;
6195
6192
  return new Promise(function (resolve) {
6196
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
6193
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
6197
6194
  return _this4.eventEmitter.emit(WALLET_EVENT.PAYMENT_METHOD_SELECTED, {
6198
6195
  data: _extends({ customer: {
6199
- payment_source: _extends(_extends(_extends(_extends({ wallet_type: WALLET_TYPE.GOOGLE, card_name: (_a = paymentData.paymentMethodData) === null || _a === void 0 ? void 0 : _a.description, type: paymentData.paymentMethodData.type, card_scheme: (_c = (_b = paymentData.paymentMethodData) === null || _b === void 0 ? void 0 : _b.info) === null || _c === void 0 ? void 0 : _c.cardNetwork }, billingAddressLine1 && { address_line1: billingAddressLine1 }), billingAddressLine2 && { address_line2: billingAddressLine2 }), billingAddressLine2 && { address_line2: billingAddressLine2 }), { address_country: (_f = (_e = (_d = paymentData.paymentMethodData) === null || _d === void 0 ? void 0 : _d.info) === null || _e === void 0 ? void 0 : _e.billingAddress) === null || _f === void 0 ? void 0 : _f.countryCode, address_city: (_j = (_h = (_g = paymentData.paymentMethodData) === null || _g === void 0 ? void 0 : _g.info) === null || _h === void 0 ? void 0 : _h.billingAddress) === null || _j === void 0 ? void 0 : _j.locality, address_postcode: (_m = (_l = (_k = paymentData.paymentMethodData) === null || _k === void 0 ? void 0 : _k.info) === null || _l === void 0 ? void 0 : _l.billingAddress) === null || _m === void 0 ? void 0 : _m.postalCode, address_state: (_q = (_p = (_o = paymentData.paymentMethodData) === null || _o === void 0 ? void 0 : _o.info) === null || _p === void 0 ? void 0 : _p.billingAddress) === null || _q === void 0 ? void 0 : _q.administrativeArea, ref_token: paymentData.paymentMethodData.tokenizationData.token })
6196
+ payment_source: _extends(_extends(_extends(_extends({ wallet_type: WALLET_TYPE.GOOGLE,
6197
+ // card_name: paymentData.shippingAddress?.name, // TODO: Do we want to use this value? Point 2 at https://paydock.atlassian.net/browse/P2-7209?focusedCommentId=60202
6198
+ type: paymentData.paymentMethodData.type, card_scheme: (_b = (_a = paymentData.paymentMethodData) === null || _a === void 0 ? void 0 : _a.info) === null || _b === void 0 ? void 0 : _b.cardNetwork }, billingAddressLine1 && { address_line1: billingAddressLine1 }), billingAddressLine2 && { address_line2: billingAddressLine2 }), billingAddressLine2 && { address_line2: billingAddressLine2 }), { address_country: (_e = (_d = (_c = paymentData.paymentMethodData) === null || _c === void 0 ? void 0 : _c.info) === null || _d === void 0 ? void 0 : _d.billingAddress) === null || _e === void 0 ? void 0 : _e.countryCode, address_city: (_h = (_g = (_f = paymentData.paymentMethodData) === null || _f === void 0 ? void 0 : _f.info) === null || _g === void 0 ? void 0 : _g.billingAddress) === null || _h === void 0 ? void 0 : _h.locality, address_postcode: (_l = (_k = (_j = paymentData.paymentMethodData) === null || _j === void 0 ? void 0 : _j.info) === null || _k === void 0 ? void 0 : _k.billingAddress) === null || _l === void 0 ? void 0 : _l.postalCode, address_state: (_p = (_o = (_m = paymentData.paymentMethodData) === null || _m === void 0 ? void 0 : _m.info) === null || _o === void 0 ? void 0 : _o.billingAddress) === null || _p === void 0 ? void 0 : _p.administrativeArea, ref_token: paymentData.paymentMethodData.tokenizationData.token })
6200
6199
  } }, _this4.isShippingRequired() && {
6201
- shipping: _extends(_extends(_extends(_extends(_extends({}, shippingOptionMethod && { method: shippingOptionMethod }), _this4.hasShippingOptions() && { options: _this4.meta.shipping_options }), shippingAddressLine1 && { address_line1: shippingAddressLine1 }), shippingAddressLine2 && { address_line2: shippingAddressLine2 }), { address_country: (_r = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _r === void 0 ? void 0 : _r.countryCode, address_city: (_s = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _s === void 0 ? void 0 : _s.locality, address_postcode: (_t = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _t === void 0 ? void 0 : _t.postalCode, address_state: (_u = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _u === void 0 ? void 0 : _u.administrativeArea, contact: {
6202
- first_name: (_v = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _v === void 0 ? void 0 : _v.name,
6200
+ shipping: _extends(_extends(_extends(_extends(_extends({}, shippingOptionMethod && { method: shippingOptionMethod }), _this4.hasShippingOptions() && { options: _this4.meta.shipping_options }), shippingAddressLine1 && { address_line1: shippingAddressLine1 }), shippingAddressLine2 && { address_line2: shippingAddressLine2 }), { address_country: (_q = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _q === void 0 ? void 0 : _q.countryCode, address_city: (_r = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _r === void 0 ? void 0 : _r.locality, address_postcode: (_s = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _s === void 0 ? void 0 : _s.postalCode, address_state: (_t = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _t === void 0 ? void 0 : _t.administrativeArea, contact: {
6201
+ first_name: (_u = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _u === void 0 ? void 0 : _u.name,
6203
6202
  email: paymentData === null || paymentData === void 0 ? void 0 : paymentData.email,
6204
- phone: (_w = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _w === void 0 ? void 0 : _w.phoneNumber
6203
+ phone: (_v = paymentData === null || paymentData === void 0 ? void 0 : paymentData.shippingAddress) === null || _v === void 0 ? void 0 : _v.phoneNumber
6205
6204
  } })
6206
6205
  }),
6207
6206
  onSuccess: function onSuccess() {
@@ -6343,7 +6342,7 @@
6343
6342
 
6344
6343
  this.auth = auth;
6345
6344
  this.authType = authType || this.setAuthType();
6346
- this.env = new Env([{ env: ENV.SANDBOX, url: 'https://api-sandbox.' }, { env: ENV.PROD, url: 'https://api.' }, { env: ENV.STAGING, url: 'https://apista.' }, { env: ENV.STAGING_1, url: 'https://apista-1.' }, { env: ENV.STAGING_2, url: 'https://apista-2.' }, { env: ENV.STAGING_3, url: 'https://apista-3.' }, { env: ENV.STAGING_4, url: 'https://apista-4.' }, { env: ENV.STAGING_5, url: 'https://apista-5.' }, { env: ENV.STAGING_6, url: 'https://apista-6.' }, { env: ENV.STAGING_7, url: 'https://apista-7.' }, { env: ENV.STAGING_8, url: 'https://apista-8.' }, { env: ENV.STAGING_9, url: 'https://apista-9.' }, { env: ENV.STAGING_10, url: 'https://apista-10.' }, { env: ENV.STAGING_11, url: 'https://apista-11.' }, { env: ENV.STAGING_12, url: 'https://apista-12.' }, { env: ENV.STAGING_13, url: 'https://apista-13.' }, { env: ENV.STAGING_14, url: 'https://apista-14.' }, { env: ENV.STAGING_15, url: 'https://apista-15.' }, { env: ENV.STAGING_CBA, url: 'https://api-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://api-cba.' }]);
6345
+ this.env = new Env(API_URL);
6347
6346
  }
6348
6347
  /**
6349
6348
  * Current method can change environment. By default environment = sandbox.
@@ -7146,7 +7145,7 @@
7146
7145
  * Show payment source inside widget only with requested gateway ids
7147
7146
  *
7148
7147
  *
7149
- * @param {string[]} ids - List of paydock gateway_id
7148
+ * @param {string[]} ids - List of gateway_id
7150
7149
  */
7151
7150
 
7152
7151
  }, {
@@ -7594,7 +7593,7 @@
7594
7593
  function Standalone3dsService(container, eventEmitter) {
7595
7594
  classCallCheck(this, Standalone3dsService);
7596
7595
 
7597
- this.env = ENV.SANDBOX;
7596
+ this.env = DEFAULT_ENV;
7598
7597
  this.container = container;
7599
7598
  this.eventEmitter = eventEmitter;
7600
7599
  }