50 Commits

Author SHA1 Message Date
stripe-openapi[bot]
91626d37e8
Support for APIs in the new API version 2025-03-31.basil (#1543)
* Update generated code for v1559

* Update generated code for v1566

* Update generated code for v1572

* Update generated code for v1618

* Update generated code for v1635

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com>
Co-authored-by: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com>
2025-03-31 11:09:09 -07:00
stripe-openapi[bot]
484f9741c5
Update generated code (#1472)
* Update generated code for v1317

* Update generated code for v1318

* Update generated code for v1318

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: prathmesh-stripe <165320323+prathmesh-stripe@users.noreply.github.com>
2024-10-29 10:12:19 -07:00
Ramya Rao
39d8736525
Support for APIs in the new API version 2024-09-30.acacia (#1458) 2024-10-01 09:35:59 -07:00
stripe-openapi[bot]
37b9771584
Update generated code (#1442)
* Update generated code for v1196

* Update generated code for v1199

* Update generated code for v1202

* Update generated code for v1204

* Update generated code for v1211

* Update generated code for v1214

* Update generated code for v1230

* Update generated code for v1232

* Update generated code for v1235

* Update generated code for v1255

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Ramya Rao <100975018+ramya-stripe@users.noreply.github.com>
2024-09-12 14:53:20 -07:00
stripe-openapi[bot]
9c2a7b2f44
Update generated code for v1187 (#1440)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2024-08-08 16:50:38 -07:00
stripe-openapi[bot]
dfea3bdac5
Update generated code (#1372)
* Update generated code for v914

* Update generated code for v918

* Update generated code for v919

* Update generated code for v923

* Update generated code for v935

* Update generated code for v938

* Revert "Update generated code for v935"

This reverts commit 5316ec6e0310a94b496213de077090b03a0fac34.

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Ramya Rao <ramya@stripe.com>
2024-04-09 13:36:37 -07:00
stripe-openapi[bot]
d478ba6679
Update generated code (#1369)
* Update generated code for v897

* Update generated code for v898

* Update generated code for v901

* Update generated code for v905

* Update generated code for v908

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2024-03-28 11:51:59 -07:00
stripe-openapi[bot]
59d3a34000
Update generated code (#1367)
* Update generated code for v888

* Update generated code for v889

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2024-03-21 13:50:11 -07:00
stripe-openapi[bot]
ad00c3e621
Update generated code (#1359)
* Update generated code for v872

* Update generated code for v878
2024-03-14 11:58:37 -07:00
stripe-openapi[bot]
bc03829f1d
Update generated code (#1310)
* Update generated code for v753

* Update generated code for v755

* Update generated code for v755

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com>
2024-01-12 16:34:38 +00:00
stripe-openapi[bot]
c51404d7a2
Update generated code (#1303)
* Update generated code for v726

* Update generated code for v733

* Update generated code for v733

* Update generated code for v734

* Update generated code for v734

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com>
2023-12-21 14:55:42 -08:00
stripe-openapi[bot]
9b84f256a5
Update generated code for v682 (#1292)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com>
2023-11-30 09:53:41 -08:00
stripe-openapi[bot]
33eff4d1d3
Update generated code (#1286)
* Update generated code for v629

* Update generated code for v633

* Update generated code for v640

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-11-02 15:11:37 -07:00
stripe-openapi[bot]
46b57349da
Update generated code (#1277)
* Update generated code for v570

* Update generated code for v573

* Update generated code for v576

* Update generated code for v580

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-10-05 09:39:48 -07:00
stripe-openapi[bot]
0f0d604ca8
Update generated code (#1272)
* Update generated code for v527

* Update generated code for v530

* Update generated code for v531

* Update generated code for v532

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-09-14 17:49:24 -07:00
stripe-openapi[bot]
405725bf9c
Update generated code (#1267)
* Update generated code for v503

* Update generated code for v507

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-09-07 08:55:57 -07:00
stripe-openapi[bot]
a6a02edebb
Update generated code for v495 (#1266)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-08-31 13:09:40 -07:00
stripe-openapi[bot]
83841fddcd
Update generated code (#1256)
* Update generated code for v451

* Update generated code for v457

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-08-10 12:47:18 -07:00
stripe-openapi[bot]
45d7e30a61
Update generated code for v413 (#1244)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-07-13 14:48:02 -07:00
stripe-openapi[bot]
57f61c09ce
Update generated code (new) (#1197)
* Update generated code for v275

* Update generated code for v276

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-03-23 13:16:46 -07:00
pakrym-stripe
a0935c246d
Next major release changes (#1144) 2022-11-16 11:35:51 -08: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
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
Dominic Charley-Roy
94d050bb13
API Updates (#1055) 2022-05-05 09:23:29 -04:00
Dominic Charley-Roy
41066a4ed1
API Updates (#1053) 2022-05-03 10:21:23 -04:00
Richard Marmorstein
3998b689de
API Updates (#1046)
* Codegen for openapi 9e8cdc3
2022-04-15 11:53:56 -04:00
Richard Marmorstein
1f8b6bf3e1
Codegen for openapi 1707cb8 (#1035) 2022-03-01 15:01:51 -05:00
Richard Marmorstein
917e512c10
API Updates (#1031)
* Codegen for openapi 4d2f301
2022-01-20 11:22:53 -05:00
yejia-stripe
d4d282d14d
API Updates (#1017) 2021-11-16 10:04:38 -05:00
Richard Marmorstein
378c71dec7
Codegen more files (#991) 2021-07-27 12:50:38 -04:00
Dominic Charley-Roy
d8b3ddf595
API Updates (#987) 2021-07-09 15:36:24 -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
Richard Marmorstein
f59ba8cae0
Add billing portal configuration (#965) 2021-02-19 20:32:33 -05: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
remi-stripe
cf8b2c5e84
Add support for the PromotionCode resource and APIs (#937)
* Codegen for openapi f71053e

* Add tests
2020-08-05 12:33:47 -07:00
remi-stripe
cfac8d7fcc
Add support for the LineItem resource and APIs (#918) 2020-05-11 17:10:41 -07:00
remi-stripe
622db9d9e7
Add support for the Price resource and APIs (#917)
* Codegen for openapi f75fd88

* Fix test suite
2020-04-29 12:41:35 -07:00
remi-stripe
b8c01be32d
Add support for BillingPortal namespace and Session resource and APIs (#911) 2020-04-22 12:09:02 -07:00
remi-stripe
368f534bce
Codegen for openapi d663cdb (#896) 2020-01-14 08:17:44 -08:00
remi-stripe
6b4a0343b3
Add support for Mandate (#879) 2019-11-05 19:36:41 -08:00
Brandur
44766516d9 stripe-ruby V5 (#815)
* Convert library to use built-in `Net::HTTP`

Moves the library off of Faraday and over onto the standard library's
built-in `Net::HTTP` module. The upside of the transition is that we
break away from a few dependencies that have caused us a fair bit of
trouble in the past, the downside is that we need more of our own code
to do things (although surprisingly, not that much more).

The biggest new pieces are:

* `ConnectionManager`: A per-thread class that manages a connection to
  each Stripe infrastructure URL (like `api.stripe.com`,
  `connect.stripe.com`, etc.) so that we can reuse them between
  requests. It's also responsible for setting up and configuring new
  `Net::HTTP` connections, which is a little more heavyweight
  code-wise compared to other libraries. All of this could have lived in
  `StripeClient`, but I extracted it because that class has gotten so
  big.

* `MultipartEncoder`: A class that does multipart form encoding for file
  uploads. Unfortunately, Ruby doesn't bundle anything like this. I
  built this by referencing the Go implementation because the original
  RFC is not very detailed or well-written. I also made sure that it was
  behaving similarly to our other custom implementations like
  stripe-node, and that it can really upload a file outside the test
  suite.

There's some risk here in that it's easy to miss something across one of
these big transitions. I've tried to test out various error cases
through tests, but also by leaving scripts running as I terminate my
network connection and bring it back. That said, we'd certainly release
on a major version bump because some of the interface (like setting
`Stripe.default_client`) changes.

* Drop support for old versions of Ruby

Drops support for Ruby 2.1 (EOL March 31, 2017) and 2.2 (EOL March 31,
2018). They're removed from `.travis.yml` and the gemspec and RuboCop
configuration have also been updated to the new lower bound.

Most of the diff here are minor updates to styling as required by
RuboCop:

* String literals are frozen by default, so the `.freeze` we had
  everywhere is now considered redundant.

* We can now use Ruby 1.9 style hash syntax with string keys like `{
  "foo": "bar" }`.

* Converted a few heredocs over to use squiggly (leading whitespace
  removed) syntax.

As discussed in Slack, I didn't drop support for Ruby 2.3 (EOL March 31,
2019) as we still have quite a few users on it. As far as I know
dropping it doesn't get us access to any major syntax improvements or
anything, so it's probably not a big deal.

* Make `CardError`'s `code` parameter named instead of positional (#816)

Makes the `code` parameter on `CardError` named instead of positional.
This makes it more consistent with the rest of the constructor's
parameters and makes instantiating `CardError` from `StripeClient`
cleaner.

This is a minor breaking change so we're aiming to release it for the
next major version of stripe-ruby.

* Bump Rubocop to latest version (#818)

* Ruby minimum version increase followup (#819)

* Remove old deprecated methods (#820)

* Remove all alias for list methods (#823)

* Remove UsageRecord.create method (#826)

* Remove IssuerFraudRecord (#827)

* Add ErrorObject to StripeError exceptions (#811)

* Tweak retry logic to be a little more like stripe-node (#828)

Tweaks the retry logic to be a little more like stripe-node's. In
particular, we also retry under these conditions:

* If we receive a 500 on a non-`POST` request.
* If we receive a 503.

I made it slightly different from stripe-node which checks for a 500
with `>= 500`. I don't really like that -- if we want to retry specific
status codes we should be explicit about it.

We're actively re-examining ways on how to make it easier for clients to
figure out when to retry right now, but I figure V5 is a good time to
tweak this because the modifications change the method signature of
`should_retry?` slightly, and it's technically a public method.

* Fix inverted sign for 500 retries (#830)

I messed up in #828 by (1) accidentally flipping the comparison against
`:post` when checking whether to retry on 500, and (2) forgetting to
write new tests for the condition, which is how (1) got through.

This patch fixes both those problems.

* Remove a few more very old deprecated methods (#831)

I noticed that we had a couple of other deprecated methods on `Stripe`
and `StripeObject` that have been around for a long time. May as well
get rid of them too -- luckily they were using `Gem::Deprecate` so
they've been producing annoying deprecated warnings for quite a while
now.

* Remove extraneous slash at the end of the line

* Reset connections when connection-changing configuration changes (#829)

Adds a few basic features around connection and connection manager
management:

* `clear` on connection manager, which calls `finish` on each active
  connection and then disposes of it.

* A centralized cross-thread tracking system for connection managers in
  `StripeClient` and `clear_all_connection_managers` which clears all
  known connection managers across all threads in a thread-safe way.

The addition of these allow us to modify the implementation of some of
our configuration on `Stripe` so that it can reset all currently open
connections when its value changes.

This fixes a currently problem with the library whereby certain
configuration must be set before the first request or it remains fixed
on any open connections. For example, if `Stripe.proxy` is set after a
request is made from the library, it has no effect because the proxy
must have been set when the connection was originally being initialized.

The impetus for getting this out is that I noticed that we will need
this internally in a few places when we're upgrading to stripe-ruby V5.
Those spots used to be able to hack around the unavailability of this
feature by just accessing the Faraday connection directly and resetting
state on it, but in V5 `StripeClient#conn` is gone, and that's no longer
possible.

* Minor cleanup in `StripeClient` (#832)

I ended up having to relax the maximum method line length in a few
previous PRs, so I wanted to try one more cleanup pass in
`execute_request` to see if I could get it back at all.

The answer was "not by much" (without reducing clarity), but I found a
few places that could be tweaked. Unfortunately, ~50 lines is probably
the "right" length for this method in that you _could_ extract it
further, but you'd end up passing huge amounts of state all over the
place in method parameters, and it really wouldn't look that good.

* Do better bookkeeping when tracking state in `Thread.current` (#833)

This is largely just another cleanup patch, but does a couple main
things:

* Hoists the `last_response` value into thread state. This is a very
  minor nicety, but effectively makes `StripeClient` fully thread-safe,
  which seems like a minor nicety. Two calls to `#request` to the same
  `StripeObject` can now be executed on two different threads and their
  results won't interfere with each other.

* Moves state off one-off `Thread.current` keys and into a single one
  for the whole client which stores a new simple type of record called
  `ThreadContext`. Again, this doesn't change much, but adds some minor
  type safety and lets us document each field we expect to have in a
  thread's context.

* Add Invoice.list_upcoming_line_items method (#834)
2019-08-20 11:35:24 -07:00
Alex Rattray (Stripe)
1272a3fc94
[codegen] Remove SubscriptionScheduleRevision (#824)
* Codegen for openapi c806fa1

* Remove tests and standalone resource for SubscriptionScheduleRevision

* Fix rubocop
2019-08-09 15:57:03 -07:00
Remi Jannel
a993e892b3 Add support for the SetupIntent resource and APIs 2019-06-27 12:55:35 -07:00
Remi Jannel
abef09ef6e Add support for CustomerBalanceTransaction resource and APIs 2019-06-16 10:49:47 -07:00
Alex Rattray
64571bee75 Move resources to their own folder 2019-05-29 21:03:37 -04:00
Alex Rattray
58d47e96f8 Move resource requires into their own file 2019-05-29 18:45:57 -04:00