Skip to content
Browse files

Merge pull request #229 from stripe/remi-countryspecs-support

Added support for the CountrySpec endpoint
  • Loading branch information...
2 parents d84bb88 + b9709ad commit 36218d47e58b487a88f6a8969d2069f4d40f72d1 @brandur brandur committed
Showing with 45 additions and 0 deletions.
  1. +13 −0 lib/resources/CountrySpecs.js
  2. +1 −0 lib/stripe.js
  3. +31 −0 test/resources/CountrySpecs.spec.js
View
13 lib/resources/CountrySpecs.js
@@ -0,0 +1,13 @@
+'use strict';
+
+var StripeResource = require('../StripeResource');
+var stripeMethod = StripeResource.method;
+
+module.exports = StripeResource.extend({
+
+ path: 'country_specs',
+
+ includeBasic: [
+ 'list', 'retrieve',
+ ],
+});
View
1 lib/stripe.js
@@ -29,6 +29,7 @@ var resources = {
Accounts: require('./resources/Accounts'),
Balance: require('./resources/Balance'),
Charges: require('./resources/Charges'),
+ CountrySpecs: require('./resources/CountrySpecs'),
Coupons: require('./resources/Coupons'),
Customers: require('./resources/Customers'),
Disputes: require('./resources/Disputes'),
View
31 test/resources/CountrySpecs.spec.js
@@ -0,0 +1,31 @@
+'use strict';
+
+var stripe = require('../testUtils').getSpyableStripe();
+var expect = require('chai').expect;
+
+describe('CountrySpecs Resource', function() {
+ describe('list', function() {
+ it('Sends the correct request', function() {
+ stripe.countrySpecs.list();
+ expect(stripe.LAST_REQUEST).to.deep.equal({
+ method: 'GET',
+ url: '/v1/country_specs',
+ data: {},
+ headers: {},
+ });
+ });
+ });
+
+ describe('retrieve', function() {
+ it('Sends the correct request', function() {
+ var country = 'US';
+ stripe.countrySpecs.retrieve(country);
+ expect(stripe.LAST_REQUEST).to.deep.equal({
+ method: 'GET',
+ url: '/v1/country_specs/' + country,
+ data: {},
+ headers: {},
+ });
+ });
+ });
+});

0 comments on commit 36218d4

Please sign in to comment.
Something went wrong with that request. Please try again.