Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for v1/issuer_fraud_records endpoint #456

Merged
merged 6 commits into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/resources/IssuerFraudRecords.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

var StripeResource = require('../StripeResource');

module.exports = StripeResource.extend({
path: 'issuer_fraud_records',

includeBasic: ['list', 'retrieve'],
});
1 change: 1 addition & 0 deletions lib/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var resources = {
ExchangeRates: require('./resources/ExchangeRates'),
Invoices: require('./resources/Invoices'),
InvoiceItems: require('./resources/InvoiceItems'),
IssuerFraudRecords: require('./resources/IssuerFraudRecords'),
LoginLinks: require('./resources/LoginLinks'),
Payouts: require('./resources/Payouts'),
Plans: require('./resources/Plans'),
Expand Down
39 changes: 39 additions & 0 deletions test/resources/IssuerFraudRecords.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
'use strict';

var stripe = require('../testUtils').getSpyableStripe();
var expect = require('chai').expect;

describe('IssuerFraudRecord Resource', function() {
describe('retrieve', function() {
it('Sends the correct request for issfr ID', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you truncate this down to just "Sends the correct request" for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

stripe.issuerFraudRecords.retrieve('issfr_123');
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/issuer_fraud_records/issfr_123',
data: {},
headers: {},
});
});
});

describe('list', function() {
it('Sends the correct request', function() {
stripe.issuerFraudRecords.list();
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/issuer_fraud_records',
data: {},
headers: {},
});
});
it('Sends the correct request for charge ID', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just remove this test case please. It's not actually exercising any new code that we've written.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

stripe.issuerFraudRecords.list({charge: 'ch_123456789'});
expect(stripe.LAST_REQUEST).to.deep.equal({
method: 'GET',
url: '/v1/issuer_fraud_records',
data: {charge: 'ch_123456789'},
headers: {},
});
});
});
});