204 Commits

Author SHA1 Message Date
Tim Craft
66be9d48dd Fix comment and use two argument form of Hash#fetch 2013-07-05 19:42:00 +01:00
Tim Craft
da6736478e Refactor Stripe::Util.convert_to_stripe_object method
* Extract hash mapping into object_classes method/ivar
* Use Hash#fetch instead of `if` and `||=`
2013-07-05 18:41:34 +01:00
Evan Broder
616b169958 Merge pull request #72 from timcraft/fix-the-build
Fix the build
2013-07-05 10:28:19 -07:00
Tim Craft
9ae705f845 Add version specifiers for activesupport/shoulda/mocha dev dependencies 2013-07-05 17:36:36 +01:00
Evan Broder
1fbce5288c Add a more helpful error message to ListObject#[]
Our list calls return their results wrapped in an object so that we
can include extra information. We use this, e.g., to include the URL
to query for more records in the Transfer#transactions sublist.

When you get a ListObject, if you want to actually manipulate it as a
list, you have to call `#data` first to get the actual underlying
list.

This adds an exception to the `#[]` method to make what's going on
clearer.

Fixes #68
2013-06-30 23:00:01 -07:00
Evan Broder
daafdb983d Fix confusion in ListObject around where api_key was coming from
Fixes #69
2013-06-30 22:34:30 -07:00
Evan Broder
c52973e7de Add a comment explaining file_readable 2013-06-29 22:46:52 -07:00
Evan Broder
2dbc700fc3 Bump version v1.8.3 2013-05-06 13:56:14 -07:00
Evan Broder
2861964755 Fix handling of per-resource API keys (fixes #67) 2013-05-06 13:53:00 -07:00
Evan Broder
aecfaa818f Bump version v1.8.2 2013-05-01 16:34:18 -07:00
Evan Broder
a95da742d4 Pass the customer-specific API key when getting the upcoming invoice 2013-05-01 15:02:34 -07:00
Evan Broder
dcb407c6d7 Merge remote-tracking branch 'origin/pull/65' 2013-05-01 14:46:23 -07:00
Evan Broder
3ab7c3253a Merge remote-tracking branch 'origin/pull/63' 2013-05-01 14:46:07 -07:00
Evan Broder
6f664422d4 Merge remote-tracking branch 'origin/pull/61' 2013-05-01 14:45:44 -07:00
Evan Broder
1b3dd625fd Merge remote-tracking branch 'origin/pull/60' 2013-05-01 14:43:44 -07:00
Evan Broder
a3884060a3 Merge remote-tracking branch 'origin/pull/58' 2013-05-01 14:38:05 -07:00
Evan Broder
c8fd610660 Merge remote-tracking branch 'origin/pull/57' 2013-05-01 14:38:03 -07:00
Evan Broder
523cdd548b Merge remote-tracking branch 'origin/pull/56' 2013-05-01 14:38:01 -07:00
Evan Broder
91c90ff43e Merge remote-tracking branch 'origin/pull/47'
Conflicts:
	lib/stripe.rb
2013-05-01 14:37:51 -07:00
Evan Broder
6b044e90ca Merge branch 'refactor'
Conflicts:
	lib/stripe.rb
2013-05-01 12:17:09 -07:00
Evan Broder
fe3eb47e60 Split out independent parts of Stripe.request and cleanup code
Make the SSL checks, user agent assembly, and request header
generation separate methods.

Also switch to class instance variables instead of class variables and
accessors instead of custom functions, and wrap lines to 80
characters.

Original patches come with thanks to Stevie Graham (with some style
fixups from me).

(fixes #53, fixes #54)
2013-05-01 12:14:29 -07:00
Brian Collins
56f9ba200f Add api_key argument to Invoice.upcoming v1.8.1 2013-04-19 13:06:17 +01:00
Rob Law
7e9407143e Add customer.upcoming_invoice convenience method
It seems to embrace the 'Ruby Way' (and more convenient in my own code) to be able to access an upcoming invoice from the customer itself rather than de-reference the customer id and ask the Invoice class itself for that info.
2013-04-14 14:21:29 +03:00
Amber Feng
cdf09a6f75 Bump version to 1.8.0. 2013-04-11 18:07:53 -07:00
Amber Feng
a7f7df94c6 Tests for transfers and recipients. 2013-04-11 18:00:47 -07:00
Amber Feng
b081187095 Allow creating transfers, add recipient object. 2013-04-11 18:00:31 -07:00
Alex Speller
abf5400726 Update README.rdoc 2013-04-06 17:13:18 +02:00
Grant Olson
81ae6d7aee Due to a server misconfiguration issue, we were low on memory.
Attempting to spawn a subprocess to get the uname threw an out of
memory error.  Since the uname is only needed to provide diagnostic
info in the User-Agent, it shouldn't cause stripe to fail.
2013-03-20 14:48:26 -04:00
Jean Boussier
6a57264758 Allow to update a resource without retreiving it first
Rationale:

  Sometime you don't care about the current state of a resource
  you just want to update one of it's attributes.
  It should only require one request.

fixes #52

```ruby
  c = Stripe::Customer.new("cus_1EqKjPaFs4ZwDD")
  c.description = 'Ny new Description'
  c.save
```

Before:

```json
{
  error: {
    type: "invalid_request_error",
    message: "A parameter provided in the URL (id) was repeated as a GET or POST parameter. You can only provide this information as a portion of the URL.",
    param: "id",
  }
}
```

After:

Successfully update the customer and return it's whole state.
2013-03-14 11:04:18 -04:00
Tim Craft
6b43da28e3 Always call to_sym instead of type checking in Stripe::StripeObject#[] method 2013-03-14 14:06:09 +00:00
Tim Craft
ae30ffff7f Add Gemfile.lock to .gitignore 2013-03-14 13:50:24 +00:00
Tim Craft
fa24c46b90 Add ruby 2.0.0 to travis config 2013-03-14 13:49:19 +00:00
Amber Feng
ce34d9ef8b Use Invoice.all instead of Invoice.upcoming for base query parameter tests. 2013-03-11 18:07:45 -07:00
Amber Feng
7ddf3ea42b Fix URL building for when the base URL already has query parameters, and add test. 2013-03-11 13:19:28 -07:00
Evan Broder
a1ab276487 Merge pull request #51 from timcraft/patch-1
Remove rubygems require
2013-02-21 18:19:21 -08:00
Ross Boucher
56b792ccad Update version v1.7.11 2013-02-21 12:09:10 -08:00
Ross Boucher
b2aafa854e Add id to the list of permanent attributes 2013-02-21 11:54:16 -08:00
Ross Boucher
1b9f776f65 Merge pull request #50 from stripe/expand
Add the ability to send options with retrieve requests.
v1.7.10
2013-02-04 15:54:26 -08:00
Ross Boucher
06c67e404e Revert to old style imports 2013-02-04 15:51:48 -08:00
Tim Craft
6a08f656d0 Remove rubygems require 2013-02-04 12:40:10 +00:00
Ross Boucher
5ffde047d3 Add the ability to send options with retrieve requests. 2013-02-01 12:12:03 -08:00
Evan Broder
3e30d5ad78 Merge pull request #49 from jalessio/patch-1
Update URL for API spec
2013-01-28 16:18:54 -08:00
Jamie
16a83dcce5 Update URL for API spec
https://stripe.com/api/spec 404's
2013-01-28 15:57:54 -08:00
spakanati
fb29711a4f Merge pull request #48 from stripe/sp-version
Add API version setting.
1.7.9 v1.7.9
2013-01-15 12:59:54 -08:00
Sheena Pakanati
4dca4320d8 Bump version to 1.7.9. 2013-01-15 11:31:23 -08:00
Sheena Pakanati
4df245996b Add support for setting API version. 2013-01-15 11:31:03 -08:00
Evan Broder
0c28189194 Slightly cleaner way of getting all of activesupport 2012-12-04 16:11:34 -08:00
Alex MacCaw
f27e72cba6 remove Gemfile.lock 2012-12-04 13:59:26 -08:00
Alex MacCaw
738429a742 Add Gemfile.lock 2012-12-04 13:38:45 -08:00
Alex MacCaw
d196d8a343 Throw an error if the API key contains whitespace 2012-12-04 13:38:34 -08:00