Compare commits

...

430 Commits

Author SHA1 Message Date
Ramya Rao
3e340c4153 Bump version to 11.7.0-beta.1 2024-05-30 12:46:31 -07:00
stripe-openapi[bot]
0229ed0e95
Merge pull request #1400 from stripe/latest-codegen-beta
Update generated code for beta
2024-05-30 12:43:27 -07:00
Stripe OpenAPI
1e5edb7386 Merge upstream and update generated code for v1055 2024-05-29 22:37:16 +00:00
Stripe OpenAPI
478d6888aa Merge upstream and update generated code for v1048 2024-05-24 17:57:24 +00:00
Stripe OpenAPI
349acd2adf Merge upstream and update generated code for v1048 2024-05-23 23:04:56 +00:00
Stripe OpenAPI
3871745743 Merge upstream and update generated code for v1021 2024-05-09 19:51:31 +00:00
Ramya Rao
59c82e3d4b Bump version to 11.5.0-beta.1 2024-05-09 12:45:39 -07:00
stripe-openapi[bot]
6a4d2d1570
Merge pull request #1395 from stripe/latest-codegen-beta
Update generated code for beta
2024-05-09 12:41:32 -07:00
Stripe OpenAPI
5669ab4d5c Merge upstream and update generated code for v1016 2024-05-08 22:04:51 +00:00
Stripe OpenAPI
78e3166e20 Merge upstream and update generated code for v1013 2024-05-07 17:28:36 +00:00
Stripe OpenAPI
318bed2067 Merge upstream and update generated code for v1011 2024-05-06 20:17:43 +00:00
Stripe OpenAPI
0c44569639 Merge upstream and update generated code for v1009 2024-05-03 17:46:17 +00:00
Helen Ye
65c85f45b3 Bump version to 11.4.0-beta.1 2024-05-02 15:23:28 -07:00
stripe-openapi[bot]
f858c6a959
Merge pull request #1386 from stripe/latest-codegen-beta
Update generated code for beta
2024-05-02 14:06:09 -07:00
Stripe OpenAPI
1fadafb39c Update generated code for v1005 2024-05-01 19:16:03 +00:00
Stripe OpenAPI
4ce9e74bf5 Merge upstream and update generated code for v1004 2024-05-01 15:56:21 +00:00
Stripe OpenAPI
b7d691bafd Update generated code for v1003 2024-04-30 21:48:46 +00:00
Stripe OpenAPI
ee9ea1595a Update generated code for v1002 2024-04-30 19:44:18 +00:00
Stripe OpenAPI
a802c007b2 Update generated code for v997 2024-04-26 16:57:43 +00:00
Stripe OpenAPI
d8701e8749 Update generated code for v989 2024-04-24 22:00:29 +00:00
Stripe OpenAPI
c83c27da74 Update generated code for v985 2024-04-24 13:03:40 +00:00
Stripe OpenAPI
fa02db50ab Update generated code for v979 2024-04-22 22:18:23 +00:00
Stripe OpenAPI
663d1460ef Merge upstream and update generated code for v972 2024-04-19 05:59:05 +00:00
Ramya Rao
9716565a2d Bump version to 11.3.0-beta.1 2024-04-18 14:44:20 -07:00
stripe-openapi[bot]
99c81c7074
Merge pull request #1383 from stripe/latest-codegen-beta
Update generated code for beta
2024-04-18 14:36:38 -07:00
Stripe OpenAPI
16c779cdea Merge upstream and update generated code for v962 2024-04-16 23:26:07 +00:00
Stripe OpenAPI
f832bff64a Merge upstream and update generated code for v962 2024-04-16 17:30:10 +00:00
Stripe OpenAPI
d9f19ec10f Update generated code for v961 2024-04-15 23:25:05 +00:00
Stripe OpenAPI
20ae76545b Update generated code for v961 2024-04-15 22:15:04 +00:00
Stripe OpenAPI
59863ea3aa Update generated code for v957 2024-04-15 18:04:44 +00:00
Ramya Rao
a49aa2d18c Bump version to 11.1.0-beta.1 2024-04-11 22:06:48 -07:00
Ramya Rao
61aba5d027 Generate code for v950 of the spec 2024-04-11 16:21:40 -07:00
Ramya Rao
3d2ad3d61c Merge remote-tracking branch 'origin/master' into beta 2024-04-11 16:19:35 -07:00
stripe-openapi[bot]
ab7d3a61d1
Merge pull request #1376 from stripe/latest-codegen-beta
Update generated code for beta
2024-04-11 23:16:02 +00:00
Ramya Rao
e5ec8c1ebf Merge remote-tracking branch 'origin/beta' into latest-codegen-beta 2024-04-11 16:15:02 -07:00
Helen Ye
8558e0ee2e Merge changes from stripe/stripe-ruby master 2024-04-11 14:50:19 -07:00
Stripe OpenAPI
8c3b51769f Update generated code for v941 2024-04-10 18:01:40 +00:00
Stripe OpenAPI
4c4485185c Merge upstream and update generated code for v940 2024-04-09 22:31:44 +00:00
Stripe OpenAPI
df7f3fad50 Merge upstream and update generated code for v939 2024-04-09 18:00:33 +00:00
Stripe OpenAPI
b9597e5eac Merge upstream and update generated code for v938 2024-04-09 17:27:59 +00:00
Stripe OpenAPI
83463f167e Merge upstream and update generated code for v935 2024-04-05 22:12:07 +00:00
Stripe OpenAPI
abcc296f24 Update generated code for v935 2024-04-05 19:51:48 +00:00
Ramya Rao
7eea258347 Bump version to 10.15.0-beta.1 2024-04-04 15:48:33 -07:00
stripe-openapi[bot]
b66f178666
Merge pull request #1373 from stripe/latest-codegen-beta
Update generated code for beta
2024-04-04 15:41:58 -07:00
Stripe OpenAPI
4ffefec536 Update generated code for v923 2024-04-02 21:05:51 +00:00
Stripe OpenAPI
7f957926c0 Update generated code for v919 2024-04-01 23:24:20 +00:00
Stripe OpenAPI
9f5e950493 Update generated code for v918 2024-03-29 17:38:06 +00:00
Stripe OpenAPI
c4f115226f Update generated code for v917 2024-03-29 17:33:06 +00:00
Stripe OpenAPI
c9c0acf980 Update generated code for v914 2024-03-28 23:38:31 +00:00
stripe-openapi[bot]
3822030694
Merge pull request #1370 from stripe/latest-codegen-beta
Update generated code for beta
2024-03-28 13:38:42 -07:00
Stripe OpenAPI
287b1fab65 Merge upstream and update generated code for v912 2024-03-28 19:19:54 +00:00
Stripe OpenAPI
6a0feb8f7d Update generated code for v905 2024-03-26 00:19:24 +00:00
Stripe OpenAPI
3f60df3581 Update generated code for v901 2024-03-22 19:59:14 +00:00
Stripe OpenAPI
c2f09bc395 Update generated code for v898 2024-03-21 23:31:40 +00:00
Stripe OpenAPI
626b576a34 Merge upstream and update generated code for v897 2024-03-21 22:25:29 +00:00
Ramya Rao
27987ef78e Bump version to 10.14.0-beta.1 2024-03-21 15:22:51 -07:00
stripe-openapi[bot]
4888991c70
Merge pull request #1363 from stripe/latest-codegen-beta
Update generated code for beta
2024-03-21 14:09:15 -07:00
Stripe OpenAPI
4f0f1ee5f9 Update generated code for v896 2024-03-21 20:50:59 +00:00
Stripe OpenAPI
f825a94c1c Update generated code for v892 2024-03-21 14:57:11 +00:00
Stripe OpenAPI
9bfea77b37 Update generated code for v890 2024-03-20 23:16:21 +00:00
Stripe OpenAPI
929b50a836 Update generated code for v889 2024-03-20 21:43:03 +00:00
Stripe OpenAPI
e14fff4431 Update generated code for v884 2024-03-20 17:52:47 +00:00
Stripe OpenAPI
bc3e460aae Update generated code for v879 2024-03-15 23:28:19 +00:00
Stripe OpenAPI
3ed806c90b Merge upstream and update generated code for v879 2024-03-15 19:13:29 +00:00
Ramya Rao
c4dd22825e Bump version to 10.13.0-beta.1 2024-03-14 15:58:30 -07:00
stripe-openapi[bot]
b594bd5c21
Merge pull request #1360 from stripe/latest-codegen-beta
Update generated code for beta
2024-03-14 15:53:41 -07:00
Stripe OpenAPI
7ddec7d6d8 Update generated code for v879 2024-03-14 22:14:21 +00:00
Stripe OpenAPI
f6a388be06 Merge upstream and update generated code for v878 2024-03-14 20:25:23 +00:00
Stripe OpenAPI
a8aac472ec Update generated code for v878 2024-03-14 18:34:26 +00:00
Stripe OpenAPI
0b3c0f3244 Update generated code for v875 2024-03-13 14:47:03 +00:00
Stripe OpenAPI
cece539ed7 Update generated code for v873 2024-03-12 17:24:55 +00:00
Stripe OpenAPI
22693301eb Merge upstream and update generated code for v872 2024-03-12 15:20:19 +00:00
Annie Li
c36c240108 Bump version to 10.12.0-beta.1 2024-02-29 18:07:32 -05:00
stripe-openapi[bot]
ec694bbd05
Merge pull request #1352 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-29 15:02:14 -08:00
Stripe OpenAPI
56039702e9 Merge upstream and update generated code for v857 2024-02-29 23:01:19 +00:00
stripe-openapi[bot]
5edc3708fc
Merge pull request #1350 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-29 14:56:10 -08:00
Stripe OpenAPI
0d0cead582 Merge upstream and update generated code for v857 2024-02-29 22:53:40 +00:00
Stripe OpenAPI
b7a9871e6a Merge upstream and update generated code for v857 2024-02-29 21:05:27 +00:00
Annie Li
e511e2fb8b Bump version to 10.12.0-beta.1 2024-02-29 15:47:54 -05:00
stripe-openapi[bot]
e37031ef1f
Merge pull request #1341 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-29 20:32:45 +00:00
anniel-stripe
d699593ea5
Merge branch 'beta' into latest-codegen-beta 2024-02-29 12:31:53 -08:00
Stripe OpenAPI
4632b7c9da Merge upstream and update generated code for v854 2024-02-28 22:16:23 +00:00
helenye-stripe
418d79de1b
Add a helper to add a beta version (#1343)
* Add a helper to add a beta header

* Typo
2024-02-28 12:19:10 -08:00
Stripe OpenAPI
b1e351f235 Update generated code for v848 2024-02-27 13:02:49 +00:00
Stripe OpenAPI
2c260289f2 Update generated code for v841 2024-02-26 19:09:56 +00:00
Pavel Krymets
d249b5f78b Bump version to 10.11.0-beta.1 2024-02-22 15:45:31 -08:00
stripe-openapi[bot]
816f8ad435
Merge pull request #1335 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-22 15:25:10 -08:00
Stripe OpenAPI
02a733676e Merge upstream and update generated code for v840 2024-02-22 22:28:45 +00:00
Stripe OpenAPI
0e96318130 Update generated code for v840 2024-02-22 17:44:00 +00:00
Stripe OpenAPI
2e0b17a3dc Merge upstream and update generated code for v840 2024-02-22 17:31:10 +00:00
Stripe OpenAPI
8c91e40f29 Merge upstream and update generated code for v838 2024-02-21 22:21:57 +00:00
Stripe OpenAPI
4617b3fbd1 Update generated code for v834 2024-02-20 21:15:37 +00:00
Stripe OpenAPI
da70f0cfc8 Update generated code for v833 2024-02-16 19:12:32 +00:00
Helen Ye
a00f541a93 Bump version to 10.10.0-beta.1 2024-02-16 10:03:53 -08:00
stripe-openapi[bot]
cbe61d7d38
Merge pull request #1332 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-16 09:42:15 -08:00
Stripe OpenAPI
3fe63202e3 Update generated code for v831 2024-02-16 17:34:00 +00:00
Stripe OpenAPI
3921d9b812 Merge upstream and update generated code for v830 2024-02-16 00:39:50 +00:00
Stripe OpenAPI
b39af8a58b Update generated code for v829 2024-02-15 21:27:13 +00:00
Stripe OpenAPI
6e62bca84a Update generated code for v828 2024-02-14 23:59:57 +00:00
stripe-openapi[bot]
a7d998ab2d
Merge pull request #1328 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-14 10:56:01 -08:00
Stripe OpenAPI
479d17b26a Merge upstream and update generated code for v827 2024-02-14 11:55:51 +00:00
Annie Li
1bcb4bc058 Bump version to 10.9.0-beta.1 2024-02-08 14:13:19 -08:00
stripe-openapi[bot]
b399f87064
Merge pull request #1321 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-08 14:08:23 -08:00
Stripe OpenAPI
a1ce673f62 Merge upstream and update generated code for v810 2024-02-05 20:32:27 +00:00
Stripe OpenAPI
4ccbe90069 Merge upstream and update generated code for v809 2024-02-05 19:28:06 +00:00
Richard Marmorstein
5da74143e8 Bump version to 10.8.0-beta.1 2024-02-01 18:13:15 -08:00
stripe-openapi[bot]
41ba199775
Merge pull request #1318 from stripe/latest-codegen-beta
Update generated code for beta
2024-02-01 17:47:33 -08:00
Stripe OpenAPI
6897561e00 Merge upstream and update generated code for v808 2024-02-01 22:28:58 +00:00
Stripe OpenAPI
33e217ba15 Update generated code for v805 2024-01-31 23:11:17 +00:00
Stripe OpenAPI
dfa7994d04 Merge upstream and update generated code for v802 2024-01-30 23:04:23 +00:00
Pavel Krymets
34ff3ed2ca Bump version to 10.7.0-beta.3 2024-01-25 15:34:35 -08:00
stripe-openapi[bot]
fe66019c7d
Merge pull request #1313 from stripe/latest-codegen-beta
Update generated code for beta
2024-01-25 23:15:48 +00:00
pakrym-stripe
f84e1154b1
Merge branch 'beta' into latest-codegen-beta 2024-01-25 15:15:09 -08:00
Stripe OpenAPI
afa13a53b0 Merge upstream and update generated code for v794 2024-01-25 18:38:01 +00:00
Stripe OpenAPI
a1deb162d0 Update generated code for v773 2024-01-22 09:30:48 +00:00
Stripe OpenAPI
499d0605d0 Update generated code for v771 2024-01-19 23:33:30 +00:00
Stripe OpenAPI
1705995709 Merge upstream and update generated code for v769 2024-01-19 19:37:25 +00:00
Richard Marmorstein
452f8ca43d Bump version to 10.7.0-beta.2 2024-01-19 13:36:10 -06:00
Richard Marmorstein
4902b4c49d
Merge pull request #1307 from stripe/richardm-report-raw-request
Beta: report raw request usage
2024-01-19 11:34:13 -08:00
Richard Marmorstein
ad26ff3fca
Merge branch 'beta' into richardm-report-raw-request 2024-01-19 11:33:35 -08:00
Stripe OpenAPI
86ac5fd329 Update generated code for v769 2024-01-19 01:18:58 +00:00
Richard Marmorstein
ee9b5c7ead bugfix 2024-01-15 18:21:39 -06:00
Pavel Krymets
083c3a104e Bump version to 10.7.0-beta.1 2024-01-12 10:58:09 -08:00
stripe-openapi[bot]
354b6a92a3
Merge pull request #1309 from stripe/latest-codegen-beta
Update generated code for beta
2024-01-12 10:50:35 -08:00
Stripe OpenAPI
c48a5e30cf Merge upstream and update generated code for v756 2024-01-12 18:22:02 +00:00
Stripe OpenAPI
71b8f84574 Update generated code for v755 2024-01-12 00:29:20 +00:00
Stripe OpenAPI
d353c130bc Merge upstream and update generated code for v755 2024-01-11 17:59:57 +00:00
Stripe OpenAPI
8bda0900f3 Update generated code for v753 2024-01-10 21:56:29 +00:00
Richard Marmorstein
3cecb75d46 bump 2024-01-10 12:00:25 -06:00
Richard Marmorstein
18fef16be2 Report raw request usage 2024-01-10 11:59:05 -06:00
Richard Marmorstein
783bcb163f Bump version to 10.6.0-beta.1 2024-01-04 14:40:29 -06:00
stripe-openapi[bot]
3e5b22eeae
Merge pull request #1305 from stripe/latest-codegen-beta
Update generated code for beta
2024-01-04 12:24:57 -08:00
Stripe OpenAPI
452e0c4485 Merge upstream and update generated code for v742 2024-01-04 19:58:10 +00:00
Stripe OpenAPI
cb256e8e1c Update generated code for v742 2024-01-04 16:18:11 +00:00
Pavel Krymets
90aa83239b Bump version to 10.5.0-beta.1 2023-12-22 08:43:19 -08:00
stripe-openapi[bot]
ab5266188f
Merge pull request #1302 from stripe/latest-codegen-beta
Update generated code for beta
2023-12-22 08:20:26 -08:00
Stripe OpenAPI
e8f3b94a9d Merge upstream and update generated code for v737 2023-12-22 16:09:18 +00:00
Stripe OpenAPI
52e17ef8ea Update generated code for v734 2023-12-21 22:42:14 +00:00
Stripe OpenAPI
16227fe1e6 Update generated code for v734 2023-12-21 22:27:23 +00:00
Stripe OpenAPI
0e8df39594 Merge upstream and update generated code for v733 2023-12-21 21:26:13 +00:00
Stripe OpenAPI
98fbfb8012 Update generated code for v733 2023-12-21 19:42:52 +00:00
Stripe OpenAPI
8acad71c3f Update generated code for v726 2023-12-20 00:04:53 +00:00
Stripe OpenAPI
3b4f6e4bcb Update generated code for v724 2023-12-19 18:15:49 +00:00
Richard Marmorstein
e1017fb6ef Bump version to 10.4.0-beta.1 2023-12-14 18:13:25 -08:00
stripe-openapi[bot]
4933ab3111
Merge pull request #1301 from stripe/latest-codegen-beta
Update generated code for beta
2023-12-14 17:39:48 -08:00
Stripe OpenAPI
b06b78aa85 Merge upstream and update generated code for v715 2023-12-14 23:58:08 +00:00
stripe-openapi[bot]
fb0f82090c
Merge pull request #1300 from stripe/latest-codegen-beta
Update generated code for beta
2023-12-14 13:24:54 -08:00
Stripe OpenAPI
7c14c42072 Merge upstream and update generated code for v709 2023-12-12 00:26:26 +00:00
Richard Marmorstein
78032b72f5
Merge pull request #1299 from stripe/richardm-merge-master-into-beta
Merge master into beta
2023-12-06 14:33:02 -08:00
Richard Marmorstein
446f6ec55c bump 2023-12-06 12:49:21 -08:00
Richard Marmorstein
7567bd2cb7 Merge remote-tracking branch 'origin/master' into beta 2023-12-05 17:21:49 -08:00
Annie Li
002767748d Bump version to 10.3.0-beta.1 2023-11-30 10:53:02 -08:00
stripe-openapi[bot]
92bad8eeee
Merge pull request #1298 from stripe/latest-codegen-beta
Update generated code for beta
2023-11-30 10:46:53 -08:00
Stripe OpenAPI
3d3552e00d Merge upstream and update generated code for v691 2023-11-30 18:45:25 +00:00
anniel-stripe
5af00f12a2
Merge pull request #1296 from stripe/richardm-beta-merge-master
Merge master into beta
2023-11-29 11:26:50 -08:00
Richard Marmorstein
208ead7817 bump 2023-11-29 10:47:56 -08:00
Richard Marmorstein
cca659d7b3 regenerate 2023-11-29 10:45:26 -08:00
Richard Marmorstein
8c0015fb2c Merge remote-tracking branch 'origin/master' into beta 2023-11-29 10:39:26 -08:00
Richard Marmorstein
5ece384518 Bump version to 10.2.0-beta.1 2023-11-02 15:55:42 -07:00
stripe-openapi[bot]
d936ddcff1
Merge pull request #1287 from stripe/latest-codegen-beta
Update generated code for beta
2023-11-02 15:47:14 -07:00
Stripe OpenAPI
77d8304c54 Merge upstream and update generated code for v645 2023-11-02 22:39:43 +00:00
Stripe OpenAPI
6ba63d9a87 Update generated code for v643 2023-11-02 18:52:37 +00:00
Stripe OpenAPI
0d538ab0f1 Update generated code for v640 2023-11-02 10:42:15 +00:00
Stripe OpenAPI
6a5b89c99d Update generated code for v629 2023-10-30 19:24:42 +00:00
Annie Li
b036d14d27 Bump version to 10.1.0-beta.2 2023-10-26 12:49:50 -07:00
stripe-openapi[bot]
eeaa682877
Merge pull request #1285 from stripe/latest-codegen-beta
Update generated code for beta
2023-10-26 12:34:51 -07:00
Stripe OpenAPI
a9611340a4 Update generated code for v627 2023-10-26 18:34:03 +00:00
Stripe OpenAPI
fee677de9e Update generated code for v623 2023-10-25 19:40:28 +00:00
Stripe OpenAPI
08400e8df9 Update generated code for v620 2023-10-25 18:45:40 +00:00
Stripe OpenAPI
b62018ee93 Update generated code for v618 2023-10-24 18:08:33 +00:00
Pavel Krymets
d4e469fa3c Bump version to 10.1.0-beta.1 2023-10-17 08:56:01 -07:00
stripe-openapi[bot]
cfd9943c83
Merge pull request #1284 from stripe/latest-codegen-beta
Update generated code for beta
2023-10-17 08:24:40 -07:00
Stripe OpenAPI
6d82ac4b56 Merge upstream and update generated code for v603 2023-10-16 20:34:12 +00:00
Stripe OpenAPI
aeb1b59206 Merge upstream and update generated code for v603 2023-10-16 19:55:50 +00:00
stripe-openapi[bot]
a7f1c57f2c
Merge pull request #1282 from stripe/latest-codegen-beta
Update generated code for beta
2023-10-16 11:51:09 -07:00
Stripe OpenAPI
7be7413461 Update generated code for v601 2023-10-13 21:44:27 +00:00
Stripe OpenAPI
42f0c2c9d4 Update generated code for v599 2023-10-12 17:45:36 +00:00
Pavel Krymets
0055df9a63 Bump version to 9.5.0-beta.2 2023-10-12 09:32:08 -07:00
stripe-openapi[bot]
4638712b2b
Merge pull request #1280 from stripe/latest-codegen-beta
Update generated code for beta
2023-10-11 11:14:09 -07:00
Stripe OpenAPI
86f5a8ac5c Update generated code for v591 2023-10-09 17:53:17 +00:00
Stripe OpenAPI
5443a95598 Merge upstream and update generated code for v582 2023-10-05 22:59:57 +00:00
Annie Li
bc3cd13405 Bump version to 9.5.0-beta.1 2023-10-05 11:09:06 -07:00
stripe-openapi[bot]
02c47fd5f0
Merge pull request #1278 from stripe/latest-codegen-beta
Update generated code for beta
2023-10-05 10:42:19 -07:00
Stripe OpenAPI
9a92aa9c72 Merge upstream and update generated code for v582 2023-10-05 17:27:41 +00:00
Stripe OpenAPI
0030faf88f Update generated code for v582 2023-10-05 16:34:47 +00:00
Stripe OpenAPI
3285671c8f Update generated code for v580 2023-10-04 17:40:17 +00:00
Stripe OpenAPI
119802aaf2 Update generated code for v576 2023-10-03 20:41:26 +00:00
Stripe OpenAPI
d7a09671d1 Update generated code for v575 2023-10-02 21:28:34 +00:00
Stripe OpenAPI
05ee1f8fd4 Update generated code for v573 2023-10-02 15:36:11 +00:00
Stripe OpenAPI
72ce4e5f83 Update generated code for v570 2023-09-29 17:34:50 +00:00
Richard Marmorstein
7dbfa2b4c4 Bump version to 9.4.0-beta.3 2023-09-28 17:04:33 -07:00
stripe-openapi[bot]
0d02750915
Merge pull request #1276 from stripe/latest-codegen-beta
Update generated code for beta
2023-09-28 17:00:58 -07:00
Stripe OpenAPI
1e13984787 Merge upstream and update generated code for v569 2023-09-28 23:53:39 +00:00
Stripe OpenAPI
5a2cf963ec Update generated code for v562 2023-09-27 20:44:30 +00:00
Stripe OpenAPI
176f13b832 Update generated code for v557 2023-09-27 00:02:48 +00:00
Stripe OpenAPI
9f77cb9c05 Update generated code for v551 2023-09-25 12:00:59 +00:00
Stripe OpenAPI
12da6ae2a8 Update generated code for v548 2023-09-22 16:56:08 +00:00
Stripe OpenAPI
aed8e679c5 Merge upstream and update generated code for v546 2023-09-22 02:21:46 +00:00
Annie Li
a11a923b23 Bump version to 9.4.0-beta.2 2023-09-21 16:37:12 -07:00
stripe-openapi[bot]
ac980c4216
Merge pull request #1273 from stripe/latest-codegen-beta
Update generated code for beta
2023-09-21 15:59:17 -07:00
Stripe OpenAPI
7852b2faeb Update generated code for v540 2023-09-21 06:13:14 +00:00
Stripe OpenAPI
0a0374b0a1 Update generated code for v536 2023-09-19 23:52:46 +00:00
Stripe OpenAPI
2e533be04d Update generated code for v533 2023-09-15 22:25:24 +00:00
Stripe OpenAPI
e058a85fe7 Merge upstream and update generated code for v532 2023-09-15 17:26:55 +00:00
Richard Marmorstein
6bf2eaf832 Bump version to 9.4.0-beta.1 2023-09-14 18:10:39 -07:00
stripe-openapi[bot]
fb6f536d00
Merge pull request #1270 from stripe/latest-codegen-beta
Update generated code for beta
2023-09-14 18:05:24 -07:00
Stripe OpenAPI
f97b214181 Update generated code for v532 2023-09-15 00:45:49 +00:00
Stripe OpenAPI
7066d7d3a1 Update generated code for v531 2023-09-15 00:10:55 +00:00
Stripe OpenAPI
147e25b288 Merge upstream and update generated code for v530 2023-09-14 23:11:35 +00:00
Stripe OpenAPI
568b3191c4 Update generated code for v526 2023-09-13 20:35:42 +00:00
Stripe OpenAPI
1ef9ff4b88 Update generated code for v525 2023-09-13 16:46:29 +00:00
Stripe OpenAPI
3165ed5905 Update generated code for v525 2023-09-13 15:42:40 +00:00
Stripe OpenAPI
be4388721d Update generated code for v522 2023-09-12 14:35:29 +00:00
Stripe OpenAPI
6ed6014b89 Update generated code for v522 2023-09-11 18:58:57 +00:00
Stripe OpenAPI
0ea7c61bcf Update generated code for v519 2023-09-11 16:50:27 +00:00
Stripe OpenAPI
f94c2cb45c Update generated code for v518 2023-09-08 19:24:11 +00:00
Pavel Krymets
c4bdddbe3c Bump version to 9.3.0-beta.1 2023-09-07 13:03:21 -07:00
stripe-openapi[bot]
81b5190aed
Merge pull request #1269 from stripe/latest-codegen-beta
Update generated code for beta
2023-09-07 12:08:03 -07:00
Stripe OpenAPI
3fd4e48999 Merge upstream and update generated code for v515 2023-09-07 18:58:48 +00:00
stripe-openapi[bot]
44a1547344
Merge pull request #1268 from stripe/latest-codegen-beta
Update generated code for beta
2023-09-07 11:26:03 -07:00
Stripe OpenAPI
65768f9ee1 Update generated code for v513 2023-09-06 22:54:15 +00:00
Stripe OpenAPI
2ebd8cc795 Update generated code for v507 2023-09-06 14:46:53 +00:00
Stripe OpenAPI
206c80733f Merge upstream and update generated code for v503 2023-09-01 20:03:33 +00:00
Richard Marmorstein
600c5fb883 Bump version to 9.2.0-beta.1 2023-08-31 17:08:35 -07:00
stripe-openapi[bot]
8dfa6f6eaa
Merge pull request #1265 from stripe/latest-codegen-beta
Update generated code for beta
2023-08-31 16:53:14 -07:00
Stripe OpenAPI
c3b05c5e71 Update generated code for v484 2023-08-25 16:36:03 +00:00
Annie Li
fee9143bb1 Bump version to 9.0.0-beta.1 2023-08-24 11:37:20 -07:00
stripe-openapi[bot]
bd62fe08d6
Merge pull request #1264 from stripe/latest-codegen-beta
Update generated code for beta
2023-08-24 10:45:57 -07:00
Stripe OpenAPI
658a0b786a Update generated code for v482 2023-08-23 22:10:54 +00:00
Stripe OpenAPI
84bf38a606 Merge upstream and update generated code for v481 2023-08-23 18:24:13 +00:00
stripe-openapi[bot]
882c2a8c36
Merge pull request #1259 from stripe/latest-codegen-beta
Update generated code for beta
2023-08-17 18:59:08 +00:00
Annie Li
f7d4abdb5f Merge remote-tracking branch 'origin/master' into latest-codegen-beta 2023-08-17 11:58:07 -07:00
Stripe OpenAPI
8977ca553f Update generated code for v461 2023-08-14 16:09:22 +00:00
Stripe OpenAPI
e8f09f4001 Merge upstream and update generated code for v460 2023-08-11 22:19:30 +00:00
Richard Marmorstein
4430246744 Bump version to 8.8.0-beta.1 2023-08-10 17:40:26 -07:00
stripe-openapi[bot]
e9b70ffd51
Merge pull request #1257 from stripe/latest-codegen-beta
Update generated code for beta
2023-08-10 17:35:11 -07:00
Stripe OpenAPI
b578ab2eb3 Update generated code for v457 2023-08-10 17:03:18 +00:00
Stripe OpenAPI
79dee2ae96 Merge upstream and update generated code for v451 2023-08-07 17:18:39 +00:00
Annie Li
e0cfc89447 Bump version to 8.7.0-beta.3 2023-08-03 13:52:18 -07:00
stripe-openapi[bot]
37b1db8140
Merge pull request #1254 from stripe/latest-codegen-beta
Update generated code for beta
2023-08-03 13:02:00 -07:00
Stripe OpenAPI
ce925ab7a4 Merge upstream and update generated code for v442 2023-08-02 21:56:11 +00:00
pakrym-stripe
d604af0247
Remove developer_message support (#1252) 2023-07-28 15:03:44 -07:00
Pavel Krymets
078adfcc37 Bump version to 8.7.0-beta.2 2023-07-28 10:19:03 -07:00
stripe-openapi[bot]
e6ff2138c6
Update generated code for beta (#1251)
* Update generated code for v428

* Update generated code for v431

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-07-25 15:15:26 -07:00
stripe-openapi[bot]
5609c6ce72
Merge pull request #1249 from stripe/latest-codegen-beta
Update generated code for beta
2023-07-24 10:32:32 -07:00
Stripe OpenAPI
2227067f71 Merge upstream and update generated code for v426 2023-07-21 17:06:45 +00:00
Stripe OpenAPI
4981cc844d Merge upstream and update generated code for v426 2023-07-21 15:32:50 +00:00
stripe-openapi[bot]
7e2a036dc5
Update generated code for beta (#1246)
* Update generated code for v417

* Update generated code for v423

* Update generated code for v424

* Update generated code for v425

---------

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-07-20 17:20:40 +00:00
Annie Li
900ecf2db9 Bump version to 8.7.0-beta.1 2023-07-13 15:55:59 -07:00
stripe-openapi[bot]
8d5a5ef183
Merge pull request #1245 from stripe/latest-codegen-beta
Update generated code for beta
2023-07-13 15:49:45 -07:00
Stripe OpenAPI
5bf957f53e Merge upstream and update generated code for v417 2023-07-13 22:43:42 +00:00
stripe-openapi[bot]
0e5e7b8647
Merge pull request #1243 from stripe/latest-codegen-beta
Update generated code for beta
2023-07-13 15:28:12 -07:00
Stripe OpenAPI
a334cb5fb4 Update generated code for v417 2023-07-13 19:22:31 +00:00
Stripe OpenAPI
801b65759e Update generated code for v417 2023-07-13 16:04:47 +00:00
Stripe OpenAPI
3d772067d1 Update generated code for v415 2023-07-12 14:00:16 +00:00
Stripe OpenAPI
6db03363ff Merge upstream and update generated code for v411 2023-07-11 01:14:27 +00:00
stripe-openapi[bot]
1af83889bb
Merge pull request #1239 from stripe/latest-codegen-beta
Update generated code for beta
2023-07-06 15:03:45 -07:00
Stripe OpenAPI
e6b3043f66 Update generated code for v406 2023-06-29 23:53:03 +00:00
Stripe OpenAPI
e74bd2e7f7 Update generated code for v405 2023-06-29 22:03:52 +00:00
Stripe OpenAPI
bc924840dd Update generated code for v396 2023-06-27 02:44:54 +00:00
Stripe OpenAPI
456f10ab93 Merge upstream and update generated code for v394 2023-06-23 21:47:05 +00:00
Annie Li
96b7453ee9 Bump version to 8.6.0-beta.6 2023-06-22 13:52:23 -07:00
stripe-openapi[bot]
c0310bc4a7
Merge pull request #1237 from stripe/latest-codegen-beta
Update generated code for beta
2023-06-22 12:49:59 -07:00
Stripe OpenAPI
a2806aca65 Update generated code for v392 2023-06-21 18:00:44 +00:00
Stripe OpenAPI
2f7ede30d1 Merge upstream and update generated code for v391 2023-06-21 15:19:36 +00:00
pakrym-stripe
4eae12c528
Merge pull request #1233 from stripe/latest-codegen-beta
Update generated code for beta
2023-06-15 12:55:50 -07:00
Stripe OpenAPI
24801210b9 Update generated code for v387 2023-06-14 22:34:36 +00:00
Stripe OpenAPI
88ef71cf32 Merge upstream and update generated code for v385 2023-06-14 04:30:49 +00:00
stripe-openapi[bot]
50c64e6c06
Update generated code for beta (#1229)
* Update generated code for v376

* Update generated code for v377

* Update generated code (#1226)

* Update generated code for v358

* Update generated code for v376

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

* Update generated code for v379

* Update generated code for v380

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-06-13 13:53:14 -07:00
Annie Li
91015aa41c Bump version to 8.6.0-beta.5 2023-06-01 15:58:18 -07:00
stripe-openapi[bot]
17619449ed
Merge pull request #1227 from stripe/latest-codegen-beta
Update generated code for beta
2023-06-01 22:17:48 +00:00
anniel-stripe
a22bc332ad
Merge branch 'beta' into latest-codegen-beta 2023-06-01 15:17:01 -07:00
Richard Marmorstein
a5519a6a57
Update README.md 2023-05-31 13:41:27 -07:00
Richard Marmorstein
90a2a55687
Merge pull request #1228 from stripe/richardm-raw-request-readme
Document raw_request
2023-05-31 13:26:59 -07:00
Richard Marmorstein
6e2e8c757d
Update README.md 2023-05-31 13:26:20 -07:00
Richard Marmorstein
c7a26629e6
Update README.md
Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com>
2023-05-31 13:25:59 -07:00
Richard Marmorstein
62c0f898c3
Document raw_request 2023-05-31 13:18:45 -07:00
Stripe OpenAPI
cd0e601188 Update generated code for v361 2023-05-26 18:35:29 +00:00
Stripe OpenAPI
43f6318ebd Merge upstream and update generated code for v358 2023-05-25 18:15:55 +00:00
stripe-openapi[bot]
150be92efc
Update generated code for beta (#1222)
* Update generated code for v352

* Update generated code for v353

* Downgrade jaro_winkler (#1225)

* Update generated code for v353 (#1223)

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>

---------

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-05-25 18:06:42 +00:00
pakrym-stripe
99dbffb9c6
Handle developer message in preview error responses (#1224) 2023-05-23 10:50:01 -07:00
Pavel Krymets
a77bbab966 Bump version to 8.6.0-beta.4 2023-05-19 10:18:57 -07:00
stripe-openapi[bot]
4d5a2aab6e
Merge pull request #1220 from stripe/latest-codegen-beta
Update generated code for beta
2023-05-19 09:52:29 -07:00
Stripe OpenAPI
7356579799 Merge upstream and update generated code for v351 2023-05-19 16:14:19 +00:00
pakrym-stripe
23cbd8fc82
Add raw_request (#1217) 2023-05-18 15:58:12 -07:00
stripe-openapi[bot]
adc0ccf8e7
Update generated code for v309 (#1216)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-04-27 09:40:10 -07:00
stripe-openapi[bot]
d9118a7dfe
Update generated code for v305 (#1214)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-04-20 11:02:17 -07:00
Annie Li
f33553bef2 Bump version to 8.6.0-beta.3 2023-04-17 14:37:02 -07:00
stripe-openapi[bot]
1d1d8a90f0
Merge pull request #1211 from stripe/latest-codegen-beta
Update generated code for beta
2023-04-17 14:34:14 -07:00
anniel-stripe
943dd4b020
Merge branch 'beta' into latest-codegen-beta 2023-04-17 11:25:12 -07:00
anniel-stripe
6366593ed5
type check sign_lambda, more tests (#1213) 2023-04-17 10:53:31 -07:00
anniel-stripe
8cdb85cb36
Accept sign as lambda function (#1212)
* Accept signing method as lambda

* trigger CI

* sign_lambda
2023-04-14 14:56:10 -07:00
anniel-stripe
9990e2b8b1
Request signing beta (#1210)
* wip

* don't check api_key type if auth_token exists

* More comments / readability

* signing header tests

* wrap lines

* Use authenticator

* fix test

* lint

* more polish

* raise error if signature calculation fails

* raise error if sign not implemented

* feedback
2023-04-14 12:23:02 -07:00
Stripe OpenAPI
d600f2e9a1 Merge upstream and update generated code for v299 2023-04-13 20:28:48 +00:00
Pavel Krymets
c3cc36ed12 Bump version to 8.6.0-beta.2 2023-04-13 08:59:53 -07:00
stripe-openapi[bot]
00077b44d8
Update generated code for beta (#1206)
* Update generated code for v296

* Update generated code for v296

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-04-13 08:29:55 -07:00
Richard Marmorstein
2c06e9c83e
Merge pull request #1205 from stripe/latest-codegen-beta
Update generated code for beta
2023-04-06 15:31:58 -07:00
Stripe OpenAPI
4b74f4c93f Merge upstream and update generated code for v294 2023-04-06 20:34:56 +00:00
Stripe OpenAPI
e3f0da227f Update generated code for v292 2023-04-03 16:57:50 +00:00
Stripe OpenAPI
3ac330785f Update generated code for v291 2023-04-03 15:23:53 +00:00
Annie Li
0075550ff8 Bump version to 8.6.0-beta.1 2023-03-30 15:39:50 -07:00
anniel-stripe
890cdae767
Merge pull request #1202 from stripe/latest-codegen-beta
* 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>

* Update generated code for v277 (#1198)

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

* Bump version to 8.4.0

* Update save deprecation message (#1201)

* Update save deprecation message

* comma

* Update generated code for v285

* Update generated code for v285 (#1203)

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>

* Bump version to 8.5.0

---------

Co-authored-by: stripe-openapi[bot] <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: Pavel Krymets <pakrym@stripe.com>
Co-authored-by: anniel-stripe <97691964+anniel-stripe@users.noreply.github.com>
Co-authored-by: Annie Li <anniel@stripe.com>
2023-03-30 15:37:55 -07:00
Stripe OpenAPI
732a1467b5 Merge upstream and update generated code for v287 2023-03-30 22:34:24 +00:00
Stripe OpenAPI
d39dcb4a81 Update generated code for v285 2023-03-30 06:58:38 +00:00
Stripe OpenAPI
fb655489eb Merge upstream and update generated code for v283 2023-03-29 19:32:07 +00:00
Pavel Krymets
4143d3930d Bump version to 8.5.0-beta.1 2023-03-23 16:04:57 -07:00
stripe-openapi[bot]
23bc1b1f3b
Update generated code for beta (new) (#1194)
* Update generated code for v268

* Update generated code for v268

* Update generated code for v276

* Update generated code for v277

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-03-23 14:58:46 -07:00
stripe-openapi[bot]
fe73975f07
Update generated code for v266 (#1191) 2023-03-17 14:18:21 -07:00
pakrym-stripe
24f8480c71
Merge pull request #1192 from stripe/merge-master-into-beta
Merge master into beta
2023-03-17 13:58:57 -07:00
Pavel Krymets
9d8ca624e3 Merge branch 'master' into beta 2023-03-17 13:52:54 -07:00
Richard Marmorstein
105506a7fd Bump version to 8.4.0-beta.4 2023-03-16 19:40:09 -07:00
Richard Marmorstein
75b29c3484
Merge pull request #1189 from stripe/latest-codegen-beta
Update generated code for beta (new)
2023-03-16 18:56:48 -07:00
Stripe OpenAPI
a6614ee701 Update generated code for v262 2023-03-16 20:08:19 +00:00
Stripe OpenAPI
33544c7c25 Update generated code for v260 2023-03-15 21:20:26 +00:00
stripe-openapi[bot]
8f210e251a
Update generated code for v258 (#1188)
Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
2023-03-15 16:05:31 +00:00
pakrym-stripe
3b31fb29a6
Merge pull request #1187 from stripe/merge-upstream-master
Merge upstream master
2023-03-15 09:02:18 -07:00
Pavel Krymets
4519e8fa19 Merge branch 'master' into beta 2023-03-15 08:41:42 -07:00
Annie Li
f471a2c6a4 Bump version to 8.4.0-beta.3 2023-03-09 13:02:58 -08:00
anniel-stripe
1e3428e87d
Merge pull request #1184 from stripe/latest-codegen-beta
API Updates for beta branch
2023-03-09 12:50:40 -08:00
Annie Li
7233155b42 Codegen for openapi v249 2023-03-09 12:02:08 -08:00
Annie Li
cbfe81107a Reset version to 8.4.0-beta.2 2023-03-09 12:01:54 -08:00
Annie Li
0b6cffde22 Set version to 8.3.0 to simplify merge 2023-03-09 12:01:53 -08:00
Pavel Krymets
1be10ae4fc Bump version to 8.4.0-beta.2 2023-03-03 06:34:37 -08:00
pakrym-stripe
167daeaf62
Merge pull request #1183 from stripe/latest-codegen-beta
API Updates for beta branch
2023-03-03 06:33:06 -08:00
Pavel Krymets
080fddce5a Codegen for openapi v237 2023-03-02 15:50:55 -08:00
Pavel Krymets
466824d0af Reset version to 8.4.0-beta.1 2023-03-02 15:50:39 -08:00
Pavel Krymets
945e691968 Set version to 8.3.0 to simplify merge 2023-03-02 15:50:39 -08:00
Richard Marmorstein
f8a9a287ab Bump version to 8.4.0-beta.1 2023-02-23 17:32:43 -08:00
Richard Marmorstein
92083a8615
Merge pull request #1182 from stripe/latest-codegen-beta
API Updates for beta branch
2023-02-23 17:22:01 -08:00
Richard Marmorstein
705078e2cf Reset version to 8.3.0-beta.1 2023-02-23 17:08:24 -08:00
Richard Marmorstein
29d8261b17 Include latest changes from the master branch 2023-02-23 17:08:24 -08:00
Richard Marmorstein
3958d6a9df Set version to 8.3.0 to simplify merge 2023-02-23 17:08:24 -08:00
Richard Marmorstein
696be38196 Bump version to 8.3.0-beta.1 2023-02-02 17:52:41 -06:00
Richard Marmorstein
ff853fda95
Merge pull request #1174 from stripe/latest-codegen-beta
API Updates for beta branch
2023-02-02 15:50:52 -08:00
Richard Marmorstein
d10398a825 Codegen for openapi v223 2023-02-02 15:06:51 -06:00
Richard Marmorstein
6f70bd8696 Reset version to 8.2.0-beta.3 2023-02-02 15:06:37 -06:00
Richard Marmorstein
1d21c60802 Include latest changes from the master branch 2023-02-02 15:06:37 -06:00
Richard Marmorstein
b9c10b9c2f Set version to 8.2.0 to simplify merge 2023-02-02 15:06:37 -06:00
Annie Li
446ffc7a22 Bump version to 8.2.0-beta.3 2023-01-26 16:15:28 -08:00
anniel-stripe
58db6d32ef
Merge pull request #1172 from stripe/latest-codegen-beta
API Updates for beta branch
2023-01-26 16:13:01 -08:00
Annie Li
9a4dfdcb2f Codegen for openapi v221 2023-01-26 10:51:25 -08:00
Annie Li
50bbc0df17 Reset version to 8.2.0-beta.2 2023-01-26 10:51:08 -08:00
Annie Li
8226f0ad99 Include latest changes from the master branch 2023-01-26 10:51:08 -08:00
Annie Li
43fa8f5af7 Set version to 8.1.0 to simplify merge 2023-01-26 10:51:08 -08:00
Pavel Krymets
0e61789557 Bump version to 8.2.0-beta.2 2023-01-19 14:35:39 -08:00
pakrym-stripe
cfe69c131e
Merge pull request #1170 from stripe/latest-codegen-beta
API Updates for beta branch
2023-01-19 14:30:44 -08:00
Pavel Krymets
7bf9cace9e Codegen for openapi v219 2023-01-19 12:27:31 -08:00
Pavel Krymets
d7eac6010d Reset version to 8.2.0-beta.1 2023-01-19 12:27:16 -08:00
Pavel Krymets
7d91cb83d9 Include latest changes from the master branch 2023-01-19 12:27:16 -08:00
Pavel Krymets
ce4946f5d8 Set version to 8.1.0 to simplify merge 2023-01-19 12:27:16 -08:00
Richard Marmorstein
15415fcbf3 Bump version to 8.2.0-beta.1 2023-01-12 13:41:17 -06:00
Richard Marmorstein
f8acdb5f6a
Merge pull request #1167 from stripe/latest-codegen-beta
API Updates for beta branch
2023-01-12 10:56:35 -08:00
Richard Marmorstein
fe794f4868 Codegen for openapi v218 2023-01-12 11:27:18 -06:00
Richard Marmorstein
2b841bc109 Reset version to 8.1.0-beta.4 2023-01-12 11:27:02 -06:00
Richard Marmorstein
1835883848 Include latest changes from the master branch 2023-01-12 11:27:02 -06:00
Richard Marmorstein
e11400adc8 Set version to 8.1.0 to simplify merge 2023-01-12 11:27:02 -06:00
Annie Li
5ea85d0867 Bump version to 8.1.0-beta.4 2023-01-05 15:03:20 -08:00
anniel-stripe
600b1965f6
Merge pull request #1164 from stripe/latest-codegen-beta
API Updates for beta branch
2023-01-05 14:46:10 -08:00
Annie Li
5fdd180667 Codegen for openapi v217 2023-01-05 11:43:34 -08:00
Annie Li
97e24e9e57 Reset version to 8.1.0-beta.3 2023-01-05 11:43:18 -08:00
Annie Li
9531f57236 Set version to 8.0.0 to simplify merge 2023-01-05 11:43:18 -08:00
Richard Marmorstein
094574d2fe Bump version to 8.1.0-beta.3 2022-12-22 17:29:09 -06:00
Richard Marmorstein
cff25d0c8b
API Updates for beta branch (#1158)
* Set version to 8.0.0 to simplify merge

* Reset version to 8.1.0-beta.2

* Codegen for openapi v216
2022-12-22 13:25:13 -08:00
Annie Li
0795c1d3d0 Bump version to 8.1.0-beta.2 2022-12-15 16:05:43 -08:00
anniel-stripe
802a1a7aa6
Merge pull request #1156 from stripe/latest-codegen-beta
API Updates for beta branch
2022-12-15 15:51:48 -08:00
Annie Li
13b0bca995 Codegen for openapi v215 2022-12-15 15:42:16 -08:00
Annie Li
51d364c844 Reset version to 8.1.0-beta.1 2022-12-15 15:41:58 -08:00
Annie Li
f4c6f2b304 Set version to 8.0.0 to simplify merge 2022-12-15 15:41:58 -08:00
anniel-stripe
b64fe42043
API Updates for beta branch (#1155)
* Set version to 8.0.0 to simplify merge

* Reset version to 8.1.0-beta.1

* Codegen for openapi v214
2022-12-15 14:53:06 -08:00
Pavel Krymets
586e685e63 Bump version to 8.1.0-beta.1 2022-12-08 14:55:41 -08:00
pakrym-stripe
3b5c725539
Merge pull request #1153 from stripe/latest-codegen-beta
API Updates for beta branch
2022-12-08 12:18:01 -08:00
Pavel Krymets
ea91a6f0b9 Codegen for openapi v212 2022-12-08 12:08:39 -08:00
Pavel Krymets
21f31edff4 Reset version to 7.2.0-beta.5 2022-12-08 12:08:24 -08:00
Pavel Krymets
a11f1ffd2a Include latest changes from the master branch 2022-12-08 12:08:24 -08:00
Pavel Krymets
4bd92239d5 Set version to 8.0.0 to simplify merge 2022-12-08 12:08:24 -08:00
anniel-stripe
c261f6bbb6
Merge pull request #1146 from stripe/latest-codegen-beta
API Updates for beta branch
2022-11-10 14:49:10 -08:00
Annie Li
f45fc7d703 Reset version to 7.2.0-beta.5 2022-11-10 12:10:48 -08:00
Annie Li
5cd522c007 Include latest changes from the master branch 2022-11-10 12:10:48 -08:00
Annie Li
e6bda8356d Set version to 7.1.0 to simplify merge 2022-11-10 12:10:48 -08:00
Kamil Pajdzik
2354633a92 Bump version to 7.2.0-beta.5 2022-11-02 13:07:25 -07:00
Kamil Pajdzik
549a73544f
Merge pull request #1139 from stripe/latest-codegen-beta
API Updates for beta branch
2022-11-02 08:58:59 -07:00
Kamil Pajdzik
25833c1408 Codegen for openapi v205 2022-11-01 16:18:04 -07:00
Kamil Pajdzik
a59b57c3d1 Reset version to 7.2.0-beta.4 2022-11-01 16:17:47 -07:00
Kamil Pajdzik
63d447df77 Include latest changes from the master branch 2022-11-01 16:17:47 -07:00
Kamil Pajdzik
5cd6f9f9bc Set version to 7.1.0 to simplify merge 2022-11-01 16:17:47 -07:00
Richard Marmorstein
ffa3747bdf
Merge pull request #1135 from stripe/latest-codegen-beta
API Updates for beta branch
2022-10-14 10:43:19 -07:00
Richard Marmorstein
ddf79610d9 Fix formatting 2022-10-14 10:26:51 -07:00
Richard Marmorstein
edad946244 Codegen for openapi v202 2022-10-14 10:08:49 -07:00
Richard Marmorstein
e3785d5893 Reset version to 7.2.0-beta.4 2022-10-14 10:08:42 -07:00
Richard Marmorstein
2062e988eb Set version to 7.1.0 to simplify merge 2022-10-14 10:08:42 -07:00
Kamil Pajdzik
0bdc688516 Bump version to 7.2.0-beta.4 2022-10-07 08:48:11 -07:00
Pavel Krymets
82ac9f2720 Bump version to 7.2.0-beta.3 2022-09-26 16:32:21 -07:00
pakrym-stripe
7381eb02a6
Merge pull request #1129 from stripe/latest-codegen-beta
API Updates for beta branch
2022-09-26 13:35:10 -07:00
Pavel Krymets
6720fc8d3f Codegen for openapi v196 2022-09-26 12:26:38 -07:00
Pavel Krymets
35a29332c5 Reset version to 7.2.0-beta.2 2022-09-26 12:26:08 -07:00
Pavel Krymets
519d68ce10 Include latest changes from the master branch 2022-09-26 12:26:08 -07:00
Pavel Krymets
b95ea4ba27 Set version to 7.1.0 to simplify merge 2022-09-26 12:26:07 -07:00
Dominic Charley-Roy
318e244a76 Bump version to 7.2.0-beta.2 2022-08-26 11:16:19 -04:00
Dominic Charley-Roy
bb1c995e93
API Updates for beta branch (#1127) 2022-08-25 10:02:19 -04:00
Pavel Krymets
0f12721697 Bump version to 7.2.0-beta.1 2022-08-23 11:57:55 -07:00
pakrym-stripe
671163245a
Merge pull request #1122 from stripe/latest-codegen-beta
API Updates for beta branch
2022-08-23 10:25:10 -07:00
Pavel Krymets
486bee15a8 Codegen for openapi v184 2022-08-23 05:35:55 -07:00
Pavel Krymets
fdf5be66f5 Reset version to 7.1.0-beta.2 2022-08-23 05:35:23 -07:00
Pavel Krymets
c732841fd3 Include latest changes from the master branch 2022-08-23 05:35:23 -07:00
Pavel Krymets
22db70b479 Set version to 7.1.0 to simplify merge 2022-08-23 05:35:23 -07:00
Pavel Krymets
2db4fd9d06 Bump version to 7.1.0-beta.2 2022-08-11 15:42:00 -07:00
pakrym-stripe
6797f906e1
Merge pull request #1113 from stripe/latest-codegen-beta
API Updates for beta branch
2022-08-11 15:39:47 -07:00
Pavel Krymets
59f2d4d0fe suppress linting error 2022-08-11 15:03:49 -07:00
Pavel Krymets
0d1b570bfa Codegen for openapi v178 2022-08-11 14:50:55 -07:00
Pavel Krymets
d7d3c1b425 Reset version to 7.1.0-beta.1 2022-08-11 14:50:25 -07:00
Pavel Krymets
7df619de69 Set version to 7.0.0 to simplify merge 2022-08-11 14:50:24 -07:00
Pavel Krymets
f649ed3824 Bump version to 7.1.0-beta.1 2022-08-03 14:04:17 -07:00
pakrym-stripe
32a95902cc
Merge pull request #1107 from stripe/latest-codegen-beta
API Updates for beta branch
2022-08-03 13:49:41 -07:00
Pavel Krymets
bdcfe6cc33 Codegen for openapi v175 2022-08-02 13:42:48 -07:00
Pavel Krymets
5e1c4a2302 Reset version to 6.6.0-beta.1 2022-08-02 13:42:16 -07:00
Pavel Krymets
54a073783f Include latest changes from the master branch 2022-08-02 13:42:16 -07:00
Pavel Krymets
e6a07ae658 Set version to 7.0.0 to simplify merge 2022-08-02 13:42:16 -07:00
Dominic Charley-Roy
588ed3b5e7 Bump version to 6.6.0-beta.1 2022-07-22 14:01:30 -04:00
Dominic Charley-Roy
de33cde125
API Updates for beta branch (#1100) 2022-07-21 17:35:24 -04:00
pakrym-stripe
d849ec3b14
Merge pull request #1097 from stripe/latest-codegen-beta
API Updates for beta branch
2022-07-19 16:32:55 -07:00
Pavel Krymets
8b5f78aa6a Codegen for openapi v166 2022-07-19 14:35:01 -07:00
Pavel Krymets
7f6ba1c35c Reset version to 6.4.0 2022-07-19 14:34:31 -07:00
Pavel Krymets
e55a2559ae Set version to 6.5.0 to simplify merge 2022-07-19 14:34:31 -07:00
pakrym-stripe
0b00266be1
Merge pull request #1093 from stripe/latest-codegen-beta
API Updates for beta branch
2022-07-07 12:07:07 -07:00
Pavel Krymets
d0cd4fbaa6 Codegen for openapi v163 2022-07-07 11:05:19 -07:00
Pavel Krymets
979da6f84b Reset version to 6.4.0 2022-07-07 11:04:51 -07:00
Pavel Krymets
d95c518a3c Include latest changes from the master branch 2022-07-07 11:04:51 -07:00
Pavel Krymets
83c773f61e Set version to 6.5.0 to simplify merge 2022-07-07 11:04:51 -07:00
pakrym-stripe
d9f719ba01
API Updates for beta branch (#1085)
* fix: Update logging to coerce ASCII-8BIT into UTF-8. (#1076)

* Add release/* and feature/* to PR CI triggers (#1080)

* Add next-major-release to PR CI triggers

* Update branch names

* Rename release to sdk-release in CI triggers

* API Updates (#1084)

* Bump version to 6.5.0

* Set version to 6.5.0 to simplify merge

* Reset version to 6.4.0

Co-authored-by: Dominic Charley-Roy <78050200+dcr-stripe@users.noreply.github.com>
Co-authored-by: Kamil Pajdzik <99290280+kamil-stripe@users.noreply.github.com>
Co-authored-by: Dominic Charley-Roy <dcr@stripe.com>
2022-06-30 13:12:17 -07:00
pakrym-stripe
73d10e8557
Use the generated API version (#1075) 2022-06-21 13:42:58 -07:00
45 changed files with 3051 additions and 688 deletions

View File

@ -38,6 +38,10 @@ Metrics/MethodLength:
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
# There's 2 methods in `StripeClient` that have long parameter lists.
Max: 8
Style/AccessModifierDeclarations:
EnforcedStyle: inline

View File

@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2023-11-28 01:02:03 UTC using RuboCop version 1.57.2.
# on 2023-11-29 18:39:02 UTC using RuboCop version 1.57.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
@ -11,15 +11,15 @@ Lint/HashCompareByIdentity:
Exclude:
- 'lib/stripe/stripe_client.rb'
# Offense count: 26
# Offense count: 27
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 50
Max: 55
# Offense count: 9
# Offense count: 10
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 592
Max: 618
# Offense count: 12
# Configuration parameters: AllowedMethods, AllowedPatterns.
@ -27,14 +27,9 @@ Metrics/CyclomaticComplexity:
Max: 12
# Offense count: 9
# Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
Metrics/ParameterLists:
Max: 7
# Offense count: 8
# Configuration parameters: AllowedMethods, AllowedPatterns.
Metrics/PerceivedComplexity:
Max: 12
Max: 13
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
@ -49,7 +44,7 @@ Style/CombinableLoops:
Exclude:
- 'lib/stripe/stripe_client.rb'
# Offense count: 39
# Offense count: 44
# Configuration parameters: AllowedConstants.
Style/Documentation:
Enabled: false

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
v1011
v1055

View File

@ -339,6 +339,17 @@ If your beta feature requires a `Stripe-Version` header to be sent, set the `Str
Stripe.add_beta_version("feature_beta", "v3")
```
### Custom requests
If you would like to send a request to an undocumented API (for example you are in a private beta), or if you prefer to bypass the method definitions in the library and specify your request details directly, you can use the `raw_request` method on `Stripe`.
```ruby
resp = Stripe.raw_request(:post, "/v1/beta_endpoint", {param: 123}, {stripe_version: "2022-11-15; feature_beta=v3"})
# (Optional) resp is a StripeResponse. You can use `Stripe.deserialize` to get a StripeObject.
deserialized_resp = Stripe.deserialize(resp.http_body)
```
## Support
New features and bug fixes are released on the latest major version of the Stripe Ruby library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates.

View File

@ -1 +1 @@
11.5.0
11.7.0-beta.1

View File

@ -13,6 +13,7 @@ require "set"
require "socket"
require "uri"
require "forwardable"
require "base64"
# Version
require "stripe/api_version"
@ -45,6 +46,7 @@ require "stripe/api_resource_test_helpers"
require "stripe/singleton_api_resource"
require "stripe/webhook"
require "stripe/stripe_configuration"
require "stripe/request_signing_authenticator"
# Named API resources
require "stripe/resources"
@ -71,6 +73,7 @@ module Stripe
# User configurable options
def_delegators :@config, :api_key, :api_key=
def_delegators :@config, :authenticator, :authenticator=
def_delegators :@config, :api_version, :api_version=
def_delegators :@config, :stripe_account, :stripe_account=
def_delegators :@config, :api_base, :api_base=
@ -117,6 +120,57 @@ module Stripe
version: version,
}
end
def self.add_beta_version(beta_name, version)
if api_version.include?("; #{beta_name}=")
raise "Stripe version header #{api_version} already contains entry for beta #{beta_name}"
end
self.api_version = "#{api_version}; #{beta_name}=#{version}"
end
class Preview
def self._get_default_opts(opts)
{ api_mode: :preview }.merge(opts)
end
def self.get(url, opts = {})
Stripe.raw_request(:get, url, {}, _get_default_opts(opts))
end
def self.post(url, params = {}, opts = {})
Stripe.raw_request(:post, url, params, _get_default_opts(opts))
end
def self.delete(url, opts = {})
Stripe.raw_request(:delete, url, {}, _get_default_opts(opts))
end
end
class RawRequest
include Stripe::APIOperations::Request
def initialize
@opts = {}
end
def execute(method, url, params = {}, opts = {}, usage = [])
resp, = execute_resource_request(method, url, params, opts, usage)
resp
end
end
# Sends a request to Stripe REST API
def self.raw_request(method, url, params = {}, opts = {})
req = RawRequest.new
req.execute(method, url, params, opts, ["raw_request"])
end
def self.deserialize(data)
data = JSON.parse(data) if data.is_a?(String)
Util.convert_to_stripe_object(data, {})
end
end
Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?

View File

@ -48,13 +48,14 @@ module Stripe
api_key = headers.delete(:api_key)
api_base = headers.delete(:api_base)
client = headers.delete(:client)
api_mode = headers.delete(:api_mode)
# Assume all remaining opts must be headers
resp, opts[:api_key] = client.send(
client_request_method_sym,
method, url,
api_base: api_base, api_key: api_key,
headers: headers, params: params, usage: usage,
headers: headers, params: params, usage: usage, api_mode: api_mode,
&read_body_chunk_block
)

View File

@ -4,5 +4,6 @@
module Stripe
module ApiVersion
CURRENT = "2024-04-10"
PREVIEW = "2024-04-11.preview-v2"
end
end

View File

@ -15,6 +15,7 @@ module Stripe
# object classes: The beginning of the section generated from our OpenAPI spec
Account.object_name => Account,
AccountLink.object_name => AccountLink,
AccountNotice.object_name => AccountNotice,
AccountSession.object_name => AccountSession,
ApplePayDomain.object_name => ApplePayDomain,
ApplicationFee.object_name => ApplicationFee,
@ -30,6 +31,9 @@ module Stripe
BillingPortal::Configuration.object_name => BillingPortal::Configuration,
BillingPortal::Session.object_name => BillingPortal::Session,
Capability.object_name => Capability,
Capital::FinancingOffer.object_name => Capital::FinancingOffer,
Capital::FinancingSummary.object_name => Capital::FinancingSummary,
Capital::FinancingTransaction.object_name => Capital::FinancingTransaction,
Card.object_name => Card,
CashBalance.object_name => CashBalance,
Charge.object_name => Charge,
@ -56,20 +60,26 @@ module Stripe
File.object_name => File,
FileLink.object_name => FileLink,
FinancialConnections::Account.object_name => FinancialConnections::Account,
FinancialConnections::AccountInferredBalance.object_name =>
FinancialConnections::AccountInferredBalance,
FinancialConnections::AccountOwner.object_name => FinancialConnections::AccountOwner,
FinancialConnections::AccountOwnership.object_name => FinancialConnections::AccountOwnership,
FinancialConnections::Session.object_name => FinancialConnections::Session,
FinancialConnections::Transaction.object_name => FinancialConnections::Transaction,
Forwarding::Request.object_name => Forwarding::Request,
FundingInstructions.object_name => FundingInstructions,
GiftCards::Card.object_name => GiftCards::Card,
GiftCards::Transaction.object_name => GiftCards::Transaction,
Identity::VerificationReport.object_name => Identity::VerificationReport,
Identity::VerificationSession.object_name => Identity::VerificationSession,
Invoice.object_name => Invoice,
InvoiceItem.object_name => InvoiceItem,
InvoiceLineItem.object_name => InvoiceLineItem,
InvoicePayment.object_name => InvoicePayment,
Issuing::Authorization.object_name => Issuing::Authorization,
Issuing::Card.object_name => Issuing::Card,
Issuing::Cardholder.object_name => Issuing::Cardholder,
Issuing::CreditUnderwritingRecord.object_name => Issuing::CreditUnderwritingRecord,
Issuing::Dispute.object_name => Issuing::Dispute,
Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
@ -78,6 +88,8 @@ module Stripe
LineItem.object_name => LineItem,
LoginLink.object_name => LoginLink,
Mandate.object_name => Mandate,
Margin.object_name => Margin,
Order.object_name => Order,
PaymentIntent.object_name => PaymentIntent,
PaymentLink.object_name => PaymentLink,
PaymentMethod.object_name => PaymentMethod,
@ -91,6 +103,9 @@ module Stripe
ProductFeature.object_name => ProductFeature,
PromotionCode.object_name => PromotionCode,
Quote.object_name => Quote,
QuotePhase.object_name => QuotePhase,
QuotePreviewInvoice.object_name => QuotePreviewInvoice,
QuotePreviewSubscriptionSchedule.object_name => QuotePreviewSubscriptionSchedule,
Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
Radar::ValueList.object_name => Radar::ValueList,
Radar::ValueListItem.object_name => Radar::ValueListItem,
@ -110,6 +125,7 @@ module Stripe
SubscriptionSchedule.object_name => SubscriptionSchedule,
Tax::Calculation.object_name => Tax::Calculation,
Tax::CalculationLineItem.object_name => Tax::CalculationLineItem,
Tax::Form.object_name => Tax::Form,
Tax::Registration.object_name => Tax::Registration,
Tax::Settings.object_name => Tax::Settings,
Tax::Transaction.object_name => Tax::Transaction,

View File

@ -0,0 +1,79 @@
# frozen_string_literal: true
module Stripe
class RequestSigningAuthenticator
AUTHORIZATION_HEADER_NAME = "Authorization"
CONTENT_TYPE_HEADER_NAME = "Content-Type"
STRIPE_CONTEXT_HEADER_NAME = "Stripe-Context"
STRIPE_ACCOUNT_HEADER_NAME = "Stripe-Account"
CONTENT_DIGEST_HEADER_NAME = "Content-Digest"
SIGNATURE_INPUT_HEADER_NAME = "Signature-Input"
SIGNATURE_HEADER_NAME = "Signature"
attr_reader :auth_token, :sign_lambda
def initialize(auth_token, sign_lambda)
raise ArgumentError, "auth_token must be a string" unless auth_token.is_a?(String)
raise ArgumentError, "sign_lambda must be a lambda" unless sign_lambda.is_a?(Proc)
@auth_token = auth_token
@sign_lambda = sign_lambda
end
def authenticate(method, headers, body)
covered_headers = [CONTENT_TYPE_HEADER_NAME,
CONTENT_DIGEST_HEADER_NAME,
STRIPE_CONTEXT_HEADER_NAME,
STRIPE_ACCOUNT_HEADER_NAME,
AUTHORIZATION_HEADER_NAME,]
headers[AUTHORIZATION_HEADER_NAME] = "STRIPE-V2-SIG #{auth_token}"
if method == :get
covered_headers -= [CONTENT_TYPE_HEADER_NAME,
CONTENT_DIGEST_HEADER_NAME,]
else
content = body || ""
headers[CONTENT_DIGEST_HEADER_NAME] =
%(sha-256=:#{content_digest(content)}:)
end
covered_headers_formatted = covered_headers
.map { |string| %("#{string.downcase}") }
.join(" ")
signature_input = "(#{covered_headers_formatted});created=#{created_time}"
inputs = covered_headers
.map { |header| %("#{header.downcase}": #{headers[header]}) }
.join("\n")
signature_base = %(#{inputs}\n"@signature-params": #{signature_input})
.encode(Encoding::UTF_8)
headers[SIGNATURE_INPUT_HEADER_NAME] = "sig1=#{signature_input}"
headers[SIGNATURE_HEADER_NAME] =
"sig1=:#{encoded_signature(signature_base)}:"
end
private def sign(signature_base)
@sign_lambda.call(signature_base)
end
private def encoded_signature(signature_base)
Base64.strict_encode64(sign(signature_base))
rescue StandardError
raise AuthenticationError, "Encountered '#{e.message} (#{e.class})' " \
"when calculating request signature."
end
private def content_digest(content)
Base64.strict_encode64(OpenSSL::Digest.new("SHA256").digest(content))
end
private def created_time
Time.now.to_i
end
end
end

View File

@ -3,6 +3,7 @@
require "stripe/resources/account"
require "stripe/resources/account_link"
require "stripe/resources/account_notice"
require "stripe/resources/account_session"
require "stripe/resources/apple_pay_domain"
require "stripe/resources/application_fee"
@ -18,6 +19,9 @@ require "stripe/resources/billing/meter_event_summary"
require "stripe/resources/billing_portal/configuration"
require "stripe/resources/billing_portal/session"
require "stripe/resources/capability"
require "stripe/resources/capital/financing_offer"
require "stripe/resources/capital/financing_summary"
require "stripe/resources/capital/financing_transaction"
require "stripe/resources/card"
require "stripe/resources/cash_balance"
require "stripe/resources/charge"
@ -44,20 +48,25 @@ require "stripe/resources/exchange_rate"
require "stripe/resources/file"
require "stripe/resources/file_link"
require "stripe/resources/financial_connections/account"
require "stripe/resources/financial_connections/account_inferred_balance"
require "stripe/resources/financial_connections/account_owner"
require "stripe/resources/financial_connections/account_ownership"
require "stripe/resources/financial_connections/session"
require "stripe/resources/financial_connections/transaction"
require "stripe/resources/forwarding/request"
require "stripe/resources/funding_instructions"
require "stripe/resources/gift_cards/card"
require "stripe/resources/gift_cards/transaction"
require "stripe/resources/identity/verification_report"
require "stripe/resources/identity/verification_session"
require "stripe/resources/invoice"
require "stripe/resources/invoice_item"
require "stripe/resources/invoice_line_item"
require "stripe/resources/invoice_payment"
require "stripe/resources/issuing/authorization"
require "stripe/resources/issuing/card"
require "stripe/resources/issuing/cardholder"
require "stripe/resources/issuing/credit_underwriting_record"
require "stripe/resources/issuing/dispute"
require "stripe/resources/issuing/personalization_design"
require "stripe/resources/issuing/physical_bundle"
@ -66,6 +75,8 @@ require "stripe/resources/issuing/transaction"
require "stripe/resources/line_item"
require "stripe/resources/login_link"
require "stripe/resources/mandate"
require "stripe/resources/margin"
require "stripe/resources/order"
require "stripe/resources/payment_intent"
require "stripe/resources/payment_link"
require "stripe/resources/payment_method"
@ -79,6 +90,9 @@ require "stripe/resources/product"
require "stripe/resources/product_feature"
require "stripe/resources/promotion_code"
require "stripe/resources/quote"
require "stripe/resources/quote_phase"
require "stripe/resources/quote_preview_invoice"
require "stripe/resources/quote_preview_subscription_schedule"
require "stripe/resources/radar/early_fraud_warning"
require "stripe/resources/radar/value_list"
require "stripe/resources/radar/value_list_item"
@ -98,6 +112,7 @@ require "stripe/resources/subscription_item"
require "stripe/resources/subscription_schedule"
require "stripe/resources/tax/calculation"
require "stripe/resources/tax/calculation_line_item"
require "stripe/resources/tax/form"
require "stripe/resources/tax/registration"
require "stripe/resources/tax/settings"
require "stripe/resources/tax/transaction"

View File

@ -0,0 +1,32 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
# A notice to a Connected account. Notice can be sent by Stripe on your behalf or you can opt to send the notices yourself.
#
# See the [guide to send notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) to your connected accounts.
class AccountNotice < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
OBJECT_NAME = "account_notice"
def self.object_name
"account_notice"
end
# Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
def self.list(filters = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/account_notices", params: filters, opts: opts)
end
# Updates an AccountNotice object.
def self.update(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/account_notices/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
end
end

View File

@ -0,0 +1,49 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Capital
# This is an object representing an offer of financing from
# Stripe Capital to a Connect subaccount.
class FinancingOffer < APIResource
extend Stripe::APIOperations::List
OBJECT_NAME = "capital.financing_offer"
def self.object_name
"capital.financing_offer"
end
# Retrieves the financing offers available for Connected accounts that belong to your platform.
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/capital/financing_offers",
params: filters,
opts: opts
)
end
# Acknowledges that platform has received and delivered the financing_offer to
# the intended merchant recipient.
def mark_delivered(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Acknowledges that platform has received and delivered the financing_offer to
# the intended merchant recipient.
def self.mark_delivered(financing_offer, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/capital/financing_offers/%<financing_offer>s/mark_delivered", { financing_offer: CGI.escape(financing_offer) }),
params: params,
opts: opts
)
end
end
end
end

View File

@ -0,0 +1,15 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Capital
# A financing object describes an account's current financing state. Used by Connect
# platforms to read the state of Capital offered to their connected accounts.
class FinancingSummary < SingletonAPIResource
OBJECT_NAME = "capital.financing_summary"
def self.object_name
"capital.financing_summary"
end
end
end
end

View File

@ -0,0 +1,27 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Capital
# This is an object representing the details of a transaction on a Capital financing object.
class FinancingTransaction < APIResource
extend Stripe::APIOperations::List
OBJECT_NAME = "capital.financing_transaction"
def self.object_name
"capital.financing_transaction"
end
# Returns a list of financing transactions. The transactions are returned in sorted order,
# with the most recent transactions appearing first.
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/capital/financing_transactions",
params: filters,
opts: opts
)
end
end
end
end

View File

@ -6,12 +6,15 @@ module Stripe
# A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
class Account < APIResource
extend Stripe::APIOperations::List
extend Stripe::APIOperations::NestedResource
OBJECT_NAME = "financial_connections.account"
def self.object_name
"financial_connections.account"
end
nested_resource_class_methods :inferred_balance, operations: %i[list]
# Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).
def disconnect(params = {}, opts = {})
request_stripe_object(

View File

@ -0,0 +1,14 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module FinancialConnections
# A historical balance for the account on a particular day. It may be sourced from a balance snapshot provided by a financial institution, or inferred using transactions data.
class AccountInferredBalance < APIResource
OBJECT_NAME = "financial_connections.account_inferred_balance"
def self.object_name
"financial_connections.account_inferred_balance"
end
end
end
end

View File

@ -0,0 +1,59 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module GiftCards
# A gift card represents a single gift card owned by a customer, including the
# remaining balance, gift card code, and whether or not it is active.
class Card < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
OBJECT_NAME = "gift_cards.card"
def self.object_name
"gift_cards.card"
end
# Creates a new gift card object.
def self.create(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/gift_cards/cards",
params: params,
opts: opts
)
end
# List gift cards for an account
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/gift_cards/cards",
params: filters,
opts: opts
)
end
# Update a gift card
def self.update(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/gift_cards/cards/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Validates a gift card code, returning the matching gift card object if it exists.
def self.validate(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/gift_cards/cards/validate",
params: params,
opts: opts
)
end
end
end
end

View File

@ -0,0 +1,93 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module GiftCards
# A gift card transaction represents a single transaction on a referenced gift card.
# A transaction is in one of three states, `confirmed`, `held` or `canceled`. A `confirmed`
# transaction is one that has added/deducted funds. A `held` transaction has created a
# temporary hold on funds, which can then be cancelled or confirmed. A `held` transaction
# can be confirmed into a `confirmed` transaction, or canceled into a `canceled` transaction.
# A `canceled` transaction has no effect on a gift card's balance.
class Transaction < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
OBJECT_NAME = "gift_cards.transaction"
def self.object_name
"gift_cards.transaction"
end
# Cancel a gift card transaction
def cancel(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/gift_cards/transactions/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Cancel a gift card transaction
def self.cancel(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/gift_cards/transactions/%<id>s/cancel", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Confirm a gift card transaction
def confirm(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/gift_cards/transactions/%<id>s/confirm", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Confirm a gift card transaction
def self.confirm(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/gift_cards/transactions/%<id>s/confirm", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Create a gift card transaction
def self.create(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/gift_cards/transactions",
params: params,
opts: opts
)
end
# List gift card transactions for a gift card
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/gift_cards/transactions",
params: filters,
opts: opts
)
end
# Update a gift card transaction
def self.update(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/gift_cards/transactions/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
end
end
end

View File

@ -48,6 +48,63 @@ module Stripe
end
nested_resource_class_methods :line, operations: %i[list]
nested_resource_class_methods :payment, operations: %i[retrieve list]
# Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
def add_lines(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Adds multiple line items to an invoice. This is only possible when an invoice is still a draft.
def self.add_lines(invoice, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/add_lines", { invoice: CGI.escape(invoice) }),
params: params,
opts: opts
)
end
# Attaches a PaymentIntent to the invoice, adding it to the list of payments.
# When the PaymentIntent's status changes to succeeded, the payment is credited
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
# invoice's status becomes paid.
#
# If the PaymentIntent's status is already succeeded when it is attached, it is
# credited to the invoice immediately.
#
# Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
def attach_payment_intent(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Attaches a PaymentIntent to the invoice, adding it to the list of payments.
# When the PaymentIntent's status changes to succeeded, the payment is credited
# to the invoice, increasing its amount_paid. When the invoice is fully paid, the
# invoice's status becomes paid.
#
# If the PaymentIntent's status is already succeeded when it is attached, it is
# credited to the invoice immediately.
#
# Related guide: [Create an invoice payment](https://stripe.com/docs/invoicing/payments/create)
def self.attach_payment_intent(invoice, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/attach_payment_intent", { invoice: CGI.escape(invoice) }),
params: params,
opts: opts
)
end
# This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or <a href="#send_invoice">send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers.
def self.create(params = {}, opts = {})
@ -165,6 +222,26 @@ module Stripe
)
end
# Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
def remove_lines(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Removes multiple line items from an invoice. This is only possible when an invoice is still a draft.
def self.remove_lines(invoice, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/remove_lines", { invoice: CGI.escape(invoice) }),
params: params,
opts: opts
)
end
def self.search(params = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/invoices/search", params: params, opts: opts)
end
@ -223,6 +300,26 @@ module Stripe
)
end
# Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
def update_lines(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Updates multiple line items on an invoice. This is only possible when an invoice is still a draft.
def self.update_lines(invoice, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/invoices/%<invoice>s/update_lines", { invoice: CGI.escape(invoice) }),
params: params,
opts: opts
)
end
# Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found.
#
# Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or <a href="#create_credit_note">credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business.

View File

@ -0,0 +1,12 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
# The invoice payment object
class InvoicePayment < APIResource
OBJECT_NAME = "invoice_payment"
def self.object_name
"invoice_payment"
end
end
end

View File

@ -0,0 +1,88 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Issuing
# Every time an applicant submits an application for a Charge Card product your platform offers, or every time your platform takes a proactive credit decision on an existing account, you must record the decision by creating a new `CreditUnderwritingRecord` object on a connected account.
#
# [Follow the guide](https://stripe.com/docs/issuing/credit/report-credit-decisions-and-manage-aans) to learn about your requirements as a platform.
class CreditUnderwritingRecord < APIResource
extend Stripe::APIOperations::List
OBJECT_NAME = "issuing.credit_underwriting_record"
def self.object_name
"issuing.credit_underwriting_record"
end
# Update a CreditUnderwritingRecord object to correct mistakes.
def correct(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/issuing/credit_underwriting_records/%<credit_underwriting_record>s/correct", { credit_underwriting_record: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Update a CreditUnderwritingRecord object to correct mistakes.
def self.correct(credit_underwriting_record, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/issuing/credit_underwriting_records/%<credit_underwriting_record>s/correct", { credit_underwriting_record: CGI.escape(credit_underwriting_record) }),
params: params,
opts: opts
)
end
# Creates a CreditUnderwritingRecord object with information about a credit application submission.
def self.create_from_application(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/issuing/credit_underwriting_records/create_from_application",
params: params,
opts: opts
)
end
# Creates a CreditUnderwritingRecord object from an underwriting decision coming from a proactive review of an existing accountholder.
def self.create_from_proactive_review(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/issuing/credit_underwriting_records/create_from_proactive_review",
params: params,
opts: opts
)
end
# Retrieves a list of CreditUnderwritingRecord objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first.
def self.list(filters = {}, opts = {})
request_stripe_object(
method: :get,
path: "/v1/issuing/credit_underwriting_records",
params: filters,
opts: opts
)
end
# Update a CreditUnderwritingRecord object from a decision made on a credit application.
def report_decision(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/issuing/credit_underwriting_records/%<credit_underwriting_record>s/report_decision", { credit_underwriting_record: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Update a CreditUnderwritingRecord object from a decision made on a credit application.
def self.report_decision(credit_underwriting_record, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/issuing/credit_underwriting_records/%<credit_underwriting_record>s/report_decision", { credit_underwriting_record: CGI.escape(credit_underwriting_record) }),
params: params,
opts: opts
)
end
end
end
end

View File

@ -0,0 +1,37 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
# A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who
# resell products and services and earn a discount (margin) for doing so.
class Margin < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
OBJECT_NAME = "margin"
def self.object_name
"margin"
end
# Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount.A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item.
def self.create(params = {}, opts = {})
request_stripe_object(method: :post, path: "/v1/billing/margins", params: params, opts: opts)
end
# Retrieve a list of your margins.
def self.list(filters = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/billing/margins", params: filters, opts: opts)
end
# Update the specified margin object. Certain fields of the margin object are not editable.
def self.update(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/billing/margins/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
end
end

View File

@ -0,0 +1,120 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
# An Order describes a purchase being made by a customer, including the
# products & quantities being purchased, the order status, the payment information,
# and the billing/shipping details.
#
# Related guide: [Orders overview](https://stripe.com/docs/orders)
class Order < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save
OBJECT_NAME = "order"
def self.object_name
"order"
end
# Cancels the order as well as the payment intent if one is attached.
def cancel(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/orders/%<id>s/cancel", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Cancels the order as well as the payment intent if one is attached.
def self.cancel(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/orders/%<id>s/cancel", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Creates a new open order object.
def self.create(params = {}, opts = {})
request_stripe_object(method: :post, path: "/v1/orders", params: params, opts: opts)
end
# Returns a list of your orders. The orders are returned sorted by creation date, with the most recently created orders appearing first.
def self.list(filters = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/orders", params: filters, opts: opts)
end
# When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
def list_line_items(params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/orders/%<id>s/line_items", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# When retrieving an order, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
def self.list_line_items(id, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/orders/%<id>s/line_items", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Reopens a submitted order.
def reopen(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/orders/%<id>s/reopen", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Reopens a submitted order.
def self.reopen(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/orders/%<id>s/reopen", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called.
def submit(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/orders/%<id>s/submit", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Submitting an Order transitions the status to processing and creates a PaymentIntent object so the order can be paid. If the Order has an amount_total of 0, no PaymentIntent object will be created. Once the order is submitted, its contents cannot be changed, unless the [reopen](https://stripe.com/docs/api#reopen_order) method is called.
def self.submit(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/orders/%<id>s/submit", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
# Updates the specific order by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
def self.update(id, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/orders/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts
)
end
end
end

View File

@ -176,6 +176,56 @@ module Stripe
request_stripe_object(method: :post, path: "/v1/payment_intents", params: params, opts: opts)
end
# Perform a decremental authorization on an eligible
# [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
# PaymentIntent's status must be requires_capture and
# [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
# must be available.
#
# Decremental authorizations decrease the authorized amount on your customer's card
# to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
#
# After decrement, the PaymentIntent object
# returns with the updated
# [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
# The PaymentIntent will now be capturable up to the new authorized amount.
#
# Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
# After it's fully captured, a PaymentIntent can no longer be decremented.
def decrement_authorization(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Perform a decremental authorization on an eligible
# [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
# PaymentIntent's status must be requires_capture and
# [decremental_authorization.status](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card-decremental_authorization)
# must be available.
#
# Decremental authorizations decrease the authorized amount on your customer's card
# to the new, lower amount provided. A single PaymentIntent can call this endpoint multiple times to further decrease the authorized amount.
#
# After decrement, the PaymentIntent object
# returns with the updated
# [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount).
# The PaymentIntent will now be capturable up to the new authorized amount.
#
# Each PaymentIntent can have a maximum of 10 decremental or incremental authorization attempts, including declines.
# After it's fully captured, a PaymentIntent can no longer be decremented.
def self.decrement_authorization(intent, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/payment_intents/%<intent>s/decrement_authorization", { intent: CGI.escape(intent) }),
params: params,
opts: opts
)
end
# Perform an incremental authorization on an eligible
# [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the
# PaymentIntent's status must be requires_capture and

View File

@ -7,6 +7,7 @@ module Stripe
class Quote < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
extend Stripe::APIOperations::NestedResource
include Stripe::APIOperations::Save
OBJECT_NAME = "quote"
@ -14,6 +15,9 @@ module Stripe
"quote"
end
nested_resource_class_methods :preview_invoice, operations: %i[list]
nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]
# Accepts the specified quote.
def accept(params = {}, opts = {})
request_stripe_object(
@ -124,6 +128,86 @@ module Stripe
)
end
# Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
def list_lines(params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Retrieves a paginated list of lines for a quote. These lines describe changes that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted.
def self.list_lines(quote, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quotes/%<quote>s/lines", { quote: CGI.escape(quote) }),
params: params,
opts: opts
)
end
# Preview the invoice line items that would be generated by accepting the quote.
def list_preview_invoice_lines(preview_invoice, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
params: params,
opts: opts
)
end
# Preview the invoice line items that would be generated by accepting the quote.
def self.list_preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
params: params,
opts: opts
)
end
# Converts a stale quote to draft.
def mark_draft(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Converts a stale quote to draft.
def self.mark_draft(quote, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
params: params,
opts: opts
)
end
# Converts a draft or open quote to stale.
def mark_stale(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Converts a draft or open quote to stale.
def self.mark_stale(quote, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
params: params,
opts: opts
)
end
# Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf)
def pdf(params = {}, opts = {}, &read_body_chunk_block)
config = opts[:client]&.config || Stripe.config
@ -150,6 +234,26 @@ module Stripe
)
end
# Recompute the upcoming invoice estimate for the quote.
def reestimate(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Recompute the upcoming invoice estimate for the quote.
def self.reestimate(quote, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/reestimate", { quote: CGI.escape(quote) }),
params: params,
opts: opts
)
end
# A quote models prices and services for a customer.
def self.update(id, params = {}, opts = {})
request_stripe_object(

View File

@ -0,0 +1,39 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
# A quote phase describes the line items, coupons, and trialing status of a subscription for a predefined time period.
class QuotePhase < APIResource
extend Stripe::APIOperations::List
OBJECT_NAME = "quote_phase"
def self.object_name
"quote_phase"
end
# Returns a list of quote phases.
def self.list(filters = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/quote_phases", params: filters, opts: opts)
end
# When retrieving a quote phase, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
def list_line_items(params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quote_phases/%<quote_phase>s/line_items", { quote_phase: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# When retrieving a quote phase, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.
def self.list_line_items(quote_phase, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quote_phases/%<quote_phase>s/line_items", { quote_phase: CGI.escape(quote_phase) }),
params: params,
opts: opts
)
end
end
end

View File

@ -0,0 +1,43 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
# Invoices are statements of amounts owed by a customer, and are either
# generated one-off, or generated periodically from a subscription.
#
# They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments
# that may be caused by subscription upgrades/downgrades (if necessary).
#
# If your invoice is configured to be billed through automatic charges,
# Stripe automatically finalizes your invoice and attempts payment. Note
# that finalizing the invoice,
# [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does
# not happen immediately as the invoice is created. Stripe waits
# until one hour after the last webhook was successfully sent (or the last
# webhook timed out after failing). If you (and the platforms you may have
# connected to) have no webhooks configured, Stripe waits one hour after
# creation to finalize the invoice.
#
# If your invoice is configured to be billed by sending an email, then based on your
# [email settings](https://dashboard.stripe.com/account/billing/automatic),
# Stripe will email the invoice to your customer and await payment. These
# emails can contain a link to a hosted page to pay the invoice.
#
# Stripe applies any customer credit on the account before determining the
# amount due for the invoice (i.e., the amount that will be actually
# charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge
# per currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the
# invoice is automatically marked paid, and we add the amount due to the
# customer's credit balance which is applied to the next invoice.
#
# More details on the customer's credit balance are
# [here](https://stripe.com/docs/billing/customer/balance).
#
# Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending)
class QuotePreviewInvoice < APIResource
OBJECT_NAME = "quote_preview_invoice"
def self.object_name
"quote_preview_invoice"
end
end
end

View File

@ -0,0 +1,11 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
class QuotePreviewSubscriptionSchedule < APIResource
OBJECT_NAME = "quote_preview_subscription_schedule"
def self.object_name
"quote_preview_subscription_schedule"
end
end
end

View File

@ -15,6 +15,26 @@ module Stripe
"subscription_schedule"
end
# Amends an existing subscription schedule.
def amend(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Amends an existing subscription schedule.
def self.amend(schedule, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/subscription_schedules/%<schedule>s/amend", { schedule: CGI.escape(schedule) }),
params: params,
opts: opts
)
end
# Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active.
def cancel(params = {}, opts = {})
request_stripe_object(

View File

@ -0,0 +1,49 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Tax
# Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes.
#
# Related guide: [US tax reporting for Connect platforms](https://stripe.com/docs/connect/tax-reporting)
class Form < APIResource
extend Stripe::APIOperations::List
OBJECT_NAME = "tax.form"
def self.object_name
"tax.form"
end
# Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first.
def self.list(filters = {}, opts = {})
request_stripe_object(method: :get, path: "/v1/tax/forms", params: filters, opts: opts)
end
# Download the PDF for a tax form.
def pdf(params = {}, opts = {}, &read_body_chunk_block)
config = opts[:client]&.config || Stripe.config
opts = { api_base: config.uploads_base }.merge(opts)
request_stream(
method: :get,
path: format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(self["id"]) }),
params: params,
opts: opts,
&read_body_chunk_block
)
end
# Download the PDF for a tax form.
def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
config = opts[:client]&.config || Stripe.config
opts = { api_base: config.uploads_base }.merge(opts)
execute_resource_request_stream(
:get,
format("/v1/tax/forms/%<id>s/pdf", { id: CGI.escape(id) }),
params,
opts,
&read_body_chunk_block
)
end
end
end
end

View File

@ -37,6 +37,66 @@ module Stripe
)
end
# Initiates an input collection flow on a Reader.
def collect_inputs(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Initiates an input collection flow on a Reader.
def self.collect_inputs(reader, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/terminal/readers/%<reader>s/collect_inputs", { reader: CGI.escape(reader) }),
params: params,
opts: opts
)
end
# Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
def collect_payment_method(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Initiates a payment flow on a Reader and updates the PaymentIntent with card details before manual confirmation.
def self.collect_payment_method(reader, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/terminal/readers/%<reader>s/collect_payment_method", { reader: CGI.escape(reader) }),
params: params,
opts: opts
)
end
# Finalizes a payment on a Reader.
def confirm_payment_intent(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end
# Finalizes a payment on a Reader.
def self.confirm_payment_intent(reader, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/terminal/readers/%<reader>s/confirm_payment_intent", { reader: CGI.escape(reader) }),
params: params,
opts: opts
)
end
# Creates a new Reader object.
def self.create(params = {}, opts = {})
request_stripe_object(

View File

@ -213,9 +213,10 @@ module Stripe
end
def execute_request(method, path,
api_base: nil, api_key: nil, headers: {}, params: {}, usage: [])
api_base: nil, api_key: nil,
headers: {}, params: {}, api_mode: nil, usage: [])
http_resp, api_key = execute_request_internal(
method, path, api_base, api_key, headers, params, usage
method, path, api_base, api_key, headers, params, api_mode, usage
)
begin
@ -246,6 +247,7 @@ module Stripe
def execute_request_stream(method, path,
api_base: nil, api_key: nil, usage: [],
headers: {}, params: {},
api_mode: nil,
&read_body_chunk_block)
unless block_given?
raise ArgumentError,
@ -253,7 +255,8 @@ module Stripe
end
http_resp, api_key = execute_request_internal(
method, path, api_base, api_key, headers, params, usage, &read_body_chunk_block
method, path, api_base, api_key,
headers, params, api_mode, usage, &read_body_chunk_block
)
# When the read_body_chunk_block is given, we no longer have access to the
@ -432,8 +435,8 @@ module Stripe
end
private def execute_request_internal(method, path,
api_base, api_key, headers, params, usage,
&read_body_chunk_block)
api_base, api_key, headers, params,
api_mode, usage, &read_body_chunk_block)
raise ArgumentError, "method should be a symbol" \
unless method.is_a?(Symbol)
raise ArgumentError, "path should be a string" \
@ -441,9 +444,10 @@ module Stripe
api_base ||= config.api_base
api_key ||= config.api_key
authenticator ||= config.authenticator
params = Util.objects_to_ids(params)
check_api_key!(api_key)
check_keys!(api_key, authenticator)
body_params = nil
query_params = nil
@ -456,8 +460,9 @@ module Stripe
query_params, path = merge_query_params(query_params, path)
headers = request_headers(api_key, method)
headers = request_headers(api_key, method, api_mode)
.update(Util.normalize_headers(headers))
url = api_url(path, api_base)
# Merge given query parameters with any already encoded in the path.
@ -468,13 +473,16 @@ module Stripe
# a log-friendly variant of the encoded form. File objects are displayed
# as such instead of as their file contents.
body, body_log =
body_params ? encode_body(body_params, headers) : [nil, nil]
body_params ? encode_body(body_params, headers, api_mode) : [nil, nil]
authenticator.authenticate(method, headers, body) unless api_key
# stores information on the request we're about to make so that we don't
# have to pass as many parameters around for logging.
context = RequestLogContext.new
context.account = headers["Stripe-Account"]
context.api_key = api_key
context.authenticator = authenticator
context.api_version = headers["Stripe-Version"]
context.body = body_log
context.idempotency_key = headers["Idempotency-Key"]
@ -511,8 +519,16 @@ module Stripe
(api_base || config.api_base) + url
end
private def check_api_key!(api_key)
unless api_key
private def check_keys!(api_key, authenticator)
if api_key && authenticator
raise AuthenticationError, "Can't specify both API key " \
"and authenticator. Either set your API key" \
'using "Stripe.api_key = <API-KEY>", or set your authenticator ' \
'using "Stripe.authenticator = <AUTHENTICATOR>"' \
end
unless api_key || authenticator
# Default to missing API key error message for general users.
raise AuthenticationError, "No API key provided. " \
'Set your API key using "Stripe.api_key = <API-KEY>". ' \
"You can generate API keys from the Stripe web interface. " \
@ -531,7 +547,7 @@ module Stripe
# Encodes a set of body parameters using multipart if `Content-Type` is set
# for that, or standard form-encoding otherwise. Returns the encoded body
# and a version of the encoded body that's safe to be logged.
private def encode_body(body_params, headers)
private def encode_body(body_params, headers, api_mode)
body = nil
flattened_params = Util.flatten_params(body_params)
@ -547,15 +563,22 @@ module Stripe
flattened_params =
flattened_params.map { |k, v| [k, v.is_a?(String) ? v : v.to_s] }.to_h
elsif api_mode == :preview
body = JSON.generate(body_params)
headers["Content-Type"] = "application/json"
else
body = Util.encode_parameters(body_params)
end
# We don't use `Util.encode_parameters` partly as an optimization (to not
# redo work we've already done), and partly because the encoded forms of
# certain characters introduce a lot of visual noise and it's nice to
# have a clearer format for logs.
body_log = flattened_params.map { |k, v| "#{k}=#{v}" }.join("&")
body_log = if api_mode == :preview
body
else
# We don't use `Util.encode_parameters` partly as an optimization (to
# not redo work we've already done), and partly because the encoded
# forms of certain characters introduce a lot of visual noise and it's
# nice to have a clearer format for logs.
flattened_params.map { |k, v| "#{k}=#{v}" }.join("&")
end
[body, body_log]
end
@ -741,10 +764,11 @@ module Stripe
end
private def specific_api_error(resp, error_data, context)
message = error_data[:message]
Util.log_error("Stripe API error",
status: resp.http_status,
error_code: error_data[:code],
error_message: error_data[:message],
error_message: message,
error_param: error_data[:param],
error_type: error_data[:type],
idempotency_key: context.idempotency_key,
@ -765,26 +789,26 @@ module Stripe
when 400, 404
case error_data[:type]
when "idempotency_error"
IdempotencyError.new(error_data[:message], **opts)
IdempotencyError.new(message, **opts)
else
InvalidRequestError.new(
error_data[:message], error_data[:param],
message, error_data[:param],
**opts
)
end
when 401
AuthenticationError.new(error_data[:message], **opts)
AuthenticationError.new(message, **opts)
when 402
CardError.new(
error_data[:message], error_data[:param],
message, error_data[:param],
**opts
)
when 403
PermissionError.new(error_data[:message], **opts)
PermissionError.new(message, **opts)
when 429
RateLimitError.new(error_data[:message], **opts)
RateLimitError.new(message, **opts)
else
APIError.new(error_data[:message], **opts)
APIError.new(message, **opts)
end
end
@ -852,16 +876,20 @@ module Stripe
message + "\n\n(Network error: #{error.message})"
end
private def request_headers(api_key, method)
private def request_headers(api_key, method, api_mode)
user_agent = "Stripe/v1 RubyBindings/#{Stripe::VERSION}"
user_agent += " " + format_app_info(Stripe.app_info) unless Stripe.app_info.nil?
headers = {
"User-Agent" => user_agent,
"Authorization" => "Bearer #{api_key}",
"Content-Type" => "application/x-www-form-urlencoded",
}
if api_mode != :preview
# TODO: (major) don't set Content-Type if method is not post
headers["Content-Type"] = "application/x-www-form-urlencoded"
end
if config.enable_telemetry? && !@last_request_metrics.nil?
headers["X-Stripe-Client-Telemetry"] = JSON.generate(
last_request_metrics: @last_request_metrics.payload
@ -874,7 +902,12 @@ module Stripe
headers["Idempotency-Key"] ||= SecureRandom.uuid
end
headers["Stripe-Version"] = config.api_version if config.api_version
if api_mode == :preview
headers["Stripe-Version"] = ApiVersion::PREVIEW
elsif config.api_version
headers["Stripe-Version"] = config.api_version
end
headers["Stripe-Account"] = config.stripe_account if config.stripe_account
user_agent = @system_profiler.user_agent
@ -957,7 +990,8 @@ module Stripe
# that we can log certain information. It's useful because it means that we
# don't have to pass around as many parameters.
class RequestLogContext
attr_accessor :body, :account, :api_key, :api_version, :idempotency_key, :method, :path, :query, :request_id
attr_accessor :body, :account, :api_key, :authenticator, :api_version, :idempotency_key, :method, :path, :query,
:request_id
# The idea with this method is that we might want to update some of
# context information because a response that we've received from the API

View File

@ -25,7 +25,7 @@ module Stripe
# If `.logger` is set, the value of `.log_level` is ignored. The decision on
# what levels to print is entirely deferred to the logger.
class StripeConfiguration
attr_accessor :api_key, :api_version, :client_id, :enable_telemetry, :logger, :stripe_account
attr_accessor :api_key, :api_version, :authenticator, :client_id, :enable_telemetry, :logger, :stripe_account
attr_reader :api_base, :uploads_base, :connect_base, :ca_bundle_path, :log_level, :initial_network_retry_delay,
# rubocop:todo Layout/LineLength
@ -50,6 +50,7 @@ module Stripe
def initialize
@api_version = ApiVersion::CURRENT
@ca_bundle_path = Stripe::DEFAULT_CA_BUNDLE_PATH
@enable_telemetry = true
@verify_ssl_certs = true

View File

@ -7,6 +7,7 @@ module Stripe
# Options that a user is allowed to specify.
OPTS_USER_SPECIFIED = Set[
:api_key,
:authenticator,
:idempotency_key,
:stripe_account,
:stripe_version
@ -279,7 +280,13 @@ module Stripe
when String
{ api_key: opts }
when Hash
check_api_key!(opts.fetch(:api_key)) if opts.key?(:api_key)
# If the user is using request signing for authentication,
# no need to check the api_key per request.
if !(opts.key?(:client) &&
opts.fetch(:client).config.authenticator) &&
opts.key?(:api_key)
check_api_key!(opts.fetch(:api_key))
end
# Explicitly use dup here instead of clone to avoid preserving freeze
# state on input params.
opts.dup

View File

@ -1,5 +1,5 @@
# frozen_string_literal: true
module Stripe
VERSION = "11.5.0"
VERSION = "11.7.0-beta.1"
end

View File

@ -83,6 +83,19 @@ module Stripe
should "not specifying api credentials should raise an exception" do
Stripe.api_key = nil
Stripe.authenticator = nil
assert_raises Stripe::AuthenticationError do
Stripe::Customer.new("cus_123").refresh
end
end
should "specifying both api_key and authenticator should raise an exception" do
Stripe.api_key = "sk_123"
def no_op; end
Stripe.authenticator = method(:no_op)
assert_raises Stripe::AuthenticationError do
Stripe::Customer.new("cus_123").refresh
end

View File

@ -1295,6 +1295,10 @@ module Stripe
Stripe::Quote.update("qt_xxxxxxxxxxxxx", { metadata: { order_id: "6735" } })
assert_requested :post, "#{Stripe.api_base}/v1/quotes/qt_xxxxxxxxxxxxx"
end
should "Test quotes preview invoices lines get" do
Stripe::Quote.list_preview_invoice_lines("qt_xyz", "in_xyz")
assert_requested :get, "#{Stripe.api_base}/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines"
end
should "Test radar early fraud warnings get" do
Stripe::Radar::EarlyFraudWarning.list({ limit: 3 })
assert_requested :get, "#{Stripe.api_base}/v1/radar/early_fraud_warnings?limit=3"
@ -1628,6 +1632,11 @@ module Stripe
Stripe::TaxCode.retrieve("txcd_xxxxxxxxxxxxx")
assert_requested :get, "#{Stripe.api_base}/v1/tax_codes/txcd_xxxxxxxxxxxxx"
end
should "Test tax forms pdf get" do
block_handler = {}
Stripe::Tax::Form.pdf("form_xxxxxxxxxxxxx", &block_handler)
assert_requested :get, "#{Stripe.api_base}/v1/tax/forms/form_xxxxxxxxxxxxx/pdf"
end
should "Test tax ids delete" do
Stripe::TaxId.delete("taxid_123")
assert_requested :delete, "#{Stripe.api_base}/v1/tax_ids/taxid_123"

View File

@ -0,0 +1,84 @@
# frozen_string_literal: true
require File.expand_path("../test_helper", __dir__)
class PreviewTest < Test::Unit::TestCase
context "preview raw requests" do
should "send preview get request with correct default options" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:get, "#{Stripe.api_base}/v2/accounts/acc_123")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe::Preview.get("/v2/accounts/acc_123")
assert_equal nil, req.headers["Content-Type"]
assert_equal Stripe::ApiVersion::PREVIEW, req.headers["Stripe-Version"]
assert_equal expected_body, resp.http_body
end
should "send preview post request with correct default options" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:post, "#{Stripe.api_base}/v2/accounts")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe::Preview.post("/v2/accounts", { p1: 1, p2: "string" })
assert_equal "application/json", req.headers["Content-Type"]
assert_equal Stripe::ApiVersion::PREVIEW, req.headers["Stripe-Version"]
assert_equal "{\"p1\":1,\"p2\":\"string\"}", req.body
assert_equal expected_body, resp.http_body
end
should "send preview delete request with correct default options" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:delete, "#{Stripe.api_base}/v2/accounts/acc_123")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe::Preview.delete("/v2/accounts/acc_123")
assert_equal nil, req.headers["Content-Type"]
assert_equal Stripe::ApiVersion::PREVIEW, req.headers["Stripe-Version"]
assert_equal expected_body, resp.http_body
end
should "allow overriding default options for preview requests" do
expected_body = "{\"id\": \"acc_123\"}"
stripe_version_override = "2022-11-15"
req = nil
stub_request(:post, "#{Stripe.api_base}/v2/accounts")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe::Preview.post("/v2/accounts", {}, { stripe_version: stripe_version_override })
assert_equal "application/json", req.headers["Content-Type"]
assert_equal stripe_version_override, req.headers["Stripe-Version"]
assert_equal expected_body, resp.http_body
end
should "allow setting stripe_context for preview requests" do
expected_body = "{\"id\": \"acc_123\"}"
stripe_context = "acc_123"
req = nil
stub_request(:post, "#{Stripe.api_base}/v2/accounts")
.with { |request| req = request }
.to_return(body: expected_body)
Stripe::Preview.post("/v2/accounts", {}, { stripe_context: stripe_context })
assert_equal "application/json", req.headers["Content-Type"]
assert_equal stripe_context, req.headers["Stripe-Context"]
end
end
end

View File

@ -0,0 +1,128 @@
# frozen_string_literal: true
require File.expand_path("../test_helper", __dir__)
class RawRequestTest < Test::Unit::TestCase
context "raw_request" do
should "send get request and return a response" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:get, "#{Stripe.api_base}/v1/accounts/acc_123")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe.raw_request(:get, "/v1/accounts/acc_123")
assert_equal expected_body, resp.http_body
assert_equal "application/x-www-form-urlencoded", req.headers["Content-Type"]
assert_equal Stripe::ApiVersion::CURRENT, req.headers["Stripe-Version"]
end
should "send post request with body and return a response" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:post, "#{Stripe.api_base}/v1/accounts/acc_123")
.with(body: "p1=1&p2=string")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe.raw_request(:post, "/v1/accounts/acc_123", { p1: 1, p2: "string" })
assert_equal expected_body, resp.http_body
assert_equal "application/x-www-form-urlencoded", req.headers["Content-Type"]
assert_equal Stripe::ApiVersion::CURRENT, req.headers["Stripe-Version"]
end
should "send post request with json body and return a response" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:post, "#{Stripe.api_base}/v1/accounts/acc_123")
.with(body: "{\"p1\":1,\"p2\":\"string\"}")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe.raw_request(:post, "/v1/accounts/acc_123", { p1: 1, p2: "string" }, { api_mode: :preview })
assert_equal expected_body, resp.http_body
assert_equal "application/json", req.headers["Content-Type"]
assert_equal Stripe::ApiVersion::PREVIEW, req.headers["Stripe-Version"]
end
should "send post request with json body and headers and return a response" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:post, "#{Stripe.api_base}/v1/accounts/acc_123")
.with(body: "{\"p1\":1,\"p2\":\"string\"}")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe.raw_request(:post, "/v1/accounts/acc_123", { p1: 1, p2: "string" }, { api_mode: :preview, "Stripe-Context": "bar" })
assert_equal expected_body, resp.http_body
assert_equal "application/json", req.headers["Content-Type"]
assert_equal Stripe::ApiVersion::PREVIEW, req.headers["Stripe-Version"]
assert_equal "bar", req.headers["Stripe-Context"]
end
should "send get request with json body and headers and return a response" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:get, "#{Stripe.api_base}/v1/accounts/acc_123")
.with { |request| req = request }
.to_return(body: expected_body)
resp = Stripe.raw_request(:get, "/v1/accounts/acc_123", {}, { api_mode: :preview, "Stripe-Account": "bar" })
assert_not_equal "application/x-www-form-urlencoded", req.headers["Content-Type"]
assert_equal expected_body, resp.http_body
end
should "set default preview version when api_mode is preview and stripe_version not specified" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:get, "#{Stripe.api_base}/v1/accounts/acc_123")
.with { |request| req = request }
.to_return(body: expected_body)
Stripe.raw_request(:get, "/v1/accounts/acc_123", {}, { api_mode: :preview })
assert_equal Stripe::ApiVersion::PREVIEW, req.headers["Stripe-Version"]
end
should "allow overriding stripe version when api_mode is preview" do
expected_body = "{\"id\": \"acc_123\"}"
req = nil
stub_request(:get, "#{Stripe.api_base}/v1/accounts/acc_123")
.with { |request| req = request }
.to_return(body: expected_body)
stripe_version_override = "2023-05-15.preview"
Stripe.raw_request(:get, "/v1/accounts/acc_123", {}, { api_mode: :preview, stripe_version: stripe_version_override })
assert_equal stripe_version_override, req.headers["Stripe-Version"]
end
should "report usage" do
expected_body = "{\"id\": \"acc_123\"}"
telemetry_header = nil
Stripe.enable_telemetry = true
stub_request(:get, "#{Stripe.api_base}/v1/accounts/acc_124")
.with { |request| telemetry_header = request.headers["X-Stripe-Client-Telemetry"] }
.to_return(body: expected_body)
Stripe.raw_request(:get, "/v1/accounts/acc_123", {}, {})
Stripe.raw_request(:get, "/v1/accounts/acc_124", {}, {})
parsed_telemetry_header = JSON.parse(telemetry_header)
assert(parsed_telemetry_header["last_request_metrics"]["usage"] == ["raw_request"])
end
end
end

View File

@ -0,0 +1,112 @@
# frozen_string_literal: true
require File.expand_path("../test_helper", __dir__)
module Stripe
class RequestSigningAuthenticatorTest < Test::Unit::TestCase
TEST_AUTH_TOKEN = "keyid"
TEST_SIGN_LAMBDA = -> {}
context "initialize" do
should "raise error if given non-String auth token" do
assert_raises ArgumentError do
Stripe::RequestSigningAuthenticator.new(123, TEST_SIGN_LAMBDA)
end
end
should "raise error if given non-lambda sign function" do
assert_raises ArgumentError do
Stripe::RequestSigningAuthenticator.new(TEST_AUTH_TOKEN, nil)
end
end
should "create a new authenticator with valid arguments" do
authenticator = Stripe::RequestSigningAuthenticator.new(TEST_AUTH_TOKEN, TEST_SIGN_LAMBDA)
assert_equal(authenticator.auth_token, TEST_AUTH_TOKEN)
assert_equal(authenticator.sign_lambda, TEST_SIGN_LAMBDA)
end
end
context ".authenticate" do
setup do
RequestSigningAuthenticator.any_instance.stubs(:created_time).returns(123_456_789)
end
should "applies signature for POST requests" do
signature_bases = []
sign = lambda { |signature_base|
signature_bases.push(signature_base)
return [1, 2, 3, 4, 5].pack("C*")
}
authenticator = RequestSigningAuthenticator.new(TEST_AUTH_TOKEN, sign)
headers = { "Content-Type" => "application/json" }
authenticator.authenticate(:post, headers, '{"string":"String!"}')
assert_equal("\"content-type\": application/json\n" \
"\"content-digest\": sha-256=:HA3i38j+04ac71IzPtG1JK8o4q9sPK0fYPmJHmci5bg=:\n" \
"\"stripe-context\": \n" \
"\"stripe-account\": \n" \
"\"authorization\": STRIPE-V2-SIG keyid\n" \
"\"@signature-params\": (\"content-type\" \"content-digest\" \"stripe-context\" \"stripe-account\" \"authorization\");created=123456789",
signature_bases[0].force_encoding(Encoding::UTF_8))
assert_equal('sig1=("content-type" "content-digest" "stripe-context" "stripe-account" "authorization");' \
"created=123456789", headers["Signature-Input"])
assert_equal("sha-256=:HA3i38j+04ac71IzPtG1JK8o4q9sPK0fYPmJHmci5bg=:", headers["Content-Digest"])
assert_equal("sig1=:AQIDBAU=:", headers["Signature"])
assert_equal("STRIPE-V2-SIG keyid", headers["Authorization"])
end
should "applies signature for DELETE requests" do
signature_bases = []
sign = lambda { |signature_base|
signature_bases.push(signature_base)
return [1, 2, 3, 4, 5].pack("C*")
}
authenticator = RequestSigningAuthenticator.new(TEST_AUTH_TOKEN, sign)
headers = { "Content-Type" => "application/json" }
authenticator.authenticate(:delete, headers, nil)
assert_equal("\"content-type\": application/json\n" \
"\"content-digest\": sha-256=:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=:\n" \
"\"stripe-context\": \n" \
"\"stripe-account\": \n" \
"\"authorization\": STRIPE-V2-SIG keyid\n" \
"\"@signature-params\": (\"content-type\" \"content-digest\" \"stripe-context\" \"stripe-account\" \"authorization\");created=123456789",
signature_bases[0].force_encoding(Encoding::UTF_8))
assert_equal('sig1=("content-type" "content-digest" "stripe-context" "stripe-account" "authorization");' \
"created=123456789", headers["Signature-Input"])
assert_equal("sha-256=:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=:", headers["Content-Digest"])
assert_equal("sig1=:AQIDBAU=:", headers["Signature"])
assert_equal("STRIPE-V2-SIG keyid", headers["Authorization"])
end
should "applies signature for GET requests" do
signature_bases = []
sign = lambda { |signature_base|
signature_bases.push(signature_base)
return [1, 2, 3, 4, 5].pack("C*")
}
authenticator = RequestSigningAuthenticator.new(TEST_AUTH_TOKEN, sign)
headers = {}
authenticator.authenticate(:get, headers, nil)
assert_equal("\"stripe-context\": \n" \
"\"stripe-account\": \n" \
"\"authorization\": STRIPE-V2-SIG keyid\n" \
"\"@signature-params\": (\"stripe-context\" \"stripe-account\" \"authorization\");created=123456789",
signature_bases[0].force_encoding(Encoding::UTF_8))
assert_equal('sig1=("stripe-context" "stripe-account" "authorization");' \
"created=123456789", headers["Signature-Input"])
assert_nil(headers["Content-Digest"])
assert_equal("sig1=:AQIDBAU=:", headers["Signature"])
assert_equal("STRIPE-V2-SIG keyid", headers["Authorization"])
end
end
end
end

View File

@ -473,6 +473,55 @@ module Stripe
end
end
context "signing headers" do
setup do
RequestSigningAuthenticator.any_instance.stubs(:content_digest).returns("digest")
RequestSigningAuthenticator.any_instance.stubs(:created_time).returns(1_234_567_890)
RequestSigningAuthenticator.any_instance.stubs(:encoded_signature).returns("signature")
Stripe.api_key = nil
Stripe.authenticator = RequestSigningAuthenticator.new("keyinfo_test_123", -> {})
end
should "apply valid signing headers for get requests" do
stub_request(:get, "#{Stripe.api_base}/v1/charges/ch_123")
.to_return(body: JSON.generate(object: "charge"))
client = StripeClient.new
client.send(request_method, :get, "/v1/charges/ch_123",
&@read_body_chunk_block)
assert_requested(
:get,
"#{Stripe.api_base}/v1/charges/ch_123",
headers: {
"Authorization" => "STRIPE-V2-SIG keyinfo_test_123",
"Signature" => "sig1=:signature:",
"Signature-Input" => 'sig1=("stripe-context" "stripe-account" "authorization");created=1234567890',
}
)
end
should "apply valid signing headers for post requests" do
stub_request(:post, "#{Stripe.api_base}/v1/charges")
.to_return(body: JSON.generate(object: "charge"))
client = StripeClient.new
client.send(request_method, :post, "/v1/charges",
&@read_body_chunk_block)
assert_requested(
:post,
"#{Stripe.api_base}/v1/charges",
headers: {
"Authorization" => "STRIPE-V2-SIG keyinfo_test_123",
"Content-Digest" => "sha-256=:digest:",
"Signature" => "sig1=:signature:",
"Signature-Input" => 'sig1=("content-type" "content-digest" "stripe-context" "stripe-account" "authorization");created=1234567890',
}
)
end
end
context "logging" do
setup do
# Freeze time for the purposes of the `elapsed` parameter that we

View File

@ -119,6 +119,18 @@ class StripeTest < Test::Unit::TestCase
assert_equal "2018-02-28", Stripe.api_version
end
should "allow beta versions to be added once only" do
Stripe.api_version = "2018-02-28"
Stripe.add_beta_version("my_beta", "v2")
assert_equal "2018-02-28; my_beta=v2", Stripe.api_version
err = assert_raises do
Stripe.add_beta_version("my_beta", "v1")
assert_equal(err, "Stripe version header 2018-02-28; my_beta=v2 already contains entry for beta my_beta")
end
end
should "allow connect_base to be configured" do
Stripe.connect_base = "https://other.stripe.com"
assert_equal "https://other.stripe.com", Stripe.connect_base
@ -134,4 +146,42 @@ class StripeTest < Test::Unit::TestCase
assert_equal "client", Stripe.client_id
end
end
context "deserialize" do
should "deserializes string into known object" do
expected_body = "{\"id\": \"acc_123\", \"object\": \"account\"}"
obj = Stripe.deserialize(expected_body)
assert_equal obj.class, Stripe::Account
assert_equal obj.id, "acc_123"
end
should "deserializes string into unknown object" do
expected_body = "{\"id\": \"acc_123\", \"object\": \"unknown\"}"
obj = Stripe.deserialize(expected_body)
assert_equal obj.class, Stripe::StripeObject
assert_equal obj.id, "acc_123"
end
should "deserializes hash into known object" do
expected_body = { "id" => "acc_123", "object" => "account" }
obj = Stripe.deserialize(expected_body)
assert_equal obj.class, Stripe::Account
assert_equal obj.id, "acc_123"
end
should "deserializes hash into unknown object" do
expected_body = { "id" => "acc_123", "object" => "unknown" }
obj = Stripe.deserialize(expected_body)
assert_equal obj.class, Stripe::StripeObject
assert_equal obj.id, "acc_123"
end
end
end

View File

@ -67,6 +67,8 @@ module Test
Stripe.api_base = "http://localhost:#{MOCK_PORT}"
Stripe.uploads_base = "http://localhost:#{MOCK_PORT}"
Stripe.authenticator = nil
stub_connect
end