From 0d58b2be7366768b5c849ed006f0f62d95d4aedf Mon Sep 17 00:00:00 2001 From: Luis Sanchez Date: Wed, 4 Apr 2018 17:52:40 +1000 Subject: [PATCH] feat(common): CHECKOUT-3035 Provide setter for config --- src/client/client.js | 4 ++++ src/payment/url-helper.js | 14 +++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/client/client.js b/src/client/client.js index 64d6077d..798f99cc 100644 --- a/src/client/client.js +++ b/src/client/client.js @@ -71,6 +71,10 @@ export default class Client { this.storeRequestSender = storeRequestSender; } + setHost(host) { + this.config.host = host; + } + /** * @param {PaymentRequestData} data * @param {Function} [callback] diff --git a/src/payment/url-helper.js b/src/payment/url-helper.js index 8bcf8f9c..b2a6534c 100644 --- a/src/payment/url-helper.js +++ b/src/payment/url-helper.js @@ -13,12 +13,20 @@ export default class UrlHelper { * @param {string} config.host * @returns {void} */ - constructor({ host }) { + constructor(config) { /** * @private - * @type {string} + * @type {Object} */ - this.host = host; + this.config = config; + } + + /** + * @private + * @returns {string} + */ + get host() { + return this.config.host; } /**