Skip to content

Commit

Permalink
Search replace stripe/fusebill
Browse files Browse the repository at this point in the history
Alter customer and plans endpoints
Add additional endpoints
Change update to PUT
Add check for 204 to not parse json in response handler
Change error to format the error object
Change content type to JSON
Add CustomerActivation and SubscriptionActivation
  • Loading branch information
justinffs committed Jun 16, 2016
1 parent 1671102 commit 0b936e1
Show file tree
Hide file tree
Showing 85 changed files with 1,055 additions and 1,124 deletions.
211 changes: 1 addition & 210 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,211 +1,2 @@
4.7.0 May 25th, 2016
- Add support for returning Relay orders

4.6.0 May 4th, 2016
- Add `update`, `create`, `retrieve`, `list` and `del` methods to `stripe.subscriptions`

4.5.0 Mar 15th, 2016
- Add `reject` on `Account` to support the new API feature

4.4.0 Feb 8th, 2016
- Add `CountrySpec` model for looking up country payment information

4.3.0 Jan 26th, 2016
- Add support for deleting Relay SKUs and products

4.2.0 Jan 13th, 2016
- Add `lastResponse` property on `StripeResource` objects
- Return usage errors of `stripeMethod` through callback instead of raising
- Use latest year for expiry years in tests to avoid new year problems

4.1.0 Dec 2nd, 2015
- Add a verification routine for external accounts

4.0.0 Sep 17th, 2015
- Remove ability for API keys to be passed as 1st param to acct.retrieve
- Rename StripeInvalidRequest to StripeInvalidRequestError

3.9.0 Sep 14th, 2015
- Add Relay resources: Products, SKUs, and Orders

3.8.0 Sep 11th, 2015
- Added rate limiting responses

3.7.1 Aug 17th, 2015
- Added refund object with listing, retrieval, updating, and creation.

3.7.0 Aug 3rd, 2015
- Added managed account deletion
- Added dispute listing and retrieval

3.6.0 Jul 7th, 2015
- Added request IDs to all Stripe errors

3.5.2 Jun 30th, 2015
- [BUGFIX] Fixed issue with uploading binary files (Gabriel Chagas Marques)

3.5.1 Jun 30th, 2015
- [BUGFIX] Fixed issue with passing arrays of objects

3.5.0 Jun 11th, 2015
- Added support for optional parameters when retrieving an upcoming invoice
(Matthew Arkin)

3.4.0 Jun 10th, 2015
- Added support for bank accounts and debit cards in managed accounts

3.3.4 Apr 2nd, 2015
- Remove SSL revocation tests and check

3.3.3 Mar 31st, 2015
- [BUGFIX] Fix support for both stripe.account and stripe.accounts

3.3.2 Feb 24th, 2015
- Support transfer reversals.

3.3.1 Feb 21st, 2015
- [BUGFIX] Fix passing in only a callback to the Account resource. (Matthew
Arkin)

3.3.0 Feb 19th, 2015
- Support BitcoinReceiver update & delete actions
- Add methods for manipulating customer sources as per 2015-02-18 API version
- The Account resource will now take an account ID. However, legacy use of
the resource (without an account ID) will still work.

3.2.0 Feb 5th, 2015
- [BUGFIX] Fix incorrect failing tests for headers support
- Update all dependencies (remove mocha-as-promised)
- Switch to bluebird for promises

3.1.0 Jan 21st, 2015
- Support making bitcoin charges through BitcoinReceiver source object

3.0.3 Dec 23rd, 2014
- Adding file uploads as a resource.

3.0.2 Nov 26th, 2014
- [BUGFIX] Fix issue where multiple expand params were not getting passed through (#130)

3.0.1 Nov 26th, 2014
- (Version skipped due to npm mishap)

3.0.0 Nov 18th, 2014
- [BUGFIX] Fix `stringifyRequestData` to deal with nested objs correctly
- Bump MAJOR as we're no longer supporting Node 0.8

2.9.0 Nov 12th, 2014
- Allow setting of HTTP agent (proxy) (issue #124)
- Add stack traces to all Stripe Errors

2.8.0 July 26th, 2014
- Make application fee refunds a list instead of array

2.7.4 July 17th, 2014
- [BUGFIX] Fix lack of subscription param in `invoices#retrieveUpcoming` method
- Add support for an `optional!` annotation on `urlParams`

2.7.3 June 17th, 2014
- Add metadata to disputes and refunds

2.6.3 May 21st, 2014
- Support cards for recipients.

2.5.3 May 16th, 2014
- Allow the `update` method on coupons for metadata changes

2.5.2 Apr 28th, 2014
- [BUGFIX] Fix when.js version string in package.json to support older npm versions

2.5.1 Apr 25th, 2014
- [BUGFIX] Fix revoked-ssl check
- Upgrade when.js to 3.1.0

2.5.0 Apr 9th, 2014
- Ensure we prevent requests using revoked SSL certs

2.4.5 Apr 8th, 2014
- Add better checks for incorrect arguments (throw exceptions accordingly).
- Validate the Connect Auth key, if passed

2.4.4 Mar 27th, 2014
- [BUGFIX] Fix URL encoding issue (not encoding interpolated URL params, see issue #93)

2.4.3 Mar 27th, 2014
- Add more debug information to the case of a failed `JSON.parse()`

2.4.2 Feb 20th, 2014
- Add binding for `transfers/{tr_id}/transactions` endpoint

2.4.1 Feb 7th, 2014
- Ensure raw error object is accessible on the generated StripeError

2.4.0 Jan 29th, 2014
- Support multiple subscriptions per customer

2.3.4 Jan 11th, 2014
- [BUGFIX] Fix #76, pass latest as version to api & fix constructor arg signature

2.3.3 Jan 10th, 2014
- Document cancelSubscription method params and add specs for `at_period_end`

2.3.2 Dec 2nd, 2013
- Add application fees API

2.2.2 Nov 20th, 2013
- [BUGFIX] Fix incorrect deleteDiscount method & related spec(s)

2.2.1
- [BUGFIX] Fix user-agent header issue (see issue #75)

2.2.0 Nov 9th, 2013
- Add support for setTimeout
- Add specs for invoice-item listing/querying via timestamp

2.1.0 Nov 7th, 2013
- Support single key/value setting on setMetadata method
- [BUGFIX] Fix Windows url-path issue
- Add missing stripe.charges.update method
- Support setting auth_token per request (useful in Connect)
- Remove global 'resources' variable

2.0.0 October 18th, 2013
- API overhaul and refactor, including addition of promises.
- Release of version 2.0.0

1.3.0 January 30th, 2013
- Requests return Javascript Errors (Guillaume Flandre)

1.2.0 August 3rd, 2012
- Added events API (Jonathan Hollinger)
- Added plans update API (Pavan Kumar Sunkara)
- Various test fixes, node 0.8.x tweaks (Jan Lehnardt)

1.1.0 February 1st, 2012
- Add Coupons API (Ryan)
- Pass a more robust error object to the callback (Ryan)
- Fix duplicate callbacks from some functions when called incorrectly
(bug #24, reported by Kishore Nallan)

1.0.0 December 6th, 2011
- Add APIs and tests for Plans and "Invoice Items"
(both changes by Ryan Ettipio)

0.0.5 November 26th, 2011
- Add Subscription API (John Ku, #3)
- Add Invoices API (Chris Winn, #6)
- [BUGFIX] Fix a bug where callback could be called twice, if the callback()
threw an error itself (Peteris Krumins)
- [BUGFIX] Fix bug in tokens.retrieve API (Xavi)
- Change documentation links (Stripe changed their URL structure)
- Make tests pass again (error in callback is null instead of 0 if all is well)
- Amount in stripe.charges.refund is optional (Branko Vukelic)
- Various documentation fixes (Xavi)
- Only require node 0.4.0

0.0.3 October 5, 2011
- Add Charges API (issue #1, brackishlake)
- Add customers.list API

0.0.2 September 28, 2011
1.0.0 June 10, 2016
- Initial release with customers and tokens APIs
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Copyright (C) 2011 Ask Bjørn Hansen
Copyright (C) 2013 Stripe, Inc. (https://stripe.com)
Copyright (C) 2013 Fusebill, Inc. (https://stripe.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stripe node.js bindings [![Build Status](https://travis-ci.org/stripe/stripe-node.png?branch=master)](https://travis-ci.org/stripe/stripe-node)
# Fusebill node.js bindings [![Build Status](https://travis-ci.org/stripe/stripe-node.png?branch=master)](https://travis-ci.org/stripe/stripe-node)

## Version 2 Update Notice

Expand Down Expand Up @@ -52,7 +52,7 @@ stripe.customers.create({
});
```

To use the `Stripe-Account` header, simply pass an extra options hash:
To use the `Fusebill-Account` header, simply pass an extra options hash:

```js
// Retrieve the balance for a connected account:
Expand Down Expand Up @@ -207,7 +207,7 @@ stripe.balance.retrieve({
* [Version 2 Overview](https://github.com/stripe/stripe-node/wiki/Version-2)
* [REST API Version](https://github.com/stripe/stripe-node/wiki/REST-API-Version)
* [Error Handling](https://github.com/stripe/stripe-node/wiki/Error-Handling)
* [Using Stripe Connect](https://github.com/stripe/stripe-node/wiki/Using-Stripe-Connect-with-node.js)
* [Using Fusebill Connect](https://github.com/stripe/stripe-node/wiki/Using-Fusebill-Connect-with-node.js)

## Development

Expand All @@ -218,7 +218,7 @@ $ npm install
$ npm test
```

If you wish, you may run tests using your Stripe *Test* API key by setting the environment variable `STRIPE_TEST_API_KEY` before running tests:
If you wish, you may run tests using your Fusebill *Test* API key by setting the environment variable `STRIPE_TEST_API_KEY` before running tests:

```bash
$ export STRIPE_TEST_API_KEY='sk_test....'
Expand All @@ -231,4 +231,4 @@ If you don't have a prefixed key (in the form `sk_test_...`) you can get one by

## Author

Originally by [Ask Bjørn Hansen](https://github.com/abh) (ask@develooper.com). Development was sponsored by YellowBot. Now officially maintained by Stripe.
Originally by [Ask Bjørn Hansen](https://github.com/abh) (ask@develooper.com). Development was sponsored by YellowBot. Now officially maintained by Fusebill.
34 changes: 17 additions & 17 deletions lib/Error.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var utils = require('./utils');
module.exports = _Error;

/**
* Generic Error klass to wrap any errors returned by stripe-node
* Generic Error klass to wrap any errors returned by fusebill-node
*/
function _Error(raw) {
this.populate.apply(this, arguments);
Expand All @@ -25,10 +25,10 @@ _Error.extend = utils.protoExtend;

/**
* Create subclass of internal Error klass
* (Specifically for errors returned from Stripe's REST API)
* (Specifically for errors returned from Fusebill's REST API)
*/
var StripeError = _Error.StripeError = _Error.extend({
type: 'StripeError',
var FusebillError = _Error.FusebillError = _Error.extend({
type: 'FusebillError',
populate: function(raw) {
// Move from prototype def (so it appears in stringified obj)
this.type = this.type;
Expand All @@ -46,24 +46,24 @@ var StripeError = _Error.StripeError = _Error.extend({
});

/**
* Helper factory which takes raw stripe errors and outputs wrapping instances
* Helper factory which takes raw fusebill errors and outputs wrapping instances
*/
StripeError.generate = function(rawStripeError) {
switch (rawStripeError.type) {
FusebillError.generate = function(rawFusebillError) {
switch (rawFusebillError.type) {
case 'card_error':
return new _Error.StripeCardError(rawStripeError);
return new _Error.FusebillCardError(rawFusebillError);
case 'invalid_request_error':
return new _Error.StripeInvalidRequestError(rawStripeError);
return new _Error.FusebillInvalidRequestError(rawFusebillError);
case 'api_error':
return new _Error.StripeAPIError(rawStripeError);
return new _Error.FusebillAPIError(rawFusebillError);
}
return new _Error('Generic', 'Unknown Error');
};

// Specific Stripe Error types:
_Error.StripeCardError = StripeError.extend({type: 'StripeCardError'});
_Error.StripeInvalidRequestError = StripeError.extend({type: 'StripeInvalidRequestError'});
_Error.StripeAPIError = StripeError.extend({type: 'StripeAPIError'});
_Error.StripeAuthenticationError = StripeError.extend({type: 'StripeAuthenticationError'});
_Error.StripeRateLimitError = StripeError.extend({type: 'StripeRateLimitError'});
_Error.StripeConnectionError = StripeError.extend({type: 'StripeConnectionError'});
// Specific Fusebill Error types:
_Error.FusebillCardError = FusebillError.extend({type: 'FusebillCardError'});
_Error.FusebillInvalidRequestError = FusebillError.extend({type: 'FusebillInvalidRequestError'});
_Error.FusebillAPIError = FusebillError.extend({type: 'FusebillAPIError'});
_Error.FusebillAuthenticationError = FusebillError.extend({type: 'FusebillAuthenticationError'});
_Error.FusebillRateLimitError = FusebillError.extend({type: 'FusebillRateLimitError'});
_Error.FusebillConnectionError = FusebillError.extend({type: 'FusebillConnectionError'});
18 changes: 9 additions & 9 deletions lib/StripeMethod.basic.js → lib/FusebillMethod.basic.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
'use strict';

var stripeMethod = require('./StripeMethod');
var fusebillMethod = require('./FusebillMethod');
var utils = require('./utils');

module.exports = {

create: stripeMethod({
create: fusebillMethod({
method: 'POST',
}),

list: stripeMethod({
list: fusebillMethod({
method: 'GET',
}),

retrieve: stripeMethod({
retrieve: fusebillMethod({
method: 'GET',
path: '/{id}',
urlParams: ['id'],
}),

update: stripeMethod({
method: 'POST',
path: '{id}',
urlParams: ['id'],
update: fusebillMethod({
method: 'PUT',
path: '',
urlParams: [],
}),

// Avoid 'delete' keyword in JS
del: stripeMethod({
del: fusebillMethod({
method: 'DELETE',
path: '{id}',
urlParams: ['id'],
Expand Down
Loading

0 comments on commit 0b936e1

Please sign in to comment.