410 Commits

Author SHA1 Message Date
Brandur
06cbe6239a Improve the accuracy on the comment above Hash serialization 2016-03-04 19:26:08 -08:00
Brandur
c173f802a6 Add comment about APIResource exclusion for clarity 2016-03-04 19:24:15 -08:00
Brandur
f215827e2f Remove uses and deprecate .serialize_params 2016-03-04 19:18:26 -08:00
Brandur
f723080220 Refactor serialize_params under StripeObject
This pull does two major things:

1. Refactors `serialize_params` to be more concise and readable while
   still complying to our existing test suite. Unfortunately over time
   this method has become a ball of mud that's very difficult to reason
   about, as recently evidenced by #384.
2. Moves `serialize_params` from class method to instance method (while
   still keeping for old class method for backwards compatibility). This
   is to give it a more sane interface.
2016-03-04 19:04:29 -08:00
Brandur
fa314f6166 Bump version to 1.36.1 2016-03-04 15:01:05 -08:00
François de Metz
bc6cc96310 Fix serialization of hash when calling save.
Hashes are converted to StripeObject when used as params of save.
They need to be converted to hash on serialize.

Signed-off-by: François de Metz <francois@stormz.me>
Signed-off-by: Cyril Duez <cyril@stormz.me>
2016-03-04 14:40:57 -08:00
Brandur
3fab2cd59f Pass params and opts through on ApplicationFee#refund
`params` and `opts` are not currently passed through when using the
`#refund` helper on `ApplicationFee`. This was an omission on the
original refactor to use the new endpoint, and wasn't an intentional
design.

Fixes #386.
2016-03-02 13:45:57 -08:00
Brandur
270dfe6052 Fix grammar problem 2016-02-19 10:28:03 -08:00
Brandur
9b1315d08c Bump version to 1.36.0 2016-02-08 08:24:04 -08:00
Brandur
85f191217b A few more nominal whitespace tweaks 2016-02-08 08:23:33 -08:00
Ioannis Kolovos
f8532d225e Support for Stripe::CountrySpec 2016-02-06 16:55:29 +02:00
Brandur
3a258806a2 Bump version to 1.35.1 2016-02-03 14:06:08 -08:00
Brandur
65b92dec4b Provide compatibility patch the Charge#refund helper
An unfortunate side effect of #364 is that it broke compatibility for
users on very old API versions because their `refunds` field will come
back as an array.

This adds a compatibility layer that will allow even users on old API
versions to seamlessly upgrade their gem versions.
2016-02-03 13:45:01 -08:00
Brandur
23c61cc867 Bump version to 1.35.0 2016-02-01 05:14:43 -08:00
Brandur
687be7015d Merge pull request #372 from stripe/brandur-update-bundle
Update CA bundle
2016-02-01 05:12:26 -08:00
Brandur
31bbf02d4d Update CA bundle
Our CA bundle has fallen quite out of date since it was last pulled.
This patch updates it and adds a Rake task to make this task more
repeatable.

One thing worth noting is I've switched us over from the Ubuntu bundle
to the Mozilla bundle that's maintained by cURL. The bundle seemed to be
previously extracted by a custom script that I don't really want to
maintain. cURL and Excon both use the Mozilla bundle and it should be a
safe replacement.
2016-01-26 14:32:16 -08:00
Brandur
61ba47d619 Allow the CA bundle to be configured
As requested in #370, this will allow advanced users to configure a
certificate bundle that is expected to be more up-to-date than what
we've managed to include with the gem.
2016-01-26 14:19:07 -08:00
Brandur
91f42f4bc2 Bump version to 1.34.0 2016-01-25 11:24:07 -08:00
Rasmus Rygaard
8d8fb67aae Support deleting SKUs and products. 2016-01-25 10:32:49 -08:00
Brandur
03086b8086 Bump version to 1.33.1 2016-01-21 15:16:34 -08:00
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 2016-01-19 15:48:20 -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 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
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
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 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
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
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
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 2015-10-29 12:06:03 -07:00
Michael Bianco
cdc1165fc5 Adding BankAccount#verify 2015-10-29 13:50:45 -04:00
Brandur
aab350e833 Bump version to 1.30.3 2015-10-28 11:33:02 -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
fe8350e3eb Bump version to 1.30.2 2015-10-12 12:19:22 -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
Brandur
20512b0ff7 Bump version to 1.30.1 2015-10-10 12:54:44 -07:00
Brandur
77b1972a72 Use alternate testing approach to satisfy 1.8.7 2015-10-10 12:40:17 -07:00