734 Commits

Author SHA1 Message Date
Yogesh Khater
4fe8474279 Forward parameters passed to charge.refund
fixes #365
2016-01-21 12:00:42 +05:30
Brandur
932ddb825a Bump version to 1.33.0 v1.33.0 2016-01-19 15:48:20 -08:00
Brandur
52a26ff08f Merge pull request #364 from stripe/brandur-deprecate-refund-helpers
Deprecate `#refund` helpers on `Charge` and `ApplicationFee`
2016-01-19 15:46:54 -08:00
Brandur
13cba9f29a Remove deprecations 2016-01-19 15:31:44 -08:00
Brandur
437c2dfa02 Move extend to top of file 2016-01-15 10:37:24 -08:00
Brandur
cd9d2bc71e Also re-implement Charge#refund to use our new endpoint
This was already done for `ApplicationFee`.
2016-01-15 10:36:42 -08:00
Brandur
8a20ab8972 Deprecate #refund helpers on Charge and ApplicationFee
As discussed previously in #354 and alluded to in #363, this patch
deprecates the `#refund` helpers on `Charge` and `ApplicationFee` in
favor of the resource-centric approach (i.e. `charge.refunds.create`).

We do this for a few reasons:

1. The new approach is far preferred and uses our modern endpoints. It's
   also been the mechanism suggested by the documentation for ages now.
2. The old approach is somewhat risky in that a forgotten "s" can lead
   to an accidental refund (i.e. `charge.refund` instead of
   `charge.refunds`).

Follows up #354. Fixes #363.
2016-01-14 18:16:56 -08:00
Brandur
0c14e6ec1f Bump version to 1.32.1 v1.32.1 2016-01-07 10:57:46 -07:00
Brandur
6fca0e63d9 Merge pull request #361 from stripe/brandur-init-original-values
Always initialize `original_values` ivar in `StripeObject`
2016-01-07 10:46:32 -07:00
Brandur
4521bfe626 Merge pull request #362 from iloveitaly/bitcoin-refresh-fix
BitcoinReceiver refresh fix
2016-01-06 20:12:26 -07:00
Michael Bianco
2255dd73a8 Adding nil customer value to mock bitcoin receiver hash 2016-01-06 21:47:32 -05:00
Michael Bianco
c259547dd7 Check for nil customer value when determining bitcoin receiver URL
Stripe API responses include `customer: nil`, which causes `refresh`
to throw an exception
2016-01-06 21:45:29 -05:00
Brandur
2564990aa2 Always initialize original_values ivar in StripeObject
This is kind of a weird one because it'll only cause a failure when
serializing a subobject or hash of a `StripeObject`, but it's good
practice to initialize instance variables anyway.

Fixes #360.
2016-01-06 14:40:52 -07:00
Brandur
121a8bfee4 Merge pull request #359 from rthbound/list-object-extends-api-operations
ListObject extends ApiOperations::Create
2016-01-06 09:22:10 -07:00
Ryan T. Hosford
0acf314e30 ListObject extends ApiOperations::Create
- Addresses a bit of duplication.
2016-01-05 22:52:33 -06:00
Brandur
c78b1b8337 Bump version to 1.32.0 v1.32.0 2016-01-05 10:19:23 -07:00
Brandur
d5f5efb77d Merge pull request #354 from stripe/brandur-refund-url-correction-2
Update application fee refunds (round 2)
2015-12-03 17:37:36 -08:00
Kyle Conroy
4e01b13efc Merge pull request #353 from nbrustein/retry-network-failures
feat(request): optionally retry network failures
2015-11-23 13:37:38 -08:00
Nate Brustein
a31986fa6e feat(request): optionally retry all requests that fail on a network failure 2015-11-23 14:30:54 -05:00
Brandur
53ff2ef7f4 Add a semi-deprecation comment 2015-11-19 14:23:33 -08:00
Brandur
c7e515ba7b Use refunds.create + maintain backward compatibility 2015-11-19 14:10:33 -08:00
Brandur
bc66a38cd4 Update application fee refunds (round 2)
Follows up the patch in #351, which I now believe is wrong. The trouble
is that we were mutating the application fee object, when in reality an
application fee refund is actually a completely new resource (see
[creating a refund][create-refund]). This patch edits the original
attempt to cut a new object and updates tests accordingly.

Once again, related to stripe/stripe-php#208.

[create-refund]: https://stripe.com/docs/api#create_fee_refund
2015-11-18 12:25:52 -08:00
Brandur
02f68e45e7 Merge pull request #351 from stripe/brandur-refund-url-correction
Correct URL used for refunding application fees
2015-11-16 13:06:26 -08:00
Brandur
c7fd5b6baa Correct URL used for refunding application fees
This uses the new endpoint instead of the deprecated one.

Related to stripe/stripe-php#208.
2015-11-16 11:07:32 -08:00
Brandur
59e7752a00 Merge pull request #349 from stripe/brandur-remove-18-hacks
Remove test hacks introduced to work around Ruby 1.8 limitations
2015-11-04 17:44:54 -08:00
Brandur
03b64a059d Remove test hacks introduced to work around Ruby 1.8 limitations 2015-11-04 16:41:59 -08:00
Kyle Conroy
90c9d8efa2 Merge pull request #348 from stripe/ruby18
No longer support Ruby 1.8.7
2015-11-04 15:52:18 -08:00
Kyle Conroy
7bf660d124 Only support Ruby >= 1.9.3
Update the README, Gemfiles, and gemspec to remove all references to
Rubies < 1.9.3.
2015-11-04 14:52:56 -08:00
Brandur
159335078c For completeness, add a test case with an empty string 2015-11-03 13:38:59 -08:00
Brandur
5769eb7c1e More consistent spacing 2015-11-03 09:31:21 -08:00
Brandur
492b24894d Fix identation 2015-11-02 13:40:39 -08:00
Brandur
3eca0a4be4 Fix spacing between sentences 2015-11-02 13:17:19 -08:00
Brandur
878d753ff1 Bump version to 1.31.0 v1.31.0 2015-10-29 12:06:03 -07:00
Brandur
c1c5b56762 Merge pull request #345 from iloveitaly/verify-bank-account
Adding BankAccount#verify
2015-10-29 12:05:45 -07:00
Michael Bianco
7cd161dd03 Tests for BankAccount#verify 2015-10-29 15:01:53 -04:00
Michael Bianco
cdc1165fc5 Adding BankAccount#verify 2015-10-29 13:50:45 -04:00
Brandur
aab350e833 Bump version to 1.30.3 v1.30.3 2015-10-28 11:33:02 -07:00
Kyle Conroy
87077c5f19 Merge pull request #344 from stripe/brandur-patch-additional-owners
Special case the serialization of account's `additional_owners`
2015-10-27 16:03:35 -07:00
Brandur
ae4bb64c5a Call serialization of a changed array of hashes undefined for now 2015-10-27 11:53:36 -07:00
Brandur
431ef3b1f2 Special case the serialization of account's additional_owners
We attempt to do a special encoding trick when serializing
`additional_owners` under an account: when updating a value, we actually
send the update parameters up as an integer-indexed hash rather than an
array. So instead of this:

    field[]=item1&field[]=item2&field[]=item3

We send this:

    field[0]=item1&field[1]=item2&field[2]=item3

The trouble is that this had previously been built into the core library
as the default handling for all arrays. Because of this, it was
impossible to resize a non-`additional_owners` array as described in
more detail in #340.

This patch special cases `additional_owners` and brings sane behavior
back to normal arrays along with a test suite so that we try to build
some better guarantees around both the general and non-general cases.
2015-10-27 09:07:41 -07:00
Brandur
1182539ae4 Give code a little breathing room 2015-10-23 16:25:33 -07:00
Brandur
216218aeb0 Order hack to make 1.8.7 tests happy
It turns out that the tests had been working ... but mostly by virtue of
luck only. This should stabilize them more permanently.
2015-10-20 12:15:36 -07:00
Brandur
7dabbd444a Revert "Tweak faulty test logic"
This reverts commit eac89a1af140600904b8e723b20b9755545b6a6e.
2015-10-20 12:15:20 -07:00
Brandur
eac89a1af1 Tweak faulty test logic 2015-10-20 12:11:28 -07:00
Brandur
4ae867f540 Small introductory paragraph and feature list 2015-10-15 12:31:08 -07:00
Brandur
59c21b9d72 Merge pull request #336 from stripe/brandur-add-byebug
Add byebug/pry as a gem development dependency
2015-10-12 12:30:11 -07:00
Brandur
fe8350e3eb Bump version to 1.30.2 v1.30.2 2015-10-12 12:19:22 -07:00
Brandur
72162f455d Merge pull request #335 from stripe/brandur-fix-opts
Correct internal usage of `#update_attributes`
2015-10-12 12:18:40 -07:00
Brandur
a084df78ef Add byebug/pry as a gem development dependency
I find myself using these quite a bit when looking into problems, and
currently have to manually re-add them to the Gemfile/gemspec to get
them in the bundle and make them available in tests.

Here we gate the debugger to only come in for Ruby > 2 so as to avoid
problems with various compatibility problems between debuggers and
versions of Ruby. If there's a demand for a pre-Ruby 2 debugger, we can
add that separately.

Any major objections to this one? Thanks.
2015-10-12 12:10:39 -07:00
Brandur
a014d505bc Correct internal usage of #update_attributes
Unfortunately usage of `#update_attributes` had rolled over from a time
where `#update_attributes_with_options` was still in use and `opts` were
being passed in as an optional argument which had the result of further
nesting the hash internally (i.e. `:opts => { :opts => ... } }`).

This patch fixes that problem, adds a regression test to prevent it from
reappearing, and banishes the unused `#update_attributes_with_options`.

Fixes #334.
2015-10-12 12:08:44 -07:00