1567 Commits

Author SHA1 Message Date
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-stripe
26ac12679c
Merge pull request #747 from stripe/remi-add-checkout-session-retrieve
Add support for retrieving a Checkout Session
2019-03-18 16:41:01 -07:00
Remi Jannel
f93c0075c0 Add support for the PaymentMethod resource 2019-03-18 16:30:51 -07:00
Remi Jannel
de204dda1c Add support for retrieving a Checkout Session 2019-03-18 16:29:04 -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 v4.9.1 2019-03-18 12:52:10 -07:00
Brandur
c1894e8f3e
Merge pull request #750 from stripe/brandur-warn-on-remove-error
Catch error and warn if unable to remove a method
2019-03-18 12:51:03 -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-stripe
df8c141bb8
Merge pull request #746 from stripe/remi-fix-tests
Fix tests to work on latest stripe-mock for future updates
2019-03-05 10:34:30 -08:00
Remi Jannel
1094e894cc Fix tests to work on latest stripe-mock for future updates 2019-03-05 10:16:49 -08:00
Brandur
c139dc890d Update changelog convention for yanked version 2019-02-20 11:25:30 -08:00
Remi Jannel
ab8704ed34 Bump version to 4.9.0 v4.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 v4.8.1 2019-02-11 11:28:47 -08:00
Brandur
65cc699832
Merge pull request #743 from stripe/brandur-remove-file-encoding
Remove attempt to nicen `UploadIO` in logs
2019-02-11 11:22:55 -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 v4.8.0 2019-02-03 12:26:29 -08:00
Brandur
c1fa537e34
Merge pull request #741 from stripe/brandur-simpler-encoding
Use `FaradayStripeEncoder` to encode all parameter styles
2019-02-03 12:25:14 -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 v4.7.1 2019-02-01 09:28:47 -08:00
Brandur
42d4f42b12
Merge pull request #740 from stripe/brandur-fix-query-encoding
Fix query encoding for integer-indexed maps
2019-02-01 09:28:00 -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 v4.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
Brandur
41b6968787
Merge pull request #738 from stripe/brandur-port-in-output
Add port in "started stripe-mock" output
2019-01-22 12:25:37 -08:00
Brandur
15af271408 Add port in "started stripe-mock" output
A tiny tweak to add the port chosen by stripe-mock to the "starting
stripe-mock" output. This gives the user a little more information
(which might be handy if something isn't working), and brings it inline
with Go's output format: https://github.com/stripe/stripe-go/pull/780
2019-01-22 12:15:31 -08:00
Brandur
a5472ed04a
Merge pull request #737 from stripe/brandur-select-port
Have stripe-mock select a port number
2019-01-22 09:00:56 -08:00
Olivier Bellone
130704a09a
Bump version to 4.6.0 v4.6.0 2019-01-21 13:21:22 +01:00
Olivier Bellone
bc62c80320
Merge pull request #736 from stripe/ob-serialize-individual
Properly serialize `individual` on Account objects
2019-01-21 13:19:13 +01:00
Brandur
ad20248ee3 Have stripe-mock select a port number
When starting a stripe-mock for a custom OpenAPI spec, pass `-http-port
0` on startup, which tells stripe-mock to select a port, then extract
that port from its output.

This is not a total win because we now have to rely on string matching,
but it is better in that (1) it gets a port more efficiently, (2) it
eliminates a race condition where another process could take the port we
found before stripe-mock gets to start, and (3) it starts a little
faster as we take advantage of the fact that we know stripe-mock has
started when we've found a port in its output (in my tests it took ~0.2
to 0.3 seconds compared to a 1 second sleep).
2019-01-18 16:38:52 -08: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
Olivier Bellone
7f55cf3a9c
Merge pull request #715 from stripe/ob-openapi-files
Detect custom OpenAPI spec file and start stripe-mock from test suite
2019-01-11 12:08:49 +01:00
Olivier Bellone
dbf8a41244
Embed OpenAPI files and start stripe-mock from test suite 2019-01-10 15:06:01 +01:00
mickjermsurawong-stripe
9776f674f1
Merge pull request #734 from stripe/mickjermsurawong/update-stripe-mock-version
bump strip mock version to 0.40.1
2019-01-09 16:03:34 -08:00
Mick Jermsurawong
652047f130 bump strip mock version to 0.40.1 2019-01-09 15:55:41 -08:00
Olivier Bellone
af1c829a41
Merge pull request #721 from stripe/ob-fix-ci
CI fixes
2019-01-05 20:22:44 +01:00
Olivier Bellone
fe4e21c8db
Remove to_hash method on NilClass after test 2019-01-04 17:34:51 +01:00
Olivier Bellone
0a63716682
Pin bundler to 1.x 2019-01-04 16:02:56 +01:00
Brandur
55b4d78026 Bump version to 4.5.0 v4.5.0 2019-01-02 08:00:53 -07:00
Brandur
365759e0b0
Merge pull request #719 from stripe/brandur-support-express-authorize
Generate OAuth authorize URLs for express accounts
2019-01-02 08:00:02 -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 v4.4.1 2018-12-31 11:09:56 -07:00
Brandur
4d7f15f881
Merge pull request #718 from seratch/typo-misspell
Fix typo/misspell in comments & error messages
2018-12-31 10:07:44 -08: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 v4.4.0 2018-12-21 09:43:55 +01:00
remi-stripe
b99ed974d4
Merge pull request #716 from stripe/remi-add-checkout-sessions
Add support for Checkout Sessions
2018-12-21 09:39:19 +01:00
Remi Jannel
0747d59752 Add support for the Checkout Session resource 2018-12-21 09:20:29 +01:00