973 Commits

Author SHA1 Message Date
Pavel Pravosud
793a61ccfb Apply safe transformations from current codegen (#777) 2019-05-08 16:09:53 -07:00
Pavel Pravosud
b13fc8465f Remove explicit Util.normalize_opts calls (#778) 2019-05-07 18:20:07 -07:00
Pavel Pravosud
cd05d363f8 More simplifying inheritance (#775) 2019-05-06 17:34:23 -07:00
Pavel Pravosud
14d6a4e6bf More method sorting for Topup class (#776) 2019-05-06 17:26:51 -07:00
Pavel Pravosud
044aa5286e Sort includes by method name for consistency (#773) 2019-05-06 13:15:58 -07:00
Pavel Pravosud
9832c5354f Simplify inheritance for nested classes (#769) 2019-05-06 11:19:53 -07:00
Remi Jannel
93deaef626 Bump version to 4.16.0 2019-04-24 14:26:18 -07:00
Remi Jannel
962538b149 Add support for TaxRate resource and APIs 2019-04-23 09:56:03 -07:00
Remi Jannel
b5b15f390e Bump version to 4.15.0 2019-04-22 16:42:48 -07:00
Remi Jannel
b5cd9e3682 Add support for TaxId resource and APIs 2019-04-19 10:13:57 -07:00
Remi Jannel
5416f020d8 Bump version to 4.14.0 2019-04-18 12:29:34 -07:00
remi-stripe
06498dbe14
Merge pull request #758 from stripe/remi-add-creditnote
Add support for CreditNote
2019-04-18 12:24:05 -07:00
Brandur
d915cd6284 Bump version to 4.13.0 2019-04-16 11:50:37 -07:00
Brandur
81b7cb3ca8 Relax constraints on objects that we'll accept as a file
When uploading a file, we previously made a check on whether it
supported both `#read` and `#path` before wrapping it in a
`Faraday::UploadIO` and sending it off. The second check on `#path`
isn't strictly necessary, and as reported in #761 can prevent objects
created by `open-uri` from being compatible with file upload.

Here we remove the check `#path` so that we just require that objects
support `#read`, and in addition error when an object is passed that's
not file-compatible and not a string. This should prevent users from
seeing the very confusing "Invalid hash" error in these situations.

Fixes #761.
2019-04-16 08:33:42 -07:00
Remi Jannel
0233deb5c6 Add support for CreditNote 2019-04-07 09:47:43 -07:00
Olivier Bellone
51d167aa29
Bump version to 4.12.0 2019-04-02 10:28:11 -07:00
Olivier Bellone
0790bb4154
Static methods for delete (#752)
New `.delete` class method on deletable API resources
2019-04-02 10:25:05 -07:00
Olivier Bellone
160028ada1
New custom_method DSL for defining custom API request methods as static methods (#754)
New `custom_method` DSL for defining custom API request methods as static methods
2019-04-02 10:06:40 -07:00
Olivier Bellone
bb25d09052 Bump version to 4.11.0 2019-03-26 09:06:55 -07:00
Olivier Bellone
6e95bf45f9 Add a global proxy configuration parameter 2019-03-25 18:34:12 -07:00
Remi Jannel
287a2e6979 Bump version to 4.10.0 2019-03-18 16:48:39 -07:00
remi-stripe
39d66c00ce
Merge pull request #745 from stripe/remi-add-payment-methods
Add support for the PaymentMethod resource
2019-03-18 16:42:53 -07:00
remi-stripe
7b9b7b6aab
Merge pull request #748 from stripe/remi-add-terminal-delete
Add support for Terminal Location and Reader deletion
2019-03-18 16:41:08 -07:00
Remi Jannel
f93c0075c0 Add support for the PaymentMethod resource 2019-03-18 16:30:51 -07:00
Remi Jannel
031075c954 Add support for Terminal Location and Reader deletion 2019-03-18 16:28:24 -07:00
Brandur
67edf85459 Bump version to 4.9.1 2019-03-18 12:52:10 -07:00
Brandur
8702e714bc Catch error and warn if unable to remove a method
In some cases there can be a method that's detected with
`method_defined?`, but which cannot be removed with `remove_method`,
even though it's on the same class. The only case so far that we've
noticed this is when a class is reopened for monkey patching like in
issue #749.

We'll still try to discourage this sort of use, but here we swallow the
error and issue a warning so at least the program doesn't crash.

Fixes #749.
2019-03-18 11:52:35 -07:00
Remi Jannel
ab8704ed34 Bump version to 4.9.0 2019-02-12 08:54:31 -08:00
remi-stripe
7af2826ad1
Merge pull request #739 from stripe/remi-add-subscription-schedules
Add support for Subscription Schedules
2019-02-12 08:51:47 -08:00
Remi Jannel
d784819901 Add support for Subscription Schedules 2019-02-11 22:38:08 -08:00
Brandur
c070c05237 Bump version to 4.8.1 2019-02-11 11:28:47 -08:00
Brandur
cf6d79a1ca Remove attempt to nicen UploadIO in logs
In #741 I tried to do something too clever by replacing instances of
`Faraday::UploadIO` found in parameters with a human-readable string to
improve `STRIPE_LOG` logging output.

I thought I'd tested it at the time, but apparently not (or not well
enough), and this change caused the regression detailed in #742.

My findings about how Faraday encodes multipart were apparently wrong
and it does use these parameters, so here we remove the step where we
try to nicen them for logging. The logs look a little worse, but it's
not that big of a deal.

I've tested this patch against the API and confirmed that it addresses
the problem.

Fixes #742.
2019-02-11 11:14:27 -08:00
Brandur
e0438d27a8 Bump version to 4.8.0 2019-02-03 12:26:29 -08:00
Brandur
9dd5bdb0e6 Use FaradayStripeEncoder to encode all parameter styles
Makes a few tweaks to hopefully simplify clarity things:

* `FaradayStripeEncoder` now becomes the way to encode all of form,
  multipart form, and query parameters.
* Introduce a cache in it so that we don't have to encode everything
  twice (once for logging, and once for the request body).
* Try to sanitize logging a bit by replacing `Faraday::UploadIO`s found
  in incoming parameters with a string representation of the file (note
  that all other styles of file input like `File` or `Tempfile` have
  been converted to `Faraday::UploadIO` by the time they reach the
  encoder).
2019-02-03 12:24:53 -08:00
Brandur
3798cadfcc Fix a few comments 2019-02-01 12:47:36 -08:00
Brandur
58512a90d8 Bump version to 4.7.1 2019-02-01 09:28:47 -08:00
Brandur
07f939b46b Fix query encoding for integer-indexed maps
As reported in #608, integer-indexed maps currently work when passed as
part of the body, but they are reverted to non-indexed maps when passed
in the query.

It turns out that we actually had two problems:

1. We weren't calling our `Util.encode_parameters` on our query
   parameters anywhere, and it's this method will does the integer
   encoding.

2. Even when I fixed (1) by calling `Util.encode_parameters`, Faraday
   would still strip the integer indexes as they were transformed in
   its default `NestedParamsEncoder`.

Here we fix both issues by calling `Util.encode_parameters` and sending
Faraday a custom encoder which bypasses its normal shenanigans.

Unfortunately, this has turned out to be somewhat difficult to test
because the integer-indexed maps also seem to confuse Webmock, which
strips them down to standard maps (I even tried testing against a
string, and it still got it wrong). I did use stripe-mock though to
verify that we are now sending the right payload.

Fixes #608.
2019-02-01 09:14:54 -08:00
Remi Jannel
94bafb451f Bump version to 4.7.0 2019-01-23 15:47:00 -08:00
remi-stripe
3366cacd6a
Merge pull request #735 from stripe/remi-fix-checkout-sessions
Move CheckoutSession to the Checkout namespace and rename to Session
2019-01-23 15:40:26 -08:00
Olivier Bellone
130704a09a
Bump version to 4.6.0 2019-01-21 13:21:22 +01:00
Olivier Bellone
6b89b3b6c1
Properly serialize individual on Account objects 2019-01-18 15:31:47 +01:00
Remi Jannel
359a0c9cdf Move CheckoutSession to the Checkout namespace and rename to Session 2019-01-16 18:50:14 -08:00
Brandur
55b4d78026 Bump version to 4.5.0 2019-01-02 08:00:53 -07:00
Brandur
403be3b106 Generate OAuth authorize URLs for express accounts
Connect with Express accounts uses a slightly different version of the
OAuth authorize URL [1] in that it's prefixed with `/express`.

Here we add a new option to `Stripe::OAuth.authorize_url` which allows
`express: true` to be passed in to generate the Express variant.

Note that the token endpoint has no equivalent so we don't need the
option there.

Fixes #717.

[1] https://stripe.com/docs/connect/oauth-reference#express-account-differences
2018-12-31 13:47:35 -07:00
Brandur
6f81c907e8 Bump version to 4.4.1 2018-12-31 11:09:56 -07:00
Kazuhiro Sera
4081d8c5ed Fix typo/misspell in comments & error messages 2018-12-31 15:26:56 +09:00
Remi Jannel
e2c352de07 Bump version to 4.4.0 2018-12-21 09:43:55 +01:00
Remi Jannel
0747d59752 Add support for the Checkout Session resource 2018-12-21 09:20:29 +01:00
Olivier Bellone
98851f9ad3
Bump version to 4.3.0 2018-12-10 17:21:21 -08:00
Remi Jannel
220bac9397 Add support for the Account Link resource 2018-12-07 16:06:04 -08:00