diff --git a/CHANGELOG.md b/CHANGELOG.md index ca0f0e348..50b0cc44a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [v4.25.10](https://github.com/recurly/recurly-js/tree/v4.25.10) (2023-09-27) + +[Full Changelog](https://github.com/recurly/recurly-js/compare/v4.25.9...v4.25.10) + + +**Merged Pull Requests** + +- Adds hostname configuration pass-through [#851](https://github.com/recurly/recurly-js/pull/851) ([chrissrogers](https://github.com/chrissrogers)) +- Updated images for iOS-15-Remote Browser for e2e tests [#850](https://github.com/recurly/recurly-js/pull/850) ([arzitney](https://github.com/arzitney)) +- Add Amazon Pay [#848](https://github.com/recurly/recurly-js/pull/848) ([gilv93](https://github.com/gilv93)) + + + ## [v4.25.9](https://github.com/recurly/recurly-js/tree/v4.25.9) (2023-09-07) [Full Changelog](https://github.com/recurly/recurly-js/compare/v4.25.8...v4.25.9) diff --git a/lib/recurly.js b/lib/recurly.js index 114ab927d..01e017e82 100644 --- a/lib/recurly.js +++ b/lib/recurly.js @@ -234,6 +234,8 @@ export class Recurly extends Emitter { if (options.publicKey) { this.config.publicKey = options.publicKey; + } else if (options.hostname) { + this.config.hostname = options.hostname; } else if (!this.config.publicKey) { throw errors('config-missing-public-key'); } diff --git a/lib/recurly/request.js b/lib/recurly/request.js index 1985c0b83..2730e5a07 100644 --- a/lib/recurly/request.js +++ b/lib/recurly/request.js @@ -297,6 +297,10 @@ export class Request { } }; + if (this.recurly.config.hostname && req.setRequestHeader) { + req.setRequestHeader('Recurly-Credential-Checkout-Hostname', this.recurly.config.hostname); + } + // XDR requests will abort if too many are sent simultaneously setTimeout(() => { if (method === 'post') { diff --git a/lib/recurly/version.js b/lib/recurly/version.js index 1207cb098..a14e86e14 100644 --- a/lib/recurly/version.js +++ b/lib/recurly/version.js @@ -3,4 +3,4 @@ * Current package/component version. */ -module.exports = '4.25.9'; +module.exports = '4.25.10'; diff --git a/package-lock.json b/package-lock.json index c80b95544..11c574974 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "recurly.js", - "version": "4.25.9", + "version": "4.25.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "recurly.js", - "version": "4.25.9", + "version": "4.25.10", "license": "MIT", "workspaces": [ "packages/*" diff --git a/package.json b/package.json index fec40d7ef..8af38386f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "recurly.js", "description": "Zen subscription billing in the browser", - "version": "4.25.9", + "version": "4.25.10", "license": "MIT", "main": "recurly.js", "repository": { diff --git a/test/e2e/support/snapshots/iOS-15-Remote/elements/card-element-390x844.png b/test/e2e/support/snapshots/iOS-15-Remote/elements/card-element-390x844.png index c0a2e2365..527466dc1 100644 Binary files a/test/e2e/support/snapshots/iOS-15-Remote/elements/card-element-390x844.png and b/test/e2e/support/snapshots/iOS-15-Remote/elements/card-element-390x844.png differ diff --git a/test/e2e/support/snapshots/iOS-15-Remote/elements/distinct-elements-390x844.png b/test/e2e/support/snapshots/iOS-15-Remote/elements/distinct-elements-390x844.png index ddc936f0e..e534fef7f 100644 Binary files a/test/e2e/support/snapshots/iOS-15-Remote/elements/distinct-elements-390x844.png and b/test/e2e/support/snapshots/iOS-15-Remote/elements/distinct-elements-390x844.png differ diff --git a/test/e2e/support/snapshots/iOS-15-Remote/hosted-fields/card-field-390x844.png b/test/e2e/support/snapshots/iOS-15-Remote/hosted-fields/card-field-390x844.png index 4d02b74f6..0528ca411 100644 Binary files a/test/e2e/support/snapshots/iOS-15-Remote/hosted-fields/card-field-390x844.png and b/test/e2e/support/snapshots/iOS-15-Remote/hosted-fields/card-field-390x844.png differ diff --git a/test/e2e/support/snapshots/iOS-15-Remote/hosted-fields/distinct-fields-390x844.png b/test/e2e/support/snapshots/iOS-15-Remote/hosted-fields/distinct-fields-390x844.png index b6a0b3788..64b765537 100644 Binary files a/test/e2e/support/snapshots/iOS-15-Remote/hosted-fields/distinct-fields-390x844.png and b/test/e2e/support/snapshots/iOS-15-Remote/hosted-fields/distinct-fields-390x844.png differ diff --git a/test/e2e/support/snapshots/iOS-16-Remote/elements/card-element-393x852.png b/test/e2e/support/snapshots/iOS-16-Remote/elements/card-element-393x852.png index 0f8fc7eb7..80821838a 100644 Binary files a/test/e2e/support/snapshots/iOS-16-Remote/elements/card-element-393x852.png and b/test/e2e/support/snapshots/iOS-16-Remote/elements/card-element-393x852.png differ diff --git a/test/e2e/support/snapshots/iOS-16-Remote/elements/distinct-elements-393x852.png b/test/e2e/support/snapshots/iOS-16-Remote/elements/distinct-elements-393x852.png index 05b4c45f6..8c1c16f68 100644 Binary files a/test/e2e/support/snapshots/iOS-16-Remote/elements/distinct-elements-393x852.png and b/test/e2e/support/snapshots/iOS-16-Remote/elements/distinct-elements-393x852.png differ diff --git a/test/e2e/support/snapshots/iOS-16-Remote/hosted-fields/card-field-393x852.png b/test/e2e/support/snapshots/iOS-16-Remote/hosted-fields/card-field-393x852.png index b298b8170..81a0194d6 100644 Binary files a/test/e2e/support/snapshots/iOS-16-Remote/hosted-fields/card-field-393x852.png and b/test/e2e/support/snapshots/iOS-16-Remote/hosted-fields/card-field-393x852.png differ diff --git a/test/e2e/support/snapshots/iOS-16-Remote/hosted-fields/distinct-fields-393x852.png b/test/e2e/support/snapshots/iOS-16-Remote/hosted-fields/distinct-fields-393x852.png index 34f55e9af..af86db10d 100644 Binary files a/test/e2e/support/snapshots/iOS-16-Remote/hosted-fields/distinct-fields-393x852.png and b/test/e2e/support/snapshots/iOS-16-Remote/hosted-fields/distinct-fields-393x852.png differ diff --git a/test/unit/request.test.js b/test/unit/request.test.js index 1cb4dd922..56aef92fa 100644 --- a/test/unit/request.test.js +++ b/test/unit/request.test.js @@ -240,11 +240,13 @@ describe('Request', () => { beforeEach(function () { sinon.spy(this.XHR.prototype, 'open'); sinon.spy(this.XHR.prototype, 'send'); + sinon.spy(this.XHR.prototype, 'setRequestHeader'); }); afterEach(function () { this.XHR.prototype.open.restore(); this.XHR.prototype.send.restore(); + this.XHR.prototype.setRequestHeader.restore(); }); describe('when performing a POST request', () => { @@ -271,6 +273,14 @@ describe('Request', () => { assert(this.XHR.prototype.send.calledWith()); }); }); + + describe('when configured with a hostname', () => { + it('Applies the hostname as a header', function () { + this.recurly.configure({ hostname: 'test-hostname.recurly.com' }); + this.request.request({ method: 'get', route: 'test' }); + assert(this.XHR.prototype.setRequestHeader.calledWithMatch('Recurly-Credential-Checkout-Hostname', 'test-hostname.recurly.com')); + }); + }); }); }); });