From 1b5eb16cc5a91abdb9a7ce65126bebe426c472b2 Mon Sep 17 00:00:00 2001 From: Olivier Bellone Date: Thu, 23 May 2019 16:19:24 -0700 Subject: [PATCH] Add support for radar.early_fraud_warning resource --- lib/resources.js | 1 + lib/resources/Radar/EarlyFraudWarnings.js | 9 ++++++ .../Radar/EarlyFraudWarnings.spec.js | 32 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 lib/resources/Radar/EarlyFraudWarnings.js create mode 100644 test/resources/Radar/EarlyFraudWarnings.spec.js diff --git a/lib/resources.js b/lib/resources.js index a0dc851559..c491e28b98 100644 --- a/lib/resources.js +++ b/lib/resources.js @@ -61,6 +61,7 @@ module.exports = { Transactions: require('./resources/Issuing/Transactions'), }), Radar: resourceNamespace('radar', { + EarlyFraudWarnings: require('./resources/Radar/EarlyFraudWarnings'), ValueLists: require('./resources/Radar/ValueLists'), ValueListItems: require('./resources/Radar/ValueListItems'), }), diff --git a/lib/resources/Radar/EarlyFraudWarnings.js b/lib/resources/Radar/EarlyFraudWarnings.js new file mode 100644 index 0000000000..f24ad19d27 --- /dev/null +++ b/lib/resources/Radar/EarlyFraudWarnings.js @@ -0,0 +1,9 @@ +'use strict'; + +const StripeResource = require('../../StripeResource'); + +module.exports = StripeResource.extend({ + path: 'radar/early_fraud_warnings', + + includeBasic: ['list', 'retrieve'], +}); diff --git a/test/resources/Radar/EarlyFraudWarnings.spec.js b/test/resources/Radar/EarlyFraudWarnings.spec.js new file mode 100644 index 0000000000..e443ef083a --- /dev/null +++ b/test/resources/Radar/EarlyFraudWarnings.spec.js @@ -0,0 +1,32 @@ +'use strict'; + +const stripe = require('../../../testUtils').getSpyableStripe(); +const expect = require('chai').expect; + +describe('Radar', () => { + describe('EarlyFraudWarnings Resource', () => { + describe('retrieve', () => { + it('Sends the correct request', () => { + stripe.radar.earlyFraudWarnings.retrieve('issfr_123'); + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/radar/early_fraud_warnings/issfr_123', + data: {}, + headers: {}, + }); + }); + }); + + describe('list', () => { + it('Sends the correct request', () => { + stripe.radar.earlyFraudWarnings.list(); + expect(stripe.LAST_REQUEST).to.deep.equal({ + method: 'GET', + url: '/v1/radar/early_fraud_warnings', + data: {}, + headers: {}, + }); + }); + }); + }); +});