550 Commits

Author SHA1 Message Date
Annie Li
dc93d96cb9 Change check to 3.1. 2022-08-24 11:01:48 -07:00
Annie Li
f647412789 Add comment and change to starts_with 2022-08-24 10:56:47 -07:00
Annie Li
2076cfd42e Add coveralls 2022-08-24 09:56:47 -07:00
Kamil Pajdzik
73324f2ce6
Codegen for openapi v183 (#1116) 2022-08-19 09:19:03 -07:00
Kamil Pajdzik
ec71fd87f2
Next major release changes (#1103)
* chore!: Update CA certifacte bundle (Apr 26). (#1079)

* Generate stripe-ruby with breaking changes (#1102)

* Generate stripe-ruby with breaking changes

* Remove RecipientTest

* Remove AlipayAccount tests

* Regenerate files

* Delete outdated tests

* Fix more tests

* Fix more tests

* Fix example test manually

* Update retrieve_cash_balance method to have params. (#1104)

Co-authored-by: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com>
2022-08-01 10:33:48 -07:00
pakrym-stripe
a961665452
Codegen for openapi v163 (#1092) 2022-07-07 09:33:48 -07:00
pakrym-stripe
8449c2ea0a
Codegen for openapi v162 (#1090) 2022-07-06 12:30:04 -07:00
Dominic Charley-Roy
0c30d8288d
API Updates (#1084) 2022-06-29 17:58:43 -04:00
Dominic Charley-Roy
9092e9dbab
fix: Update logging to coerce ASCII-8BIT into UTF-8. (#1076) 2022-06-21 16:35:46 -04:00
Kamil Pajdzik
8ec93fb0b7
Codegen for openapi v157 (#1073) 2022-06-17 12:05:31 -07:00
pakrym-stripe
b841931ffe
Use request_stripe_object for all requests (#1071) 2022-06-13 10:21:38 -07:00
Dominic Charley-Roy
6ffacea45f
fix: Update cash balance methods to no longer require nested ID. (#1063) 2022-06-08 11:55:12 -04:00
pakrym-stripe
5f4227f52a
Codegen for openapi v146 (#1060) 2022-05-23 12:49:27 -07:00
Kamil Pajdzik
22f9da1565
API Updates (#1057)
Co-authored-by: Richard Marmorstein <richardm@stripe.com>
Co-authored-by: Dominic Charley-Roy <dcr@stripe.com>
2022-05-19 20:11:21 -04:00
Richard Marmorstein
2a702cedd7
API Updates (#1056) 2022-05-09 14:14:29 -04:00
Richard Marmorstein
fad1dcaa7b
API Updates (#1050)
* Codegen for openapi e07f049
2022-04-21 18:19:56 -04:00
Richard Marmorstein
2be83cf0cb
Codegen for openapi a8928d0 (#1047)
* Codegen for openapi a8928d0
2022-04-18 17:59:30 -04:00
Richard Marmorstein
3998b689de
API Updates (#1046)
* Codegen for openapi 9e8cdc3
2022-04-15 11:53:56 -04:00
pakrym-stripe
60d51f2c0a
API Updates (#1041) 2022-03-29 15:37:58 -07:00
pakrym-stripe
90fae49d64
API Updates (#1040) 2022-03-28 12:42:32 -07:00
pakrym-stripe
fc480cdb6c
Add supporting classes for test helper generation (#1034) 2022-03-28 08:00:54 -07:00
Susindaran Elangovan
ba38dc9d24
Add support for Search API (#992) 2022-03-17 09:50:15 -07:00
Richard Marmorstein
1f8b6bf3e1
Codegen for openapi 1707cb8 (#1035) 2022-03-01 15:01:51 -05:00
Richard Marmorstein
c641c3ab19
Codegen for openapi a285624 (#1032) 2022-02-15 17:50:41 -05:00
Richard Marmorstein
917e512c10
API Updates (#1031)
* Codegen for openapi 4d2f301
2022-01-20 11:22:53 -05:00
Dominic Charley-Roy
234a9611a6
Add connection manager logging and include object IDs in logging. (#1022) 2021-12-13 12:55:40 -05:00
yejia-stripe
d4d282d14d
API Updates (#1017) 2021-11-16 10:04:38 -05:00
Richard Marmorstein
3db855d309
Codegen for openapi 21065d4 (#1015) 2021-11-11 15:55:13 -05:00
Dominic Charley-Roy
9774447859
Add tests for child resources. (#1013) 2021-10-13 11:30:44 -04:00
Dominic Charley-Roy
3e2665fb11
Add tests for namespaced resources. (#1012) 2021-10-12 14:38:30 -04:00
Richard Marmorstein
4c36bacd41
API Updates (#1010) 2021-10-11 10:58:59 -04:00
Dominic Charley-Roy
e534c876b3
Add generated test suite. (#1009) 2021-10-07 18:11:34 -04:00
DJ Patterson
85c7f52c3a
Add request_id to RequestEndEvent (#993)
Co-authored-by: Richard Marmorstein <52928443+richardm-stripe@users.noreply.github.com>
2021-08-09 19:47:46 -04:00
Richard Marmorstein
cbecb42185
API Updates (#988) 2021-07-14 12:14:41 -04:00
Dominic Charley-Roy
d8b3ddf595
API Updates (#987) 2021-07-09 15:36:24 -04:00
Dominic Charley-Roy
90223fa06b
Update normalize_opts to use dup instead of clone. (#985) 2021-06-29 17:04:56 -04:00
Richard Marmorstein
19da5510df
Deprecate travis (#982) 2021-06-24 12:01:53 -04:00
Dominic Charley-Roy
59eb8d06cf
Add support for making a request and receiving the response as a stream. (#983) 2021-06-24 10:24:11 -04:00
Richard Marmorstein
faf84198c6
API Updates (#981) 2021-06-04 12:35:25 -04:00
Richard Marmorstein
0ba9307bdb
API Updates (#979) 2021-05-19 10:13:22 -04:00
Brandur Leach
16a094cf34
Rename Stripe.configuration to Stripe.config (#972)
This is just a cosmetic change that renames `Stripe.configuration` to
just `Stripe.config`. We use the shorter "config" in most other places
including `StripeClient#config`, so I feel that this is overall more
consistent.

This change is backwards compatible because the new accessor came in
with #968, and that hasn't been given a formal release yet.

I've left the class name as `StripeConfiguration` which IMO is fine. The
class uses the expanded form of the name while vars and accessors use
the shorter `config`. Also, `StripeConfiguration` has been around a
little bit longer, so renaming it is somewhat backwards incompatible
too.
2021-04-02 13:24:37 -07:00
Brandur
3e26570fcd
On config change, only clear connection managers for changed config (#971)
Follows up #968.

As a relic from when we had global configuration, anytime any config
value is changed on any client, we still clear all connection managers
everywhere on every thread, even though this is not necessary. This
means that we lose all open connections, etc.

Here, we make changes so that if a configuration is changed, we only
clear the configuration managers pertaining to that one particular
configuration, thus conserving resources globally.

Co-authored-by: Brandur <brandur@brandur.org>
2021-04-02 13:13:26 -07:00
Brandur Leach
b9c7afd5fe
Reserve some critical field names when adding StripeObject accessors (#970)
When populating `StripeObject`s, we add accessors to them so that people
can access fields like `obj.currency`.

This was probably only meant to apply to API resources, but through
what might have been an accident of history, we've also traditionally
unmarshaled any hash that comes back from the API as a `StripeObject`,
including `metadata` fields. This allows some convenience because users
can access values like `obj.metadata.my_field`, but is also obviously a
minefield for potential problems.

In issue #969, what's essentially happening is that because there's a
metadata field named `class`, we've overwritten the object's normal
`class` method with our own custom one that accesses the metadata value.
Amazingly, the object can still marshal/unmarshal mostly properly, but
fails on this line as we try to access `obj.class` and that turns out to
be a metadata value instead of a class:

``` ruby
when StripeObject
  obj.class.construct_from(
    ...
```

Here I solve the problem by banning accessors added with the name
`class`. This has a slight risk of backward incompatibility in that
users that previously had metadata named "class" will now have to use
square bracket accessors instead like `obj.metadata[:class]`, but
honestly, I just can't see anything good in allowing "class" to be used
as an accessor.

An alternative solution might be to alias `class` in `StripeObject` and
then make sure we always use that in places like `initialize_from` and
`deep_copy`.

The best long term solution would be to stop add accessors to metadata
objects. This just seems like a bad idea given that there are still
myriads of Ruby built-ins that could potentially be overwritten. This is
definitely a considerably-sized breaking change though, so we'd have to
do it on a major.
2021-04-02 11:08:56 -07:00
Joel Taylor
21643f0716
Allow StripeClient to be configured per instance (#968)
This changes allows for each instance of StripeClient to have its own
configuration object instead of relying on the global config. Each
instance can be configured to override any global config values
previously set.
2021-04-01 14:19:38 -07:00
Richard Marmorstein
f864e68bf7
CI: github actions (#967) 2021-03-10 14:48:48 -05:00
Richard Marmorstein
f59ba8cae0
Add billing portal configuration (#965) 2021-02-19 20:32:33 -05:00
Brandur
c28ee66a14
Fix return value of Customer#delete_discount (#964)
`Customer#delete_discount` has been broken for some time in that it
tries to re-initialize `self` (which is a customer) with a received
discount response. This is incorrect and leads to various problems.

Here, we redefine the return value of `delete_discount` as a discount,
and have it no longer mutate the object on which is was called. We add a
comment as well just to help flag some of the behavior which could
potentially be confusing.

Fixes #963.
2021-02-09 09:50:07 -08:00
Bart de Water
085e08142d
Allow setting write_timeout for connections on Ruby 2.6+ (#950) 2020-10-14 11:43:32 -07:00
remi-stripe
db24334b9e
Add support for the Payout Reverse API (#951)
* Codegen for openapi 4bd4c01

* Add test
2020-10-14 07:51:16 -07:00
remi-stripe
29f321b224
Add support for the SetupAttempt resource and List API (#949)
* Codegen for openapi 3854362

* Fix and add tests
2020-09-29 22:54:58 -07:00