1230 Commits

Author SHA1 Message Date
Olivier Bellone
4916eadafa
Merge pull request #667 from stripe/brandur-disable-lengths
Rubocop: Cap method length at 50 lines + disable module length
2018-07-28 14:53:15 +02:00
Brandur
ebbce668fd Rubocop: Cap method length at 50 lines + disable module length
Remi pointed out in #666 that we basically just have to keep adding more
more onto the `Max` exception for both these rules every time we add a
new API resource.

Here I suggest that we modify the check on method length in two ways:

1. Permanently disable the cop on `Util.object_classes`. This is just
   going to keep growing until we change are approach to it.
2. Choose a more reasonable maximum of 50 lines for elsewhere (IMO, the
   default of 10 is just too short). Most of our methods already come in
   below this, but there's a couple outliers like `#execute_request` in
   `StripeClient`. If we knock over some of those, we could lower this
   number again, but I suspect that we'd probably want somewhere closer
   to 30 (instead of 10) event then.

I also disable the check on module length completely. I'm not convinced
this is a very good heuristic for code quality.
2018-07-27 17:13:07 -07:00
Brandur
4e3f38ec09 Bump version to 3.19.0 v3.19.0 2018-07-27 17:01:39 -07:00
Brandur
42839f8c20
Merge pull request #666 from stripe/remi-add-sigma-scheduled-query-run
Add support for ScheduledQueryRun
2018-07-27 17:00:26 -07:00
Remi Jannel
4c39c35fd8 Add support for ScheduledQueryRun 2018-07-27 19:14:37 -04:00
Brandur
ec5c51c3ba Very minor fix for alphabetical ordering 2018-07-26 11:32:35 -07:00
Brandur
3b0c34d53b Bump version to 3.18.0 v3.18.0 2018-07-26 11:19:23 -07:00
Brandur
69092da48a
Merge pull request #665 from stripe/remi-add-issuing-resources
Add support for Issuing resources
2018-07-26 11:18:06 -07:00
Remi Jannel
04ae411754 Add support for Issuing resources 2018-07-26 13:35:50 -04:00
Brandur
7c9492b37d Bump version to 3.17.2 v3.17.2 2018-07-19 09:56:15 -07:00
Brandur
b3eb5d3e30
Merge pull request #664 from jasonwebster/do_not_colorize_logger_logging
Do not colorize output destined for configured logger
2018-07-19 09:55:30 -07:00
Jason Webster
9d0cd25897 Do not colorize output destined for configured logger
This changes the predicate supplied to the #colorize method to ensure
that if a logger is set, the colorizing ANSI escape codes are not applied.

This definitely appears to have been the intention behind the original
implementation, but the tests didn't reflect how .log_internal was
actually called. In reality, it is always supplied with an `out:`
argument, not nil. This caused all logger bound output to also be
colorized.
2018-07-19 12:28:28 -04:00
Olivier Bellone
74b25a40dd
Bump version to 3.17.1 v3.17.1 2018-07-19 16:42:10 +02:00
Olivier Bellone
87b758e3ae
Merge pull request #663 from stripe/ob-better-resource-url
Better `resource_url` method
2018-07-19 16:38:35 +02:00
Olivier Bellone
73eb3fec77
Regenerate .rubocop_todo.yml 2018-07-19 14:23:18 +02:00
Olivier Bellone
b4e57ea981
Better resource_url method 2018-07-19 14:23:07 +02:00
Olivier Bellone
99a1d57c0a
Merge pull request #662 from stripe/remi-move-payment-intent-stripe-mock
Move paymentintent to stripe-mock
2018-07-09 11:03:57 +02:00
Remi Jannel
b206552c60 Move paymentintent to stripe-mock 2018-07-07 15:55:12 -04:00
Olivier Bellone
a097b23a0c
Merge pull request #661 from stripe/brandur-ruby-25
Add Ruby 2.5 to test matrix + use aliases
2018-07-03 08:57:40 +02:00
Brandur
1cb90b87f4 Add Ruby 2.5 to test matrix + use aliases
Adds Ruby 2.5 to the test matrix.

I also switched us over to aliases of each major Ruby version because I
think it makes more sense to be locked to whatever the latest release in
each is.
2018-07-02 14:08:00 -07:00
Brandur
9e35a5e0d9 Bump version to 3.17.0 v3.17.0 2018-06-28 08:57:18 -07:00
zach wick
ab3949b8da Adds support for 'partner_id' in 'set_app_info' (#658)
* Adds support for 'partner_id' in 'set_app_info'

Signed-off-by: zach wick <zwick@stripe.com>
2018-06-28 08:55:58 -07:00
Olivier Bellone
32151d5a31
Bump version to 3.16.0 v3.16.0 2018-06-28 14:09:58 +02:00
Olivier Bellone
d4bd5aad5a
Merge pull request #657 from stripe/remi-add-payment-intent
Add support for the PaymentIntent resource
2018-06-28 14:07:21 +02:00
Remi Jannel
201f9c29f4 Add support for the PaymentIntent resource
This feature is gated so the tests are stubbed for now
2018-06-27 19:24:23 -04:00
remi-stripe
89d1994f35
Merge pull request #654 from xtrasimplicity/patch-1
Readme: Fixed minor spelling issue.
2018-06-21 16:48:53 -07:00
Andrew
2230ec8b76
Update README.md 2018-06-22 09:46:26 +10:00
Brandur
1f18f24991
Merge pull request #650 from stripe/brandur-fix-tests
Fix some parameters being sent in tests
2018-05-16 10:14:41 -07:00
Brandur
02200e4c96 Add missing magic comment 2018-05-16 16:52:58 +02:00
Brandur
ed2a0f066d Fix some parameters being sent in tests
I found a bug recently in stripe-mock which causes it not to actually be
validating that parameters not in the spec are not being sent (the
actual Stripe API does check for this).

After applying a fix, I found that stripe-ruby's test suite no longer
passes against it, and the reason is that there are some subtle mistakes
throughout. This patch corrects them to be in line with what the API
actually expects.
2018-05-16 15:10:00 +02:00
Brandur
e8b272653e Bump version to 3.15.0 v3.15.0 2018-05-10 15:42:50 -07:00
Brandur
ec66c3f0f4
Merge pull request #649 from stripe/brandur-frozen-strings
Add `frozen_string_literal` to every file and enforce Rubocop rule
2018-05-10 15:41:46 -07:00
Brandur
863da48398 Add frozen_string_literal to every file and enforce Rubocop rule
Adds the magic `frozen_string_literal: true` comment to every file and
enables a Rubocop rule to make sure that it's always going to be there
going forward as well.

See here for more background [1], but the basic idea is that unlike many
other languages, static strings in code are mutable by default. This has
since been acknowledged as not a particularly good idea, and the
intention is to rectify the mistake when Ruby 3 comes out, where all
string literals will be frozen. The `frozen_string_literal` magic
comment was introduced in Ruby 2.3 as a way of easing the transition,
and allows libraries and projects to freeze their literals in advance.

I don't think this is breaking in any way: it's possible that users
might've been pulling out one of are literals somehow and mutating it,
but that would probably not have been useful for anything and would
certainly not be recommended, so I'm quite comfortable pushing this
change through as a minor version.

As discussed in #641.

[1] https://stackoverflow.com/a/37799399
2018-05-10 14:56:14 -07:00
Brandur
40e4883ddc Bump version to 3.14.0 v3.14.0 2018-05-09 14:56:01 -07:00
Fay Wu
6ce45193d2 Add support for v1/issuer_fraud_records endpoints (#645) 2018-05-09 14:55:10 -07:00
Fay Wu
d07d1d37d6
Merge pull request #648 from stripe/fay/update-version
Upgrade `stripe-mock` to v0.16.0
2018-05-09 09:16:16 -07:00
Fay Wu
188fef5b6e Update minimum version of stripe-mock 2018-05-09 09:10:58 -07:00
Brandur
a44259b8f7 Bump version to 3.13.1 v3.13.1 2018-05-07 15:11:56 -07:00
Brandur
357ec528a2
Merge pull request #647 from stripe/brandur-merge-query-params
Merge query parameters coming from path with `params` argument
2018-05-07 15:11:09 -07:00
Brandur
3a2724bfcc Merge query parameters coming from path with params argument
If specifying both query parameters in a path/URL down to Faraday (e.g.,
`/v1/invoices/upcoming?coupon=25OFF`) _and_ query parameters in a hash
(e.g., `{ customer: "cus_123" }`), it will silently overwrite the ones
in the path with the ones in the hash. This can cause problems where
some critical parameters are discarded and causes an error, as seen in
issue #646.

This patch modifies `#execute_request` so that before going out to
Faraday we check whether the incoming path has query parameters. If it
does, we decode them and add them to our `query_params` hash so that
all parameters from either place are preserved.

Fixes #646.
2018-05-07 14:51:25 -07:00
Brandur
b3b0f78c91
Merge pull request #644 from stripe/brandur-stripe-mock-0-15
Move file upload tests over to be handled by `stripe-mock`
2018-05-07 06:52:37 -07:00
Brandur
4518050527
Merge pull request #643 from stripe/brandur-configuring-version
Add a README section for globally configuration an API version
2018-05-04 15:59:55 -07:00
Brandur
76e6383727 Add a README section for globally configuration an API version
I don't remember why I wrote this originally, but found it sitting
locally uncommitted. It seems like a useful example to have in the
README, so add it in.
2018-05-04 14:25:34 -07:00
Brandur
b9a3971df8 Move file upload tests over to be handled by stripe-mock
`stripe-mock` can now respond accurately for file API endpoints thanks
to a few improvements in how it handles `multipart/form-data` payloads
and the OpenAPI spec.

Here we upgrade `stripe-mock` to 0.15.0 and remove the manual stubbing
that we had previously.
2018-05-04 11:31:11 -07:00
Brandur
21b0514d1e Bump version to 3.13.0 v3.13.0 2018-04-11 13:51:35 -07:00
Brandur
9594875bbd
Merge pull request #634 from stripe/alexander/flexible-billing
Flexible/Metered Billing API support
2018-04-11 13:50:13 -07:00
Alexander Thiemann
c066c9c5f8 flexible billing primitives and tests 2018-04-11 13:29:24 -07:00
Brandur
0b54bf7ba2
Merge pull request #638 from stripe/brandur-stripe-mock-v0.12.0
Upgrade `stripe-mock` to v0.12.0
2018-04-10 13:38:44 -07:00
Brandur
93503dceb5 Fix one test that was incorrectly expecting a non-deleted object back 2018-04-10 13:03:14 -07:00
Brandur
31ac109b21 Upgrade stripe-mock to v0.12.0
The most important changes here are that deleted objects are now
represented more accurately, and that IDs used in URLs are "reflected"
back into responses so that test suites can treat return objects a
little more realistically than they could before.

This should resolve incompatibilities between `stripe-ruby` and newer
versions of `stripe-mock`.
2018-04-10 12:52:55 -07:00