@paydock/client-sdk 1.10.89-beta → 1.11.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.
Files changed (44) hide show
  1. package/README.md +478 -2
  2. package/bundles/widget.umd.js +429 -0
  3. package/bundles/widget.umd.min.js +1 -1
  4. package/inicialization-guide.md +7 -0
  5. package/lib/api/api-internal.d.ts +2 -0
  6. package/lib/api/api-internal.js +4 -0
  7. package/lib/api/api-internal.js.map +1 -1
  8. package/lib/api/api-service-internal.d.ts +17 -0
  9. package/lib/api/api-service-internal.js +18 -0
  10. package/lib/api/api-service-internal.js.map +1 -0
  11. package/lib/components/iframe-event.d.ts +3 -0
  12. package/lib/components/iframe-event.js +2 -0
  13. package/lib/components/iframe-event.js.map +1 -1
  14. package/lib/components/link.d.ts +4 -2
  15. package/lib/components/link.js +4 -0
  16. package/lib/components/link.js.map +1 -1
  17. package/lib/components/param.d.ts +6 -0
  18. package/lib/components/param.js.map +1 -1
  19. package/lib/index.d.ts +1 -0
  20. package/lib/index.js +1 -0
  21. package/lib/index.js.map +1 -1
  22. package/lib/secure-remote-commerce/index.d.ts +1 -0
  23. package/lib/secure-remote-commerce/index.js +2 -0
  24. package/lib/secure-remote-commerce/index.js.map +1 -0
  25. package/lib/secure-remote-commerce/interfaces.d.ts +58 -0
  26. package/lib/secure-remote-commerce/interfaces.js +22 -0
  27. package/lib/secure-remote-commerce/interfaces.js.map +1 -0
  28. package/lib/secure-remote-commerce/providers/src-provider.d.ts +10 -0
  29. package/lib/secure-remote-commerce/providers/src-provider.js +1 -0
  30. package/lib/secure-remote-commerce/providers/src-provider.js.map +1 -0
  31. package/lib/secure-remote-commerce/providers/visa-src/index.d.ts +1 -0
  32. package/lib/secure-remote-commerce/providers/visa-src/index.js +2 -0
  33. package/lib/secure-remote-commerce/providers/visa-src/index.js.map +1 -0
  34. package/lib/secure-remote-commerce/providers/visa-src/visa-src.d.ts +27 -0
  35. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js +100 -0
  36. package/lib/secure-remote-commerce/providers/visa-src/visa-src.js.map +1 -0
  37. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.d.ts +8 -0
  38. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js +10 -0
  39. package/lib/secure-remote-commerce/providers/visa-src/visa-src.styles.js.map +1 -0
  40. package/lib/secure-remote-commerce/secure-remote-commerce.d.ts +148 -0
  41. package/lib/secure-remote-commerce/secure-remote-commerce.js +210 -0
  42. package/lib/secure-remote-commerce/secure-remote-commerce.js.map +1 -0
  43. package/package.json +1 -1
  44. package/slate.md +233 -3
@@ -343,6 +343,7 @@
343
343
  var SECURE_3D = '/3ds/webhook';
344
344
  var FLYPAY_LINK = '/wallet/flypay';
345
345
  var FLYPAY_LOGO_LINK = '/images/logo.png';
346
+ var VISA_SRC = '/secure-remote-commerce/visa';
346
347
  var Link = function () {
347
348
  function Link(linkResource) {
348
349
  classCallCheck(this, Link);
@@ -398,6 +399,11 @@
398
399
  value: function getEnv() {
399
400
  return this.env.getEnv();
400
401
  }
402
+ }, {
403
+ key: "getBaseUrl",
404
+ value: function getBaseUrl() {
405
+ return this.env.getConf().url;
406
+ }
401
407
  }]);
402
408
  return Link;
403
409
  }();
@@ -1585,7 +1591,9 @@
1585
1591
  VALIDATION_ERROR: 'validationError',
1586
1592
  SYSTEM_ERROR: 'systemError',
1587
1593
  CHECKOUT_SUCCESS: 'checkoutSuccess',
1594
+ CHECKOUT_READY: 'checkoutReady',
1588
1595
  CHECKOUT_ERROR: 'checkoutError',
1596
+ CHECKOUT_COMPLETED: 'checkoutCompleted',
1589
1597
  VALIDATION: 'validation',
1590
1598
  SELECT: 'select',
1591
1599
  UNSELECT: 'unselect',
@@ -6384,6 +6392,28 @@
6384
6392
  return ApiChargeInternal;
6385
6393
  }();
6386
6394
 
6395
+ var GET_CONFIG = '/v1/services/:service_id/config';
6396
+ var ApiServiceInternal = function () {
6397
+ function ApiServiceInternal(api) {
6398
+ classCallCheck(this, ApiServiceInternal);
6399
+
6400
+ this.api = api;
6401
+ }
6402
+
6403
+ createClass(ApiServiceInternal, [{
6404
+ key: 'getConfig',
6405
+ value: function getConfig(service_id) {
6406
+ var url = GET_CONFIG.replace(':service_id', service_id);
6407
+ return this.api.getClientPromise('GET', url).send(undefined);
6408
+ }
6409
+ }]);
6410
+ return ApiServiceInternal;
6411
+ }();
6412
+ var CARD_SCHEME_SERVICE;
6413
+ (function (CARD_SCHEME_SERVICE) {
6414
+ CARD_SCHEME_SERVICE["VISA_SRC"] = "VisaSRC";
6415
+ })(CARD_SCHEME_SERVICE || (CARD_SCHEME_SERVICE = {}));
6416
+
6387
6417
  var ApiInternal = function (_ApiBase) {
6388
6418
  inherits(ApiInternal, _ApiBase);
6389
6419
 
@@ -6397,6 +6427,11 @@
6397
6427
  value: function charge() {
6398
6428
  return new ApiChargeInternal(this);
6399
6429
  }
6430
+ }, {
6431
+ key: 'service',
6432
+ value: function service() {
6433
+ return new ApiServiceInternal(this);
6434
+ }
6400
6435
  }]);
6401
6436
  return ApiInternal;
6402
6437
  }(ApiBase);
@@ -7934,6 +7969,399 @@
7934
7969
  return VaultDisplayWidget;
7935
7970
  }();
7936
7971
 
7972
+ var VisaSRCStyles = function VisaSRCStyles() {
7973
+ classCallCheck(this, VisaSRCStyles);
7974
+ };
7975
+ VisaSRCStyles.buttonContainerStyles = "display: flex; flex-direction: column; justify-content: center; align-items: center;";
7976
+ 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;";
7977
+ VisaSRCStyles.footerContainerStyles = "display: flex; flex: 1; flex-wrap: wrap; justify-content: center;";
7978
+ VisaSRCStyles.footerTextStyles = "text-align: center; color: #666666; margin: 0;";
7979
+ VisaSRCStyles.verticalLineStyle = "display: inline-block; padding: 0.5px; background-color: #E5E5E5; height: 15px;";
7980
+ VisaSRCStyles.clickToPayAllCardsStyle = "height: 21px; margin-left: 8px; vertical-align: middle;";
7981
+
7982
+ /**
7983
+ * List of available event's name in the SRC checkout lifecycle
7984
+ * @enum EVENT
7985
+ *
7986
+ * @type {object}
7987
+ * @param {string} CHECKOUT_BUTTON_LOADED=checkoutButtonLoaded
7988
+ * @param {string} CHECKOUT_BUTTON_CLICKED=checkoutButtonClicked
7989
+ * @param {string} IFRAME_LOADED=iframeLoaded
7990
+ * @param {string} CHECKOUT_READY=checkoutReady
7991
+ * @param {string} CHECKOUT_COMPLETED=checkoutCompleted
7992
+ * @param {string} CHECKOUT_ERROR=checkoutError
7993
+ */
7994
+ var EVENT$3;
7995
+ (function (EVENT) {
7996
+ EVENT["CHECKOUT_BUTTON_LOADED"] = "checkoutButtonLoaded";
7997
+ EVENT["CHECKOUT_BUTTON_CLICKED"] = "checkoutButtonClicked";
7998
+ EVENT["IFRAME_LOADED"] = "iframeLoaded";
7999
+ EVENT["CHECKOUT_READY"] = "checkoutReady";
8000
+ EVENT["CHECKOUT_COMPLETED"] = "checkoutCompleted";
8001
+ EVENT["CHECKOUT_ERROR"] = "checkoutError";
8002
+ })(EVENT$3 || (EVENT$3 = {}));
8003
+
8004
+ var VisaSRC = function () {
8005
+ function VisaSRC(button_selector, iframe_selector, service_id, public_key, meta, eventEmitter, autoResize, env, alias) {
8006
+ classCallCheck(this, VisaSRC);
8007
+
8008
+ this.meta = meta;
8009
+ this.eventEmitter = eventEmitter;
8010
+ this.autoResize = autoResize;
8011
+ this.link = new Link(VISA_SRC);
8012
+ this.link.setParams(_extends({ service_id: service_id, public_key: public_key }, meta && { meta: JSON.stringify(meta) }));
8013
+ if (env) this.link.setEnv(env, alias);
8014
+ this.iFrameContainer = new Container(iframe_selector);
8015
+ this.iFrame = new IFrame(this.iFrameContainer);
8016
+ this.buttonContainer = new Container(button_selector);
8017
+ this.iFrameEvent = new IFrameEvent(window);
8018
+ this.setupIFrameEvents();
8019
+ }
8020
+
8021
+ createClass(VisaSRC, [{
8022
+ key: 'setupIFrameEvents',
8023
+ value: function setupIFrameEvents() {
8024
+ var _this = this;
8025
+
8026
+ var widgetId = this.link.getParams().widget_id;
8027
+ this.iFrameEvent.on(EVENT$3.CHECKOUT_READY, widgetId, function (_ref) {
8028
+ var data = _ref.data;
8029
+
8030
+ _this.eventEmitter.emit(EVENT$3.CHECKOUT_READY, data);
8031
+ });
8032
+ this.iFrameEvent.on(EVENT$3.CHECKOUT_COMPLETED, widgetId, function (_ref2) {
8033
+ var data = _ref2.data;
8034
+
8035
+ _this.eventEmitter.emit(EVENT$3.CHECKOUT_COMPLETED, data);
8036
+ });
8037
+ this.iFrameEvent.on(EVENT$3.CHECKOUT_ERROR, widgetId, function (_ref3) {
8038
+ var data = _ref3.data;
8039
+
8040
+ _this.eventEmitter.emit(EVENT$3.CHECKOUT_ERROR, data);
8041
+ });
8042
+ if (this.autoResize) this.useAutoResize(true);
8043
+ }
8044
+ }, {
8045
+ key: 'load',
8046
+ value: function load() {
8047
+ var _this2 = this;
8048
+
8049
+ var container = document.createElement('div');
8050
+ container.setAttribute('style', VisaSRCStyles.buttonContainerStyles);
8051
+ var checkoutButton = document.createElement('button');
8052
+ checkoutButton.setAttribute('style', VisaSRCStyles.buttonStyles);
8053
+ checkoutButton.innerHTML = 'Checkout';
8054
+ var footerContainer = document.createElement('div');
8055
+ footerContainer.setAttribute('style', VisaSRCStyles.footerContainerStyles);
8056
+ var verticalLine = document.createElement('div');
8057
+ verticalLine.setAttribute('style', VisaSRCStyles.verticalLineStyle);
8058
+ var footerText = document.createElement('p');
8059
+ footerText.setAttribute('style', VisaSRCStyles.footerTextStyles);
8060
+ footerText.innerHTML = 'WE ACCEPT';
8061
+ var clickToPayAllCards = document.createElement('img');
8062
+ clickToPayAllCards.setAttribute('style', VisaSRCStyles.clickToPayAllCardsStyle);
8063
+ clickToPayAllCards.src = this.link.getBaseUrl() + '/images/visa-src/src-vmad.svg';
8064
+ checkoutButton.onclick = function () {
8065
+ _this2.eventEmitter.emit(EVENT$3.CHECKOUT_BUTTON_CLICKED, {});
8066
+ _this2.iFrame.load(_this2.link.getUrl(), { title: 'Visa SRC checkout' });
8067
+ _this2.iFrame.getElement().onload = function () {
8068
+ return _this2.eventEmitter.emit(EVENT$3.IFRAME_LOADED, {});
8069
+ };
8070
+ };
8071
+ container.appendChild(checkoutButton);
8072
+ container.appendChild(footerContainer);
8073
+ footerContainer.appendChild(footerText);
8074
+ footerContainer.appendChild(clickToPayAllCards);
8075
+ this.buttonContainer.getElement().appendChild(container);
8076
+ this.eventEmitter.emit(EVENT$3.CHECKOUT_BUTTON_LOADED, {});
8077
+ }
8078
+ }, {
8079
+ key: 'getEnv',
8080
+ value: function getEnv() {
8081
+ return this.link.getEnv();
8082
+ }
8083
+ }, {
8084
+ key: 'hideButton',
8085
+ value: function hideButton(_saveSize) {
8086
+ if (this.buttonContainer.getElement()) this.buttonContainer.getElement().style['display'] = 'none';
8087
+ }
8088
+ }, {
8089
+ key: 'showButton',
8090
+ value: function showButton() {
8091
+ if (this.buttonContainer.getElement()) this.buttonContainer.getElement().style['display'] = 'block';
8092
+ }
8093
+ }, {
8094
+ key: 'hideCheckout',
8095
+ value: function hideCheckout(saveSize) {
8096
+ if (this.iFrame) this.iFrame.hide();
8097
+ }
8098
+ }, {
8099
+ key: 'showCheckout',
8100
+ value: function showCheckout() {
8101
+ if (this.iFrame) this.iFrame.show();
8102
+ }
8103
+ }, {
8104
+ key: 'reload',
8105
+ value: function reload() {
8106
+ this.iFrame.remove();
8107
+ this.load();
8108
+ }
8109
+ }, {
8110
+ key: 'useAutoResize',
8111
+ value: function useAutoResize(force) {
8112
+ var _this3 = this;
8113
+
8114
+ if (this.autoResize && !force) return;
8115
+ this.autoResize = true;
8116
+ this.iFrameEvent.on('resize', this.link.getParams().widget_id, function (_ref4) {
8117
+ var data = _ref4.data;
8118
+
8119
+ if (_this3.iFrame.getElement()) {
8120
+ _this3.iFrame.getElement().scrolling = 'no';
8121
+ if (data.height) _this3.iFrame.setStyle('height', data.height + 'px');
8122
+ }
8123
+ });
8124
+ }
8125
+ }]);
8126
+ return VisaSRC;
8127
+ }();
8128
+
8129
+ /**
8130
+ * Interface of data used for the Visa Checkout.
8131
+ * @interface IVisaSRCMeta
8132
+ *
8133
+ * @type {object}
8134
+ * @param {string} [srci_transaction_id] Used to identify the SRC Id.
8135
+ * @param {object} [dpa_data] Object where the DPA creation data is stored.
8136
+ * @param {string} [dpa_data.dpa_presentation_name] Name in which the DPA is presented in.
8137
+ * @param {string} [dpa_data.dpa_uri] Used for indicating the DPA URI.
8138
+ * @param {object} [dpa_transaction_options] Object that stores options for creating a trasaction with DPA.
8139
+ * @param {string} [dpa_transaction_options.dpa_locale] DPA’s preferred locale, example en_US.
8140
+ * @param {Array} [dpa_transaction_options.dpa_accepted_billing_countries] Used to indicate list of accepted billing countries for DPA.
8141
+ * @param {Array} [dpa_transaction_options.dpa_accepted_shipping_countries] Used to indicate list of accepted shipping countries for DPA.
8142
+ * @param {string} [dpa_transaction_options.dpa_billing_preference] Used for listing the enumeration for billing preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'.
8143
+ * @param {string} [dpa_transaction_options.dpa_shipping_preference] Used for listing the enumeration for shipping preferences for DPA. Options are 'ALL', 'POSTAL_COUNTRY' and 'NONE'.
8144
+ * @param {boolean} [dpa_transaction_options.consumer_name_requested] Used to check if the name of the consumer is needed.
8145
+ * @param {boolean} [dpa_transaction_options.consumer_email_address_requested] Used to check if the email of the consumer is needed.
8146
+ * @param {boolean} [dpa_transaction_options.consumer_phone_number_requested] Used to check if the phone number of the consumer is needed.
8147
+ * @param {object} [dpa_transaction_options.payment_options] Object used to check the payment options that are included.
8148
+ * @param {number} [dpa_transaction_options.payment_options.dpa_dynamic_data_ttl_minutes] The minimum requested validity period for the transaction credentials.
8149
+ * @param {string} [dpa_transaction_options.payment_options.dynamic_data_type] Used for listing the enumeration for dynamic data types. Options are 'TAVV' and 'DTVV'.
8150
+ * @param {boolean} [dpa_transaction_options.payment_options.dpa_pan_requested] Used to check if PAN number was requested.
8151
+ * @param {string} [dpa_transaction_options.review_action] Used for listing the enumeration of review actions. Options are 'pay' and 'continue'.
8152
+ * @param {string} [dpa_transaction_options.checkout_description] Used for indicating the description of the checkout.
8153
+ * @param {string} [dpa_transaction_options.transaction_type] Used for listing the enumeration of the type of the transaction. 'PURCHASE', 'BILL_PAYMENT' and 'MONEY_TRANSFER'
8154
+ * @param {string} [dpa_transaction_options.order_type] Used for listing the enumeration of the type of the order. Options are 'REAUTHORIZATION', 'RECURRING' and 'INSTALLMENT'.
8155
+ * @param {object} [dpa_transaction_options.transaction_amount] Object used to describe the details of the transaction.
8156
+ * @param {number} [dpa_transaction_options.transaction_amount.transaction_amount] Used to indicate the amount of the transaction.
8157
+ * @param {string} [dpa_transaction_options.transaction_amount.transaction_currency_code] Used to indicate the currency code of the transaction. 3 letter ISO code format.
8158
+ * @param {string} [dpa_transaction_options.merchant_order_id] Used to indicate the merchants order Id.
8159
+ * @param {string} [dpa_transaction_options.merchant_category_code] Used to indicate the merchants category code.
8160
+ * @param {string} [dpa_transaction_options.merchant_country_code] Used to indicate the merchants country code. 2 letter ISO code format.
8161
+ * @param {object} [customer] Object where the customer data is stored to prefill in the checkout.
8162
+ * @param {string} [customer.email] Customer email.
8163
+ * @param {string} [customer.first_name] Customer first name.
8164
+ * @param {string} [customer.last_name] Customer last name.
8165
+ * @param {object} [customer.phone] Object where the customer phone is stored.
8166
+ * @param {string} [customer.phone.country_code] Customer phone country code (example "1" for US).
8167
+ * @param {string} [customer.phone.phone] Customer phone number.
8168
+ * @param {object} [customer.payment_source] Object where the customer billing address data is stored.
8169
+ * @param {string} [customer.payment_source.address_line1] Customer billing address line 1.
8170
+ * @param {string} [customer.payment_source.address_line2] Customer billing address line 2.
8171
+ * @param {string} [customer.payment_source.address_city] Customer billing address city.
8172
+ * @param {string} [customer.payment_source.address_postcode] Customer billing address postcode.
8173
+ * @param {string} [customer.payment_source.address_state] Customer billing address state code (if applicable for the country, example "FL" for Florida).
8174
+ * @param {string} [customer.payment_source.address_country] Customer billing address country code (example "US").
8175
+ *
8176
+ */
8177
+ /**
8178
+ * Class SRC include methods for interacting with different secure remote commerce options such as Visa SRC
8179
+ * @constructor
8180
+ *
8181
+ * @param {string} button_selector - Selector of html element. Container for SRC checkout button.
8182
+ * @param {string} iframe_selector - Selector of html element. Container for SRC checkout iFrame.
8183
+ * @param {string} service_id - Card Scheme Service ID
8184
+ * @param {string} public_key - Paydock public key
8185
+ * @param {IVisaSRCMeta} meta - Data that configures the SRC checkout
8186
+ * @example
8187
+ * var SRC = new SRC('#checkoutButton', '#checkoutIframe', 'service_id', 'public_key', {});
8188
+ *
8189
+ **/
8190
+ var SRC = function () {
8191
+ function SRC(button_selector, iframe_selector, service_id, public_key, meta) {
8192
+ classCallCheck(this, SRC);
8193
+
8194
+ this.button_selector = button_selector;
8195
+ this.iframe_selector = iframe_selector;
8196
+ this.service_id = service_id;
8197
+ this.public_key = public_key;
8198
+ this.meta = meta;
8199
+ this.autoResize = false;
8200
+ this.api = new ApiInternal(public_key, API_AUTH_TYPE.PUBLIC_KEY);
8201
+ this.eventEmitter = new EventEmitter();
8202
+ }
8203
+ /**
8204
+ * The final method after configuring the SRC to start the load process of SRC checkout
8205
+ *
8206
+ */
8207
+
8208
+
8209
+ createClass(SRC, [{
8210
+ key: 'load',
8211
+ value: function load() {
8212
+ var _this = this;
8213
+
8214
+ if (this.provider) return;
8215
+ this.api.service().getConfig(this.service_id).then(function (_ref) {
8216
+ var type = _ref.type;
8217
+
8218
+ switch (type) {
8219
+ case CARD_SCHEME_SERVICE.VISA_SRC:
8220
+ _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);
8221
+ break;
8222
+ }
8223
+ if (_this.provider) _this.provider.load();
8224
+ });
8225
+ }
8226
+ /**
8227
+ * Current method can change environment. By default environment = sandbox.
8228
+ * Also we can change domain alias for this environment. By default domain_alias = paydock.com
8229
+ *
8230
+ * @example
8231
+ * SRC.setEnv('production');
8232
+ * @param {string} env - sandbox, production
8233
+ * @param {string} [alias] - Own domain alias
8234
+ */
8235
+
8236
+ }, {
8237
+ key: 'setEnv',
8238
+ value: function setEnv(env, alias) {
8239
+ if (this.provider) return;
8240
+ this.env = env;
8241
+ this.alias = alias;
8242
+ this.api.setEnv(env, alias);
8243
+ }
8244
+ /**
8245
+ * Method to read the current environment
8246
+ *
8247
+ * @example
8248
+ * SRC.getEnv();
8249
+ */
8250
+
8251
+ }, {
8252
+ key: 'getEnv',
8253
+ value: function getEnv() {
8254
+ if (this.provider) return this.provider.getEnv();else return this.env;
8255
+ }
8256
+ /**
8257
+ * Listen to events of SRC
8258
+ *
8259
+ * @example
8260
+ *
8261
+ * SRC.on('checkoutCompleted', function (token) {
8262
+ * console.log(token);
8263
+ * });
8264
+ * // or
8265
+ * SRC.on('checkoutCompleted').then(function (token) {
8266
+ * console.log(token);
8267
+ * });
8268
+ * @param {string} eventName - Available event names [EVENT]{@link EVENT}
8269
+ * @param {listener} [cb]
8270
+ * @return {Promise<any> | void}
8271
+ */
8272
+
8273
+ }, {
8274
+ key: 'on',
8275
+ value: function on(eventName, cb) {
8276
+ var _this2 = this;
8277
+
8278
+ if (typeof cb === "function") return this.eventEmitter.subscribe(eventName, cb);
8279
+ return new Promise(function (resolve) {
8280
+ return _this2.eventEmitter.subscribe(eventName, function (res) {
8281
+ return resolve(res);
8282
+ });
8283
+ });
8284
+ }
8285
+ /**
8286
+ * Using this method you can hide button
8287
+ * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
8288
+ *
8289
+ * @example
8290
+ * SRC.hideButton();
8291
+ */
8292
+
8293
+ }, {
8294
+ key: 'hideButton',
8295
+ value: function hideButton(saveSize) {
8296
+ if (this.provider && typeof this.provider.hideButton === 'function') this.provider.hideButton(saveSize);
8297
+ }
8298
+ /**
8299
+ * Using this method you can show the SRC button after using hideButton method
8300
+ *
8301
+ * @example
8302
+ * SRC.showButton();
8303
+ */
8304
+
8305
+ }, {
8306
+ key: 'showButton',
8307
+ value: function showButton() {
8308
+ if (this.provider && typeof this.provider.showButton === 'function') this.provider.showButton();
8309
+ }
8310
+ /**
8311
+ * Using this method you can hide checkout after load and button click
8312
+ * @param {boolean} [saveSize=false] - using this param you can save iframe's size (if applicable)
8313
+ *
8314
+ * @example
8315
+ * SRC.hideCheckout();
8316
+ */
8317
+
8318
+ }, {
8319
+ key: 'hideCheckout',
8320
+ value: function hideCheckout(saveSize) {
8321
+ if (this.provider && typeof this.provider.hideCheckout === 'function') this.provider.hideCheckout(saveSize);
8322
+ }
8323
+ /**
8324
+ * Using this method you can show checkout after using hideCheckout method
8325
+ *
8326
+ * @example
8327
+ * SRC.showCheckout()
8328
+ */
8329
+
8330
+ }, {
8331
+ key: 'showCheckout',
8332
+ value: function showCheckout() {
8333
+ if (this.provider && typeof this.provider.showCheckout === 'function') this.provider.showCheckout();
8334
+ }
8335
+ /**
8336
+ * Using this method you can reload the whole checkout
8337
+ *
8338
+ * @example
8339
+ * SRC.reload()
8340
+ */
8341
+
8342
+ }, {
8343
+ key: 'reload',
8344
+ value: function reload() {
8345
+ if (this.provider) this.provider.reload();
8346
+ }
8347
+ /**
8348
+ * Use this method for resize checkout iFrame according to content height, if applicable
8349
+ *
8350
+ * @example
8351
+ * SRC.useAutoResize();
8352
+ *
8353
+ */
8354
+
8355
+ }, {
8356
+ key: 'useAutoResize',
8357
+ value: function useAutoResize() {
8358
+ this.autoResize = true;
8359
+ if (this.provider && typeof this.provider.useAutoResize === 'function') this.provider.useAutoResize();
8360
+ }
8361
+ }]);
8362
+ return SRC;
8363
+ }();
8364
+
7937
8365
  exports.AfterpayCheckoutButton = AfterpayCheckoutButton;
7938
8366
  exports.Api = Api;
7939
8367
  exports.CHECKOUT_BUTTON_EVENT = CHECKOUT_BUTTON_EVENT;
@@ -7954,6 +8382,7 @@
7954
8382
  exports.PaymentSourceBuilder = Builder$1;
7955
8383
  exports.PaymentSourceWidget = PaymentSourceWidget;
7956
8384
  exports.PaypalCheckoutButton = PaypalCheckoutButton;
8385
+ exports.SRC = SRC;
7957
8386
  exports.STYLABLE_ELEMENT = STYLABLE_ELEMENT;
7958
8387
  exports.STYLABLE_ELEMENT_STATE = STYLABLE_ELEMENT_STATE;
7959
8388
  exports.STYLE = STYLE;