@paydock/client-sdk 1.11.3-beta → 1.11.7

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 (40) hide show
  1. package/README.md +887 -838
  2. package/bundles/widget.umd.js +109 -28
  3. package/bundles/widget.umd.min.js +1 -1
  4. package/lib/api/api-base.js +10 -0
  5. package/lib/api/api-base.js.map +1 -1
  6. package/lib/api/api-charge-internal.d.ts +2 -2
  7. package/lib/canvas-3ds/services/gpayments-service.js +3 -1
  8. package/lib/canvas-3ds/services/gpayments-service.js.map +1 -1
  9. package/lib/checkout-button/runner.js +10 -0
  10. package/lib/checkout-button/runner.js.map +1 -1
  11. package/lib/checkout-button/zipmoney.runner.js +10 -0
  12. package/lib/checkout-button/zipmoney.runner.js.map +1 -1
  13. package/lib/components/dispatcher.js +10 -0
  14. package/lib/components/dispatcher.js.map +1 -1
  15. package/lib/components/env.d.ts +10 -0
  16. package/lib/components/env.js +10 -0
  17. package/lib/components/env.js.map +1 -1
  18. package/lib/components/http-core.js +10 -0
  19. package/lib/components/http-core.js.map +1 -1
  20. package/lib/components/link.js +10 -0
  21. package/lib/components/link.js.map +1 -1
  22. package/lib/components/popup.js +3 -1
  23. package/lib/components/popup.js.map +1 -1
  24. package/lib/secure-remote-commerce/interfaces.d.ts +13 -0
  25. package/lib/secure-remote-commerce/interfaces.js +6 -0
  26. package/lib/secure-remote-commerce/interfaces.js.map +1 -1
  27. package/lib/secure-remote-commerce/providers/visa-src/helper.d.ts +7 -0
  28. package/lib/secure-remote-commerce/providers/visa-src/helper.js +36 -0
  29. package/lib/secure-remote-commerce/providers/visa-src/helper.js.map +1 -0
  30. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +7 -1
  31. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +1 -1
  32. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +3 -3
  33. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +1 -1
  34. package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +19 -5
  35. package/lib/secure-remote-commerce/secure-remote-commerce.js +33 -6
  36. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -1
  37. package/lib/widget/configuration.js +10 -0
  38. package/lib/widget/configuration.js.map +1 -1
  39. package/package.json +1 -1
  40. package/slate.md +35 -7
@@ -231,6 +231,16 @@
231
231
  STAGING_3: 'staging_3',
232
232
  STAGING_4: 'staging_4',
233
233
  STAGING_5: 'staging_5',
234
+ STAGING_6: 'staging_6',
235
+ STAGING_7: 'staging_7',
236
+ STAGING_8: 'staging_8',
237
+ STAGING_9: 'staging_9',
238
+ STAGING_10: 'staging_10',
239
+ STAGING_11: 'staging_11',
240
+ STAGING_12: 'staging_12',
241
+ STAGING_13: 'staging_13',
242
+ STAGING_14: 'staging_14',
243
+ STAGING_15: 'staging_15',
234
244
  STAGING_CBA: 'staging_cba',
235
245
  SANDBOX_CBA: 'sandbox_cba',
236
246
  PROD_CBA: 'production_cba'
@@ -351,7 +361,7 @@
351
361
  this.params = {};
352
362
  this.widgetId = Uuid.generate();
353
363
  this.linkResource = linkResource;
354
- 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_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_CBA, url: 'https://widget-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://widget-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://widget-cba.' }]);
364
+ 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_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.' }]);
355
365
  this.setParams({ widget_id: this.widgetId });
356
366
  }
357
367
 
@@ -568,7 +578,7 @@
568
578
 
569
579
  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');
570
580
  if (ObjectHelper.values(PURPOSE).indexOf(purpose) === -1) throw new Error('unsupported purpose');
571
- 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_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_CBA, url: 'https://api-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://api-cba.' }]);
581
+ 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_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.' }]);
572
582
  this.configs = {
573
583
  purpose: purpose,
574
584
  meta: {},
@@ -2368,7 +2378,7 @@
2368
2378
  function HttpCore() {
2369
2379
  classCallCheck(this, HttpCore);
2370
2380
 
2371
- 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_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_CBA, url: 'https://api-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://api-cba.' }]);
2381
+ 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_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.' }]);
2372
2382
  }
2373
2383
 
2374
2384
  createClass(HttpCore, [{
@@ -2869,7 +2879,7 @@
2869
2879
  this.background.onTrigger(TRIGGER$1.CLOSE, function () {
2870
2880
  return _this.stop();
2871
2881
  });
2872
- 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_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_CBA, url: 'https://widget-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://widget-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://widget-cba.' }]);
2882
+ 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_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.' }]);
2873
2883
  }
2874
2884
 
2875
2885
  createClass(Runner, [{
@@ -3969,7 +3979,7 @@
3969
3979
  _this.checkout = null;
3970
3980
  _this.runs = false;
3971
3981
  _this.eventEmitter = new EventEmitter();
3972
- _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_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_CBA, url: 'https://api-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://api-cba.' }]);
3982
+ _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_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.' }]);
3973
3983
  return _this;
3974
3984
  }
3975
3985
 
@@ -4134,7 +4144,7 @@
4134
4144
  classCallCheck(this, Dispatcher);
4135
4145
 
4136
4146
  this.messageSource = messageSource;
4137
- 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_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_CBA, url: 'https://widget-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://widget-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://widget-cba.' }]);
4147
+ 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_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.' }]);
4138
4148
  }
4139
4149
 
4140
4150
  createClass(Dispatcher, [{
@@ -4271,7 +4281,7 @@
4271
4281
  this.getElement().document.write(".");
4272
4282
  var body = this.getElement().document.body || this.getElement().document.getElementsByTagName('body')[0];
4273
4283
  body.innerHTML = STYLE$1 + TEMPLATE;
4274
- if (this.env !== ENV.STAGING || this.env !== ENV.STAGING_2 || this.env !== ENV.STAGING_3 || this.env !== ENV.STAGING_4 || this.env !== ENV.STAGING_5) return;
4284
+ if (this.env !== ENV.STAGING || this.env !== ENV.STAGING_2 || this.env !== ENV.STAGING_3 || this.env !== ENV.STAGING_4 || this.env !== ENV.STAGING_5 || this.env !== ENV.STAGING_6 || this.env !== ENV.STAGING_7 || this.env !== ENV.STAGING_8 || this.env !== ENV.STAGING_9 || this.env !== ENV.STAGING_10 || this.env !== ENV.STAGING_11 || this.env !== ENV.STAGING_12 || this.env !== ENV.STAGING_13 || this.env !== ENV.STAGING_14 || this.env !== ENV.STAGING_15) return;
4275
4285
  var clickCount = 0;
4276
4286
  Event.subscribe('click', body, function () {
4277
4287
  clickCount++;
@@ -6264,7 +6274,7 @@
6264
6274
 
6265
6275
  this.auth = auth;
6266
6276
  this.authType = authType || this.setAuthType();
6267
- 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_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_CBA, url: 'https://api-staging-cba.' }, { env: ENV.SANDBOX_CBA, url: 'https://api-sandbox-cba.' }, { env: ENV.PROD_CBA, url: 'https://api-cba.' }]);
6277
+ 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_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.' }]);
6268
6278
  }
6269
6279
  /**
6270
6280
  * Current method can change environment. By default environment = sandbox.
@@ -7399,7 +7409,7 @@
7399
7409
  var _this = this;
7400
7410
 
7401
7411
  this.iFrameEvent.on(EVENT.CHARGE_AUTH, widgetId, function (data) {
7402
- if (data.status === "MethodSkipped" /* SKIPPED */) _this.performAuthentication(data);
7412
+ if (data.status === "MethodSkipped" /* SKIPPED */ || data.status === "MethodFinished" /* FINISHED */) _this.performAuthentication(data);else if (data.status === "AuthTimedOut" /* TIMEOUT */ || data.status === "invalid_event" /* INVALID */) _this.eventEmitter.emit(GPAYMENTS_EVENT.AUTH_ERROR, _this.parseHandleResponse({ status: data.status }, data.charge_3ds_id));
7403
7413
  });
7404
7414
  this.iFrameEvent.on(EVENT.CHARGE_AUTH_SUCCESS, widgetId, function (data) {
7405
7415
  _this.processResult(data.charge_3ds_id);
@@ -7990,11 +8000,11 @@
7990
8000
  classCallCheck(this, VisaSRCStyles);
7991
8001
  };
7992
8002
  VisaSRCStyles.buttonContainerStyles = "display: flex; flex-direction: column; justify-content: center; align-items: center;";
7993
- VisaSRCStyles.buttonStyles = "color: #ffff; background-color: #ffbe24; border: none; width: 100%; min-height: 40px; font-size: 16px; font-weight: bold; line-height: 19px; letter-spacing: 0.7px; text-transform: uppercase; border-radius: 4px; margin-bottom: 30px; cursor: pointer;";
8003
+ VisaSRCStyles.buttonStyles = "color: #ffff; background-color: #ffbe24; border: none; width: 100%; min-height: 40px; font-size: 16px; font-weight: bold; line-height: 19px; letter-spacing: 0.7px; text-transform: uppercase; border-radius: 4px; margin-bottom: 15px; cursor: pointer;";
7994
8004
  VisaSRCStyles.footerContainerStyles = "display: flex; flex: 1; flex-wrap: wrap; justify-content: center;";
7995
- VisaSRCStyles.footerTextStyles = "text-align: center; color: #666666; margin: 0;";
8005
+ VisaSRCStyles.footerTextStyles = "text-align: center; color: #666666; margin: 2px 0;";
7996
8006
  VisaSRCStyles.verticalLineStyle = "display: inline-block; padding: 0.5px; background-color: #E5E5E5; height: 15px;";
7997
- VisaSRCStyles.clickToPayAllCardsStyle = "height: 21px; margin-left: 8px; vertical-align: middle;";
8007
+ VisaSRCStyles.clickToPayAllCardsStyle = "height: 17px; margin-left: 8px; vertical-align: middle; padding-top: 3px;";
7998
8008
 
7999
8009
  /**
8000
8010
  * List of available event's name in the SRC checkout lifecycle
@@ -8010,13 +8020,55 @@
8010
8020
  */
8011
8021
  var EVENT$3;
8012
8022
  (function (EVENT) {
8013
- EVENT["CHECKOUT_BUTTON_LOADED"] = "checkoutButtonLoaded";
8014
- EVENT["CHECKOUT_BUTTON_CLICKED"] = "checkoutButtonClicked";
8015
- EVENT["IFRAME_LOADED"] = "iframeLoaded";
8016
- EVENT["CHECKOUT_READY"] = "checkoutReady";
8017
- EVENT["CHECKOUT_COMPLETED"] = "checkoutCompleted";
8018
- EVENT["CHECKOUT_ERROR"] = "checkoutError";
8023
+ EVENT["CHECKOUT_BUTTON_LOADED"] = "checkoutButtonLoaded";
8024
+ EVENT["CHECKOUT_BUTTON_CLICKED"] = "checkoutButtonClicked";
8025
+ EVENT["IFRAME_LOADED"] = "iframeLoaded";
8026
+ EVENT["CHECKOUT_READY"] = "checkoutReady";
8027
+ EVENT["CHECKOUT_COMPLETED"] = "checkoutCompleted";
8028
+ EVENT["CHECKOUT_ERROR"] = "checkoutError";
8019
8029
  })(EVENT$3 || (EVENT$3 = {}));
8030
+ var STYLE$2 = {
8031
+ BUTTON_TEXT_COLOR: 'button_text_color',
8032
+ PRIMARY_COLOR: 'primary_color',
8033
+ FONT_FAMILY: 'font_family',
8034
+ CARD_SCHEMES: 'card_schemes'
8035
+ };
8036
+
8037
+ var CARD_SCHEME = {
8038
+ VISA: 'visa',
8039
+ MASTERCARD: 'mastercard',
8040
+ AMEX: 'amex',
8041
+ DISCOVER: 'discover'
8042
+ };
8043
+ var CHEVRON_VMAD_IMG_PATH = '/images/visa-src/Chevron_Large_VMAD.png';
8044
+ var CHEVRON_VMA_IMG_PATH = '/images/visa-src/Chevron_Large_VMA.png';
8045
+ var CHEVRON_VM_IMG_PATH = '/images/visa-src/Chevron_Large_VM.png';
8046
+ var CHEVRON_M_IMG_PATH = '/images/visa-src/Chevron_Large_M.png';
8047
+ var CHEVRON_D_IMG_PATH = '/images/visa-src/Chevron_Large_D.png';
8048
+ var CHEVRON_V_IMG_PATH = '/images/visa-src/Chevron_Large_V.png';
8049
+ var VMAD_IMG_PATH = '/images/visa-src/vmad.svg';
8050
+ var VMA_IMG_PATH = '/images/visa-src/logos/Networks_Large_VMA.png';
8051
+ var VM_IMG_PATH = '/images/visa-src/logos/Networks_Large_VM.png';
8052
+ var M_IMG_PATH = '/images/visa-src/logos/master-logo.png';
8053
+ var D_IMG_PATH = '/images/visa-src/logos/Networks_Large_D.png';
8054
+ var V_IMG_PATH = '/images/visa-src/logos/visa-logo.png';
8055
+ var GenerateCardSchemesLogo = function GenerateCardSchemesLogo(card_scheme) {
8056
+ var chevron = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
8057
+
8058
+ if (!card_scheme || !Array.isArray(card_scheme)) return chevron ? CHEVRON_VMAD_IMG_PATH : VMAD_IMG_PATH;
8059
+ var card_scheme_sort = card_scheme.sort();
8060
+ if (includeArray([CARD_SCHEME.AMEX, CARD_SCHEME.MASTERCARD, CARD_SCHEME.VISA], card_scheme_sort)) return chevron ? CHEVRON_VMA_IMG_PATH : VMA_IMG_PATH;
8061
+ if (includeArray([CARD_SCHEME.MASTERCARD, CARD_SCHEME.VISA], card_scheme_sort)) return chevron ? CHEVRON_VM_IMG_PATH : VM_IMG_PATH;
8062
+ if (includeArray([CARD_SCHEME.MASTERCARD], card_scheme_sort)) return chevron ? CHEVRON_M_IMG_PATH : M_IMG_PATH;
8063
+ if (includeArray([CARD_SCHEME.DISCOVER], card_scheme_sort)) return chevron ? CHEVRON_D_IMG_PATH : D_IMG_PATH;
8064
+ if (includeArray([CARD_SCHEME.VISA], card_scheme_sort)) return chevron ? CHEVRON_V_IMG_PATH : V_IMG_PATH;
8065
+ return chevron ? CHEVRON_V_IMG_PATH : VMAD_IMG_PATH;
8066
+ };
8067
+ var includeArray = function includeArray(condition, card_scheme) {
8068
+ return condition.every(function (card, index) {
8069
+ return card === card_scheme[index];
8070
+ });
8071
+ };
8020
8072
 
8021
8073
  var VisaSRC = function () {
8022
8074
  function VisaSRC(button_selector, iframe_selector, service_id, public_key, meta, eventEmitter, autoResize, env, alias) {
@@ -8063,10 +8115,13 @@
8063
8115
  value: function load() {
8064
8116
  var _this2 = this;
8065
8117
 
8118
+ var _a;
8066
8119
  var container = document.createElement('div');
8067
8120
  container.setAttribute('style', VisaSRCStyles.buttonContainerStyles);
8068
8121
  var checkoutButton = document.createElement('button');
8069
8122
  checkoutButton.setAttribute('style', VisaSRCStyles.buttonStyles);
8123
+ if (this.meta.customizations.primary_color) checkoutButton.style.backgroundColor = this.meta.customizations.primary_color;
8124
+ if (this.meta.customizations.button_text_color) checkoutButton.style.color = this.meta.customizations.button_text_color;
8070
8125
  checkoutButton.innerHTML = 'Checkout';
8071
8126
  var footerContainer = document.createElement('div');
8072
8127
  footerContainer.setAttribute('style', VisaSRCStyles.footerContainerStyles);
@@ -8077,7 +8132,7 @@
8077
8132
  footerText.innerHTML = 'WE ACCEPT';
8078
8133
  var clickToPayAllCards = document.createElement('img');
8079
8134
  clickToPayAllCards.setAttribute('style', VisaSRCStyles.clickToPayAllCardsStyle);
8080
- clickToPayAllCards.src = this.link.getBaseUrl() + '/images/visa-src/src-vmad.svg';
8135
+ clickToPayAllCards.src = this.link.getBaseUrl() + ('' + GenerateCardSchemesLogo((_a = this.meta.customizations) === null || _a === void 0 ? void 0 : _a.card_schemes, true));
8081
8136
  checkoutButton.onclick = function () {
8082
8137
  _this2.eventEmitter.emit(EVENT$3.CHECKOUT_BUTTON_CLICKED, {});
8083
8138
  _this2.iFrame.load(_this2.link.getUrl(), { title: 'Visa SRC checkout' });
@@ -8189,7 +8244,6 @@
8189
8244
  * @param {string} [customer.payment_source.address_postcode] Customer billing address postcode.
8190
8245
  * @param {string} [customer.payment_source.address_state] Customer billing address state code (if applicable for the country, example "FL" for Florida).
8191
8246
  * @param {string} [customer.payment_source.address_country] Customer billing address country code (example "US").
8192
- *
8193
8247
  */
8194
8248
  /**
8195
8249
  * Class SRC include methods for interacting with different secure remote commerce options such as Visa SRC
@@ -8198,32 +8252,58 @@
8198
8252
  * @param {string} button_selector - Selector of html element. Container for SRC checkout button.
8199
8253
  * @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
8200
8254
  * @param {string} service_id - Card Scheme Service ID
8201
- * @param {string} public_key - Paydock public key
8255
+ * @param {string} public_key_or_access_token - Paydock public key or Access Token
8202
8256
  * @param {IVisaSRCMeta} meta - Data that configures the SRC checkout
8203
8257
  * @example
8204
8258
  * var SRC = new SRC('#checkoutButton', '#checkoutIframe', 'service_id', 'public_key', {});
8205
8259
  *
8206
8260
  **/
8207
8261
  var SRC = function () {
8208
- function SRC(button_selector, iframe_selector, service_id, public_key, meta) {
8262
+ function SRC(button_selector, iframe_selector, service_id, public_key_or_access_token, meta) {
8209
8263
  classCallCheck(this, SRC);
8210
8264
 
8211
8265
  this.button_selector = button_selector;
8212
8266
  this.iframe_selector = iframe_selector;
8213
8267
  this.service_id = service_id;
8214
- this.public_key = public_key;
8268
+ this.public_key_or_access_token = public_key_or_access_token;
8215
8269
  this.meta = meta;
8216
8270
  this.autoResize = false;
8217
- this.api = new ApiInternal(public_key, API_AUTH_TYPE.PUBLIC_KEY);
8271
+ this.style = {};
8272
+ this.api = new ApiInternal(public_key_or_access_token, API_AUTH_TYPE.PUBLIC_KEY);
8218
8273
  this.eventEmitter = new EventEmitter();
8219
8274
  }
8220
8275
  /**
8221
- * The final method after configuring the SRC to start the load process of SRC checkout
8222
- *
8223
- */
8276
+ * Object contain styles for widget - call before `.load()`.
8277
+ *
8278
+ * @example
8279
+ * widget.setStyles({
8280
+ * button_text_color: '#32a852',
8281
+ * primary_color: '#32a852',
8282
+ * font_family: 'sans-serif',
8283
+ * card_schemes: ['visa']
8284
+ * });
8285
+ * @param {IStyles} fields - name of styles which can be shown in widget [STYLE]{@link STYLE}
8286
+ */
8224
8287
 
8225
8288
 
8226
8289
  createClass(SRC, [{
8290
+ key: 'setStyles',
8291
+ value: function setStyles(styles) {
8292
+ for (var index in styles) {
8293
+ if (styles.hasOwnProperty(index)) this.setStyle(index, styles[index]);
8294
+ }
8295
+ }
8296
+ }, {
8297
+ key: 'setStyle',
8298
+ value: function setStyle(param, value) {
8299
+ if (ObjectHelper.values(STYLE$2).indexOf(param) !== -1) this.style[param] = value;else console.warn('Widget::setStyle[s: unsupported style param ' + param);
8300
+ }
8301
+ /**
8302
+ * The final method after configuring the SRC to start the load process of SRC checkout
8303
+ *
8304
+ */
8305
+
8306
+ }, {
8227
8307
  key: 'load',
8228
8308
  value: function load() {
8229
8309
  var _this = this;
@@ -8232,9 +8312,10 @@
8232
8312
  this.api.service().getConfig(this.service_id).then(function (_ref) {
8233
8313
  var type = _ref.type;
8234
8314
 
8315
+ _this.meta.customizations = _this.style; // assign the style on the start of the widget
8235
8316
  switch (type) {
8236
8317
  case CARD_SCHEME_SERVICE.VISA_SRC:
8237
- _this.provider = new VisaSRC(_this.button_selector, _this.iframe_selector, _this.service_id, _this.public_key, _this.meta, _this.eventEmitter, _this.autoResize, _this.env, _this.alias);
8318
+ _this.provider = new VisaSRC(_this.button_selector, _this.iframe_selector, _this.service_id, _this.public_key_or_access_token, _this.meta, _this.eventEmitter, _this.autoResize, _this.env, _this.alias);
8238
8319
  break;
8239
8320
  }
8240
8321
  if (_this.provider) _this.provider.load();