diff --git a/lib/recurly/token.js b/lib/recurly/token.js index d08e48d3..45b7dc8c 100644 --- a/lib/recurly/token.js +++ b/lib/recurly/token.js @@ -177,7 +177,7 @@ function token (customerData, bus, done) { .then(results => { enrichInputs(this, inputs, results) }) - .then(() => this.request.post({ route: '/tokens', data: inputs, done: complete })) + .then(() => this.request.post({ route: '/token', data: inputs, done: complete })) .done(); } diff --git a/lib/util/readiness-emitter.js b/lib/util/readiness-emitter.js index d6135669..206f0edd 100644 --- a/lib/util/readiness-emitter.js +++ b/lib/util/readiness-emitter.js @@ -19,7 +19,6 @@ export default class ReadinessEmitter extends Emitter { * @return {[type]} [description] */ markReady () { - console.log('look we are ready') this._ready = true; this.emit('ready'); } diff --git a/test/unit/risk/three-d-secure.test.js b/test/unit/risk/three-d-secure.test.js index a65abb87..f90496b0 100644 --- a/test/unit/risk/three-d-secure.test.js +++ b/test/unit/risk/three-d-secure.test.js @@ -19,7 +19,6 @@ describe('ThreeDSecure', function () { beforeEach(function (done) { const actionTokenId = this.actionTokenId = 'action-token-test'; - const proactiveTokenId = this.proactiveTokenId = 'proactive-token-test'; const recurly = this.recurly = initRecurly(); const risk = this.risk = { add: sinon.stub(), remove: sinon.stub(),concerns: [], recurly }; const sandbox = this.sandbox = sinon.createSandbox(); @@ -180,17 +179,9 @@ describe('ThreeDSecure', function () { new ThreeDSecure({ risk }); }, /Option actionTokenId must be a three_d_secure_action_token_id/); }); - - it('does not throw an error if proactiveTokenId is provided instead', function () { - const { risk, proactiveTokenId } = this; - - assert.doesNotThrow(() => { - new ThreeDSecure({ risk, proactiveTokenId }); - }); - }); }); - describe.only('when an actionTokenId is valid', function () { + describe('when an actionTokenId is valid', function () { it('sets the strategy according to the gateway type of the action token', function (done) { const { risk } = this; [ @@ -251,7 +242,7 @@ describe('ThreeDSecure', function () { }); }); - describe.only('when a proactiveTokenId is provided', function () { + describe('when a proactiveTokenId is provided', function () { it('throws an error if it is not valid', function (done) { const { risk } = this; const threeDSecure = new ThreeDSecure({ risk, proactiveTokenId: 'invalid-token-id' }); @@ -263,42 +254,6 @@ describe('ThreeDSecure', function () { }); }); - it('sets the strategy to TestStrategy', function (done) { - const { risk, proactiveTokenId } = this; - const threeDSecure = new ThreeDSecure({ risk, proactiveTokenId }); - threeDSecure.whenReady(() => { - assert(threeDSecure.strategy instanceof TestStrategy); - done(); - }); - }); - - it('constructs the strategy with the proactive token', function (done) { - const { risk, proactiveTokenId } = this; - const threeDSecure = new ThreeDSecure({ risk, proactiveTokenId }); - threeDSecure.whenReady(() => { - const { strategy } = threeDSecure; - assert(strategy instanceof TestStrategy); - assert.strictEqual(strategy.proactiveToken.id, proactiveTokenId); - done(); - }); - }); - - it('reports the strategy name', function (done) { - const { risk, proactiveTokenId } = this; - - const threeDSecure = new ThreeDSecure({ risk, proactiveTokenId }); - risk.recurly.reporter.send.reset(); - - threeDSecure.whenReady(() => { - assert(risk.recurly.reporter.send.calledOnce); - assert(risk.recurly.reporter.send.calledWithMatch( - 'three-d-secure:ready', - { concernId: threeDSecure.id, strategy: 'test' } - )); - done(); - }); - }); - it('calls onStrategyDone when a strategy completes', function (done) { const { sandbox, threeDSecure } = this; const example = { arbitrary: 'test-payload' };