1027 Commits

Author SHA1 Message Date
JuanitoFatas
f4f8d38643 Fix homepage for Ruby docs in gemspec 2016-06-13 18:07:11 +08:00
Brandur
6fb907b322 Merge pull request #423 from stripe/brandur-document-convert
Document `Util.convert_to_stripe_object`
2016-06-09 09:39:24 -07:00
Brandur
6695340d50 Minor fixes to Rubydoc of #update_attributes 2016-06-09 09:19:28 -07:00
Brandur
531e0ff317 Document Util.convert_to_stripe_object
Adds some basic documentation to `Util.convert_to_stripe_object`.
2016-06-09 09:02:23 -07:00
Brandur
6920d9db68 Update authors/email in Gemspec
Unfortunately neither of these people work for Stripe anymore. Let's put
a valid contact email address in here instead.
2016-05-25 10:55:29 -07:00
Brandur
065ad92c0e Bump version to 1.43.0 v1.43.0 2016-05-20 10:32:29 -07:00
Brandur
31c6fbe8bb Merge pull request #419 from stripe/rasmus-add_order_returns
Add order returns
2016-05-20 10:28:02 -07:00
Rasmus Rygaard
6202d66873 Add tests for return deletion, updating. 2016-05-20 09:54:09 -07:00
Rasmus Rygaard
dab45737c9 Add order returns. 2016-05-18 17:56:15 -07:00
Brandur
43c86909d7 Merge pull request #418 from stripe/remi-add-alipay-account
Support AlipayAccount retrieval and deletion
2016-05-18 11:02:03 +02:00
Remi Jannel
2a6673a8e5 Support AlipayAccount retrieval and deletion 2016-05-17 17:52:00 -04:00
Kyle Conroy
49382f7ac2 Bump version to 1.42.0 v1.42.0 2016-05-04 14:15:44 -07:00
Jacqueline
60248fbd00 Use v1/subs endpoints for operations on subs and allow direct sub access (#411)
* allow subs to be retrieved & created with new v1/subs API endpoint

* edit tests to check for url

* fix customer subscription URLs to go through v1/customers
2016-05-04 14:14:24 -07:00
Brandur
ca7adcf8c8 Bump version to 1.41.0 v1.41.0 2016-04-13 14:00:35 -07:00
Brandur
679b2b9b19 Merge pull request #412 from Edouard-chin/global-stripe-account-head
Allow `stripe_account` to be set globally:
2016-04-13 13:58:32 -07:00
Edouard CHIN
75f366acb9 Allow stripe_account to be set globally:
- When performing requests on the behalf of a managed account, `stripe_account` option must be passed everytime, this can become redundant
- Allowing to set the `stripe_account` globally makes thing easier for wrapping every request in a single method, the same way as it is for defining the `api_key` globally
2016-04-13 20:40:55 +00:00
Brandur
c98f555aeb Merge pull request #410 from stripe/brandur-fix-warnings
Fix warnings emitted during tests
2016-04-11 15:47:32 -07:00
Brandur
2663e9ff85 Merge pull request #409 from stripe/br-charge-outcomes
add test for handling of charge.outcome subfield
2016-04-11 15:23:43 -07:00
Brandur
8f55baa6ea Fix warnings emitted during tests
I'm not sure exactly what changed here (did we change the `$VERBOSE`
setting?), but I'm not seeing a whole lot of warnings when running the
test suites locally and in CI. For example:

```
Started
........................................./home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
............../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
......../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
.../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
........./home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
...
..../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
....../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
..../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
......./home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
........./home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
........../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
................./home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
.../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
..../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
....../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
..........
........./home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
....../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
......../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
......../home/travis/build/stripe/stripe-ruby/lib/stripe/api_operations/list.rb:6: warning: instance variable @opts not initialized
............./home/travis/build/stripe/stripe-ruby/lib/stripe/stripe_object.rb:35: warning: instance variable @values not initialized
./home/travis/build/stripe/stripe-ruby/lib/stripe/stripe_object.rb:35: warning: instance variable @values not initialized
...................../home/travis/build/stripe/stripe-ruby/lib/stripe/transfer.rb:8: warning: instance variable @api_key not initialized
..............
..
Finished in 0.785621037 seconds.
```

Most of these are due to unused or uninitialized variables. This patch
fixes all warnings by fixing offending code.
2016-04-11 15:20:42 -07:00
Ben Rahn
6dfc4e8c25 add test for handling of charge.outcome subfield 2016-04-11 14:47:30 -07:00
Karla
cb734cfeac Merge pull request #408 from stripe/karla-openssl-errors
Catch SSL connection errors, and re-raise them as APIConnectionErrors
2016-04-11 10:39:13 -07:00
Karla Burnett
0046cd1e4f Catch SSL connection errors, and re-raise them as APIConnectionErrors
This is consistent with API library behavior in other languages, and with our
API documentation (which doesn't mention needing to handle this type of error).
2016-04-08 18:15:22 -07:00
Brandur
37cde9ed03 Bump version to 1.40.0 v1.40.0 2016-04-06 15:53:54 -07:00
Brandur
2c79925212 Merge pull request #407 from stripe/brandur-remove-api-resource-check
Remove check that prevents API resource subobjects from being serialized
2016-04-06 13:47:38 -07:00
Brandur
bebf77e099 Merge pull request #397 from stripe/brandur-ca-store
Initialize an internal CA store
2016-04-05 10:53:44 -07:00
Brandur
7bbc6ef2e5 Remove check that prevents API resource subobjects from being serialized
Prior to my last major serialization refactor, there was a check in the
code that would remove any subobjects from serialization that were of
their own proper resource type (for example, if a charge contained a
customer, that customer would be removed).

What I didn't realize at the time is that the old serialization code had
a bug/quirk that would allow *certain types* of subobjects that were API
resources to make it through unscathed.

In short, the behavior requirement here is *directly* contradictory.
There was a test in place that would make sure that `customer` was
removed from this hash:

``` ruby
{
  :id => 'ch_id',
  :object => 'charge',
  :customer => {
    :object => 'customer',
    :id => 'customer_id'
  }
}
```

But, as reported in #406, we expect, and indeed need, for `source` (a
card) to make it through to the API in this hash:

``` ruby
{
  :id => 'cus_id',
  :object => 'customer',
  :source => {
    :object => 'card',
    :id => 'card_id'
  }
}
```

My proposal here is to just remove the check on serializing API
resources. The normal code that only sends up keys/hashes that have
changed is still in place, so in the first example, `customer` still
isn't sent unless the user has directly manipulated a field on that
subobject. I propose that in those cases we allow the API itself to
reject the request rather than try to cut it off at the client level.

Unfortunately, there is some possibility that removing those API
resources is important for some reason, but of course there's no
documentation on it beyond the after-the-fact post-justification that I
wrote during my last refactor. I can't think of any reason that it would
be too destructive, but there is some level of risk.
2016-04-01 10:54:53 -07:00
Brandur
3930d9a587 Bump version to 1.39.0 v1.39.0 2016-03-31 14:43:52 -07:00
Brandur
4be5c9d23d Merge pull request #402 from stripe/brandur-cybertrust
Add "CyberTrust Global Root"
2016-03-31 14:35:29 -07:00
Brandur
9ae8a49697 Merge pull request #404 from stripe/brandur-improve-error-message
Improve error message on setting empty strings
2016-03-28 08:09:21 -07:00
Brandur
98d06ae6df Improve error message on setting empty strings
This improves the error message that a user sees when attempting to set
a property to an empty string.

Fixes #403.
2016-03-24 10:58:59 -07:00
Brandur
4947b0dfd0 Add "CyberTrust Global Root"
This allows old OpenSSL versions (0.9.8 and 1.0.0) to successfully
verify Stripe's certificate chain.
2016-03-22 17:10:55 -07:00
Brandur
e18823e63b Bump version to 1.38.0 v1.38.0 2016-03-18 08:50:59 -07:00
Brandur
38f3263abe Merge pull request #401 from herimedia/add-options-to-save
Allow options (headers) to be passed into .save
2016-03-18 08:49:48 -07:00
Niels Ganser
db3059a3c0 Allow options (headers) to be passed into .save
in the same manner as is already possible for .create.
2016-03-18 13:30:36 +01:00
Brandur
b2db930f6a Bump version to 1.37.0 v1.37.0 2016-03-14 14:30:56 -07:00
Brandur
efe4deb847 Merge pull request #400 from stripe/gregsabo-add-account-reject
Create account.reject method.
2016-03-14 14:30:12 -07:00
Greg Sabo
2c0f6bc219 Create account.reject method. 2016-03-14 13:43:19 -07:00
Brandur
b17cf0b78b Merge pull request #399 from stripe/brandur-fix-warning
Initialize @max_network_retries
2016-03-14 10:24:54 -07:00
Brandur
5c47264cc2 Initialize @max_network_retries
Certain platforms will throw an error if this variable is accessed
without being initialized. Assign it a value instead of relying on the
OR operator to give it a default.
2016-03-14 10:16:14 -07:00
Brandur
dfa0bf75a8 Merge pull request #398 from stripe/brandur-byebug-platform-lock
Lock Byebug to just the MRI
2016-03-14 10:15:39 -07:00
Brandur
a905da2ff2 9.0.5.0 instead? 2016-03-14 09:56:35 -07:00
Brandur
dd2bae2057 Lock Byebug to just the MRI
Here we predicate the installation of Byebug on being on the MRI. This
allows us to `bundle install` on alternate platforms like JRuby.

Also performs some Gemfile management: add latest MRI and JRuby versions
and remove special case Gemfiles.
2016-03-14 08:59:13 -07:00
Brandur
5ea3c264e3 Initialize an internal CA store
This attempts to give some semblance of thread safety to parallel
library requests by pre-assigning a certificate store, the
initialization of which seems to be a weak point for thread safety. Note
that while this does seem to empirically improve the situation, it
doesn't guarantee actual thread safety.

A longer term solution to the problem is probably to assign a per-thread
HTTP client for much stronger guarantees, but this is a little further
out. More discussion on that topic in #313.

Fixes #382.
2016-03-14 07:57:51 -07:00
Brandur
c3c541363b Bump version to 1.36.2 v1.36.2 2016-03-14 07:25:28 -07:00
Brandur
5c999c3100 Merge pull request #396 from stripe/brandur-fix-list
Fix reference to URLs on ListObject
2016-03-14 07:24:14 -07:00
Brandur
0311b4a7cd Fix reference to URLs on ListObject
In #394 we renamed `url` to `resource_url` in order to prevent name
collisions in API resource that also have a `url` property.
Unfortunately, this didn't account for the fact that when making API
calls on a list object we rely on a returned `url` property to build a
request, and this had been renamed to `resource_url`. Test should have
caught this, but they were written to work differently than how live
API calls actually function.

This patch repairs the problem by adding a `resource_url` to list
objects, and modifies test to be more accurate to reality so that
they'll catch this class of problem in the future.

Fixes #395.
2016-03-14 06:52:26 -07:00
Brandur
f612aa9057 Merge pull request #394 from shekibobo/feature/resource-url
Fix ApiResource resource URL clashing with user-defined URL properties. Fixes #393.
2016-03-11 11:23:00 -08:00
Joshua Kovach
e226ef2ea1 Change everything from url to resource_url 2016-03-11 02:53:50 -05:00
Brandur
7849e844cd Merge pull request #390 from stripe/brandur-refactor-serialize-params
Refactor `serialize_params` under `StripeObject`
2016-03-07 11:41:48 -08:00
Brandur
b452835344 Fix spelling problem 2016-03-07 11:32:50 -08:00