mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-06-24 00:00:39 -04:00
Compare commits
573 Commits
master
...
v13.4.0-be
Author | SHA1 | Date | |
---|---|---|---|
|
012de92b7b | ||
|
601cc26a05 | ||
|
5b20aabff0 | ||
|
e0474fc6ee | ||
|
baba14ba6f | ||
|
9896232084 | ||
|
6dba00fabf | ||
|
d9118a2be2 | ||
|
1e9681fece | ||
|
43e3ecd280 | ||
|
1402ac7e17 | ||
|
7ec394e5ce | ||
|
c1ca97215b | ||
|
4c7a2891f1 | ||
|
f21e023bb2 | ||
|
39283a358d | ||
|
9d54b5cfdf | ||
|
7daac5c78b | ||
|
80c41a768b | ||
|
463efa561b | ||
|
467e034676 | ||
|
17457e0ff5 | ||
|
097e25fb6a | ||
|
3fe258ae9a | ||
|
52ee306b24 | ||
|
60114d2d8c | ||
|
f5a9fea082 | ||
|
2cef804a3d | ||
|
37da195da5 | ||
|
a63e70c63f | ||
|
fc2f62322f | ||
|
c37e8c0ea1 | ||
|
2a80b4cfa4 | ||
|
bc1d5a8721 | ||
|
beda56c945 | ||
|
dfa3166559 | ||
|
aa58664f71 | ||
|
4ca1162115 | ||
|
03f7e8b424 | ||
|
d708979899 | ||
|
d8d9367c97 | ||
|
ee1b40e2a4 | ||
|
a6fb7c989d | ||
|
4b790c6f66 | ||
|
bff038c787 | ||
|
c1846fa90f | ||
|
3e2a9a3e44 | ||
|
15059f9b07 | ||
|
0473767568 | ||
|
5a2738c473 | ||
|
a3b68600bc | ||
|
20f88738f3 | ||
|
e8534041dd | ||
|
1c83fd3827 | ||
|
f5930cbf05 | ||
|
05b04762f7 | ||
|
4345d6c4b3 | ||
|
8564329082 | ||
|
0ffd089cab | ||
|
afa823dfcb | ||
|
e98f2280b7 | ||
|
45ea7c1dcd | ||
|
b6c3993328 | ||
|
76a6c402e6 | ||
|
f6a53cf830 | ||
|
51983ebd07 | ||
|
44e28a3c97 | ||
|
e30dd59b19 | ||
|
70dae52d5c | ||
|
37eeea65aa | ||
|
c1a67e7b6f | ||
|
4217591d6f | ||
|
f8d2d6d808 | ||
|
3baa3bb485 | ||
|
0a92bde7ef | ||
|
8efdc5fa03 | ||
|
8408fe0e5d | ||
|
6b8c0fe7a2 | ||
|
14ec67c5e5 | ||
|
2cc89bdf57 | ||
|
ea01a5f86a | ||
|
abe64d9057 | ||
|
7475e76249 | ||
|
b0baf7dcf5 | ||
|
164c41f4c2 | ||
|
ad79e5ddec | ||
|
6637663560 | ||
|
c751d28679 | ||
|
abb7f96f7e | ||
|
f5b1550a4d | ||
|
f00e7b755e | ||
|
6043574338 | ||
|
9ba520b192 | ||
|
5e3db6ff02 | ||
|
41f5d0a594 | ||
|
be974ad4a2 | ||
|
d28d37fe3e | ||
|
910162ef12 | ||
|
6a1332d803 | ||
|
8b34c0f101 | ||
|
9cc7023598 | ||
|
79daac7bcf | ||
|
b1dc11f8c0 | ||
|
1d21518d1f | ||
|
2a6f80ab14 | ||
|
7616bf9e25 | ||
|
bee43846c7 | ||
|
c9d24fd3ed | ||
|
e0f699be5d | ||
|
d1d589ddde | ||
|
961c39195d | ||
|
b4f0f7a47a | ||
|
7ea397e89a | ||
|
9c4b2ba949 | ||
|
174a13d131 | ||
|
fa6fe2c58e | ||
|
731bf9f3ac | ||
|
ae6f89d29a | ||
|
bef2a670dd | ||
|
3a3f21eb6e | ||
|
1d25994ec2 | ||
|
36d12fd7a4 | ||
|
da3439f464 | ||
|
87190ffac5 | ||
|
10babebbf6 | ||
|
6e65602f6e | ||
|
1e6e4c2c84 | ||
|
f4ced072fd | ||
|
006dd567fc | ||
|
4151971cc2 | ||
|
787d71ed67 | ||
|
f9cf82d23f | ||
|
83404d14f9 | ||
|
7b693ab18c | ||
|
dbed1a3a59 | ||
|
28f0ff6120 | ||
|
d402193c93 | ||
|
4427ba0f2a | ||
|
f8aa5a4fa6 | ||
|
8be3c30e4a | ||
|
8ee88fefc7 | ||
|
b3a7a47917 | ||
|
4659c14672 | ||
|
3e340c4153 | ||
|
0229ed0e95 | ||
|
1e5edb7386 | ||
|
478d6888aa | ||
|
349acd2adf | ||
|
3871745743 | ||
|
59c82e3d4b | ||
|
6a4d2d1570 | ||
|
5669ab4d5c | ||
|
78e3166e20 | ||
|
318bed2067 | ||
|
0c44569639 | ||
|
65c85f45b3 | ||
|
f858c6a959 | ||
|
1fadafb39c | ||
|
4ce9e74bf5 | ||
|
b7d691bafd | ||
|
ee9ea1595a | ||
|
a802c007b2 | ||
|
d8701e8749 | ||
|
c83c27da74 | ||
|
fa02db50ab | ||
|
663d1460ef | ||
|
9716565a2d | ||
|
99c81c7074 | ||
|
16c779cdea | ||
|
f832bff64a | ||
|
d9f19ec10f | ||
|
20ae76545b | ||
|
59863ea3aa | ||
|
a49aa2d18c | ||
|
61aba5d027 | ||
|
3d2ad3d61c | ||
|
ab7d3a61d1 | ||
|
e5ec8c1ebf | ||
|
8558e0ee2e | ||
|
8c3b51769f | ||
|
4c4485185c | ||
|
df7f3fad50 | ||
|
b9597e5eac | ||
|
83463f167e | ||
|
abcc296f24 | ||
|
7eea258347 | ||
|
b66f178666 | ||
|
4ffefec536 | ||
|
7f957926c0 | ||
|
9f5e950493 | ||
|
c4f115226f | ||
|
c9c0acf980 | ||
|
3822030694 | ||
|
287b1fab65 | ||
|
6a0feb8f7d | ||
|
3f60df3581 | ||
|
c2f09bc395 | ||
|
626b576a34 | ||
|
27987ef78e | ||
|
4888991c70 | ||
|
4f0f1ee5f9 | ||
|
f825a94c1c | ||
|
9bfea77b37 | ||
|
929b50a836 | ||
|
e14fff4431 | ||
|
bc3e460aae | ||
|
3ed806c90b | ||
|
c4dd22825e | ||
|
b594bd5c21 | ||
|
7ddec7d6d8 | ||
|
f6a388be06 | ||
|
a8aac472ec | ||
|
0b3c0f3244 | ||
|
cece539ed7 | ||
|
22693301eb | ||
|
c36c240108 | ||
|
ec694bbd05 | ||
|
56039702e9 | ||
|
5edc3708fc | ||
|
0d0cead582 | ||
|
b7a9871e6a | ||
|
e511e2fb8b | ||
|
e37031ef1f | ||
|
d699593ea5 | ||
|
4632b7c9da | ||
|
418d79de1b | ||
|
b1e351f235 | ||
|
2c260289f2 | ||
|
d249b5f78b | ||
|
816f8ad435 | ||
|
02a733676e | ||
|
0e96318130 | ||
|
2e0b17a3dc | ||
|
8c91e40f29 | ||
|
4617b3fbd1 | ||
|
da70f0cfc8 | ||
|
a00f541a93 | ||
|
cbe61d7d38 | ||
|
3fe63202e3 | ||
|
3921d9b812 | ||
|
b39af8a58b | ||
|
6e62bca84a | ||
|
a7d998ab2d | ||
|
479d17b26a | ||
|
1bcb4bc058 | ||
|
b399f87064 | ||
|
a1ce673f62 | ||
|
4ccbe90069 | ||
|
5da74143e8 | ||
|
41ba199775 | ||
|
6897561e00 | ||
|
33e217ba15 | ||
|
dfa7994d04 | ||
|
34ff3ed2ca | ||
|
fe66019c7d | ||
|
f84e1154b1 | ||
|
afa13a53b0 | ||
|
a1deb162d0 | ||
|
499d0605d0 | ||
|
1705995709 | ||
|
452f8ca43d | ||
|
4902b4c49d | ||
|
ad26ff3fca | ||
|
86ac5fd329 | ||
|
ee9b5c7ead | ||
|
083c3a104e | ||
|
354b6a92a3 | ||
|
c48a5e30cf | ||
|
71b8f84574 | ||
|
d353c130bc | ||
|
8bda0900f3 | ||
|
3cecb75d46 | ||
|
18fef16be2 | ||
|
783bcb163f | ||
|
3e5b22eeae | ||
|
452e0c4485 | ||
|
cb256e8e1c | ||
|
90aa83239b | ||
|
ab5266188f | ||
|
e8f3b94a9d | ||
|
52e17ef8ea | ||
|
16227fe1e6 | ||
|
0e8df39594 | ||
|
98fbfb8012 | ||
|
8acad71c3f | ||
|
3b4f6e4bcb | ||
|
e1017fb6ef | ||
|
4933ab3111 | ||
|
b06b78aa85 | ||
|
fb0f82090c | ||
|
7c14c42072 | ||
|
78032b72f5 | ||
|
446f6ec55c | ||
|
7567bd2cb7 | ||
|
002767748d | ||
|
92bad8eeee | ||
|
3d3552e00d | ||
|
5af00f12a2 | ||
|
208ead7817 | ||
|
cca659d7b3 | ||
|
8c0015fb2c | ||
|
5ece384518 | ||
|
d936ddcff1 | ||
|
77d8304c54 | ||
|
6ba63d9a87 | ||
|
0d538ab0f1 | ||
|
6a5b89c99d | ||
|
b036d14d27 | ||
|
eeaa682877 | ||
|
a9611340a4 | ||
|
fee677de9e | ||
|
08400e8df9 | ||
|
b62018ee93 | ||
|
d4e469fa3c | ||
|
cfd9943c83 | ||
|
6d82ac4b56 | ||
|
aeb1b59206 | ||
|
a7f1c57f2c | ||
|
7be7413461 | ||
|
42f0c2c9d4 | ||
|
0055df9a63 | ||
|
4638712b2b | ||
|
86f5a8ac5c | ||
|
5443a95598 | ||
|
bc3cd13405 | ||
|
02c47fd5f0 | ||
|
9a92aa9c72 | ||
|
0030faf88f | ||
|
3285671c8f | ||
|
119802aaf2 | ||
|
d7a09671d1 | ||
|
05ee1f8fd4 | ||
|
72ce4e5f83 | ||
|
7dbfa2b4c4 | ||
|
0d02750915 | ||
|
1e13984787 | ||
|
5a2cf963ec | ||
|
176f13b832 | ||
|
9f77cb9c05 | ||
|
12da6ae2a8 | ||
|
aed8e679c5 | ||
|
a11a923b23 | ||
|
ac980c4216 | ||
|
7852b2faeb | ||
|
0a0374b0a1 | ||
|
2e533be04d | ||
|
e058a85fe7 | ||
|
6bf2eaf832 | ||
|
fb6f536d00 | ||
|
f97b214181 | ||
|
7066d7d3a1 | ||
|
147e25b288 | ||
|
568b3191c4 | ||
|
1ef9ff4b88 | ||
|
3165ed5905 | ||
|
be4388721d | ||
|
6ed6014b89 | ||
|
0ea7c61bcf | ||
|
f94c2cb45c | ||
|
c4bdddbe3c | ||
|
81b5190aed | ||
|
3fd4e48999 | ||
|
44a1547344 | ||
|
65768f9ee1 | ||
|
2ebd8cc795 | ||
|
206c80733f | ||
|
600c5fb883 | ||
|
8dfa6f6eaa | ||
|
c3b05c5e71 | ||
|
fee9143bb1 | ||
|
bd62fe08d6 | ||
|
658a0b786a | ||
|
84bf38a606 | ||
|
882c2a8c36 | ||
|
f7d4abdb5f | ||
|
8977ca553f | ||
|
e8f09f4001 | ||
|
4430246744 | ||
|
e9b70ffd51 | ||
|
b578ab2eb3 | ||
|
79dee2ae96 | ||
|
e0cfc89447 | ||
|
37b1db8140 | ||
|
ce925ab7a4 | ||
|
d604af0247 | ||
|
078adfcc37 | ||
|
e6ff2138c6 | ||
|
5609c6ce72 | ||
|
2227067f71 | ||
|
4981cc844d | ||
|
7e2a036dc5 | ||
|
900ecf2db9 | ||
|
8d5a5ef183 | ||
|
5bf957f53e | ||
|
0e5e7b8647 | ||
|
a334cb5fb4 | ||
|
801b65759e | ||
|
3d772067d1 | ||
|
6db03363ff | ||
|
1af83889bb | ||
|
e6b3043f66 | ||
|
e74bd2e7f7 | ||
|
bc924840dd | ||
|
456f10ab93 | ||
|
96b7453ee9 | ||
|
c0310bc4a7 | ||
|
a2806aca65 | ||
|
2f7ede30d1 | ||
|
4eae12c528 | ||
|
24801210b9 | ||
|
88ef71cf32 | ||
|
50c64e6c06 | ||
|
91015aa41c | ||
|
17619449ed | ||
|
a22bc332ad | ||
|
a5519a6a57 | ||
|
90a2a55687 | ||
|
6e2e8c757d | ||
|
c7a26629e6 | ||
|
62c0f898c3 | ||
|
cd0e601188 | ||
|
43f6318ebd | ||
|
150be92efc | ||
|
99dbffb9c6 | ||
|
a77bbab966 | ||
|
4d5a2aab6e | ||
|
7356579799 | ||
|
23cbd8fc82 | ||
|
adc0ccf8e7 | ||
|
d9118a7dfe | ||
|
f33553bef2 | ||
|
1d1d8a90f0 | ||
|
943dd4b020 | ||
|
6366593ed5 | ||
|
8cdb85cb36 | ||
|
9990e2b8b1 | ||
|
d600f2e9a1 | ||
|
c3cc36ed12 | ||
|
00077b44d8 | ||
|
2c06e9c83e | ||
|
4b74f4c93f | ||
|
e3f0da227f | ||
|
3ac330785f | ||
|
0075550ff8 | ||
|
890cdae767 | ||
|
732a1467b5 | ||
|
d39dcb4a81 | ||
|
fb655489eb | ||
|
4143d3930d | ||
|
23bc1b1f3b | ||
|
fe73975f07 | ||
|
24f8480c71 | ||
|
9d8ca624e3 | ||
|
105506a7fd | ||
|
75b29c3484 | ||
|
a6614ee701 | ||
|
33544c7c25 | ||
|
8f210e251a | ||
|
3b31fb29a6 | ||
|
4519e8fa19 | ||
|
f471a2c6a4 | ||
|
1e3428e87d | ||
|
7233155b42 | ||
|
cbfe81107a | ||
|
0b6cffde22 | ||
|
1be10ae4fc | ||
|
167daeaf62 | ||
|
080fddce5a | ||
|
466824d0af | ||
|
945e691968 | ||
|
f8a9a287ab | ||
|
92083a8615 | ||
|
705078e2cf | ||
|
29d8261b17 | ||
|
3958d6a9df | ||
|
696be38196 | ||
|
ff853fda95 | ||
|
d10398a825 | ||
|
6f70bd8696 | ||
|
1d21c60802 | ||
|
b9c10b9c2f | ||
|
446ffc7a22 | ||
|
58db6d32ef | ||
|
9a4dfdcb2f | ||
|
50bbc0df17 | ||
|
8226f0ad99 | ||
|
43fa8f5af7 | ||
|
0e61789557 | ||
|
cfe69c131e | ||
|
7bf9cace9e | ||
|
d7eac6010d | ||
|
7d91cb83d9 | ||
|
ce4946f5d8 | ||
|
15415fcbf3 | ||
|
f8acdb5f6a | ||
|
fe794f4868 | ||
|
2b841bc109 | ||
|
1835883848 | ||
|
e11400adc8 | ||
|
5ea85d0867 | ||
|
600b1965f6 | ||
|
5fdd180667 | ||
|
97e24e9e57 | ||
|
9531f57236 | ||
|
094574d2fe | ||
|
cff25d0c8b | ||
|
0795c1d3d0 | ||
|
802a1a7aa6 | ||
|
13b0bca995 | ||
|
51d364c844 | ||
|
f4c6f2b304 | ||
|
b64fe42043 | ||
|
586e685e63 | ||
|
3b5c725539 | ||
|
ea91a6f0b9 | ||
|
21f31edff4 | ||
|
a11f1ffd2a | ||
|
4bd92239d5 | ||
|
c261f6bbb6 | ||
|
f45fc7d703 | ||
|
5cd522c007 | ||
|
e6bda8356d | ||
|
2354633a92 | ||
|
549a73544f | ||
|
25833c1408 | ||
|
a59b57c3d1 | ||
|
63d447df77 | ||
|
5cd6f9f9bc | ||
|
ffa3747bdf | ||
|
ddf79610d9 | ||
|
edad946244 | ||
|
e3785d5893 | ||
|
2062e988eb | ||
|
0bdc688516 | ||
|
82ac9f2720 | ||
|
7381eb02a6 | ||
|
6720fc8d3f | ||
|
35a29332c5 | ||
|
519d68ce10 | ||
|
b95ea4ba27 | ||
|
318e244a76 | ||
|
bb1c995e93 | ||
|
0f12721697 | ||
|
671163245a | ||
|
486bee15a8 | ||
|
fdf5be66f5 | ||
|
c732841fd3 | ||
|
22db70b479 | ||
|
2db4fd9d06 | ||
|
6797f906e1 | ||
|
59f2d4d0fe | ||
|
0d1b570bfa | ||
|
d7d3c1b425 | ||
|
7df619de69 | ||
|
f649ed3824 | ||
|
32a95902cc | ||
|
bdcfe6cc33 | ||
|
5e1c4a2302 | ||
|
54a073783f | ||
|
e6a07ae658 | ||
|
588ed3b5e7 | ||
|
de33cde125 | ||
|
d849ec3b14 | ||
|
8b5f78aa6a | ||
|
7f6ba1c35c | ||
|
e55a2559ae | ||
|
0b00266be1 | ||
|
d0cd4fbaa6 | ||
|
979da6f84b | ||
|
d95c518a3c | ||
|
83c773f61e | ||
|
d9f719ba01 | ||
|
73d10e8557 |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -1,2 +0,0 @@
|
||||
# All files should be reviewed by a member of the SDKs team
|
||||
* @stripe/api-library-reviewers
|
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -45,7 +45,7 @@ jobs:
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3, 3.4, jruby-9.4.0.0, truffleruby-head]
|
||||
ruby-version: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1, 3.2, '3.3', jruby-9.4.0.0, truffleruby-head]
|
||||
steps:
|
||||
- uses: extractions/setup-just@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
21
.github/workflows/rules.yml
vendored
21
.github/workflows/rules.yml
vendored
@ -1,21 +0,0 @@
|
||||
|
||||
name: rules
|
||||
|
||||
on:
|
||||
workflow_dispatch: {}
|
||||
pull_request:
|
||||
types:
|
||||
- auto_merge_enabled
|
||||
|
||||
jobs:
|
||||
require_merge_commit_on_merge_script_pr:
|
||||
name: Merge script PRs must create merge commits
|
||||
if: ${{ contains(github.head_ref, '/merge-') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- run: |
|
||||
if ${{ github.event.pull_request.auto_merge.merge_method != 'merge' }}; then
|
||||
echo "Auto-merge method must be 'merge' instead of '${{github.event.pull_request.auto_merge.merge_method}}'"
|
||||
exit 1
|
||||
fi
|
||||
|
85
.rubocop.yml
85
.rubocop.yml
@ -21,6 +21,7 @@ Layout/LineLength:
|
||||
- "lib/stripe/services/**/*.rb"
|
||||
- "test/**/*.rb"
|
||||
|
||||
|
||||
Lint/MissingSuper:
|
||||
Exclude:
|
||||
- "lib/stripe/resources/**/*.rb"
|
||||
@ -50,7 +51,6 @@ Metrics/CyclomaticComplexity:
|
||||
Metrics/PerceivedComplexity:
|
||||
Exclude:
|
||||
- "lib/stripe/api_requestor.rb"
|
||||
- "lib/stripe/stripe_object.rb"
|
||||
- "lib/stripe/util.rb"
|
||||
|
||||
Metrics/MethodLength:
|
||||
@ -60,23 +60,13 @@ Metrics/MethodLength:
|
||||
Max: 55
|
||||
Exclude:
|
||||
- "lib/stripe/services/v1_services.rb"
|
||||
- "lib/stripe/event_types.rb"
|
||||
AllowedMethods:
|
||||
- initialize
|
||||
|
||||
# TODO(xavdid): remove this once the first `basil` release is out
|
||||
Naming/MethodName:
|
||||
# these endpoints are removed soon so we pulled their overrides, meaning their names are wrong
|
||||
# that won't make it out to users, but it's breaking linting/formatting in the meantime
|
||||
Exclude:
|
||||
- "lib/stripe/services/invoice_service.rb"
|
||||
- "lib/stripe/resources/invoice.rb"
|
||||
|
||||
Metrics/ModuleLength:
|
||||
Enabled: false
|
||||
|
||||
Metrics/ParameterLists:
|
||||
# There's 2 methods in `StripeClient` that have long parameter lists.
|
||||
Max: 8
|
||||
# Optional parameters should be consistent across libraries, we need not be
|
||||
# concerned about this. Was introduced with adding `base_address`
|
||||
@ -201,9 +191,6 @@ Lint/UnexpectedBlockArity: # new in 1.5
|
||||
Enabled: true
|
||||
Lint/UnmodifiedReduceAccumulator: # new in 1.1
|
||||
Enabled: true
|
||||
Lint/UselessAssignment:
|
||||
Exclude:
|
||||
- "test/stripe/generated_examples_test.rb"
|
||||
Lint/UselessRescue: # new in 1.43
|
||||
Enabled: true
|
||||
Lint/UselessRuby2Keywords: # new in 1.23
|
||||
@ -326,73 +313,3 @@ Style/SwapValues: # new in 1.1
|
||||
Enabled: true
|
||||
Style/YAMLFileRead: # new in 1.53
|
||||
Enabled: true
|
||||
Gemspec/AddRuntimeDependency: # new in 1.65
|
||||
Enabled: true
|
||||
Lint/ArrayLiteralInRegexp: # new in 1.71
|
||||
Enabled: true
|
||||
Lint/ConstantReassignment: # new in 1.70
|
||||
Enabled: true
|
||||
Lint/CopDirectiveSyntax: # new in 1.72
|
||||
Enabled: true
|
||||
Lint/DuplicateSetElement: # new in 1.67
|
||||
Enabled: true
|
||||
Lint/HashNewWithKeywordArgumentsAsDefault: # new in 1.69
|
||||
Enabled: true
|
||||
Lint/ItWithoutArgumentsInBlock: # new in 1.59
|
||||
Enabled: true
|
||||
Lint/LiteralAssignmentInCondition: # new in 1.58
|
||||
Enabled: true
|
||||
Lint/NumericOperationWithConstantResult: # new in 1.69
|
||||
Enabled: true
|
||||
Lint/RedundantTypeConversion: # new in 1.72
|
||||
Enabled: true
|
||||
Lint/SharedMutableDefault: # new in 1.70
|
||||
Enabled: true
|
||||
Lint/SuppressedExceptionInNumberConversion: # new in 1.72
|
||||
Enabled: true
|
||||
Lint/UnescapedBracketInRegexp: # new in 1.68
|
||||
Enabled: true
|
||||
Lint/UselessConstantScoping: # new in 1.72
|
||||
Enabled: true
|
||||
Lint/UselessDefined: # new in 1.69
|
||||
Enabled: true
|
||||
Lint/UselessNumericOperation: # new in 1.66
|
||||
Enabled: true
|
||||
Style/AmbiguousEndlessMethodDefinition: # new in 1.68
|
||||
Enabled: true
|
||||
Style/BitwisePredicate: # new in 1.68
|
||||
Enabled: true
|
||||
Style/CombinableDefined: # new in 1.68
|
||||
Enabled: true
|
||||
Style/ComparableBetween: # new in 1.74
|
||||
Enabled: true
|
||||
Style/DigChain: # new in 1.69
|
||||
Enabled: true
|
||||
Style/FileNull: # new in 1.69
|
||||
Enabled: true
|
||||
Style/FileTouch: # new in 1.69
|
||||
Enabled: true
|
||||
Style/HashFetchChain: # new in 1.75
|
||||
Enabled: true
|
||||
Style/HashSlice: # new in 1.71
|
||||
Enabled: true
|
||||
Style/ItAssignment: # new in 1.70
|
||||
Enabled: true
|
||||
Style/ItBlockParameter: # new in 1.75
|
||||
Enabled: true
|
||||
Style/KeywordArgumentsMerging: # new in 1.68
|
||||
Enabled: true
|
||||
Style/MapIntoArray: # new in 1.63
|
||||
Enabled: true
|
||||
Style/RedundantFormat: # new in 1.72
|
||||
Enabled: true
|
||||
Style/RedundantInterpolationUnfreeze: # new in 1.66
|
||||
Enabled: true
|
||||
Style/SafeNavigationChainLength: # new in 1.68
|
||||
Enabled: true
|
||||
Style/SendWithLiteralMethodName: # new in 1.64
|
||||
Enabled: true
|
||||
Style/SuperArguments: # new in 1.64
|
||||
Enabled: true
|
||||
Style/SuperWithArgsParentheses: # new in 1.58
|
||||
Enabled: true
|
||||
|
@ -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/api_requestor.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/api_requestor.rb'
|
||||
|
||||
# Offense count: 39
|
||||
# Offense count: 44
|
||||
# Configuration parameters: AllowedConstants.
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
|
2188
CHANGELOG.md
2188
CHANGELOG.md
File diff suppressed because it is too large
Load Diff
@ -1,25 +0,0 @@
|
||||
|
||||
# Contributing
|
||||
|
||||
We welcome bug reports, feature requests, and code contributions in a pull request.
|
||||
|
||||
For most pull requests, we request that you identify or create an associated issue that has the necessary context. We use these issues to reach agreement on an approach and save the PR author from having to redo work. Fixing typos or documentation issues likely do not need an issue; for any issue that introduces substantial code changes, changes the public interface, or if you aren't sure, please find or [create an issue](https://www.github.com/stripe/stripe-ruby/issues/new/choose).
|
||||
|
||||
## Contributor License Agreement
|
||||
|
||||
All contributors must sign the Contributor License Agreement (CLA) before we can accept their contribution. If you have not yet signed the agreement, you will be given an option to do so when you open a pull request. You can then sign by clicking on the badge in the comment from @CLAassistant.
|
||||
|
||||
## Generated code
|
||||
|
||||
This project has a combination of manually maintained code and code generated from our private code generator. If your contribution involves changes to generated code, please call this out in the issue or pull request as we will likely need to make a change to our code generator before accepting the contribution.
|
||||
|
||||
To identify files with purely generated code, look for the comment `File generated from our OpenAPI spec.` at the start of the file. Generated blocks of code within hand-written files will be between comments that say `The beginning of the section generated from our OpenAPI spec` and `The end of the section generated from our OpenAPI spec`.
|
||||
|
||||
## Compatibility with supported language and runtime versions
|
||||
|
||||
This project supports [many different langauge and runtime versions](README.md#requirements) and we are unable to accept any contribution that does not work on _all_ supported versions. If, after discussing the approach in the associated issue, your change must use an API / feature that isn't available in all supported versions, please call this out explicitly in the issue or pull request so we can help figure out the best way forward.
|
||||
|
||||
## Set up your dev environment
|
||||
|
||||
Please refer to this project's [README.md](README.md#development) for instructions on how to set up your development environment.
|
||||
|
6
Gemfile
6
Gemfile
@ -24,7 +24,7 @@ group :development do
|
||||
# up-to-date, but it's not the end of the world if it's not.
|
||||
#
|
||||
# The latest version of rubocop is only compatible with Ruby 2.7+
|
||||
gem "rubocop", "1.75.2" if RUBY_VERSION >= "2.7"
|
||||
gem "rubocop", "1.57.2" if RUBY_VERSION >= "2.7"
|
||||
|
||||
gem "sorbet"
|
||||
gem "tapioca"
|
||||
@ -34,8 +34,4 @@ group :development do
|
||||
gem "pry"
|
||||
gem "pry-byebug"
|
||||
end
|
||||
|
||||
platforms :jruby do
|
||||
gem "rbi", "0.2.4" # jruby does not support rbs, a new dependency in 0.3.0
|
||||
end
|
||||
end
|
||||
|
@ -1 +1 @@
|
||||
v1773
|
||||
v1460
|
114
README.md
114
README.md
@ -20,6 +20,8 @@ The library also provides other features. For example:
|
||||
|
||||
See the [Ruby API docs](https://stripe.com/docs/api?lang=ruby).
|
||||
|
||||
See [video demonstrations][youtube-playlist] covering how to use the library.
|
||||
|
||||
## Installation
|
||||
|
||||
You don't need this source code unless you want to modify the gem. If you just
|
||||
@ -60,14 +62,13 @@ value:
|
||||
|
||||
```ruby
|
||||
require 'stripe'
|
||||
|
||||
client = Stripe::StripeClient.new("sk_test_...")
|
||||
Stripe.api_key = 'sk_test_...'
|
||||
|
||||
# list customers
|
||||
customers = client.v1.customers.list()
|
||||
Stripe::Customer.list()
|
||||
|
||||
# retrieve single customer
|
||||
customer = client.v1.customers.retrieve('cus_123456789')
|
||||
Stripe::Customer.retrieve('cus_123456789')
|
||||
```
|
||||
|
||||
### Per-request Configuration
|
||||
@ -79,9 +80,7 @@ per-request key and/or account:
|
||||
```ruby
|
||||
require "stripe"
|
||||
|
||||
client = Stripe::StripeClient.new("sk_test_...")
|
||||
|
||||
client.v1.customers.list(
|
||||
Stripe::Customer.list(
|
||||
{},
|
||||
{
|
||||
api_key: 'sk_test_...',
|
||||
@ -89,20 +88,53 @@ client.v1.customers.list(
|
||||
stripe_version: '2018-02-28',
|
||||
}
|
||||
)
|
||||
|
||||
Stripe::Customer.retrieve(
|
||||
'cus_123456789',
|
||||
{
|
||||
api_key: 'sk_test_...',
|
||||
stripe_account: 'acct_...',
|
||||
stripe_version: '2018-02-28',
|
||||
}
|
||||
)
|
||||
|
||||
Stripe::Customer.retrieve(
|
||||
{
|
||||
id: 'cus_123456789',
|
||||
expand: %w(balance_transaction)
|
||||
},
|
||||
{
|
||||
stripe_version: '2018-02-28',
|
||||
api_key: 'sk_test_...',
|
||||
}
|
||||
)
|
||||
|
||||
Stripe::Customer.capture(
|
||||
'cus_123456789',
|
||||
{},
|
||||
{
|
||||
stripe_version: '2018-02-28',
|
||||
api_key: 'sk_test_...',
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
### StripeClient vs legacy pattern
|
||||
Keep in mind that there are different method signatures depending on the action:
|
||||
|
||||
We introduced the `StripeClient` class in v13 of the Ruby SDK. The legacy pattern used prior to that version is still available to use but will be marked as deprecated soon. Review the [migration guide to use StripeClient](https://github.com/stripe/stripe-ruby/wiki/Migration-guide-for-v13) to move from the legacy pattern.
|
||||
|
||||
Once the legacy pattern is deprecated, new API endpoints will only be accessible in the StripeClient. While there are no current plans to remove the legacy pattern for existing API endpoints, this may change in the future.
|
||||
- When operating on a collection (e.g. `.list`, `.create`) the method signature is
|
||||
`method(params, opts)`.
|
||||
- When operating on resource (e.g. `.capture`, `.update`) the method signature is
|
||||
`method(id, params, opts)`.
|
||||
- One exception is that `retrieve`, despite being an operation on a resource, has the signature
|
||||
`retrieve(id, opts)`. In addition, it will accept a Hash for the `id` param but will extract the
|
||||
`id` key out and use the others as options.
|
||||
|
||||
### Accessing resource properties
|
||||
|
||||
Both indexer and accessors can be used to retrieve values of resource properties.
|
||||
|
||||
```ruby
|
||||
customer = client.v1.customers.retrieve('cus_123456789')
|
||||
customer = Stripe::Customer.retrieve('cus_123456789')
|
||||
puts customer['id']
|
||||
puts customer.id
|
||||
```
|
||||
@ -110,7 +142,7 @@ puts customer.id
|
||||
NOTE: If the resource property is not defined, the accessors will raise an exception, while the indexer will return `nil`.
|
||||
|
||||
```ruby
|
||||
customer = client.v1.customers.retrieve('cus_123456789')
|
||||
customer = Stripe::Customer.retrieve('cus_123456789')
|
||||
puts customer['unknown'] # nil
|
||||
puts customer.unknown # raises NoMethodError
|
||||
```
|
||||
@ -120,15 +152,12 @@ puts customer.unknown # raises NoMethodError
|
||||
Get access to response objects by using the `last_response` property of the returned resource:
|
||||
|
||||
```ruby
|
||||
customer = client.v1.customers.retrieve('cus_123456789')
|
||||
customer = Stripe::Customer.retrieve('cus_123456789')
|
||||
|
||||
print(customer.last_response.http_status) # to retrieve status code
|
||||
print(customer.last_response.http_headers) # to retrieve headers
|
||||
```
|
||||
|
||||
If you are accessing a response field with custom hashes provided by you, such as `Customer.metadata`,
|
||||
please access your fields with the `[]` accessor.
|
||||
|
||||
### Configuring a proxy
|
||||
|
||||
A proxy can be configured with `Stripe.proxy`:
|
||||
@ -288,54 +317,22 @@ You can disable this behavior if you prefer:
|
||||
Stripe.enable_telemetry = false
|
||||
```
|
||||
|
||||
### Types
|
||||
### Beta SDKs
|
||||
|
||||
In [v14.0.0](https://github.com/stripe/stripe-python/releases/tag/v7.1.0) and newer, the library provides RBI
|
||||
static type annotations. See [the wiki](https://github.com/stripe/stripe-ruby/wiki/Static-Type-Annotations)
|
||||
for an detailed guide.
|
||||
|
||||
Please note that these types are available only for static analysis and we only support RBIs at the moment.
|
||||
Please [report an issue](https://github.com/stripe/stripe-ruby/issues/new/choose)
|
||||
if you find discrepancies or have issues using types.
|
||||
|
||||
The RBIs can be found in the `rbi/stripe/` directory, and to decrease `Tapioca` loading time we pack the gem with the
|
||||
combined RBI at `rbi/stripe.rbi`.
|
||||
|
||||
#### Types and the Versioning Policy
|
||||
|
||||
We release type changes in minor releases. While stripe-ruby follows semantic versioning, our semantic
|
||||
versions describe the runtime behavior of the library alone. Our type annotations are not reflected in the
|
||||
semantic version. That is, upgrading to a new minor version of `stripe-ruby` might result in your type checker
|
||||
producing a type error that it didn't before. You can use `~> x.x` or `x.x.x` constrain the version
|
||||
of `stripe-ruby` in your Gemfile to a certain version or range of `stripe-ruby`.
|
||||
|
||||
#### Types and API Versions
|
||||
|
||||
The types describe the [Stripe API version](https://stripe.com/docs/api/versioning)
|
||||
that was the latest at the time of release. This is the version that your library sends
|
||||
by default. If you are overriding `Stripe.api_version` / `stripe_version` on the StripeClient,
|
||||
or using a webhook endpoint tied to an older version, be aware that the data
|
||||
you see at runtime may not match the types.
|
||||
|
||||
### Public Preview SDKs
|
||||
|
||||
Stripe has features in the [public preview phase](https://docs.stripe.com/release-phases) that can be accessed via versions of this package that have the `-beta.X` suffix like `11.2.0-beta.2`.
|
||||
We would love for you to try these as we incrementally release new features and improve them based on your feedback.
|
||||
|
||||
To install, choose the version that includes support for the preview feature you are interested in by reviewing the [releases page](https://github.com/stripe/stripe-ruby/releases/) and use it in the `gem install` command:
|
||||
Stripe has features in the beta phase that can be accessed via the beta version of this package.
|
||||
We would love for you to try these and share feedback with us before these features reach the stable phase.
|
||||
To install a beta version use `gem install` with the exact version you'd like to use:
|
||||
|
||||
```sh
|
||||
gem install stripe -v <replace-with-the-version-of-your-choice>
|
||||
gem install stripe -v 7.1.0.pre.beta.2
|
||||
```
|
||||
|
||||
You can find the latest version to use in this command from the [releases page](https://github.com/stripe/stripe-ruby/releases/)
|
||||
|
||||
> **Note**
|
||||
> There can be breaking changes between two versions of the public preview SDKs without a bump in the major version. Therefore we recommend pinning the package version to a specific version in your Gemfile. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest version of the public preview SDK.
|
||||
> There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your Gemfile. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version.
|
||||
|
||||
We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version.
|
||||
|
||||
Some preview features require a name and version to be set in the `Stripe-Version` header like `feature_beta=v3`. If your preview feature has this requirement, use the `Stripe.add_beta_version` function (available only in the public preview SDKs):
|
||||
If your beta feature requires a `Stripe-Version` header to be sent, set the `Stripe.api_version` field using `Stripe.add_beta_version`:
|
||||
|
||||
```python
|
||||
Stripe.add_beta_version("feature_beta", "v3")
|
||||
@ -352,8 +349,8 @@ If you:
|
||||
you can now use the `raw_request` method on `StripeClient`.
|
||||
|
||||
```ruby
|
||||
client = Stripe::StripeClient.new('sk_test_...')
|
||||
resp = client.raw_request(:post, "/v1/beta_endpoint", params: {param: 123}, opts: {stripe_version: "2022-11-15; feature_beta=v3"})
|
||||
client = Stripe::StripeClient.new(...)
|
||||
resp = client.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 = client.deserialize(resp.http_body)
|
||||
@ -418,6 +415,7 @@ Update the bundled [stripe-mock] by editing the version number found in
|
||||
[idempotency-keys]: https://stripe.com/docs/api/idempotent_requests?lang=ruby
|
||||
[stripe-mock]: https://github.com/stripe/stripe-mock
|
||||
[versioning]: https://stripe.com/docs/api/versioning?lang=ruby
|
||||
[youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M50RmP6ie-gdcSnfOuQCRYk
|
||||
|
||||
<!--
|
||||
# vim: set tw=79:
|
||||
|
@ -13,6 +13,7 @@ require "set"
|
||||
require "socket"
|
||||
require "uri"
|
||||
require "forwardable"
|
||||
require "base64"
|
||||
|
||||
# Version
|
||||
require "stripe/api_version"
|
||||
@ -51,6 +52,7 @@ require "stripe/api_resource_test_helpers"
|
||||
require "stripe/singleton_api_resource"
|
||||
require "stripe/webhook"
|
||||
require "stripe/stripe_configuration"
|
||||
require "stripe/request_signing_authenticator"
|
||||
require "stripe/thin_event"
|
||||
|
||||
# Named API resources
|
||||
@ -108,6 +110,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=
|
||||
@ -155,6 +158,48 @@ 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 RawRequest
|
||||
def initialize
|
||||
@opts = {}
|
||||
end
|
||||
|
||||
def execute(method, url, base_address: :api, params: {}, opts: {}, usage: [])
|
||||
opts = Util.normalize_opts(opts)
|
||||
req_opts = RequestOptions.extract_opts_from_hash(opts)
|
||||
|
||||
requestor = APIRequestor.active_requestor
|
||||
resp, = requestor.send(:execute_request_internal, method, url, base_address, params, req_opts,
|
||||
usage)
|
||||
|
||||
requestor.interpret_response(resp)
|
||||
end
|
||||
end
|
||||
|
||||
# Sends a request to Stripe REST API
|
||||
def self.raw_request(method, url, params = {}, opts = {}, base_address: :api)
|
||||
req = RawRequest.new
|
||||
req.execute(method, url, base_address: base_address, params: params, opts: opts,
|
||||
usage: ["raw_request"])
|
||||
end
|
||||
|
||||
def self.deserialize(data, api_mode: :v1)
|
||||
data = JSON.parse(data) if data.is_a?(String)
|
||||
Util.convert_to_stripe_object(data, {}, api_mode: api_mode)
|
||||
end
|
||||
class << self
|
||||
extend Gem::Deprecate
|
||||
deprecate :raw_request, "StripeClient#raw_request", 2024, 9
|
||||
deprecate :deserialize, "StripeClient#deserialize", 2024, 9
|
||||
end
|
||||
end
|
||||
|
||||
Stripe.log_level = ENV["STRIPE_LOG"] unless ENV["STRIPE_LOG"].nil?
|
||||
|
@ -67,8 +67,7 @@ module Stripe
|
||||
values.delete(:id)
|
||||
opts = Util.normalize_opts(opts)
|
||||
APIRequestor.active_requestor.execute_request_initialize_from(:post, save_url, :api, self,
|
||||
params: values,
|
||||
opts: RequestOptions.extract_opts_from_hash(opts),
|
||||
params: values, opts: opts,
|
||||
usage: ["save"])
|
||||
end
|
||||
extend Gem::Deprecate
|
||||
|
@ -64,8 +64,7 @@ module Stripe
|
||||
opts = Util.normalize_opts(opts)
|
||||
|
||||
APIRequestor.active_requestor.execute_request_initialize_from(:post, resource_url, :api, self,
|
||||
params: values,
|
||||
opts: RequestOptions.extract_opts_from_hash(opts),
|
||||
params: values, opts: opts,
|
||||
usage: ["save"])
|
||||
end
|
||||
extend Gem::Deprecate
|
||||
|
@ -220,11 +220,8 @@ module Stripe
|
||||
# with future non-major changes.
|
||||
def execute_request_initialize_from(method, path, base_address, object,
|
||||
params: {}, opts: {}, usage: [])
|
||||
opts = RequestOptions.combine_opts(object.instance_variable_get(:@opts) || {}, opts)
|
||||
opts = RequestOptions.combine_opts(object.instance_variable_get(:@opts), opts)
|
||||
opts = Util.normalize_opts(opts)
|
||||
|
||||
params = params.to_h if params.is_a?(RequestParams)
|
||||
|
||||
http_resp, req_opts = execute_request_internal(
|
||||
method, path, base_address, params, opts, usage
|
||||
)
|
||||
@ -274,7 +271,6 @@ module Stripe
|
||||
"execute_request_stream requires a read_body_chunk_block"
|
||||
end
|
||||
|
||||
params = params.to_h if params.is_a?(RequestParams)
|
||||
http_resp, api_key = execute_request_internal(
|
||||
method, path, base_address, params, opts, usage, &read_body_chunk_block
|
||||
)
|
||||
@ -913,7 +909,7 @@ module Stripe
|
||||
"with Stripe. Please let us know at support@stripe.com."
|
||||
end
|
||||
|
||||
message %= base_url
|
||||
message = message % base_url
|
||||
|
||||
message += " Request was retried #{num_retries} times." if num_retries > 0
|
||||
|
||||
|
@ -98,10 +98,7 @@ module Stripe
|
||||
"It is not possible to refresh v2 objects. Please retrieve the object using the StripeClient instead."
|
||||
end
|
||||
|
||||
opts = RequestOptions.extract_opts_from_hash(@retrieve_opts || {})
|
||||
@retrieve_opts = {} # Make sure to clear the retrieve options
|
||||
@obj = @requestor.execute_request_initialize_from(:get, resource_url, :api, self, params: @retrieve_params,
|
||||
opts: opts)
|
||||
@obj = @requestor.execute_request_initialize_from(:get, resource_url, :api, self, params: @retrieve_params)
|
||||
initialize_from(
|
||||
@obj.last_response.data,
|
||||
@obj.instance_variable_get(:@opts),
|
||||
@ -117,12 +114,8 @@ module Stripe
|
||||
"It is not possible to retrieve v2 objects on the resource. Please use the StripeClient instead."
|
||||
end
|
||||
|
||||
instance = new(id)
|
||||
# Explicitly send options for the retrieve call, to preserve custom headers
|
||||
# This is so we can pass custom headers from this static function
|
||||
# to the instance variable method call
|
||||
# The custom headers will be cleaned up with the rest of the RequestOptions
|
||||
instance.instance_variable_set(:@retrieve_opts, Util.normalize_opts(opts))
|
||||
opts = Util.normalize_opts(opts)
|
||||
instance = new(id, opts)
|
||||
instance.refresh
|
||||
end
|
||||
|
||||
|
@ -3,6 +3,6 @@
|
||||
|
||||
module Stripe
|
||||
module ApiVersion
|
||||
CURRENT = "2025-05-28.basil"
|
||||
CURRENT = "2025-01-27.acacia"
|
||||
end
|
||||
end
|
||||
|
@ -36,7 +36,9 @@ module Stripe
|
||||
# clears them from internal tracking.
|
||||
def clear
|
||||
@mutex.synchronize do
|
||||
@active_connections.each_value(&:finish)
|
||||
@active_connections.each do |_, connection|
|
||||
connection.finish
|
||||
end
|
||||
@active_connections = {}
|
||||
end
|
||||
end
|
||||
|
@ -31,6 +31,13 @@ module Stripe
|
||||
ErrorObject.construct_from(@json_body[:error], {}, nil, :v1)
|
||||
end
|
||||
|
||||
# Whether the error was the result of an idempotent replay, meaning that it
|
||||
# originally occurred on a previous request and is being replayed back
|
||||
# because the user sent the same idempotency key for this one.
|
||||
def idempotent_replayed?
|
||||
@idempotent_replayed
|
||||
end
|
||||
|
||||
def to_s
|
||||
status_string = @http_status.nil? ? "" : "(Status #{@http_status}) "
|
||||
id_string = @request_id.nil? ? "" : "(Request #{@request_id}) "
|
||||
|
@ -7,7 +7,6 @@ module Stripe
|
||||
# The beginning of the section generated from our OpenAPI spec
|
||||
V1BillingMeterErrorReportTriggeredEvent.lookup_type => V1BillingMeterErrorReportTriggeredEvent,
|
||||
V1BillingMeterNoMeterFoundEvent.lookup_type => V1BillingMeterNoMeterFoundEvent,
|
||||
V2CoreEventDestinationPingEvent.lookup_type => V2CoreEventDestinationPingEvent,
|
||||
# The end of the section generated from our OpenAPI spec
|
||||
}
|
||||
end
|
||||
|
@ -2,7 +2,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
# Occurs when a Meter has invalid async usage events.
|
||||
# This event occurs when there are invalid async usage events for a given meter.
|
||||
class V1BillingMeterErrorReportTriggeredEvent < Stripe::V2::Event
|
||||
def self.lookup_type
|
||||
"v1.billing.meter.error_report_triggered"
|
||||
|
@ -2,7 +2,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
# Occurs when a Meter's id is missing or invalid in async usage events.
|
||||
# This event occurs when async usage events have missing or invalid meter ids.
|
||||
class V1BillingMeterNoMeterFoundEvent < Stripe::V2::Event
|
||||
def self.lookup_type
|
||||
"v1.billing.meter.no_meter_found"
|
||||
|
@ -1,21 +0,0 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
# A ping event used to test the connection to an event destination.
|
||||
class V2CoreEventDestinationPingEvent < Stripe::V2::Event
|
||||
def self.lookup_type
|
||||
"v2.core.event_destination.ping"
|
||||
end
|
||||
|
||||
# Retrieves the related object from the API. Make an API request on every call.
|
||||
def fetch_related_object
|
||||
_request(
|
||||
method: :get,
|
||||
path: related_object.url,
|
||||
base_address: :api,
|
||||
opts: { stripe_account: context }
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
@ -8,7 +8,7 @@ module Stripe
|
||||
def self.execute_resource_request(method, url, base_address, params, opts)
|
||||
opts = Util.normalize_opts(opts)
|
||||
|
||||
super
|
||||
super(method, url, base_address, params, opts)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -14,6 +14,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,
|
||||
Application.object_name => Application,
|
||||
@ -29,12 +30,16 @@ module Stripe
|
||||
Billing::CreditBalanceTransaction.object_name => Billing::CreditBalanceTransaction,
|
||||
Billing::CreditGrant.object_name => Billing::CreditGrant,
|
||||
Billing::Meter.object_name => Billing::Meter,
|
||||
Billing::MeterErrorReport.object_name => Billing::MeterErrorReport,
|
||||
Billing::MeterEvent.object_name => Billing::MeterEvent,
|
||||
Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment,
|
||||
Billing::MeterEventSummary.object_name => Billing::MeterEventSummary,
|
||||
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,
|
||||
@ -63,12 +68,17 @@ 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::Institution.object_name => FinancialConnections::Institution,
|
||||
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,
|
||||
@ -79,19 +89,27 @@ module Stripe
|
||||
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::DisputeSettlementDetail.object_name => Issuing::DisputeSettlementDetail,
|
||||
Issuing::FraudLiabilityDebit.object_name => Issuing::FraudLiabilityDebit,
|
||||
Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
|
||||
Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
|
||||
Issuing::Settlement.object_name => Issuing::Settlement,
|
||||
Issuing::Token.object_name => Issuing::Token,
|
||||
Issuing::Transaction.object_name => Issuing::Transaction,
|
||||
LineItem.object_name => LineItem,
|
||||
LoginLink.object_name => LoginLink,
|
||||
Mandate.object_name => Mandate,
|
||||
Margin.object_name => Margin,
|
||||
Order.object_name => Order,
|
||||
PaymentAttemptRecord.object_name => PaymentAttemptRecord,
|
||||
PaymentIntent.object_name => PaymentIntent,
|
||||
PaymentLink.object_name => PaymentLink,
|
||||
PaymentMethod.object_name => PaymentMethod,
|
||||
PaymentMethodConfiguration.object_name => PaymentMethodConfiguration,
|
||||
PaymentMethodDomain.object_name => PaymentMethodDomain,
|
||||
PaymentRecord.object_name => PaymentRecord,
|
||||
Payout.object_name => Payout,
|
||||
Person.object_name => Person,
|
||||
Plan.object_name => Plan,
|
||||
@ -100,6 +118,9 @@ module Stripe
|
||||
ProductFeature.object_name => ProductFeature,
|
||||
PromotionCode.object_name => PromotionCode,
|
||||
Quote.object_name => Quote,
|
||||
QuoteLine.object_name => QuoteLine,
|
||||
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,
|
||||
@ -119,8 +140,10 @@ module Stripe
|
||||
Subscription.object_name => Subscription,
|
||||
SubscriptionItem.object_name => SubscriptionItem,
|
||||
SubscriptionSchedule.object_name => SubscriptionSchedule,
|
||||
Tax::Association.object_name => Tax::Association,
|
||||
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,
|
||||
@ -133,6 +156,7 @@ module Stripe
|
||||
Terminal::ConnectionToken.object_name => Terminal::ConnectionToken,
|
||||
Terminal::Location.object_name => Terminal::Location,
|
||||
Terminal::Reader.object_name => Terminal::Reader,
|
||||
Terminal::ReaderCollectedData.object_name => Terminal::ReaderCollectedData,
|
||||
TestHelpers::TestClock.object_name => TestHelpers::TestClock,
|
||||
Token.object_name => Token,
|
||||
Topup.object_name => Topup,
|
||||
@ -148,6 +172,8 @@ module Stripe
|
||||
Treasury::ReceivedDebit.object_name => Treasury::ReceivedDebit,
|
||||
Treasury::Transaction.object_name => Treasury::Transaction,
|
||||
Treasury::TransactionEntry.object_name => Treasury::TransactionEntry,
|
||||
UsageRecord.object_name => UsageRecord,
|
||||
UsageRecordSummary.object_name => UsageRecordSummary,
|
||||
WebhookEndpoint.object_name => WebhookEndpoint,
|
||||
# object classes: The end of the section generated from our OpenAPI spec
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ module Stripe
|
||||
# Merges requestor options hash on a StripeObject
|
||||
# with a per-request options hash, giving precedence
|
||||
# to the per-request options. Returns the merged request options.
|
||||
# Expects two hashes, expects extract_opts_from_hash to be called first!!!
|
||||
# Expects two hashes.
|
||||
def self.combine_opts(object_opts, req_opts)
|
||||
merged_opts = {
|
||||
api_key: req_opts[:api_key] || object_opts[:api_key],
|
||||
@ -64,7 +64,6 @@ module Stripe
|
||||
stripe_account: req_opts[:stripe_account] || object_opts[:stripe_account],
|
||||
stripe_context: req_opts[:stripe_context] || object_opts[:stripe_context],
|
||||
stripe_version: req_opts[:stripe_version] || object_opts[:stripe_version],
|
||||
headers: req_opts[:headers] || {},
|
||||
}
|
||||
|
||||
# Remove nil values from headers
|
||||
|
79
lib/stripe/request_signing_authenticator.rb
Normal file
79
lib/stripe/request_signing_authenticator.rb
Normal 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
|
@ -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"
|
||||
@ -18,12 +19,16 @@ require "stripe/resources/billing/credit_balance_summary"
|
||||
require "stripe/resources/billing/credit_balance_transaction"
|
||||
require "stripe/resources/billing/credit_grant"
|
||||
require "stripe/resources/billing/meter"
|
||||
require "stripe/resources/billing/meter_error_report"
|
||||
require "stripe/resources/billing/meter_event"
|
||||
require "stripe/resources/billing/meter_event_adjustment"
|
||||
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"
|
||||
@ -52,12 +57,16 @@ 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/institution"
|
||||
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"
|
||||
@ -68,19 +77,27 @@ require "stripe/resources/invoice_rendering_template"
|
||||
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/dispute_settlement_detail"
|
||||
require "stripe/resources/issuing/fraud_liability_debit"
|
||||
require "stripe/resources/issuing/personalization_design"
|
||||
require "stripe/resources/issuing/physical_bundle"
|
||||
require "stripe/resources/issuing/settlement"
|
||||
require "stripe/resources/issuing/token"
|
||||
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_attempt_record"
|
||||
require "stripe/resources/payment_intent"
|
||||
require "stripe/resources/payment_link"
|
||||
require "stripe/resources/payment_method"
|
||||
require "stripe/resources/payment_method_configuration"
|
||||
require "stripe/resources/payment_method_domain"
|
||||
require "stripe/resources/payment_record"
|
||||
require "stripe/resources/payout"
|
||||
require "stripe/resources/person"
|
||||
require "stripe/resources/plan"
|
||||
@ -89,6 +106,9 @@ require "stripe/resources/product"
|
||||
require "stripe/resources/product_feature"
|
||||
require "stripe/resources/promotion_code"
|
||||
require "stripe/resources/quote"
|
||||
require "stripe/resources/quote_line"
|
||||
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"
|
||||
@ -108,8 +128,10 @@ require "stripe/resources/source_transaction"
|
||||
require "stripe/resources/subscription"
|
||||
require "stripe/resources/subscription_item"
|
||||
require "stripe/resources/subscription_schedule"
|
||||
require "stripe/resources/tax/association"
|
||||
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"
|
||||
@ -122,6 +144,7 @@ require "stripe/resources/terminal/configuration"
|
||||
require "stripe/resources/terminal/connection_token"
|
||||
require "stripe/resources/terminal/location"
|
||||
require "stripe/resources/terminal/reader"
|
||||
require "stripe/resources/terminal/reader_collected_data"
|
||||
require "stripe/resources/test_helpers/test_clock"
|
||||
require "stripe/resources/token"
|
||||
require "stripe/resources/topup"
|
||||
@ -137,6 +160,8 @@ require "stripe/resources/treasury/received_credit"
|
||||
require "stripe/resources/treasury/received_debit"
|
||||
require "stripe/resources/treasury/transaction"
|
||||
require "stripe/resources/treasury/transaction_entry"
|
||||
require "stripe/resources/usage_record"
|
||||
require "stripe/resources/usage_record_summary"
|
||||
require "stripe/resources/v2/billing/meter_event"
|
||||
require "stripe/resources/v2/billing/meter_event_adjustment"
|
||||
require "stripe/resources/v2/billing/meter_event_session"
|
||||
@ -145,4 +170,3 @@ require "stripe/resources/v2/event_destination"
|
||||
require "stripe/resources/webhook_endpoint"
|
||||
require "stripe/events/v1_billing_meter_error_report_triggered_event"
|
||||
require "stripe/events/v1_billing_meter_no_meter_found_event"
|
||||
require "stripe/events/v2_core_event_destination_ping_event"
|
||||
|
File diff suppressed because it is too large
Load Diff
132
lib/stripe/resources/account_notice.rb
Normal file
132
lib/stripe/resources/account_notice.rb
Normal file
@ -0,0 +1,132 @@
|
||||
# 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
|
||||
|
||||
class Email < Stripe::StripeObject
|
||||
# Content of the email in plain text. The copy must match exactly the language that Stripe Compliance has approved for use.
|
||||
attr_reader :plain_text
|
||||
# Email address of the recipient.
|
||||
attr_reader :recipient
|
||||
# Subject of the email.
|
||||
attr_reader :subject
|
||||
end
|
||||
|
||||
class LinkedObjects < Stripe::StripeObject
|
||||
# Associated [Capability](https://stripe.com/docs/api/capabilities)
|
||||
attr_reader :capability
|
||||
# Associated [Credit Underwriting Record](https://stripe.com/docs/api/issuing/credit_underwriting_record)
|
||||
attr_reader :issuing_credit_underwriting_record
|
||||
# Associated [Issuing Dispute](https://stripe.com/docs/api/issuing/disputes)
|
||||
attr_reader :issuing_dispute
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# Set to false to only return unsent AccountNotices.
|
||||
attr_accessor :sent
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
|
||||
def initialize(ending_before: nil, expand: nil, limit: nil, sent: nil, starting_after: nil)
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@limit = limit
|
||||
@sent = sent
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Email < Stripe::RequestParams
|
||||
# Content of the email in plain text. The copy must match exactly the language that Stripe Compliance has approved for use.
|
||||
attr_accessor :plain_text
|
||||
# Email address of the recipient.
|
||||
attr_accessor :recipient
|
||||
# Subject of the email.
|
||||
attr_accessor :subject
|
||||
|
||||
def initialize(plain_text: nil, recipient: nil, subject: nil)
|
||||
@plain_text = plain_text
|
||||
@recipient = recipient
|
||||
@subject = subject
|
||||
end
|
||||
end
|
||||
# Information about the email you sent.
|
||||
attr_accessor :email
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
# Date when you sent the notice.
|
||||
attr_accessor :sent_at
|
||||
|
||||
def initialize(email: nil, expand: nil, metadata: nil, sent_at: nil)
|
||||
@email = email
|
||||
@expand = expand
|
||||
@metadata = metadata
|
||||
@sent_at = sent_at
|
||||
end
|
||||
end
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# When present, the deadline for sending the notice to meet the relevant regulations.
|
||||
attr_reader :deadline
|
||||
# Information about the email when sent.
|
||||
attr_reader :email
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Information about objects related to the notice.
|
||||
attr_reader :linked_objects
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
attr_reader :metadata
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# Reason the notice is being sent. The reason determines what copy the notice must contain. See the [regulated customer notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) guide. All reasons might not apply to your integration, and Stripe might add new reasons in the future, so we recommend an internal warning when you receive an unknown reason.
|
||||
attr_reader :reason
|
||||
# Date when the notice was sent. When absent, you must send the notice, update the content of the email and date when it was sent.
|
||||
attr_reader :sent_at
|
||||
|
||||
# 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(params = {}, opts = {})
|
||||
request_stripe_object(method: :get, path: "/v1/account_notices", params: params, 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
|
@ -63,17 +63,24 @@ module Stripe
|
||||
attr_reader :features
|
||||
end
|
||||
|
||||
class DisputesList < Stripe::StripeObject
|
||||
class Features < Stripe::StripeObject
|
||||
# Whether to allow capturing and cancelling payment intents. This is `true` by default.
|
||||
attr_reader :capture_payments
|
||||
# Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
|
||||
attr_reader :destination_on_behalf_of_charge_management
|
||||
# Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
|
||||
attr_reader :dispute_management
|
||||
# Whether to allow sending refunds. This is `true` by default.
|
||||
attr_reader :refund_management
|
||||
class CapitalFinancing < Stripe::StripeObject
|
||||
class Features < Stripe::StripeObject; end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_reader :enabled
|
||||
# Attribute for field features
|
||||
attr_reader :features
|
||||
end
|
||||
|
||||
class CapitalFinancingApplication < Stripe::StripeObject
|
||||
class Features < Stripe::StripeObject; end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_reader :enabled
|
||||
# Attribute for field features
|
||||
attr_reader :features
|
||||
end
|
||||
|
||||
class CapitalFinancingPromotion < Stripe::StripeObject
|
||||
class Features < Stripe::StripeObject; end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_reader :enabled
|
||||
# Attribute for field features
|
||||
@ -182,21 +189,6 @@ module Stripe
|
||||
attr_reader :features
|
||||
end
|
||||
|
||||
class PaymentDisputes < Stripe::StripeObject
|
||||
class Features < Stripe::StripeObject
|
||||
# Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
|
||||
attr_reader :destination_on_behalf_of_charge_management
|
||||
# Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
|
||||
attr_reader :dispute_management
|
||||
# Whether to allow sending refunds. This is `true` by default.
|
||||
attr_reader :refund_management
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_reader :enabled
|
||||
# Attribute for field features
|
||||
attr_reader :features
|
||||
end
|
||||
|
||||
class Payments < Stripe::StripeObject
|
||||
class Features < Stripe::StripeObject
|
||||
# Whether to allow capturing and cancelling payment intents. This is `true` by default.
|
||||
@ -262,8 +254,12 @@ module Stripe
|
||||
attr_reader :account_onboarding
|
||||
# Attribute for field balances
|
||||
attr_reader :balances
|
||||
# Attribute for field disputes_list
|
||||
attr_reader :disputes_list
|
||||
# Attribute for field capital_financing
|
||||
attr_reader :capital_financing
|
||||
# Attribute for field capital_financing_application
|
||||
attr_reader :capital_financing_application
|
||||
# Attribute for field capital_financing_promotion
|
||||
attr_reader :capital_financing_promotion
|
||||
# Attribute for field documents
|
||||
attr_reader :documents
|
||||
# Attribute for field financial_account
|
||||
@ -278,8 +274,6 @@ module Stripe
|
||||
attr_reader :notification_banner
|
||||
# Attribute for field payment_details
|
||||
attr_reader :payment_details
|
||||
# Attribute for field payment_disputes
|
||||
attr_reader :payment_disputes
|
||||
# Attribute for field payments
|
||||
attr_reader :payments
|
||||
# Attribute for field payouts
|
||||
@ -346,6 +340,46 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class AppInstall < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
# List of apps allowed to be enabled for this account session.
|
||||
attr_accessor :allowed_apps
|
||||
|
||||
def initialize(allowed_apps: nil)
|
||||
@allowed_apps = allowed_apps
|
||||
end
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
attr_accessor :features
|
||||
|
||||
def initialize(enabled: nil, features: nil)
|
||||
@enabled = enabled
|
||||
@features = features
|
||||
end
|
||||
end
|
||||
|
||||
class AppViewport < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
# List of apps allowed to be enabled for this account session.
|
||||
attr_accessor :allowed_apps
|
||||
|
||||
def initialize(allowed_apps: nil)
|
||||
@allowed_apps = allowed_apps
|
||||
end
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
attr_accessor :features
|
||||
|
||||
def initialize(enabled: nil, features: nil)
|
||||
@enabled = enabled
|
||||
@features = features
|
||||
end
|
||||
end
|
||||
|
||||
class Balances < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
# Disables Stripe user authentication for this embedded component. This value can only be true for accounts where `controller.requirement_collection` is `application`. The default value is the opposite of the `external_account_collection` value. For example, if you don’t set `external_account_collection`, it defaults to true and `disable_stripe_user_authentication` defaults to false.
|
||||
@ -384,28 +418,50 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class DisputesList < Stripe::RequestParams
|
||||
class CapitalFinancing < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
# Whether to allow capturing and cancelling payment intents. This is `true` by default.
|
||||
attr_accessor :capture_payments
|
||||
# Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
|
||||
attr_accessor :destination_on_behalf_of_charge_management
|
||||
# Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
|
||||
attr_accessor :dispute_management
|
||||
# Whether to allow sending refunds. This is `true` by default.
|
||||
attr_accessor :refund_management
|
||||
|
||||
def initialize(
|
||||
capture_payments: nil,
|
||||
destination_on_behalf_of_charge_management: nil,
|
||||
dispute_management: nil,
|
||||
refund_management: nil
|
||||
)
|
||||
@capture_payments = capture_payments
|
||||
@destination_on_behalf_of_charge_management = destination_on_behalf_of_charge_management
|
||||
@dispute_management = dispute_management
|
||||
@refund_management = refund_management
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
attr_accessor :features
|
||||
|
||||
def initialize(enabled: nil, features: nil)
|
||||
@enabled = enabled
|
||||
@features = features
|
||||
end
|
||||
end
|
||||
|
||||
class CapitalFinancingApplication < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
attr_accessor :features
|
||||
|
||||
def initialize(enabled: nil, features: nil)
|
||||
@enabled = enabled
|
||||
@features = features
|
||||
end
|
||||
end
|
||||
|
||||
class CapitalFinancingPromotion < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
attr_accessor :features
|
||||
|
||||
def initialize(enabled: nil, features: nil)
|
||||
@enabled = enabled
|
||||
@features = features
|
||||
end
|
||||
end
|
||||
|
||||
class CapitalOverview < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
@ -419,7 +475,8 @@ module Stripe
|
||||
end
|
||||
|
||||
class Documents < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams; end
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
@ -617,24 +674,8 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class PaymentDisputes < Stripe::RequestParams
|
||||
class PaymentMethodSettings < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
# Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default.
|
||||
attr_accessor :destination_on_behalf_of_charge_management
|
||||
# Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default.
|
||||
attr_accessor :dispute_management
|
||||
# Whether to allow sending refunds. This is `true` by default.
|
||||
attr_accessor :refund_management
|
||||
|
||||
def initialize(
|
||||
destination_on_behalf_of_charge_management: nil,
|
||||
dispute_management: nil,
|
||||
refund_management: nil
|
||||
)
|
||||
@destination_on_behalf_of_charge_management = destination_on_behalf_of_charge_management
|
||||
@dispute_management = dispute_management
|
||||
@refund_management = refund_management
|
||||
end
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
@ -720,7 +761,42 @@ module Stripe
|
||||
end
|
||||
|
||||
class PayoutsList < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams; end
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
attr_accessor :features
|
||||
|
||||
def initialize(enabled: nil, features: nil)
|
||||
@enabled = enabled
|
||||
@features = features
|
||||
end
|
||||
end
|
||||
|
||||
class Recipients < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
# Whether to allow sending money.
|
||||
attr_accessor :send_money
|
||||
|
||||
def initialize(send_money: nil)
|
||||
@send_money = send_money
|
||||
end
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# Attribute for param field features
|
||||
attr_accessor :features
|
||||
|
||||
def initialize(enabled: nil, features: nil)
|
||||
@enabled = enabled
|
||||
@features = features
|
||||
end
|
||||
end
|
||||
|
||||
class ReportingChart < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
@ -733,7 +809,8 @@ module Stripe
|
||||
end
|
||||
|
||||
class TaxRegistrations < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams; end
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
@ -746,7 +823,22 @@ module Stripe
|
||||
end
|
||||
|
||||
class TaxSettings < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams; end
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
attr_accessor :features
|
||||
|
||||
def initialize(enabled: nil, features: nil)
|
||||
@enabled = enabled
|
||||
@features = features
|
||||
end
|
||||
end
|
||||
|
||||
class TaxThresholdMonitoring < Stripe::RequestParams
|
||||
class Features < Stripe::RequestParams
|
||||
end
|
||||
# Whether the embedded component is enabled.
|
||||
attr_accessor :enabled
|
||||
# The list of features enabled in the embedded component.
|
||||
@ -761,10 +853,20 @@ module Stripe
|
||||
attr_accessor :account_management
|
||||
# Configuration for the account onboarding embedded component.
|
||||
attr_accessor :account_onboarding
|
||||
# Configuration for the app install component.
|
||||
attr_accessor :app_install
|
||||
# Configuration for the app viewport component.
|
||||
attr_accessor :app_viewport
|
||||
# Configuration for the balances embedded component.
|
||||
attr_accessor :balances
|
||||
# Configuration for the disputes list embedded component.
|
||||
attr_accessor :disputes_list
|
||||
# Configuration for the capital financing embedded component.
|
||||
attr_accessor :capital_financing
|
||||
# Configuration for the capital financing application embedded component.
|
||||
attr_accessor :capital_financing_application
|
||||
# Configuration for the capital financing promotion embedded component.
|
||||
attr_accessor :capital_financing_promotion
|
||||
# Configuration for the capital overview embedded component.
|
||||
attr_accessor :capital_overview
|
||||
# Configuration for the documents embedded component.
|
||||
attr_accessor :documents
|
||||
# Configuration for the financial account embedded component.
|
||||
@ -779,24 +881,35 @@ module Stripe
|
||||
attr_accessor :notification_banner
|
||||
# Configuration for the payment details embedded component.
|
||||
attr_accessor :payment_details
|
||||
# Configuration for the payment disputes embedded component.
|
||||
attr_accessor :payment_disputes
|
||||
# Configuration for the payment method settings embedded component.
|
||||
attr_accessor :payment_method_settings
|
||||
# Configuration for the payments embedded component.
|
||||
attr_accessor :payments
|
||||
# Configuration for the payouts embedded component.
|
||||
attr_accessor :payouts
|
||||
# Configuration for the payouts list embedded component.
|
||||
attr_accessor :payouts_list
|
||||
# Configuration for the recipients component.
|
||||
attr_accessor :recipients
|
||||
# Configuration for the reporting chart embedded component.
|
||||
attr_accessor :reporting_chart
|
||||
# Configuration for the tax registrations embedded component.
|
||||
attr_accessor :tax_registrations
|
||||
# Configuration for the tax settings embedded component.
|
||||
attr_accessor :tax_settings
|
||||
# Configuration for the tax threshold monitoring embedded component.
|
||||
attr_accessor :tax_threshold_monitoring
|
||||
|
||||
def initialize(
|
||||
account_management: nil,
|
||||
account_onboarding: nil,
|
||||
app_install: nil,
|
||||
app_viewport: nil,
|
||||
balances: nil,
|
||||
disputes_list: nil,
|
||||
capital_financing: nil,
|
||||
capital_financing_application: nil,
|
||||
capital_financing_promotion: nil,
|
||||
capital_overview: nil,
|
||||
documents: nil,
|
||||
financial_account: nil,
|
||||
financial_account_transactions: nil,
|
||||
@ -804,17 +917,25 @@ module Stripe
|
||||
issuing_cards_list: nil,
|
||||
notification_banner: nil,
|
||||
payment_details: nil,
|
||||
payment_disputes: nil,
|
||||
payment_method_settings: nil,
|
||||
payments: nil,
|
||||
payouts: nil,
|
||||
payouts_list: nil,
|
||||
recipients: nil,
|
||||
reporting_chart: nil,
|
||||
tax_registrations: nil,
|
||||
tax_settings: nil
|
||||
tax_settings: nil,
|
||||
tax_threshold_monitoring: nil
|
||||
)
|
||||
@account_management = account_management
|
||||
@account_onboarding = account_onboarding
|
||||
@app_install = app_install
|
||||
@app_viewport = app_viewport
|
||||
@balances = balances
|
||||
@disputes_list = disputes_list
|
||||
@capital_financing = capital_financing
|
||||
@capital_financing_application = capital_financing_application
|
||||
@capital_financing_promotion = capital_financing_promotion
|
||||
@capital_overview = capital_overview
|
||||
@documents = documents
|
||||
@financial_account = financial_account
|
||||
@financial_account_transactions = financial_account_transactions
|
||||
@ -822,12 +943,15 @@ module Stripe
|
||||
@issuing_cards_list = issuing_cards_list
|
||||
@notification_banner = notification_banner
|
||||
@payment_details = payment_details
|
||||
@payment_disputes = payment_disputes
|
||||
@payment_method_settings = payment_method_settings
|
||||
@payments = payments
|
||||
@payouts = payouts
|
||||
@payouts_list = payouts_list
|
||||
@recipients = recipients
|
||||
@reporting_chart = reporting_chart
|
||||
@tax_registrations = tax_registrations
|
||||
@tax_settings = tax_settings
|
||||
@tax_threshold_monitoring = tax_threshold_monitoring
|
||||
end
|
||||
end
|
||||
# The identifier of the account to create an Account Session for.
|
||||
|
@ -13,7 +13,17 @@ module Stripe
|
||||
"apple_pay_domain"
|
||||
end
|
||||
|
||||
class DeleteParams < Stripe::RequestParams; end
|
||||
class DeleteParams < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
# Attribute for param field domain_name
|
||||
@ -77,10 +87,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Delete an apple pay domain.
|
||||
def self.delete(domain, params = {}, opts = {})
|
||||
def self.delete(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
path: format("/v1/apple_pay/domains/%<domain>s", { domain: CGI.escape(domain) }),
|
||||
path: format("/v1/apple_pay/domains/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -18,7 +18,7 @@ module Stripe
|
||||
attr_reader :charge
|
||||
# Payout ID that created this application fee.
|
||||
attr_reader :payout
|
||||
# Type of object that created the application fee.
|
||||
# Type of object that created the application fee, either `charge` or `payout`.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
@ -69,6 +69,15 @@ module Stripe
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# ID of the Stripe account this fee was taken from.
|
||||
attr_reader :account
|
||||
# Amount earned, in cents (or local equivalent).
|
||||
|
@ -21,11 +21,11 @@ module Stripe
|
||||
|
||||
class Available < Stripe::StripeObject
|
||||
class SourceTypes < Stripe::StripeObject
|
||||
# Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
|
||||
# Amount for bank account.
|
||||
attr_reader :bank_account
|
||||
# Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
|
||||
# Amount for card.
|
||||
attr_reader :card
|
||||
# Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
|
||||
# Amount for FPX.
|
||||
attr_reader :fpx
|
||||
end
|
||||
# Balance amount.
|
||||
@ -38,11 +38,11 @@ module Stripe
|
||||
|
||||
class ConnectReserved < Stripe::StripeObject
|
||||
class SourceTypes < Stripe::StripeObject
|
||||
# Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
|
||||
# Amount for bank account.
|
||||
attr_reader :bank_account
|
||||
# Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
|
||||
# Amount for card.
|
||||
attr_reader :card
|
||||
# Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
|
||||
# Amount for FPX.
|
||||
attr_reader :fpx
|
||||
end
|
||||
# Balance amount.
|
||||
@ -56,11 +56,11 @@ module Stripe
|
||||
class InstantAvailable < Stripe::StripeObject
|
||||
class NetAvailable < Stripe::StripeObject
|
||||
class SourceTypes < Stripe::StripeObject
|
||||
# Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
|
||||
# Amount for bank account.
|
||||
attr_reader :bank_account
|
||||
# Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
|
||||
# Amount for card.
|
||||
attr_reader :card
|
||||
# Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
|
||||
# Amount for FPX.
|
||||
attr_reader :fpx
|
||||
end
|
||||
# Net balance amount, subtracting fees from platform-set pricing.
|
||||
@ -72,11 +72,11 @@ module Stripe
|
||||
end
|
||||
|
||||
class SourceTypes < Stripe::StripeObject
|
||||
# Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
|
||||
# Amount for bank account.
|
||||
attr_reader :bank_account
|
||||
# Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
|
||||
# Amount for card.
|
||||
attr_reader :card
|
||||
# Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
|
||||
# Amount for FPX.
|
||||
attr_reader :fpx
|
||||
end
|
||||
# Balance amount.
|
||||
@ -92,11 +92,11 @@ module Stripe
|
||||
class Issuing < Stripe::StripeObject
|
||||
class Available < Stripe::StripeObject
|
||||
class SourceTypes < Stripe::StripeObject
|
||||
# Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
|
||||
# Amount for bank account.
|
||||
attr_reader :bank_account
|
||||
# Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
|
||||
# Amount for card.
|
||||
attr_reader :card
|
||||
# Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
|
||||
# Amount for FPX.
|
||||
attr_reader :fpx
|
||||
end
|
||||
# Balance amount.
|
||||
@ -112,11 +112,11 @@ module Stripe
|
||||
|
||||
class Pending < Stripe::StripeObject
|
||||
class SourceTypes < Stripe::StripeObject
|
||||
# Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
|
||||
# Amount for bank account.
|
||||
attr_reader :bank_account
|
||||
# Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
|
||||
# Amount for card.
|
||||
attr_reader :card
|
||||
# Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
|
||||
# Amount for FPX.
|
||||
attr_reader :fpx
|
||||
end
|
||||
# Balance amount.
|
||||
@ -127,44 +127,13 @@ module Stripe
|
||||
attr_reader :source_types
|
||||
end
|
||||
|
||||
class RefundAndDisputePrefunding < Stripe::StripeObject
|
||||
class Available < Stripe::StripeObject
|
||||
class SourceTypes < Stripe::StripeObject
|
||||
# Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
|
||||
attr_reader :bank_account
|
||||
# Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
|
||||
attr_reader :card
|
||||
# Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
|
||||
attr_reader :fpx
|
||||
end
|
||||
# Balance amount.
|
||||
attr_reader :amount
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# Attribute for field source_types
|
||||
attr_reader :source_types
|
||||
end
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
class Pending < Stripe::StripeObject
|
||||
class SourceTypes < Stripe::StripeObject
|
||||
# Amount coming from [legacy US ACH payments](https://docs.stripe.com/ach-deprecated).
|
||||
attr_reader :bank_account
|
||||
# Amount coming from most payment methods, including cards as well as [non-legacy bank debits](https://docs.stripe.com/payments/bank-debits).
|
||||
attr_reader :card
|
||||
# Amount coming from [FPX](https://docs.stripe.com/payments/fpx), a Malaysian payment method.
|
||||
attr_reader :fpx
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
# Balance amount.
|
||||
attr_reader :amount
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# Attribute for field source_types
|
||||
attr_reader :source_types
|
||||
end
|
||||
# Funds that are available for use.
|
||||
attr_reader :available
|
||||
# Funds that are pending
|
||||
attr_reader :pending
|
||||
end
|
||||
# Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property.
|
||||
attr_reader :available
|
||||
@ -180,7 +149,5 @@ module Stripe
|
||||
attr_reader :object
|
||||
# Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property.
|
||||
attr_reader :pending
|
||||
# Attribute for field refund_and_dispute_prefunding
|
||||
attr_reader :refund_and_dispute_prefunding
|
||||
end
|
||||
end
|
||||
|
@ -61,7 +61,7 @@ module Stripe
|
||||
attr_accessor :source
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
# Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
|
||||
# Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(
|
||||
@ -86,12 +86,19 @@ module Stripe
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party.
|
||||
attr_reader :amount
|
||||
# The date that the transaction's net funds become available in the Stripe balance.
|
||||
attr_reader :available_on
|
||||
# The balance that this transaction impacts.
|
||||
attr_reader :balance_type
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
@ -116,7 +123,7 @@ module Stripe
|
||||
attr_reader :source
|
||||
# The transaction's net funds status in the Stripe balance, which are either `available` or `pending`.
|
||||
attr_reader :status
|
||||
# Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
|
||||
# Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
|
||||
attr_reader :type
|
||||
|
||||
# Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
|
||||
|
@ -4,11 +4,11 @@
|
||||
module Stripe
|
||||
# These bank accounts are payment methods on `Customer` objects.
|
||||
#
|
||||
# On the other hand [External Accounts](https://docs.stripe.com/api#external_accounts) are transfer
|
||||
# On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer
|
||||
# destinations on `Account` objects for connected accounts.
|
||||
# They can be bank accounts or debit cards as well, and are documented in the links above.
|
||||
#
|
||||
# Related guide: [Bank debits and transfers](https://docs.stripe.com/payments/bank-debits-transfers)
|
||||
# Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers)
|
||||
class BankAccount < APIResource
|
||||
include Stripe::APIOperations::Delete
|
||||
extend Stripe::APIOperations::List
|
||||
@ -56,7 +56,7 @@ module Stripe
|
||||
# Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending.
|
||||
attr_reader :pending_verification
|
||||
end
|
||||
# The account this bank account belongs to. Only applicable on Accounts (not customers or recipients) This property is only available when returned as an [External Account](/api/external_account_bank_accounts/object) where [controller.is_controller](/api/accounts/object#account_object-controller-is_controller) is `true`.
|
||||
# The ID of the account that the bank account is associated with.
|
||||
attr_reader :account
|
||||
# The name of the person or business that owns the bank account.
|
||||
attr_reader :account_holder_name
|
||||
|
@ -107,6 +107,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class ActivateParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
@ -41,6 +41,43 @@ module Stripe
|
||||
# Attribute for field ledger_balance
|
||||
attr_reader :ledger_balance
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
class Filter < Stripe::RequestParams
|
||||
class ApplicabilityScope < Stripe::RequestParams
|
||||
# The price type that credit grants can apply to. We currently only support the `metered` price type.
|
||||
attr_accessor :price_type
|
||||
|
||||
def initialize(price_type: nil)
|
||||
@price_type = price_type
|
||||
end
|
||||
end
|
||||
# The billing credit applicability scope for which to fetch credit balance summary.
|
||||
attr_accessor :applicability_scope
|
||||
# The credit grant for which to fetch credit balance summary.
|
||||
attr_accessor :credit_grant
|
||||
# Specify the type of this filter.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(applicability_scope: nil, credit_grant: nil, type: nil)
|
||||
@applicability_scope = applicability_scope
|
||||
@credit_grant = credit_grant
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
# The customer for which to fetch credit balance summary.
|
||||
attr_accessor :customer
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The filter criteria for the credit balance summary.
|
||||
attr_accessor :filter
|
||||
|
||||
def initialize(customer: nil, expand: nil, filter: nil)
|
||||
@customer = customer
|
||||
@expand = expand
|
||||
@filter = filter
|
||||
end
|
||||
end
|
||||
# The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry.
|
||||
attr_reader :balances
|
||||
# The customer the balance is for.
|
||||
|
@ -98,6 +98,15 @@ module Stripe
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# Credit details for this credit balance transaction. Only present if type is `credit`.
|
||||
|
@ -31,14 +31,8 @@ module Stripe
|
||||
|
||||
class ApplicabilityConfig < Stripe::StripeObject
|
||||
class Scope < Stripe::StripeObject
|
||||
class Price < Stripe::StripeObject
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
end
|
||||
# The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `prices`.
|
||||
# The price type that credit grants can apply to. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
|
||||
attr_reader :price_type
|
||||
# The prices that credit grants can apply to. We currently only support `metered` prices. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. Cannot be used in combination with `price_type`.
|
||||
attr_reader :prices
|
||||
end
|
||||
# Attribute for field scope
|
||||
attr_reader :scope
|
||||
@ -97,22 +91,11 @@ module Stripe
|
||||
|
||||
class ApplicabilityConfig < Stripe::RequestParams
|
||||
class Scope < Stripe::RequestParams
|
||||
class Price < Stripe::RequestParams
|
||||
# The price ID this credit grant should apply to.
|
||||
attr_accessor :id
|
||||
|
||||
def initialize(id: nil)
|
||||
@id = id
|
||||
end
|
||||
end
|
||||
# The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`.
|
||||
# The price type that credit grants can apply to. We currently only support the `metered` price type.
|
||||
attr_accessor :price_type
|
||||
# A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`.
|
||||
attr_accessor :prices
|
||||
|
||||
def initialize(price_type: nil, prices: nil)
|
||||
def initialize(price_type: nil)
|
||||
@price_type = price_type
|
||||
@prices = prices
|
||||
end
|
||||
end
|
||||
# Specify the scope of this applicability config.
|
||||
@ -124,7 +107,7 @@ module Stripe
|
||||
end
|
||||
# Amount of this credit grant.
|
||||
attr_accessor :amount
|
||||
# Configuration specifying what this credit grant applies to. We currently only support `metered` prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them.
|
||||
# Configuration specifying what this credit grant applies to.
|
||||
attr_accessor :applicability_config
|
||||
# The category of this credit grant.
|
||||
attr_accessor :category
|
||||
@ -140,8 +123,6 @@ module Stripe
|
||||
attr_accessor :metadata
|
||||
# A descriptive name shown in the Dashboard.
|
||||
attr_accessor :name
|
||||
# The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100.
|
||||
attr_accessor :priority
|
||||
|
||||
def initialize(
|
||||
amount: nil,
|
||||
@ -152,8 +133,7 @@ module Stripe
|
||||
expand: nil,
|
||||
expires_at: nil,
|
||||
metadata: nil,
|
||||
name: nil,
|
||||
priority: nil
|
||||
name: nil
|
||||
)
|
||||
@amount = amount
|
||||
@applicability_config = applicability_config
|
||||
@ -164,7 +144,15 @@ module Stripe
|
||||
@expires_at = expires_at
|
||||
@metadata = metadata
|
||||
@name = name
|
||||
@priority = priority
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
@ -224,8 +212,6 @@ module Stripe
|
||||
attr_reader :name
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# The priority for applying this credit grant. The highest priority is 0 and the lowest is 100.
|
||||
attr_reader :priority
|
||||
# ID of the test clock this credit grant belongs to.
|
||||
attr_reader :test_clock
|
||||
# Time at which the object was last updated. Measured in seconds since the Unix epoch.
|
||||
|
@ -84,7 +84,7 @@ module Stripe
|
||||
end
|
||||
|
||||
class DefaultAggregation < Stripe::RequestParams
|
||||
# Specifies how events are aggregated. Allowed values are `count` to count the number of events, `sum` to sum each event's value and `last` to take the last event's value in the window.
|
||||
# Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value.
|
||||
attr_accessor :formula
|
||||
|
||||
def initialize(formula: nil)
|
||||
@ -134,6 +134,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# The meter’s name. Not visible to the customer.
|
||||
attr_accessor :display_name
|
||||
|
59
lib/stripe/resources/billing/meter_error_report.rb
Normal file
59
lib/stripe/resources/billing/meter_error_report.rb
Normal file
@ -0,0 +1,59 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
module Billing
|
||||
class MeterErrorReport < APIResource
|
||||
OBJECT_NAME = "billing.meter_error_report"
|
||||
def self.object_name
|
||||
"billing.meter_error_report"
|
||||
end
|
||||
|
||||
class Reason < Stripe::StripeObject
|
||||
class ErrorType < Stripe::StripeObject
|
||||
class SampleError < Stripe::StripeObject
|
||||
class ApiRequest < Stripe::StripeObject
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# idempotency_key of the request
|
||||
attr_reader :idempotency_key
|
||||
end
|
||||
# Attribute for field api_request
|
||||
attr_reader :api_request
|
||||
# message of the error
|
||||
attr_reader :error_message
|
||||
end
|
||||
# Attribute for field sample_errors
|
||||
attr_reader :sample_errors
|
||||
end
|
||||
# The number of errors generated
|
||||
attr_reader :error_count
|
||||
# More information about errors
|
||||
attr_reader :error_types
|
||||
end
|
||||
|
||||
class RelatedObject < Stripe::StripeObject
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# The type of meter error related object. Should be 'meter'
|
||||
attr_reader :object
|
||||
# The url of the meter object
|
||||
attr_reader :url
|
||||
end
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# Attribute for field reason
|
||||
attr_reader :reason
|
||||
# The related objects about the error
|
||||
attr_reader :related_object
|
||||
# Summary of invalid events
|
||||
attr_reader :summary
|
||||
# Time when validation ended. Measured in seconds since the Unix epoch
|
||||
attr_reader :validation_end
|
||||
# Time when validation started. Measured in seconds since the Unix epoch
|
||||
attr_reader :validation_start
|
||||
end
|
||||
end
|
||||
end
|
@ -5,8 +5,6 @@ module Stripe
|
||||
module Billing
|
||||
# A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much
|
||||
# usage was accrued by a customer for that period.
|
||||
#
|
||||
# Note: Meters events are aggregated asynchronously so the meter event summaries provide an eventually consistent view of the reported usage.
|
||||
class MeterEventSummary < APIResource
|
||||
OBJECT_NAME = "billing.meter_event_summary"
|
||||
def self.object_name
|
||||
|
@ -336,6 +336,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class BusinessProfile < Stripe::RequestParams
|
||||
# The messaging shown to customers in the portal.
|
||||
@ -588,10 +597,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates a configuration that describes the functionality of the customer portal.
|
||||
def self.update(configuration, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/billing_portal/configurations/%<configuration>s", { configuration: CGI.escape(configuration) }),
|
||||
path: format("/v1/billing_portal/configurations/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -16,7 +16,7 @@ module Stripe
|
||||
# Create sessions on-demand when customers intend to manage their subscriptions
|
||||
# and billing details.
|
||||
#
|
||||
# Related guide: [Customer management](https://docs.stripe.com/customer-management)
|
||||
# Related guide: [Customer management](https://stripe.com/customer-management)
|
||||
class Session < APIResource
|
||||
extend Stripe::APIOperations::Create
|
||||
|
||||
|
@ -65,7 +65,7 @@ module Stripe
|
||||
end
|
||||
# Fields that are due and can be satisfied by providing the corresponding alternative fields instead.
|
||||
attr_reader :alternatives
|
||||
# The date by which all required account information must be both submitted and verified. This includes fields listed in `currently_due` as well as those in `pending_verification`. If any required information is missing or unverified by this date, the account may be disabled. Note that `current_deadline` may change if additional `currently_due` requirements are requested.
|
||||
# Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. These fields may disable the capability sooner if the next threshold is reached before they are collected.
|
||||
attr_reader :current_deadline
|
||||
# Fields that need to be collected to keep the capability enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled.
|
||||
attr_reader :currently_due
|
||||
|
188
lib/stripe/resources/capital/financing_offer.rb
Normal file
188
lib/stripe/resources/capital/financing_offer.rb
Normal file
@ -0,0 +1,188 @@
|
||||
# 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
|
||||
|
||||
class AcceptedTerms < Stripe::StripeObject
|
||||
# Amount of financing offered, in minor units.
|
||||
attr_reader :advance_amount
|
||||
# Currency that the financing offer is transacted in. For example, `usd`.
|
||||
attr_reader :currency
|
||||
# Fixed fee amount, in minor units.
|
||||
attr_reader :fee_amount
|
||||
# Populated when the `product_type` of the `financingoffer` is `refill`.
|
||||
# Represents the discount amount on remaining premium for the existing loan at payout time.
|
||||
attr_reader :previous_financing_fee_discount_amount
|
||||
# Per-transaction rate at which Stripe will withhold funds to repay the financing.
|
||||
attr_reader :withhold_rate
|
||||
end
|
||||
|
||||
class OfferedTerms < Stripe::StripeObject
|
||||
# Amount of financing offered, in minor units.
|
||||
attr_reader :advance_amount
|
||||
# Describes the type of user the offer is being extended to.
|
||||
attr_reader :campaign_type
|
||||
# Currency that the financing offer is transacted in. For example, `usd`.
|
||||
attr_reader :currency
|
||||
# Fixed fee amount, in minor units.
|
||||
attr_reader :fee_amount
|
||||
# Populated when the `product_type` of the `financingoffer` is `refill`.
|
||||
# Represents the discount rate percentage on remaining fee on the existing loan. When the `financing_offer`
|
||||
# is paid out, the `previous_financing_fee_discount_amount` will be computed as the multiple of this rate
|
||||
# and the remaining fee.
|
||||
attr_reader :previous_financing_fee_discount_rate
|
||||
# Per-transaction rate at which Stripe will withhold funds to repay the financing.
|
||||
attr_reader :withhold_rate
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
class Created < Stripe::RequestParams
|
||||
# Minimum value to filter by (exclusive)
|
||||
attr_accessor :gt
|
||||
# Minimum value to filter by (inclusive)
|
||||
attr_accessor :gte
|
||||
# Maximum value to filter by (exclusive)
|
||||
attr_accessor :lt
|
||||
# Maximum value to filter by (inclusive)
|
||||
attr_accessor :lte
|
||||
|
||||
def initialize(gt: nil, gte: nil, lt: nil, lte: nil)
|
||||
@gt = gt
|
||||
@gte = gte
|
||||
@lt = lt
|
||||
@lte = lte
|
||||
end
|
||||
end
|
||||
# limit list to offers belonging to given connected account
|
||||
attr_accessor :connected_account
|
||||
# Only return offers that were created during the given date interval.
|
||||
attr_accessor :created
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
# limit list to offers with given status
|
||||
attr_accessor :status
|
||||
|
||||
def initialize(
|
||||
connected_account: nil,
|
||||
created: nil,
|
||||
ending_before: nil,
|
||||
expand: nil,
|
||||
limit: nil,
|
||||
starting_after: nil,
|
||||
status: nil
|
||||
)
|
||||
@connected_account = connected_account
|
||||
@created = created
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@limit = limit
|
||||
@starting_after = starting_after
|
||||
@status = status
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class MarkDeliveredParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# This is an object representing the terms of an offer of financing from
|
||||
# Stripe Capital to a Connected account. This resource represents
|
||||
# the terms accepted by the Connected account, which may differ from those
|
||||
# offered.
|
||||
attr_reader :accepted_terms
|
||||
# The ID of the merchant associated with this financing object.
|
||||
attr_reader :account
|
||||
# The time at which this financing offer was charged off, if applicable. Given in seconds since unix epoch.
|
||||
attr_reader :charged_off_at
|
||||
# Time at which the offer was created. Given in seconds since unix epoch.
|
||||
attr_reader :created
|
||||
# Time at which the offer expires. Given in seconds since unix epoch.
|
||||
attr_reader :expires_after
|
||||
# The type of financing being offered.
|
||||
attr_reader :financing_type
|
||||
# A unique identifier for the financing object.
|
||||
attr_reader :id
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
attr_reader :metadata
|
||||
# The object type: financing_offer.
|
||||
attr_reader :object
|
||||
# This is an object representing the terms of an offer of financing from
|
||||
# Stripe Capital to a Connected account. This resource represents
|
||||
# both the terms offered to the Connected account.
|
||||
attr_reader :offered_terms
|
||||
# Financing product identifier.
|
||||
attr_reader :product_type
|
||||
# The ID of the financing offer that replaced this offer.
|
||||
attr_reader :replacement
|
||||
# The ID of the financing offer that this offer is a replacement for.
|
||||
attr_reader :replacement_for
|
||||
# The current status of the offer.
|
||||
attr_reader :status
|
||||
# See [financing_type](https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type).
|
||||
attr_reader :type
|
||||
|
||||
# Retrieves the financing offers available for Connected accounts that belong to your platform.
|
||||
def self.list(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
path: "/v1/capital/financing_offers",
|
||||
params: params,
|
||||
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
|
64
lib/stripe/resources/capital/financing_summary.rb
Normal file
64
lib/stripe/resources/capital/financing_summary.rb
Normal file
@ -0,0 +1,64 @@
|
||||
# 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
|
||||
|
||||
class Details < Stripe::StripeObject
|
||||
class CurrentRepaymentInterval < Stripe::StripeObject
|
||||
# The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account or account balance will be debited.
|
||||
# Given in seconds since unix epoch.
|
||||
attr_reader :due_at
|
||||
# The amount that has already been paid in the current repayment interval.
|
||||
attr_reader :paid_amount
|
||||
# The amount that is yet to be paid in the current repayment interval.
|
||||
attr_reader :remaining_amount
|
||||
end
|
||||
# Amount of financing offered, in minor units.
|
||||
attr_reader :advance_amount
|
||||
# The time at which the funds were paid out to the connected account's Stripe balance. Given in milliseconds since unix epoch.
|
||||
attr_reader :advance_paid_out_at
|
||||
# Currency that the financing offer is transacted in. For example, `usd`.
|
||||
attr_reader :currency
|
||||
# The chronologically current repayment interval for the financing offer.
|
||||
attr_reader :current_repayment_interval
|
||||
# Fixed fee amount, in minor units.
|
||||
attr_reader :fee_amount
|
||||
# The amount the Connected account has paid toward the financing debt so far.
|
||||
attr_reader :paid_amount
|
||||
# The balance remaining to be paid on the financing, in minor units.
|
||||
attr_reader :remaining_amount
|
||||
# The time at which Capital will begin withholding from payments. Given in seconds since unix epoch.
|
||||
attr_reader :repayments_begin_at
|
||||
# Per-transaction rate at which Stripe will withhold funds to repay the financing.
|
||||
attr_reader :withhold_rate
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Additional information about the financing summary. Describes currency, advance amount,
|
||||
# fee amount, withhold rate, remaining amount, paid amount, current repayment interval,
|
||||
# repayment start date, and advance payout date.
|
||||
attr_reader :details
|
||||
# The Financing Offer ID this Financing Summary corresponds to
|
||||
attr_reader :financing_offer
|
||||
# The object type: financing_summary
|
||||
attr_reader :object
|
||||
# Status of the Connected Account's financing. [/v1/capital/financing_summary](https://stripe.com/docs/api/capital/financing_summary) will only return `details` for `paid_out` financing.
|
||||
attr_reader :status
|
||||
end
|
||||
end
|
||||
end
|
123
lib/stripe/resources/capital/financing_transaction.rb
Normal file
123
lib/stripe/resources/capital/financing_transaction.rb
Normal file
@ -0,0 +1,123 @@
|
||||
# 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
|
||||
|
||||
class Details < Stripe::StripeObject
|
||||
class Transaction < Stripe::StripeObject
|
||||
# The linked payment ID.
|
||||
attr_reader :charge
|
||||
# The linked Treasury Financing Transaction ID.
|
||||
attr_reader :treasury_transaction
|
||||
end
|
||||
# The advance amount being repaid, paid out, or reversed in minor units.
|
||||
attr_reader :advance_amount
|
||||
# The currency of the financing transaction.
|
||||
attr_reader :currency
|
||||
# The fee amount being repaid, paid out, or reversed in minor units.
|
||||
attr_reader :fee_amount
|
||||
# The linked payment for the transaction. This field only applies to financing transactions of type `paydown` and reason `automatic_withholding`.
|
||||
attr_reader :linked_payment
|
||||
# The reason for the financing transaction (if applicable).
|
||||
attr_reader :reason
|
||||
# The reversed transaction. This field only applies to financing
|
||||
# transactions of type `reversal`.
|
||||
attr_reader :reversed_transaction
|
||||
# The advance and fee amount being repaid, paid out, or reversed in minor units.
|
||||
attr_reader :total_amount
|
||||
# This is an object representing a linked transaction on a Capital Financing Transaction.
|
||||
attr_reader :transaction
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
# For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this charge.
|
||||
attr_accessor :charge
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Returns transactions that were created that apply to this financing offer ID.
|
||||
attr_accessor :financing_offer
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# Only returns transactions that are responsible for reversing this financing transaction ID.
|
||||
attr_accessor :reversed_transaction
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
# For transactions of type `paydown` and reason `automatic_withholding` only, only returns transactions that were created as a result of this Treasury Transaction.
|
||||
attr_accessor :treasury_transaction
|
||||
|
||||
def initialize(
|
||||
charge: nil,
|
||||
ending_before: nil,
|
||||
expand: nil,
|
||||
financing_offer: nil,
|
||||
limit: nil,
|
||||
reversed_transaction: nil,
|
||||
starting_after: nil,
|
||||
treasury_transaction: nil
|
||||
)
|
||||
@charge = charge
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@financing_offer = financing_offer
|
||||
@limit = limit
|
||||
@reversed_transaction = reversed_transaction
|
||||
@starting_after = starting_after
|
||||
@treasury_transaction = treasury_transaction
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# The ID of the merchant associated with this financing transaction.
|
||||
attr_reader :account
|
||||
# Time at which the financing transaction was created. Given in seconds since unix epoch.
|
||||
attr_reader :created_at
|
||||
# This is an object representing a transaction on a Capital financing offer.
|
||||
attr_reader :details
|
||||
# The Capital financing offer for this financing transaction.
|
||||
attr_reader :financing_offer
|
||||
# A unique identifier for the financing transaction object.
|
||||
attr_reader :id
|
||||
# The Capital transaction object that predates the Financing Transactions API and
|
||||
# corresponds with the balance transaction that was created as a result of this
|
||||
# financing transaction.
|
||||
attr_reader :legacy_balance_transaction_source
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# The object type: financing_transaction
|
||||
attr_reader :object
|
||||
# The type of the financing transaction.
|
||||
attr_reader :type
|
||||
# A human-friendly description of the financing transaction.
|
||||
attr_reader :user_facing_description
|
||||
|
||||
# Returns a list of financing transactions. The transactions are returned in sorted order,
|
||||
# with the most recent transactions appearing first.
|
||||
def self.list(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
path: "/v1/capital/financing_transactions",
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -21,7 +21,7 @@ module Stripe
|
||||
# The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card.
|
||||
attr_reader :preferred
|
||||
end
|
||||
# Attribute for field account
|
||||
# The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts.
|
||||
attr_reader :account
|
||||
# City/District/Suburb/Town/Village.
|
||||
attr_reader :address_city
|
||||
@ -45,9 +45,11 @@ module Stripe
|
||||
attr_reader :available_payout_methods
|
||||
# Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`.
|
||||
attr_reader :brand
|
||||
# The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. (For internal use only and not typically available in standard API requests.)
|
||||
attr_reader :brand_product
|
||||
# Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.
|
||||
attr_reader :country
|
||||
# Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available when returned as an [External Account](/api/external_account_cards/object) where [controller.is_controller](/api/accounts/object#account_object-controller-is_controller) is `true`.
|
||||
# Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts.
|
||||
attr_reader :currency
|
||||
# The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead.
|
||||
attr_reader :customer
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -106,6 +106,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Beneficiary < Stripe::RequestParams
|
||||
# Publicly displayable name for the end beneficiary of carbon removal.
|
||||
@ -221,10 +230,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates the specified order by setting the values of the parameters passed.
|
||||
def self.update(order, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/climate/orders/%<order>s", { order: CGI.escape(order) }),
|
||||
path: format("/v1/climate/orders/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -39,6 +39,15 @@ module Stripe
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# Current prices for a metric ton of carbon removal in a currency's smallest unit.
|
||||
|
@ -42,6 +42,15 @@ module Stripe
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Link to a webpage to learn more about the supplier.
|
||||
|
@ -34,23 +34,8 @@ module Stripe
|
||||
|
||||
class PaymentMethodOptions < Stripe::StripeObject
|
||||
class Card < Stripe::StripeObject
|
||||
class Installments < Stripe::StripeObject
|
||||
class Plan < Stripe::StripeObject
|
||||
# For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.
|
||||
attr_reader :count
|
||||
# For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.
|
||||
# One of `month`.
|
||||
attr_reader :interval
|
||||
# Type of installment plan, one of `fixed_count`.
|
||||
attr_reader :type
|
||||
end
|
||||
# Attribute for field plan
|
||||
attr_reader :plan
|
||||
end
|
||||
# The `cvc_update` Token collected from the Payment Element.
|
||||
attr_reader :cvc_token
|
||||
# Installment configuration for payments.
|
||||
attr_reader :installments
|
||||
end
|
||||
# This hash contains the card payment method options.
|
||||
attr_reader :card
|
||||
@ -95,7 +80,6 @@ module Stripe
|
||||
end
|
||||
|
||||
class Bancontact < Stripe::StripeObject; end
|
||||
class Billie < Stripe::StripeObject; end
|
||||
|
||||
class BillingDetails < Stripe::StripeObject
|
||||
class Address < Stripe::StripeObject
|
||||
@ -120,8 +104,6 @@ module Stripe
|
||||
attr_reader :name
|
||||
# Billing phone number (including extension).
|
||||
attr_reader :phone
|
||||
# Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
|
||||
attr_reader :tax_id
|
||||
end
|
||||
|
||||
class Blik < Stripe::StripeObject; end
|
||||
@ -243,7 +225,7 @@ module Stripe
|
||||
end
|
||||
|
||||
class Networks < Stripe::StripeObject
|
||||
# All networks available for selection via [payment_method_options.card.network](/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network).
|
||||
# All available networks for the card.
|
||||
attr_reader :available
|
||||
# The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card.
|
||||
attr_reader :preferred
|
||||
@ -400,7 +382,7 @@ module Stripe
|
||||
|
||||
class CardPresent < Stripe::StripeObject
|
||||
class Networks < Stripe::StripeObject
|
||||
# All networks available for selection via [payment_method_options.card.network](/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network).
|
||||
# All available networks for the card.
|
||||
attr_reader :available
|
||||
# The preferred network for the card.
|
||||
attr_reader :preferred
|
||||
@ -477,8 +459,20 @@ module Stripe
|
||||
end
|
||||
|
||||
class Giropay < Stripe::StripeObject; end
|
||||
class Gopay < Stripe::StripeObject; end
|
||||
class Grabpay < Stripe::StripeObject; end
|
||||
|
||||
class IdBankTransfer < Stripe::StripeObject
|
||||
# Attribute for field bank
|
||||
attr_reader :bank
|
||||
# Attribute for field bank_code
|
||||
attr_reader :bank_code
|
||||
# Attribute for field bank_name
|
||||
attr_reader :bank_name
|
||||
# Attribute for field display_name
|
||||
attr_reader :display_name
|
||||
end
|
||||
|
||||
class Ideal < Stripe::StripeObject
|
||||
# The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
|
||||
attr_reader :bank
|
||||
@ -488,7 +482,7 @@ module Stripe
|
||||
|
||||
class InteracPresent < Stripe::StripeObject
|
||||
class Networks < Stripe::StripeObject
|
||||
# All networks available for selection via [payment_method_options.card.network](/api/payment_intents/confirm#confirm_payment_intent-payment_method_options-card-network).
|
||||
# All available networks for the card.
|
||||
attr_reader :available
|
||||
# The preferred network for the card.
|
||||
attr_reader :preferred
|
||||
@ -556,31 +550,15 @@ module Stripe
|
||||
attr_reader :persistent_token
|
||||
end
|
||||
|
||||
class MbWay < Stripe::StripeObject; end
|
||||
class Mobilepay < Stripe::StripeObject; end
|
||||
class Multibanco < Stripe::StripeObject; end
|
||||
|
||||
class NaverPay < Stripe::StripeObject
|
||||
# Uniquely identifies this particular Naver Pay account. You can use this attribute to check whether two Naver Pay accounts are the same.
|
||||
attr_reader :buyer_id
|
||||
# Whether to fund this transaction with Naver Pay points or a card.
|
||||
attr_reader :funding
|
||||
end
|
||||
|
||||
class NzBankAccount < Stripe::StripeObject
|
||||
# The name on the bank account. Only present if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
|
||||
attr_reader :account_holder_name
|
||||
# The numeric code for the bank account's bank.
|
||||
attr_reader :bank_code
|
||||
# The name of the bank.
|
||||
attr_reader :bank_name
|
||||
# The numeric code for the bank account's bank branch.
|
||||
attr_reader :branch_code
|
||||
# Last four digits of the bank account number.
|
||||
attr_reader :last4
|
||||
# The suffix of the bank account number.
|
||||
attr_reader :suffix
|
||||
end
|
||||
|
||||
class Oxxo < Stripe::StripeObject; end
|
||||
|
||||
class P24 < Stripe::StripeObject
|
||||
@ -595,18 +573,46 @@ module Stripe
|
||||
class Paypal < Stripe::StripeObject
|
||||
# Two-letter ISO code representing the buyer's country. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.
|
||||
attr_reader :country
|
||||
# Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same.
|
||||
attr_reader :fingerprint
|
||||
# Owner's email. Values are provided by PayPal directly
|
||||
# (if supported) at the time of authorization or settlement. They cannot be set or mutated.
|
||||
attr_reader :payer_email
|
||||
# PayPal account PayerID. This identifier uniquely identifies the PayPal customer.
|
||||
attr_reader :payer_id
|
||||
# Owner's verified email. Values are verified or provided by PayPal directly
|
||||
# (if supported) at the time of authorization or settlement. They cannot be set or mutated.
|
||||
attr_reader :verified_email
|
||||
end
|
||||
|
||||
class Payto < Stripe::StripeObject
|
||||
# Bank-State-Branch number of the bank account.
|
||||
attr_reader :bsb_number
|
||||
# Last four digits of the bank account number.
|
||||
attr_reader :last4
|
||||
# The PayID alias for the bank account.
|
||||
attr_reader :pay_id
|
||||
end
|
||||
|
||||
class Pix < Stripe::StripeObject; end
|
||||
class Promptpay < Stripe::StripeObject; end
|
||||
class Qris < Stripe::StripeObject; end
|
||||
|
||||
class Rechnung < Stripe::StripeObject
|
||||
class Dob < Stripe::StripeObject
|
||||
# The day of birth, between 1 and 31.
|
||||
attr_reader :day
|
||||
# The month of birth, between 1 and 12.
|
||||
attr_reader :month
|
||||
# The four-digit year of birth.
|
||||
attr_reader :year
|
||||
end
|
||||
# Attribute for field dob
|
||||
attr_reader :dob
|
||||
end
|
||||
|
||||
class RevolutPay < Stripe::StripeObject; end
|
||||
class SamsungPay < Stripe::StripeObject; end
|
||||
class Satispay < Stripe::StripeObject; end
|
||||
|
||||
class SepaDebit < Stripe::StripeObject
|
||||
class GeneratedFrom < Stripe::StripeObject
|
||||
@ -629,6 +635,8 @@ module Stripe
|
||||
attr_reader :last4
|
||||
end
|
||||
|
||||
class Shopeepay < Stripe::StripeObject; end
|
||||
|
||||
class Sofort < Stripe::StripeObject
|
||||
# Two-letter ISO code representing the country the bank account is located in.
|
||||
attr_reader :country
|
||||
@ -657,6 +665,8 @@ module Stripe
|
||||
end
|
||||
# Account holder type: individual or company.
|
||||
attr_reader :account_holder_type
|
||||
# Account number of the bank account.
|
||||
attr_reader :account_number
|
||||
# Account type: checkings or savings. Defaults to checking if omitted.
|
||||
attr_reader :account_type
|
||||
# The name of the bank.
|
||||
@ -697,8 +707,6 @@ module Stripe
|
||||
attr_reader :bacs_debit
|
||||
# Attribute for field bancontact
|
||||
attr_reader :bancontact
|
||||
# Attribute for field billie
|
||||
attr_reader :billie
|
||||
# Attribute for field billing_details
|
||||
attr_reader :billing_details
|
||||
# Attribute for field blik
|
||||
@ -721,8 +729,12 @@ module Stripe
|
||||
attr_reader :fpx
|
||||
# Attribute for field giropay
|
||||
attr_reader :giropay
|
||||
# Attribute for field gopay
|
||||
attr_reader :gopay
|
||||
# Attribute for field grabpay
|
||||
attr_reader :grabpay
|
||||
# Attribute for field id_bank_transfer
|
||||
attr_reader :id_bank_transfer
|
||||
# Attribute for field ideal
|
||||
attr_reader :ideal
|
||||
# Attribute for field interac_present
|
||||
@ -737,14 +749,14 @@ module Stripe
|
||||
attr_reader :kr_card
|
||||
# Attribute for field link
|
||||
attr_reader :link
|
||||
# Attribute for field mb_way
|
||||
attr_reader :mb_way
|
||||
# Attribute for field mobilepay
|
||||
attr_reader :mobilepay
|
||||
# Attribute for field multibanco
|
||||
attr_reader :multibanco
|
||||
# Attribute for field naver_pay
|
||||
attr_reader :naver_pay
|
||||
# Attribute for field nz_bank_account
|
||||
attr_reader :nz_bank_account
|
||||
# Attribute for field oxxo
|
||||
attr_reader :oxxo
|
||||
# Attribute for field p24
|
||||
@ -757,18 +769,24 @@ module Stripe
|
||||
attr_reader :paynow
|
||||
# Attribute for field paypal
|
||||
attr_reader :paypal
|
||||
# Attribute for field payto
|
||||
attr_reader :payto
|
||||
# Attribute for field pix
|
||||
attr_reader :pix
|
||||
# Attribute for field promptpay
|
||||
attr_reader :promptpay
|
||||
# Attribute for field qris
|
||||
attr_reader :qris
|
||||
# Attribute for field rechnung
|
||||
attr_reader :rechnung
|
||||
# Attribute for field revolut_pay
|
||||
attr_reader :revolut_pay
|
||||
# Attribute for field samsung_pay
|
||||
attr_reader :samsung_pay
|
||||
# Attribute for field satispay
|
||||
attr_reader :satispay
|
||||
# Attribute for field sepa_debit
|
||||
attr_reader :sepa_debit
|
||||
# Attribute for field shopeepay
|
||||
attr_reader :shopeepay
|
||||
# Attribute for field sofort
|
||||
attr_reader :sofort
|
||||
# Attribute for field swish
|
||||
@ -808,6 +826,15 @@ module Stripe
|
||||
attr_reader :phone
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class CreateParams < Stripe::RequestParams
|
||||
class PaymentMethodData < Stripe::RequestParams
|
||||
class AcssDebit < Stripe::RequestParams
|
||||
@ -825,11 +852,20 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class Affirm < Stripe::RequestParams; end
|
||||
class AfterpayClearpay < Stripe::RequestParams; end
|
||||
class Alipay < Stripe::RequestParams; end
|
||||
class Alma < Stripe::RequestParams; end
|
||||
class AmazonPay < Stripe::RequestParams; end
|
||||
class Affirm < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class AfterpayClearpay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Alipay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Alma < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class AmazonPay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class AuBecsDebit < Stripe::RequestParams
|
||||
# The account number for the bank account.
|
||||
@ -855,8 +891,8 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class Bancontact < Stripe::RequestParams; end
|
||||
class Billie < Stripe::RequestParams; end
|
||||
class Bancontact < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class BillingDetails < Stripe::RequestParams
|
||||
class Address < Stripe::RequestParams
|
||||
@ -897,19 +933,17 @@ module Stripe
|
||||
attr_accessor :name
|
||||
# Billing phone number (including extension).
|
||||
attr_accessor :phone
|
||||
# Taxpayer identification number. Used only for transactions between LATAM buyers and non-LATAM sellers.
|
||||
attr_accessor :tax_id
|
||||
|
||||
def initialize(address: nil, email: nil, name: nil, phone: nil, tax_id: nil)
|
||||
def initialize(address: nil, email: nil, name: nil, phone: nil)
|
||||
@address = address
|
||||
@email = email
|
||||
@name = name
|
||||
@phone = phone
|
||||
@tax_id = tax_id
|
||||
end
|
||||
end
|
||||
|
||||
class Blik < Stripe::RequestParams; end
|
||||
class Blik < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Boleto < Stripe::RequestParams
|
||||
# The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
|
||||
@ -920,8 +954,11 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class Cashapp < Stripe::RequestParams; end
|
||||
class CustomerBalance < Stripe::RequestParams; end
|
||||
class Cashapp < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class CustomerBalance < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Eps < Stripe::RequestParams
|
||||
# The customer's bank.
|
||||
@ -944,8 +981,23 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class Giropay < Stripe::RequestParams; end
|
||||
class Grabpay < Stripe::RequestParams; end
|
||||
class Giropay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Gopay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Grabpay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class IdBankTransfer < Stripe::RequestParams
|
||||
# Bank where the account is held.
|
||||
attr_accessor :bank
|
||||
|
||||
def initialize(bank: nil)
|
||||
@bank = bank
|
||||
end
|
||||
end
|
||||
|
||||
class Ideal < Stripe::RequestParams
|
||||
# The customer's bank. Only use this parameter for existing customers. Don't use it for new customers.
|
||||
@ -956,8 +1008,11 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class InteracPresent < Stripe::RequestParams; end
|
||||
class KakaoPay < Stripe::RequestParams; end
|
||||
class InteracPresent < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class KakaoPay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Klarna < Stripe::RequestParams
|
||||
class Dob < Stripe::RequestParams
|
||||
@ -982,11 +1037,23 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class Konbini < Stripe::RequestParams; end
|
||||
class KrCard < Stripe::RequestParams; end
|
||||
class Link < Stripe::RequestParams; end
|
||||
class Mobilepay < Stripe::RequestParams; end
|
||||
class Multibanco < Stripe::RequestParams; end
|
||||
class Konbini < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class KrCard < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Link < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class MbWay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Mobilepay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Multibanco < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class NaverPay < Stripe::RequestParams
|
||||
# Whether to use Naver Pay points or a card to fund this transaction. If not provided, this defaults to `card`.
|
||||
@ -997,38 +1064,8 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class NzBankAccount < Stripe::RequestParams
|
||||
# The name on the bank account. Only required if the account holder name is different from the name of the authorized signatory collected in the PaymentMethod’s billing details.
|
||||
attr_accessor :account_holder_name
|
||||
# The account number for the bank account.
|
||||
attr_accessor :account_number
|
||||
# The numeric code for the bank account's bank.
|
||||
attr_accessor :bank_code
|
||||
# The numeric code for the bank account's bank branch.
|
||||
attr_accessor :branch_code
|
||||
# Attribute for param field reference
|
||||
attr_accessor :reference
|
||||
# The suffix of the bank account number.
|
||||
attr_accessor :suffix
|
||||
|
||||
def initialize(
|
||||
account_holder_name: nil,
|
||||
account_number: nil,
|
||||
bank_code: nil,
|
||||
branch_code: nil,
|
||||
reference: nil,
|
||||
suffix: nil
|
||||
)
|
||||
@account_holder_name = account_holder_name
|
||||
@account_number = account_number
|
||||
@bank_code = bank_code
|
||||
@branch_code = branch_code
|
||||
@reference = reference
|
||||
@suffix = suffix
|
||||
class Oxxo < Stripe::RequestParams
|
||||
end
|
||||
end
|
||||
|
||||
class Oxxo < Stripe::RequestParams; end
|
||||
|
||||
class P24 < Stripe::RequestParams
|
||||
# The customer's bank.
|
||||
@ -1039,12 +1076,41 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class PayByBank < Stripe::RequestParams; end
|
||||
class Payco < Stripe::RequestParams; end
|
||||
class Paynow < Stripe::RequestParams; end
|
||||
class Paypal < Stripe::RequestParams; end
|
||||
class Pix < Stripe::RequestParams; end
|
||||
class Promptpay < Stripe::RequestParams; end
|
||||
class PayByBank < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Payco < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Paynow < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Paypal < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Payto < Stripe::RequestParams
|
||||
# The account number for the bank account.
|
||||
attr_accessor :account_number
|
||||
# Bank-State-Branch number of the bank account.
|
||||
attr_accessor :bsb_number
|
||||
# The PayID alias for the bank account.
|
||||
attr_accessor :pay_id
|
||||
|
||||
def initialize(account_number: nil, bsb_number: nil, pay_id: nil)
|
||||
@account_number = account_number
|
||||
@bsb_number = bsb_number
|
||||
@pay_id = pay_id
|
||||
end
|
||||
end
|
||||
|
||||
class Pix < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Promptpay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Qris < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class RadarOptions < Stripe::RequestParams
|
||||
# A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.
|
||||
@ -1055,9 +1121,34 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RevolutPay < Stripe::RequestParams; end
|
||||
class SamsungPay < Stripe::RequestParams; end
|
||||
class Satispay < Stripe::RequestParams; end
|
||||
class Rechnung < Stripe::RequestParams
|
||||
class Dob < Stripe::RequestParams
|
||||
# The day of birth, between 1 and 31.
|
||||
attr_accessor :day
|
||||
# The month of birth, between 1 and 12.
|
||||
attr_accessor :month
|
||||
# The four-digit year of birth.
|
||||
attr_accessor :year
|
||||
|
||||
def initialize(day: nil, month: nil, year: nil)
|
||||
@day = day
|
||||
@month = month
|
||||
@year = year
|
||||
end
|
||||
end
|
||||
# Customer's date of birth
|
||||
attr_accessor :dob
|
||||
|
||||
def initialize(dob: nil)
|
||||
@dob = dob
|
||||
end
|
||||
end
|
||||
|
||||
class RevolutPay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class SamsungPay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class SepaDebit < Stripe::RequestParams
|
||||
# IBAN of the bank account.
|
||||
@ -1068,6 +1159,9 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class Shopeepay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Sofort < Stripe::RequestParams
|
||||
# Two-letter ISO code representing the country the bank account is located in.
|
||||
attr_accessor :country
|
||||
@ -1077,8 +1171,11 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class Swish < Stripe::RequestParams; end
|
||||
class Twint < Stripe::RequestParams; end
|
||||
class Swish < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Twint < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class UsBankAccount < Stripe::RequestParams
|
||||
# Account holder type: individual or company.
|
||||
@ -1107,8 +1204,11 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class WechatPay < Stripe::RequestParams; end
|
||||
class Zip < Stripe::RequestParams; end
|
||||
class WechatPay < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class Zip < Stripe::RequestParams
|
||||
end
|
||||
# If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.
|
||||
attr_accessor :acss_debit
|
||||
# If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
|
||||
@ -1129,8 +1229,6 @@ module Stripe
|
||||
attr_accessor :bacs_debit
|
||||
# If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.
|
||||
attr_accessor :bancontact
|
||||
# If this is a `billie` PaymentMethod, this hash contains details about the Billie payment method.
|
||||
attr_accessor :billie
|
||||
# Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
|
||||
attr_accessor :billing_details
|
||||
# If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
|
||||
@ -1147,8 +1245,12 @@ module Stripe
|
||||
attr_accessor :fpx
|
||||
# If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.
|
||||
attr_accessor :giropay
|
||||
# If this is a Gopay PaymentMethod, this hash contains details about the Gopay payment method.
|
||||
attr_accessor :gopay
|
||||
# If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.
|
||||
attr_accessor :grabpay
|
||||
# If this is an `IdBankTransfer` PaymentMethod, this hash contains details about the IdBankTransfer payment method.
|
||||
attr_accessor :id_bank_transfer
|
||||
# If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.
|
||||
attr_accessor :ideal
|
||||
# If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.
|
||||
@ -1163,6 +1265,8 @@ module Stripe
|
||||
attr_accessor :kr_card
|
||||
# If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.
|
||||
attr_accessor :link
|
||||
# If this is a MB WAY PaymentMethod, this hash contains details about the MB WAY payment method.
|
||||
attr_accessor :mb_way
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
# If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method.
|
||||
@ -1171,8 +1275,6 @@ module Stripe
|
||||
attr_accessor :multibanco
|
||||
# If this is a `naver_pay` PaymentMethod, this hash contains details about the Naver Pay payment method.
|
||||
attr_accessor :naver_pay
|
||||
# If this is an nz_bank_account PaymentMethod, this hash contains details about the nz_bank_account payment method.
|
||||
attr_accessor :nz_bank_account
|
||||
# If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.
|
||||
attr_accessor :oxxo
|
||||
# If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.
|
||||
@ -1185,20 +1287,26 @@ module Stripe
|
||||
attr_accessor :paynow
|
||||
# If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method.
|
||||
attr_accessor :paypal
|
||||
# If this is a `payto` PaymentMethod, this hash contains details about the PayTo payment method.
|
||||
attr_accessor :payto
|
||||
# If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.
|
||||
attr_accessor :pix
|
||||
# If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.
|
||||
attr_accessor :promptpay
|
||||
# If this is a `qris` PaymentMethod, this hash contains details about the QRIS payment method.
|
||||
attr_accessor :qris
|
||||
# Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.
|
||||
attr_accessor :radar_options
|
||||
# If this is a `revolut_pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
|
||||
# If this is a `rechnung` PaymentMethod, this hash contains details about the Rechnung payment method.
|
||||
attr_accessor :rechnung
|
||||
# If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method.
|
||||
attr_accessor :revolut_pay
|
||||
# If this is a `samsung_pay` PaymentMethod, this hash contains details about the SamsungPay payment method.
|
||||
attr_accessor :samsung_pay
|
||||
# If this is a `satispay` PaymentMethod, this hash contains details about the Satispay payment method.
|
||||
attr_accessor :satispay
|
||||
# If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.
|
||||
attr_accessor :sepa_debit
|
||||
# If this is a Shopeepay PaymentMethod, this hash contains details about the Shopeepay payment method.
|
||||
attr_accessor :shopeepay
|
||||
# If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.
|
||||
attr_accessor :sofort
|
||||
# If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method.
|
||||
@ -1225,7 +1333,6 @@ module Stripe
|
||||
au_becs_debit: nil,
|
||||
bacs_debit: nil,
|
||||
bancontact: nil,
|
||||
billie: nil,
|
||||
billing_details: nil,
|
||||
blik: nil,
|
||||
boleto: nil,
|
||||
@ -1234,7 +1341,9 @@ module Stripe
|
||||
eps: nil,
|
||||
fpx: nil,
|
||||
giropay: nil,
|
||||
gopay: nil,
|
||||
grabpay: nil,
|
||||
id_bank_transfer: nil,
|
||||
ideal: nil,
|
||||
interac_present: nil,
|
||||
kakao_pay: nil,
|
||||
@ -1242,24 +1351,27 @@ module Stripe
|
||||
konbini: nil,
|
||||
kr_card: nil,
|
||||
link: nil,
|
||||
mb_way: nil,
|
||||
metadata: nil,
|
||||
mobilepay: nil,
|
||||
multibanco: nil,
|
||||
naver_pay: nil,
|
||||
nz_bank_account: nil,
|
||||
oxxo: nil,
|
||||
p24: nil,
|
||||
pay_by_bank: nil,
|
||||
payco: nil,
|
||||
paynow: nil,
|
||||
paypal: nil,
|
||||
payto: nil,
|
||||
pix: nil,
|
||||
promptpay: nil,
|
||||
qris: nil,
|
||||
radar_options: nil,
|
||||
rechnung: nil,
|
||||
revolut_pay: nil,
|
||||
samsung_pay: nil,
|
||||
satispay: nil,
|
||||
sepa_debit: nil,
|
||||
shopeepay: nil,
|
||||
sofort: nil,
|
||||
swish: nil,
|
||||
twint: nil,
|
||||
@ -1278,7 +1390,6 @@ module Stripe
|
||||
@au_becs_debit = au_becs_debit
|
||||
@bacs_debit = bacs_debit
|
||||
@bancontact = bancontact
|
||||
@billie = billie
|
||||
@billing_details = billing_details
|
||||
@blik = blik
|
||||
@boleto = boleto
|
||||
@ -1287,7 +1398,9 @@ module Stripe
|
||||
@eps = eps
|
||||
@fpx = fpx
|
||||
@giropay = giropay
|
||||
@gopay = gopay
|
||||
@grabpay = grabpay
|
||||
@id_bank_transfer = id_bank_transfer
|
||||
@ideal = ideal
|
||||
@interac_present = interac_present
|
||||
@kakao_pay = kakao_pay
|
||||
@ -1295,24 +1408,27 @@ module Stripe
|
||||
@konbini = konbini
|
||||
@kr_card = kr_card
|
||||
@link = link
|
||||
@mb_way = mb_way
|
||||
@metadata = metadata
|
||||
@mobilepay = mobilepay
|
||||
@multibanco = multibanco
|
||||
@naver_pay = naver_pay
|
||||
@nz_bank_account = nz_bank_account
|
||||
@oxxo = oxxo
|
||||
@p24 = p24
|
||||
@pay_by_bank = pay_by_bank
|
||||
@payco = payco
|
||||
@paynow = paynow
|
||||
@paypal = paypal
|
||||
@payto = payto
|
||||
@pix = pix
|
||||
@promptpay = promptpay
|
||||
@qris = qris
|
||||
@radar_options = radar_options
|
||||
@rechnung = rechnung
|
||||
@revolut_pay = revolut_pay
|
||||
@samsung_pay = samsung_pay
|
||||
@satispay = satispay
|
||||
@sepa_debit = sepa_debit
|
||||
@shopeepay = shopeepay
|
||||
@sofort = sofort
|
||||
@swish = swish
|
||||
@twint = twint
|
||||
@ -1323,47 +1439,6 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class PaymentMethodOptions < Stripe::RequestParams
|
||||
class Card < Stripe::RequestParams
|
||||
class Installments < Stripe::RequestParams
|
||||
class Plan < Stripe::RequestParams
|
||||
# For `fixed_count` installment plans, this is required. It represents the number of installment payments your customer will make to their credit card.
|
||||
attr_accessor :count
|
||||
# For `fixed_count` installment plans, this is required. It represents the interval between installment payments your customer will make to their credit card.
|
||||
# One of `month`.
|
||||
attr_accessor :interval
|
||||
# Type of installment plan, one of `fixed_count`.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(count: nil, interval: nil, type: nil)
|
||||
@count = count
|
||||
@interval = interval
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
# The selected installment plan to use for this payment attempt.
|
||||
# This parameter can only be provided during confirmation.
|
||||
attr_accessor :plan
|
||||
|
||||
def initialize(plan: nil)
|
||||
@plan = plan
|
||||
end
|
||||
end
|
||||
# Installment configuration for payments confirmed using this ConfirmationToken.
|
||||
attr_accessor :installments
|
||||
|
||||
def initialize(installments: nil)
|
||||
@installments = installments
|
||||
end
|
||||
end
|
||||
# Configuration for any card payments confirmed using this ConfirmationToken.
|
||||
attr_accessor :card
|
||||
|
||||
def initialize(card: nil)
|
||||
@card = card
|
||||
end
|
||||
end
|
||||
|
||||
class Shipping < Stripe::RequestParams
|
||||
class Address < Stripe::RequestParams
|
||||
# City, district, suburb, town, or village.
|
||||
@ -1414,8 +1489,6 @@ module Stripe
|
||||
attr_accessor :payment_method
|
||||
# If provided, this hash will be used to create a PaymentMethod.
|
||||
attr_accessor :payment_method_data
|
||||
# Payment-method-specific configuration for this ConfirmationToken.
|
||||
attr_accessor :payment_method_options
|
||||
# Return URL used to confirm the Intent.
|
||||
attr_accessor :return_url
|
||||
# Indicates that you intend to make future payments with this ConfirmationToken's payment method.
|
||||
@ -1429,7 +1502,6 @@ module Stripe
|
||||
expand: nil,
|
||||
payment_method: nil,
|
||||
payment_method_data: nil,
|
||||
payment_method_options: nil,
|
||||
return_url: nil,
|
||||
setup_future_usage: nil,
|
||||
shipping: nil
|
||||
@ -1437,7 +1509,6 @@ module Stripe
|
||||
@expand = expand
|
||||
@payment_method = payment_method
|
||||
@payment_method_data = payment_method_data
|
||||
@payment_method_options = payment_method_options
|
||||
@return_url = return_url
|
||||
@setup_future_usage = setup_future_usage
|
||||
@shipping = shipping
|
||||
|
@ -7,7 +7,7 @@ module Stripe
|
||||
# Country Specs API makes these rules available to your integration.
|
||||
#
|
||||
# You can also view the information from this API call as [an online
|
||||
# guide](https://docs.stripe.com/docs/connect/required-verification-information).
|
||||
# guide](https://stripe.com/docs/connect/required-verification-information).
|
||||
class CountrySpec < APIResource
|
||||
extend Stripe::APIOperations::List
|
||||
|
||||
@ -53,6 +53,15 @@ module Stripe
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# The default currency for this country. This applies to both payment methods and bank accounts.
|
||||
attr_reader :default_currency
|
||||
# Unique identifier for the object. Represented as the ISO country code for this country.
|
||||
|
@ -26,7 +26,17 @@ module Stripe
|
||||
attr_reader :amount_off
|
||||
end
|
||||
|
||||
class DeleteParams < Stripe::RequestParams; end
|
||||
class DeleteParams < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class CurrencyOptions < Stripe::RequestParams
|
||||
@ -177,7 +187,7 @@ module Stripe
|
||||
attr_reader :currency
|
||||
# Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency_options
|
||||
# One of `forever`, `once`, or `repeating`. Describes how long a customer who applies this coupon will get the discount.
|
||||
# One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount.
|
||||
attr_reader :duration
|
||||
# If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`.
|
||||
attr_reader :duration_in_months
|
||||
@ -212,10 +222,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API.
|
||||
def self.delete(coupon, params = {}, opts = {})
|
||||
def self.delete(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
path: format("/v1/coupons/%<coupon>s", { coupon: CGI.escape(coupon) }),
|
||||
path: format("/v1/coupons/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
@ -237,10 +247,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
|
||||
def self.update(coupon, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/coupons/%<coupon>s", { coupon: CGI.escape(coupon) }),
|
||||
path: format("/v1/coupons/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -44,9 +44,9 @@ module Stripe
|
||||
class Tax < Stripe::StripeObject
|
||||
# Amount of tax applied for this rate.
|
||||
attr_reader :amount
|
||||
# Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.
|
||||
# Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.
|
||||
#
|
||||
# Related guide: [Tax rates](/billing/taxes/tax-rates)
|
||||
# Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates)
|
||||
attr_reader :rate
|
||||
# The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
|
||||
attr_reader :taxability_reason
|
||||
@ -65,23 +65,17 @@ module Stripe
|
||||
attr_reader :taxes
|
||||
end
|
||||
|
||||
class TotalTax < Stripe::StripeObject
|
||||
class TaxRateDetails < Stripe::StripeObject
|
||||
# Attribute for field tax_rate
|
||||
attr_reader :tax_rate
|
||||
end
|
||||
# The amount of the tax, in cents (or local equivalent).
|
||||
class TaxAmount < Stripe::StripeObject
|
||||
# The amount, in cents (or local equivalent), of the tax.
|
||||
attr_reader :amount
|
||||
# Whether this tax is inclusive or exclusive.
|
||||
attr_reader :tax_behavior
|
||||
# Additional details about the tax rate. Only present when `type` is `tax_rate_details`.
|
||||
attr_reader :tax_rate_details
|
||||
# Whether this tax amount is inclusive or exclusive.
|
||||
attr_reader :inclusive
|
||||
# The tax rate that was applied to get this tax amount.
|
||||
attr_reader :tax_rate
|
||||
# The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
|
||||
attr_reader :taxability_reason
|
||||
# The amount on which tax is calculated, in cents (or local equivalent).
|
||||
attr_reader :taxable_amount
|
||||
# The type of tax information.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
@ -236,6 +230,8 @@ module Stripe
|
||||
attr_accessor :out_of_band_amount
|
||||
# Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`
|
||||
attr_accessor :reason
|
||||
# ID of an existing refund to link this credit note to.
|
||||
attr_accessor :refund
|
||||
# The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
|
||||
attr_accessor :refund_amount
|
||||
# Refunds to link to this credit note.
|
||||
@ -255,6 +251,7 @@ module Stripe
|
||||
metadata: nil,
|
||||
out_of_band_amount: nil,
|
||||
reason: nil,
|
||||
refund: nil,
|
||||
refund_amount: nil,
|
||||
refunds: nil,
|
||||
shipping_cost: nil
|
||||
@ -270,12 +267,22 @@ module Stripe
|
||||
@metadata = metadata
|
||||
@out_of_band_amount = out_of_band_amount
|
||||
@reason = reason
|
||||
@refund = refund
|
||||
@refund_amount = refund_amount
|
||||
@refunds = refunds
|
||||
@shipping_cost = shipping_cost
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
@ -391,6 +398,8 @@ module Stripe
|
||||
attr_accessor :out_of_band_amount
|
||||
# Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`
|
||||
attr_accessor :reason
|
||||
# ID of an existing refund to link this credit note to.
|
||||
attr_accessor :refund
|
||||
# The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
|
||||
attr_accessor :refund_amount
|
||||
# Refunds to link to this credit note.
|
||||
@ -410,6 +419,7 @@ module Stripe
|
||||
metadata: nil,
|
||||
out_of_band_amount: nil,
|
||||
reason: nil,
|
||||
refund: nil,
|
||||
refund_amount: nil,
|
||||
refunds: nil,
|
||||
shipping_cost: nil
|
||||
@ -425,6 +435,7 @@ module Stripe
|
||||
@metadata = metadata
|
||||
@out_of_band_amount = out_of_band_amount
|
||||
@reason = reason
|
||||
@refund = refund
|
||||
@refund_amount = refund_amount
|
||||
@refunds = refunds
|
||||
@shipping_cost = shipping_cost
|
||||
@ -535,6 +546,8 @@ module Stripe
|
||||
attr_accessor :out_of_band_amount
|
||||
# Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`
|
||||
attr_accessor :reason
|
||||
# ID of an existing refund to link this credit note to.
|
||||
attr_accessor :refund
|
||||
# The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
|
||||
attr_accessor :refund_amount
|
||||
# Refunds to link to this credit note.
|
||||
@ -558,6 +571,7 @@ module Stripe
|
||||
metadata: nil,
|
||||
out_of_band_amount: nil,
|
||||
reason: nil,
|
||||
refund: nil,
|
||||
refund_amount: nil,
|
||||
refunds: nil,
|
||||
shipping_cost: nil,
|
||||
@ -576,6 +590,7 @@ module Stripe
|
||||
@metadata = metadata
|
||||
@out_of_band_amount = out_of_band_amount
|
||||
@reason = reason
|
||||
@refund = refund
|
||||
@refund_amount = refund_amount
|
||||
@refunds = refunds
|
||||
@shipping_cost = shipping_cost
|
||||
@ -629,14 +644,16 @@ module Stripe
|
||||
attr_reader :out_of_band_amount
|
||||
# The link to download the PDF of the credit note.
|
||||
attr_reader :pdf
|
||||
# The amount of the credit note that was refunded to the customer, credited to the customer's balance, credited outside of Stripe, or any combination thereof.
|
||||
# Attribute for field post_payment_amount
|
||||
attr_reader :post_payment_amount
|
||||
# The amount of the credit note by which the invoice's `amount_remaining` and `amount_due` were reduced.
|
||||
# Attribute for field pre_payment_amount
|
||||
attr_reader :pre_payment_amount
|
||||
# The pretax credit amounts (ex: discount, credit grants, etc) for all line items.
|
||||
attr_reader :pretax_credit_amounts
|
||||
# Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`
|
||||
attr_reader :reason
|
||||
# Refund related to this credit note.
|
||||
attr_reader :refund
|
||||
# Refunds related to this credit note.
|
||||
attr_reader :refunds
|
||||
# The details of the cost of shipping, including the ShippingRate applied to the invoice.
|
||||
@ -647,30 +664,31 @@ module Stripe
|
||||
attr_reader :subtotal
|
||||
# The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts.
|
||||
attr_reader :subtotal_excluding_tax
|
||||
# The aggregate amounts calculated per tax rate for all line items.
|
||||
attr_reader :tax_amounts
|
||||
# The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount.
|
||||
attr_reader :total
|
||||
# The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts.
|
||||
attr_reader :total_excluding_tax
|
||||
# The aggregate tax information for all line items.
|
||||
attr_reader :total_taxes
|
||||
# Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid.
|
||||
attr_reader :type
|
||||
# The time that the credit note was voided.
|
||||
attr_reader :voided_at
|
||||
|
||||
# Issue a credit note to adjust the amount of a finalized invoice. A credit note will first reduce the invoice's amount_remaining (and amount_due), but not below zero.
|
||||
# This amount is indicated by the credit note's pre_payment_amount. The excess amount is indicated by post_payment_amount, and it can result in any combination of the following:
|
||||
# Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces
|
||||
# its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result
|
||||
# in any combination of the following:
|
||||
#
|
||||
#
|
||||
# Refunds: create a new refund (using refund_amount) or link existing refunds (using refunds).
|
||||
# Refund: create a new refund (using refund_amount) or link an existing refund (using refund).
|
||||
# Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized.
|
||||
# Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount).
|
||||
#
|
||||
#
|
||||
# The sum of refunds, customer balance credits, and outside of Stripe credits must equal the post_payment_amount.
|
||||
# For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total.
|
||||
#
|
||||
# You may issue multiple credit notes for an invoice. Each credit note may increment the invoice's pre_payment_credit_notes_amount,
|
||||
# post_payment_credit_notes_amount, or both, depending on the invoice's amount_remaining at the time of credit note creation.
|
||||
# You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount
|
||||
# or post_payment_credit_notes_amount depending on its status at the time of credit note creation.
|
||||
def self.create(params = {}, opts = {})
|
||||
request_stripe_object(method: :post, path: "/v1/credit_notes", params: params, opts: opts)
|
||||
end
|
||||
@ -710,7 +728,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Marks a credit note as void. Learn more about [voiding credit notes](https://docs.stripe.com/docs/billing/invoices/credit-notes#voiding).
|
||||
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
||||
def void_credit_note(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -720,7 +738,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Marks a credit note as void. Learn more about [voiding credit notes](https://docs.stripe.com/docs/billing/invoices/credit-notes#voiding).
|
||||
# Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding).
|
||||
def self.void_credit_note(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
|
@ -27,26 +27,22 @@ module Stripe
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class Tax < Stripe::StripeObject
|
||||
class TaxRateDetails < Stripe::StripeObject
|
||||
# Attribute for field tax_rate
|
||||
attr_reader :tax_rate
|
||||
end
|
||||
# The amount of the tax, in cents (or local equivalent).
|
||||
class TaxAmount < Stripe::StripeObject
|
||||
# The amount, in cents (or local equivalent), of the tax.
|
||||
attr_reader :amount
|
||||
# Whether this tax is inclusive or exclusive.
|
||||
attr_reader :tax_behavior
|
||||
# Additional details about the tax rate. Only present when `type` is `tax_rate_details`.
|
||||
attr_reader :tax_rate_details
|
||||
# Whether this tax amount is inclusive or exclusive.
|
||||
attr_reader :inclusive
|
||||
# The tax rate that was applied to get this tax amount.
|
||||
attr_reader :tax_rate
|
||||
# The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
|
||||
attr_reader :taxability_reason
|
||||
# The amount on which tax is calculated, in cents (or local equivalent).
|
||||
attr_reader :taxable_amount
|
||||
# The type of tax information.
|
||||
attr_reader :type
|
||||
end
|
||||
# The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
|
||||
attr_reader :amount
|
||||
# The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts.
|
||||
attr_reader :amount_excluding_tax
|
||||
# Description of the item being credited.
|
||||
attr_reader :description
|
||||
# The integer amount in cents (or local equivalent) representing the discount being credited for this line item.
|
||||
@ -65,15 +61,17 @@ module Stripe
|
||||
attr_reader :pretax_credit_amounts
|
||||
# The number of units of product being credited.
|
||||
attr_reader :quantity
|
||||
# The amount of tax calculated per tax rate for this line item
|
||||
attr_reader :tax_amounts
|
||||
# The tax rates which apply to the line item.
|
||||
attr_reader :tax_rates
|
||||
# The tax information of the line item.
|
||||
attr_reader :taxes
|
||||
# The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice.
|
||||
attr_reader :type
|
||||
# The cost of each unit of product being credited.
|
||||
attr_reader :unit_amount
|
||||
# Same as `unit_amount`, but contains a decimal value with at most 12 decimal places.
|
||||
attr_reader :unit_amount_decimal
|
||||
# The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts.
|
||||
attr_reader :unit_amount_excluding_tax
|
||||
end
|
||||
end
|
||||
|
@ -90,22 +90,32 @@ module Stripe
|
||||
|
||||
class Tax < Stripe::StripeObject
|
||||
class Location < Stripe::StripeObject
|
||||
# The identified tax country of the customer.
|
||||
# The customer's country as identified by Stripe Tax.
|
||||
attr_reader :country
|
||||
# The data source used to infer the customer's location.
|
||||
attr_reader :source
|
||||
# The identified tax state, county, province, or region of the customer.
|
||||
# The customer's state, county, province, or region as identified by Stripe Tax.
|
||||
attr_reader :state
|
||||
end
|
||||
# Surfaces if automatic tax computation is possible given the current customer location information.
|
||||
attr_reader :automatic_tax
|
||||
# A recent IP address of the customer used for tax reporting and tax location inference.
|
||||
attr_reader :ip_address
|
||||
# The identified tax location of the customer.
|
||||
# The customer's location as identified by Stripe Tax.
|
||||
attr_reader :location
|
||||
end
|
||||
|
||||
class DeleteParams < Stripe::RequestParams; end
|
||||
class DeleteParams < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Address < Stripe::RequestParams
|
||||
@ -265,6 +275,8 @@ module Stripe
|
||||
attr_accessor :balance
|
||||
# Balance information and default balance settings for this customer.
|
||||
attr_accessor :cash_balance
|
||||
# Attribute for param field coupon
|
||||
attr_accessor :coupon
|
||||
# If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter.
|
||||
#
|
||||
# Provide the ID of a payment source already attached to this customer to make it this customer's default payment source.
|
||||
@ -291,6 +303,8 @@ module Stripe
|
||||
attr_accessor :phone
|
||||
# Customer's preferred languages, ordered by preference.
|
||||
attr_accessor :preferred_locales
|
||||
# The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount.
|
||||
attr_accessor :promotion_code
|
||||
# The customer's shipping information. Appears on invoices emailed to this customer.
|
||||
attr_accessor :shipping
|
||||
# Attribute for param field source
|
||||
@ -306,6 +320,7 @@ module Stripe
|
||||
address: nil,
|
||||
balance: nil,
|
||||
cash_balance: nil,
|
||||
coupon: nil,
|
||||
default_source: nil,
|
||||
description: nil,
|
||||
email: nil,
|
||||
@ -317,6 +332,7 @@ module Stripe
|
||||
next_invoice_sequence: nil,
|
||||
phone: nil,
|
||||
preferred_locales: nil,
|
||||
promotion_code: nil,
|
||||
shipping: nil,
|
||||
source: nil,
|
||||
tax: nil,
|
||||
@ -326,6 +342,7 @@ module Stripe
|
||||
@address = address
|
||||
@balance = balance
|
||||
@cash_balance = cash_balance
|
||||
@coupon = coupon
|
||||
@default_source = default_source
|
||||
@description = description
|
||||
@email = email
|
||||
@ -337,6 +354,7 @@ module Stripe
|
||||
@next_invoice_sequence = next_invoice_sequence
|
||||
@phone = phone
|
||||
@preferred_locales = preferred_locales
|
||||
@promotion_code = promotion_code
|
||||
@shipping = shipping
|
||||
@source = source
|
||||
@tax = tax
|
||||
@ -345,7 +363,8 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class DeleteDiscountParams < Stripe::RequestParams; end
|
||||
class DeleteDiscountParams < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
class Created < Stripe::RequestParams
|
||||
@ -553,7 +572,7 @@ module Stripe
|
||||
end
|
||||
|
||||
class TaxIdDatum < Stripe::RequestParams
|
||||
# Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `aw_tin`, `az_tin`, `ba_tin`, `bb_tin`, `bd_bin`, `bf_ifu`, `bg_uic`, `bh_vat`, `bj_ifu`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cm_niu`, `cn_tin`, `co_nit`, `cr_tin`, `cv_nif`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `et_tin`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kg_tin`, `kh_tin`, `kr_brn`, `kz_bin`, `la_tin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
|
||||
# Type of the tax ID, one of `ad_nrt`, `ae_trn`, `al_tin`, `am_tin`, `ao_tin`, `ar_cuit`, `au_abn`, `au_arn`, `ba_tin`, `bb_tin`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `bs_tin`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `cd_nif`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `gn_nif`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kh_tin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `me_pib`, `mk_vat`, `mr_nif`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `np_pan`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sn_ninea`, `sr_fin`, `sv_nit`, `th_vat`, `tj_tin`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `ug_tin`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, `za_vat`, `zm_tin`, or `zw_tin`
|
||||
attr_accessor :type
|
||||
# Value of the tax ID.
|
||||
attr_accessor :value
|
||||
@ -569,6 +588,8 @@ module Stripe
|
||||
attr_accessor :balance
|
||||
# Balance information and default balance settings for this customer.
|
||||
attr_accessor :cash_balance
|
||||
# Attribute for param field coupon
|
||||
attr_accessor :coupon
|
||||
# An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard.
|
||||
attr_accessor :description
|
||||
# Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*.
|
||||
@ -591,6 +612,8 @@ module Stripe
|
||||
attr_accessor :phone
|
||||
# Customer's preferred languages, ordered by preference.
|
||||
attr_accessor :preferred_locales
|
||||
# The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount.
|
||||
attr_accessor :promotion_code
|
||||
# The customer's shipping information. Appears on invoices emailed to this customer.
|
||||
attr_accessor :shipping
|
||||
# Attribute for param field source
|
||||
@ -610,6 +633,7 @@ module Stripe
|
||||
address: nil,
|
||||
balance: nil,
|
||||
cash_balance: nil,
|
||||
coupon: nil,
|
||||
description: nil,
|
||||
email: nil,
|
||||
expand: nil,
|
||||
@ -621,6 +645,7 @@ module Stripe
|
||||
payment_method: nil,
|
||||
phone: nil,
|
||||
preferred_locales: nil,
|
||||
promotion_code: nil,
|
||||
shipping: nil,
|
||||
source: nil,
|
||||
tax: nil,
|
||||
@ -632,6 +657,7 @@ module Stripe
|
||||
@address = address
|
||||
@balance = balance
|
||||
@cash_balance = cash_balance
|
||||
@coupon = coupon
|
||||
@description = description
|
||||
@email = email
|
||||
@expand = expand
|
||||
@ -643,6 +669,7 @@ module Stripe
|
||||
@payment_method = payment_method
|
||||
@phone = phone
|
||||
@preferred_locales = preferred_locales
|
||||
@promotion_code = promotion_code
|
||||
@shipping = shipping
|
||||
@source = source
|
||||
@tax = tax
|
||||
@ -654,7 +681,7 @@ module Stripe
|
||||
end
|
||||
|
||||
class ListPaymentMethodsParams < Stripe::RequestParams
|
||||
# This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow.
|
||||
# This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`.
|
||||
attr_accessor :allow_redisplay
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
@ -753,15 +780,6 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class FundCashBalanceParams < Stripe::RequestParams
|
||||
# Amount to be used for this test cash balance transaction. A positive integer representing how much to fund in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, a zero-decimal currency).
|
||||
attr_accessor :amount
|
||||
@ -874,10 +892,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer.
|
||||
def self.delete(customer, params = {}, opts = {})
|
||||
def self.delete(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
path: format("/v1/customers/%<customer>s", { customer: CGI.escape(customer) }),
|
||||
path: format("/v1/customers/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
@ -979,10 +997,10 @@ module Stripe
|
||||
# Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior.
|
||||
#
|
||||
# This request accepts mostly the same arguments as the customer creation call.
|
||||
def self.update(customer, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/customers/%<customer>s", { customer: CGI.escape(customer) }),
|
||||
path: format("/v1/customers/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -18,8 +18,6 @@ module Stripe
|
||||
|
||||
# The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`.
|
||||
attr_reader :amount
|
||||
# The ID of the checkout session (if any) that created the transaction.
|
||||
attr_reader :checkout_session
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# The ID of the credit note (if any) related to the transaction.
|
||||
@ -42,7 +40,7 @@ module Stripe
|
||||
attr_reader :metadata
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, `unapplied_from_invoice`, `checkout_session_subscription_payment`, or `checkout_session_subscription_payment_canceled`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types.
|
||||
# Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types.
|
||||
attr_reader :type
|
||||
|
||||
def resource_url
|
||||
|
@ -5,9 +5,9 @@ module Stripe
|
||||
# A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access
|
||||
# control over a Customer.
|
||||
#
|
||||
# Related guides: [Customer Session with the Payment Element](https://docs.stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods),
|
||||
# [Customer Session with the Pricing Table](https://docs.stripe.com/payments/checkout/pricing-table#customer-session),
|
||||
# [Customer Session with the Buy Button](https://docs.stripe.com/payment-links/buy-button#pass-an-existing-customer).
|
||||
# Related guides: [Customer Session with the Payment Element](https://stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods),
|
||||
# [Customer Session with the Pricing Table](https://stripe.com/payments/checkout/pricing-table#customer-session),
|
||||
# [Customer Session with the Buy Button](https://stripe.com/payment-links/buy-button#pass-an-existing-customer).
|
||||
class CustomerSession < APIResource
|
||||
extend Stripe::APIOperations::Create
|
||||
|
||||
|
@ -277,6 +277,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Evidence < Stripe::RequestParams
|
||||
class EnhancedEvidence < Stripe::RequestParams
|
||||
@ -621,7 +630,7 @@ module Stripe
|
||||
attr_reader :payment_intent
|
||||
# Attribute for field payment_method_details
|
||||
attr_reader :payment_method_details
|
||||
# Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `noncompliant`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories).
|
||||
# Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories).
|
||||
attr_reader :reason
|
||||
# Current status of dispute. Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`.
|
||||
attr_reader :status
|
||||
@ -657,11 +666,11 @@ module Stripe
|
||||
|
||||
# When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically.
|
||||
#
|
||||
# Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://docs.stripe.com/docs/disputes/categories).
|
||||
def self.update(dispute, params = {}, opts = {})
|
||||
# Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories).
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/disputes/%<dispute>s", { dispute: CGI.escape(dispute) }),
|
||||
path: format("/v1/disputes/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -38,6 +38,15 @@ module Stripe
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# The [Feature](https://stripe.com/docs/api/entitlements/feature) that the customer is entitled to.
|
||||
attr_reader :feature
|
||||
# Unique identifier for the object.
|
||||
|
@ -64,6 +64,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# Inactive features cannot be attached to new products and will not be returned from the features list endpoint.
|
||||
attr_accessor :active
|
||||
|
@ -33,10 +33,10 @@ module Stripe
|
||||
attr_reader :secret
|
||||
|
||||
# Invalidates a short-lived API key for a given resource.
|
||||
def self.delete(key, params = {}, opts = {})
|
||||
def self.delete(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
path: format("/v1/ephemeral_keys/%<key>s", { key: CGI.escape(key) }),
|
||||
path: format("/v1/ephemeral_keys/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -47,6 +47,35 @@ module Stripe
|
||||
attr_reader :previous_attributes
|
||||
end
|
||||
|
||||
class Reason < Stripe::StripeObject
|
||||
class AutomationAction < Stripe::StripeObject
|
||||
class StripeSendWebhookCustomEvent < Stripe::StripeObject
|
||||
# Set of key-value pairs attached to the action when creating an Automation.
|
||||
attr_reader :custom_data
|
||||
end
|
||||
# Attribute for field stripe_send_webhook_custom_event
|
||||
attr_reader :stripe_send_webhook_custom_event
|
||||
# The trigger name of the automation that triggered this action.
|
||||
# Please visit [Revenue and retention automations](https://docs.stripe.com/billing/automations#choose-a-trigger) for all possible trigger names.
|
||||
attr_reader :trigger
|
||||
# The type of the `automation_action`.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class Request < Stripe::StripeObject
|
||||
# ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API.
|
||||
attr_reader :id
|
||||
# The idempotency key transmitted during the request, if any. *Note: This property is populated only for events on or after May 23, 2017*.
|
||||
attr_reader :idempotency_key
|
||||
end
|
||||
# Attribute for field automation_action
|
||||
attr_reader :automation_action
|
||||
# Attribute for field request
|
||||
attr_reader :request
|
||||
# The type of the reason for the event.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class Request < Stripe::StripeObject
|
||||
# ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API.
|
||||
attr_reader :id
|
||||
@ -109,12 +138,19 @@ module Stripe
|
||||
@types = types
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# The connected account that originates the event.
|
||||
attr_reader :account
|
||||
# The Stripe API version used to render `data`. This property is populated only for events on or after October 31, 2014.
|
||||
attr_reader :api_version
|
||||
# Authentication context needed to fetch the event or related object.
|
||||
attr_reader :context
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# Attribute for field data
|
||||
@ -127,6 +163,8 @@ module Stripe
|
||||
attr_reader :object
|
||||
# Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify.
|
||||
attr_reader :pending_webhooks
|
||||
# Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://docs.stripe.com/billing/automations) action.
|
||||
attr_reader :reason
|
||||
# Information on the API request that triggers the event.
|
||||
attr_reader :request
|
||||
# Description of the event (for example, `invoice.created` or `charge.refunded`).
|
||||
|
@ -53,6 +53,15 @@ module Stripe
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Unique identifier for the object. Represented as the three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase.
|
||||
attr_reader :id
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
|
@ -6,7 +6,7 @@ module Stripe
|
||||
# files with the [create file](https://stripe.com/docs/api#create_file) request
|
||||
# (for example, when uploading dispute evidence). Stripe also
|
||||
# creates files independently (for example, the results of a [Sigma scheduled
|
||||
# query](https://docs.stripe.com/api#scheduled_queries)).
|
||||
# query](https://stripe.com/docs/api#scheduled_queries)).
|
||||
#
|
||||
# Related guide: [File upload guide](https://stripe.com/docs/file-upload)
|
||||
class File < APIResource
|
||||
@ -97,6 +97,15 @@ module Stripe
|
||||
@purpose = purpose
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# The file expires and isn't available at this time in epoch seconds.
|
||||
|
@ -85,6 +85,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
@ -129,10 +138,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates an existing file link object. Expired links can no longer be updated.
|
||||
def self.update(link, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/file_links/%<link>s", { link: CGI.escape(link) }),
|
||||
path: format("/v1/file_links/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -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]
|
||||
|
||||
class AccountHolder < Stripe::StripeObject
|
||||
# The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`.
|
||||
attr_reader :account
|
||||
@ -64,6 +67,15 @@ module Stripe
|
||||
attr_reader :status
|
||||
end
|
||||
|
||||
class InferredBalancesRefresh < Stripe::StripeObject
|
||||
# The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
|
||||
attr_reader :last_attempted_at
|
||||
# Time at which the next inferred balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch.
|
||||
attr_reader :next_refresh_available_at
|
||||
# The status of the last refresh attempt.
|
||||
attr_reader :status
|
||||
end
|
||||
|
||||
class OwnershipRefresh < Stripe::StripeObject
|
||||
# The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch.
|
||||
attr_reader :last_attempted_at
|
||||
@ -126,6 +138,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class ListOwnersParams < Stripe::RequestParams
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
@ -211,6 +232,8 @@ module Stripe
|
||||
attr_reader :display_name
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# The state of the most recent attempt to refresh the account's inferred balance history.
|
||||
attr_reader :inferred_balances_refresh
|
||||
# The name of the institution that holds this account.
|
||||
attr_reader :institution_name
|
||||
# The last 4 digits of the account number. If present, this will be 4 numeric characters.
|
||||
|
@ -0,0 +1,27 @@
|
||||
# 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
|
||||
|
||||
# The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC.
|
||||
attr_reader :as_of
|
||||
# The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions.
|
||||
#
|
||||
# Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
|
||||
#
|
||||
# Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder.
|
||||
attr_reader :current
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
end
|
||||
end
|
||||
end
|
99
lib/stripe/resources/financial_connections/institution.rb
Normal file
99
lib/stripe/resources/financial_connections/institution.rb
Normal file
@ -0,0 +1,99 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
module FinancialConnections
|
||||
# An institution represents a financial institution to which an end user can connect using the Financial Connections authentication flow.
|
||||
class Institution < APIResource
|
||||
extend Stripe::APIOperations::List
|
||||
|
||||
OBJECT_NAME = "financial_connections.institution"
|
||||
def self.object_name
|
||||
"financial_connections.institution"
|
||||
end
|
||||
|
||||
class Features < Stripe::StripeObject
|
||||
class Balances < Stripe::StripeObject
|
||||
# Whether the given feature is supported by this institution.
|
||||
attr_reader :supported
|
||||
end
|
||||
|
||||
class Ownership < Stripe::StripeObject
|
||||
# Whether the given feature is supported by this institution.
|
||||
attr_reader :supported
|
||||
end
|
||||
|
||||
class PaymentMethod < Stripe::StripeObject
|
||||
# Whether the given feature is supported by this institution.
|
||||
attr_reader :supported
|
||||
end
|
||||
|
||||
class Transactions < Stripe::StripeObject
|
||||
# Whether the given feature is supported by this institution.
|
||||
attr_reader :supported
|
||||
end
|
||||
# Attribute for field balances
|
||||
attr_reader :balances
|
||||
# Attribute for field ownership
|
||||
attr_reader :ownership
|
||||
# Attribute for field payment_method
|
||||
attr_reader :payment_method
|
||||
# Attribute for field transactions
|
||||
attr_reader :transactions
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
|
||||
def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@limit = limit
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Attribute for field features
|
||||
attr_reader :features
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# The name of this institution.
|
||||
attr_reader :name
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# A list of routing numbers which are known to correspond to this institution. Due to the many to many relationship between institutions and routing numbers, this list may not be comprehensive and routing numbers may also be shared between institutions.
|
||||
attr_reader :routing_numbers
|
||||
# The status of this institution in the Financial Connections authentication flow.
|
||||
attr_reader :status
|
||||
# A URL corresponding to this institution. This URL is also displayed in the authentication flow to help end users confirm that they are authenticating with the right institution.
|
||||
attr_reader :url
|
||||
|
||||
# Returns a list of Financial Connections Institution objects.
|
||||
def self.list(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
path: "/v1/financial_connections/institutions",
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -26,6 +26,33 @@ module Stripe
|
||||
attr_reader :account_subcategories
|
||||
# List of countries from which to filter accounts.
|
||||
attr_reader :countries
|
||||
# Stripe ID of the institution with which the customer should be directed to log in.
|
||||
attr_reader :institution
|
||||
end
|
||||
|
||||
class Limits < Stripe::StripeObject
|
||||
# The number of accounts that can be linked in this Session.
|
||||
attr_reader :accounts
|
||||
end
|
||||
|
||||
class ManualEntry < Stripe::StripeObject; end
|
||||
|
||||
class StatusDetails < Stripe::StripeObject
|
||||
class Cancelled < Stripe::StripeObject
|
||||
# The reason for the Session being cancelled.
|
||||
attr_reader :reason
|
||||
end
|
||||
# Attribute for field cancelled
|
||||
attr_reader :cancelled
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class CreateParams < Stripe::RequestParams
|
||||
@ -49,10 +76,31 @@ module Stripe
|
||||
attr_accessor :account_subcategories
|
||||
# List of countries from which to collect accounts.
|
||||
attr_accessor :countries
|
||||
# Stripe ID of the institution with which the customer should be directed to log in.
|
||||
attr_accessor :institution
|
||||
|
||||
def initialize(account_subcategories: nil, countries: nil)
|
||||
def initialize(account_subcategories: nil, countries: nil, institution: nil)
|
||||
@account_subcategories = account_subcategories
|
||||
@countries = countries
|
||||
@institution = institution
|
||||
end
|
||||
end
|
||||
|
||||
class Limits < Stripe::RequestParams
|
||||
# The number of accounts that can be linked in this Session.
|
||||
attr_accessor :accounts
|
||||
|
||||
def initialize(accounts: nil)
|
||||
@accounts = accounts
|
||||
end
|
||||
end
|
||||
|
||||
class ManualEntry < Stripe::RequestParams
|
||||
# Whether manual entry will be handled by Stripe during the Session.
|
||||
attr_accessor :mode
|
||||
|
||||
def initialize(mode: nil)
|
||||
@mode = mode
|
||||
end
|
||||
end
|
||||
# The account holder to link accounts for.
|
||||
@ -61,6 +109,10 @@ module Stripe
|
||||
attr_accessor :expand
|
||||
# Filters to restrict the kinds of accounts to collect.
|
||||
attr_accessor :filters
|
||||
# Settings for configuring Session-specific limits.
|
||||
attr_accessor :limits
|
||||
# Settings for configuring manual entry of account details for this Session.
|
||||
attr_accessor :manual_entry
|
||||
# List of data features that you would like to request access to.
|
||||
#
|
||||
# Possible values are `balances`, `transactions`, `ownership`, and `payment_method`.
|
||||
@ -74,6 +126,8 @@ module Stripe
|
||||
account_holder: nil,
|
||||
expand: nil,
|
||||
filters: nil,
|
||||
limits: nil,
|
||||
manual_entry: nil,
|
||||
permissions: nil,
|
||||
prefetch: nil,
|
||||
return_url: nil
|
||||
@ -81,6 +135,8 @@ module Stripe
|
||||
@account_holder = account_holder
|
||||
@expand = expand
|
||||
@filters = filters
|
||||
@limits = limits
|
||||
@manual_entry = manual_entry
|
||||
@permissions = permissions
|
||||
@prefetch = prefetch
|
||||
@return_url = return_url
|
||||
@ -96,8 +152,12 @@ module Stripe
|
||||
attr_reader :filters
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Attribute for field limits
|
||||
attr_reader :limits
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# Attribute for field manual_entry
|
||||
attr_reader :manual_entry
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# Permissions requested for accounts collected during this session.
|
||||
@ -106,6 +166,10 @@ module Stripe
|
||||
attr_reader :prefetch
|
||||
# For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.
|
||||
attr_reader :return_url
|
||||
# The current state of the session.
|
||||
attr_reader :status
|
||||
# Attribute for field status_details
|
||||
attr_reader :status_details
|
||||
|
||||
# To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js.
|
||||
def self.create(params = {}, opts = {})
|
||||
|
@ -79,6 +79,15 @@ module Stripe
|
||||
@transaction_refresh = transaction_refresh
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# The ID of the Financial Connections Account this transaction belongs to.
|
||||
attr_reader :account
|
||||
# The amount of this transaction, in cents (or local equivalent).
|
||||
|
@ -161,6 +161,15 @@ module Stripe
|
||||
@url = url
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# Unique identifier for the object.
|
||||
|
@ -326,7 +326,7 @@ module Stripe
|
||||
raise NotImplementedError,
|
||||
"FundingInstructions cannot be accessed without a customer ID."
|
||||
end
|
||||
"#{Customer.resource_url}/#{CGI.escape(customer)}/funding_instructions" + "/#{CGI.escape(id)}"
|
||||
"#{Customer.resource_url}/#{CGI.escape(customer)}/funding_instructions" "/#{CGI.escape(id)}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
217
lib/stripe/resources/gift_cards/card.rb
Normal file
217
lib/stripe/resources/gift_cards/card.rb
Normal file
@ -0,0 +1,217 @@
|
||||
# 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
|
||||
|
||||
class CreatedBy < Stripe::StripeObject
|
||||
class Checkout < Stripe::StripeObject
|
||||
# The Stripe CheckoutSession that created this object.
|
||||
attr_reader :checkout_session
|
||||
# The Stripe CheckoutSession LineItem that created this object.
|
||||
attr_reader :line_item
|
||||
end
|
||||
|
||||
class Order < Stripe::StripeObject
|
||||
# The Stripe Order LineItem that created this object.
|
||||
attr_reader :line_item
|
||||
# The Stripe Order that created this object.
|
||||
attr_reader :order
|
||||
end
|
||||
|
||||
class Payment < Stripe::StripeObject
|
||||
# The PaymentIntent that created this object.
|
||||
attr_reader :payment_intent
|
||||
end
|
||||
# Attribute for field checkout
|
||||
attr_reader :checkout
|
||||
# Attribute for field order
|
||||
attr_reader :order
|
||||
# Attribute for field payment
|
||||
attr_reader :payment
|
||||
# The type of event that created this object.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
|
||||
def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@limit = limit
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class CreateParams < Stripe::RequestParams
|
||||
class CreatedBy < Stripe::RequestParams
|
||||
class Payment < Stripe::RequestParams
|
||||
# The PaymentIntent used to collect payment for this object.
|
||||
attr_accessor :payment_intent
|
||||
|
||||
def initialize(payment_intent: nil)
|
||||
@payment_intent = payment_intent
|
||||
end
|
||||
end
|
||||
# The details for the payment that created this object.
|
||||
attr_accessor :payment
|
||||
# The type of event that created this object.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(payment: nil, type: nil)
|
||||
@payment = payment
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
# The active state for the new gift card, defaults to false. The active state can be updated after creation.
|
||||
attr_accessor :active
|
||||
# Related objects which created this gift card.
|
||||
attr_accessor :created_by
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_accessor :currency
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The initial amount to load onto the new gift card, defaults to 0.
|
||||
attr_accessor :initial_amount
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
|
||||
def initialize(
|
||||
active: nil,
|
||||
created_by: nil,
|
||||
currency: nil,
|
||||
expand: nil,
|
||||
initial_amount: nil,
|
||||
metadata: nil
|
||||
)
|
||||
@active = active
|
||||
@created_by = created_by
|
||||
@currency = currency
|
||||
@expand = expand
|
||||
@initial_amount = initial_amount
|
||||
@metadata = metadata
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# The new active state for the gift card.
|
||||
attr_accessor :active
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
|
||||
def initialize(active: nil, expand: nil, metadata: nil)
|
||||
@active = active
|
||||
@expand = expand
|
||||
@metadata = metadata
|
||||
end
|
||||
end
|
||||
|
||||
class ValidateParams < Stripe::RequestParams
|
||||
# The gift card code to be validated.
|
||||
attr_accessor :code
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The pin associated with the gift card. Not all gift cards have pins.
|
||||
attr_accessor :giftcard_pin
|
||||
|
||||
def initialize(code: nil, expand: nil, giftcard_pin: nil)
|
||||
@code = code
|
||||
@expand = expand
|
||||
@giftcard_pin = giftcard_pin
|
||||
end
|
||||
end
|
||||
# Whether this gift card can be used or not.
|
||||
attr_reader :active
|
||||
# The amount of funds available for new transactions.
|
||||
attr_reader :amount_available
|
||||
# The amount of funds marked as held.
|
||||
attr_reader :amount_held
|
||||
# Code used to redeem this gift card.
|
||||
attr_reader :code
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# The related Stripe objects that created this gift card.
|
||||
attr_reader :created_by
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
attr_reader :metadata
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# Transactions on this gift card.
|
||||
attr_reader :transactions
|
||||
|
||||
# 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(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
path: "/v1/gift_cards/cards",
|
||||
params: params,
|
||||
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
|
281
lib/stripe/resources/gift_cards/transaction.rb
Normal file
281
lib/stripe/resources/gift_cards/transaction.rb
Normal file
@ -0,0 +1,281 @@
|
||||
# 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
|
||||
|
||||
class CreatedBy < Stripe::StripeObject
|
||||
class Checkout < Stripe::StripeObject
|
||||
# The Stripe CheckoutSession that created this object.
|
||||
attr_reader :checkout_session
|
||||
# The Stripe CheckoutSession LineItem that created this object.
|
||||
attr_reader :line_item
|
||||
end
|
||||
|
||||
class Order < Stripe::StripeObject
|
||||
# The Stripe Order LineItem that created this object.
|
||||
attr_reader :line_item
|
||||
# The Stripe Order that created this object.
|
||||
attr_reader :order
|
||||
end
|
||||
|
||||
class Payment < Stripe::StripeObject
|
||||
# The PaymentIntent that created this object.
|
||||
attr_reader :payment_intent
|
||||
end
|
||||
# Attribute for field checkout
|
||||
attr_reader :checkout
|
||||
# Attribute for field order
|
||||
attr_reader :order
|
||||
# Attribute for field payment
|
||||
attr_reader :payment
|
||||
# The type of event that created this object.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The gift card to list transactions for.
|
||||
attr_accessor :gift_card
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
# A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details.
|
||||
attr_accessor :transfer_group
|
||||
|
||||
def initialize(
|
||||
ending_before: nil,
|
||||
expand: nil,
|
||||
gift_card: nil,
|
||||
limit: nil,
|
||||
starting_after: nil,
|
||||
transfer_group: nil
|
||||
)
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@gift_card = gift_card
|
||||
@limit = limit
|
||||
@starting_after = starting_after
|
||||
@transfer_group = transfer_group
|
||||
end
|
||||
end
|
||||
|
||||
class CreateParams < Stripe::RequestParams
|
||||
class CreatedBy < Stripe::RequestParams
|
||||
class Payment < Stripe::RequestParams
|
||||
# The PaymentIntent used to collect payment for this object.
|
||||
attr_accessor :payment_intent
|
||||
|
||||
def initialize(payment_intent: nil)
|
||||
@payment_intent = payment_intent
|
||||
end
|
||||
end
|
||||
# The details for the payment that created this object.
|
||||
attr_accessor :payment
|
||||
# The type of event that created this object.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(payment: nil, type: nil)
|
||||
@payment = payment
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
# The amount of the transaction. A negative amount deducts funds, and a positive amount adds funds.
|
||||
attr_accessor :amount
|
||||
# Whether this is a confirmed transaction. A confirmed transaction immediately deducts from/adds to the `amount_available` on the gift card. Otherwise, it creates a held transaction that increments the `amount_held` on the gift card.
|
||||
attr_accessor :confirm
|
||||
# Related objects which created this transaction.
|
||||
attr_accessor :created_by
|
||||
# The currency of the transaction. This must match the currency of the gift card.
|
||||
attr_accessor :currency
|
||||
# An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
attr_accessor :description
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The gift card to create a new transaction on.
|
||||
attr_accessor :gift_card
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
# A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details.
|
||||
attr_accessor :transfer_group
|
||||
|
||||
def initialize(
|
||||
amount: nil,
|
||||
confirm: nil,
|
||||
created_by: nil,
|
||||
currency: nil,
|
||||
description: nil,
|
||||
expand: nil,
|
||||
gift_card: nil,
|
||||
metadata: nil,
|
||||
transfer_group: nil
|
||||
)
|
||||
@amount = amount
|
||||
@confirm = confirm
|
||||
@created_by = created_by
|
||||
@currency = currency
|
||||
@description = description
|
||||
@expand = expand
|
||||
@gift_card = gift_card
|
||||
@metadata = metadata
|
||||
@transfer_group = transfer_group
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
attr_accessor :description
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
|
||||
def initialize(description: nil, expand: nil, metadata: nil)
|
||||
@description = description
|
||||
@expand = expand
|
||||
@metadata = metadata
|
||||
end
|
||||
end
|
||||
|
||||
class CancelParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class ConfirmParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# The amount of this transaction. A positive value indicates that funds were added to the gift card. A negative value indicates that funds were removed from the gift card.
|
||||
attr_reader :amount
|
||||
# Time at which the transaction was confirmed. Measured in seconds since the Unix epoch.
|
||||
attr_reader :confirmed_at
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# The related Stripe objects that created this gift card transaction.
|
||||
attr_reader :created_by
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
attr_reader :description
|
||||
# The gift card that this transaction occurred on
|
||||
attr_reader :gift_card
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
attr_reader :metadata
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# Status of this transaction, one of `held`, `confirmed`, or `canceled`.
|
||||
attr_reader :status
|
||||
# A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details.
|
||||
attr_reader :transfer_group
|
||||
|
||||
# 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(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
path: "/v1/gift_cards/transactions",
|
||||
params: params,
|
||||
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
|
@ -91,16 +91,10 @@ module Stripe
|
||||
attr_reader :last_name
|
||||
# Document ID number.
|
||||
attr_reader :number
|
||||
# Sex of the person in the document.
|
||||
attr_reader :sex
|
||||
# Status of this `document` check.
|
||||
attr_reader :status
|
||||
# Type of the document.
|
||||
attr_reader :type
|
||||
# Place of birth as it appears in the document.
|
||||
attr_reader :unparsed_place_of_birth
|
||||
# Sex as it appears in the document.
|
||||
attr_reader :unparsed_sex
|
||||
end
|
||||
|
||||
class Email < Stripe::StripeObject
|
||||
@ -256,6 +250,15 @@ module Stripe
|
||||
@verification_session = verification_session
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems.
|
||||
attr_reader :client_reference_id
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
|
@ -5,11 +5,11 @@ module Stripe
|
||||
module Identity
|
||||
# A VerificationSession guides you through the process of collecting and verifying the identities
|
||||
# of your users. It contains details about the type of verification, such as what [verification
|
||||
# check](https://docs.stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for
|
||||
# check](https://stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for
|
||||
# each verification in your system.
|
||||
#
|
||||
# A VerificationSession transitions through [multiple
|
||||
# statuses](https://docs.stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through
|
||||
# statuses](https://stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through
|
||||
# the verification flow. The VerificationSession contains the user's verified data after
|
||||
# verification checks are complete.
|
||||
#
|
||||
@ -116,12 +116,6 @@ module Stripe
|
||||
attr_reader :last_name
|
||||
# The user's verified phone number
|
||||
attr_reader :phone
|
||||
# The user's verified sex.
|
||||
attr_reader :sex
|
||||
# The user's verified place of birth as it appears in the document.
|
||||
attr_reader :unparsed_place_of_birth
|
||||
# The user's verified sex as it appears in the document.
|
||||
attr_reader :unparsed_sex
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
@ -233,7 +227,7 @@ module Stripe
|
||||
attr_accessor :options
|
||||
# Details provided about the user being verified. These details may be shown to the user.
|
||||
attr_accessor :provided_details
|
||||
# Customer ID
|
||||
# Token referencing a Customer resource.
|
||||
attr_accessor :related_customer
|
||||
# The URL that the user will be redirected to upon completing the verification flow.
|
||||
attr_accessor :return_url
|
||||
@ -265,6 +259,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Options < Stripe::RequestParams
|
||||
class Document < Stripe::RequestParams
|
||||
@ -369,7 +372,7 @@ module Stripe
|
||||
attr_reader :provided_details
|
||||
# Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null.
|
||||
attr_reader :redaction
|
||||
# Customer ID
|
||||
# Token referencing a Customer resource.
|
||||
attr_reader :related_customer
|
||||
# Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work).
|
||||
attr_reader :status
|
||||
@ -382,9 +385,9 @@ module Stripe
|
||||
# The user’s verified data.
|
||||
attr_reader :verified_outputs
|
||||
|
||||
# A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work).
|
||||
# A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
|
||||
#
|
||||
# Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#cancel).
|
||||
# Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
|
||||
def cancel(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -394,9 +397,9 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# A VerificationSession object can be canceled when it is in requires_input [status](https://docs.stripe.com/docs/identity/how-sessions-work).
|
||||
# A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work).
|
||||
#
|
||||
# Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#cancel).
|
||||
# Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel).
|
||||
def self.cancel(session, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -412,7 +415,7 @@ module Stripe
|
||||
#
|
||||
# If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode.
|
||||
#
|
||||
# Related guide: [Verify your users' identity documents](https://docs.stripe.com/docs/identity/verify-identity-documents)
|
||||
# Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents)
|
||||
def self.create(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -437,7 +440,7 @@ module Stripe
|
||||
# request logs, etc.
|
||||
#
|
||||
# A VerificationSession object can be redacted when it is in requires_input or verified
|
||||
# [status](https://docs.stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
|
||||
# [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
|
||||
# state will automatically cancel it.
|
||||
#
|
||||
# The redaction process may take up to four days. When the redaction process is in progress, the
|
||||
@ -450,7 +453,7 @@ module Stripe
|
||||
# placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
|
||||
# used for any purpose.
|
||||
#
|
||||
# [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#redact).
|
||||
# [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
|
||||
def redact(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -465,7 +468,7 @@ module Stripe
|
||||
# request logs, etc.
|
||||
#
|
||||
# A VerificationSession object can be redacted when it is in requires_input or verified
|
||||
# [status](https://docs.stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
|
||||
# [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action
|
||||
# state will automatically cancel it.
|
||||
#
|
||||
# The redaction process may take up to four days. When the redaction process is in progress, the
|
||||
@ -478,7 +481,7 @@ module Stripe
|
||||
# placeholder. The metadata field will also be erased. Redacted objects cannot be updated or
|
||||
# used for any purpose.
|
||||
#
|
||||
# [Learn more](https://docs.stripe.com/docs/identity/verification-sessions#redact).
|
||||
# [Learn more](https://stripe.com/docs/identity/verification-sessions#redact).
|
||||
def self.redact(session, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -492,10 +495,10 @@ module Stripe
|
||||
#
|
||||
# When the session status is requires_input, you can use this method to update the
|
||||
# verification check and options.
|
||||
def self.update(session, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/identity/verification_sessions/%<session>s", { session: CGI.escape(session) }),
|
||||
path: format("/v1/identity/verification_sessions/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -24,19 +24,6 @@ module Stripe
|
||||
"invoiceitem"
|
||||
end
|
||||
|
||||
class Parent < Stripe::StripeObject
|
||||
class SubscriptionDetails < Stripe::StripeObject
|
||||
# The subscription that generated this invoice item
|
||||
attr_reader :subscription
|
||||
# The subscription item that generated this invoice item
|
||||
attr_reader :subscription_item
|
||||
end
|
||||
# Details about the subscription that generated this invoice item
|
||||
attr_reader :subscription_details
|
||||
# The type of parent that generated this invoice item
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class Period < Stripe::StripeObject
|
||||
# The end of the period, which must be greater than or equal to the start. This value is inclusive.
|
||||
attr_reader :end
|
||||
@ -44,35 +31,58 @@ module Stripe
|
||||
attr_reader :start
|
||||
end
|
||||
|
||||
class Pricing < Stripe::StripeObject
|
||||
class PriceDetails < Stripe::StripeObject
|
||||
# The ID of the price this item is associated with.
|
||||
attr_reader :price
|
||||
# The ID of the product this item is associated with.
|
||||
attr_reader :product
|
||||
end
|
||||
# Attribute for field price_details
|
||||
attr_reader :price_details
|
||||
# The type of the pricing details.
|
||||
attr_reader :type
|
||||
# The unit amount (in the `currency` specified) of the item which contains a decimal value with at most 12 decimal places.
|
||||
attr_reader :unit_amount_decimal
|
||||
class DeleteParams < Stripe::RequestParams
|
||||
end
|
||||
|
||||
class DeleteParams < Stripe::RequestParams; end
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Discount < Stripe::RequestParams
|
||||
class DiscountEnd < Stripe::RequestParams
|
||||
class Duration < Stripe::RequestParams
|
||||
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
||||
attr_accessor :interval
|
||||
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
||||
attr_accessor :interval_count
|
||||
|
||||
def initialize(interval: nil, interval_count: nil)
|
||||
@interval = interval
|
||||
@interval_count = interval_count
|
||||
end
|
||||
end
|
||||
# Time span for the redeemed discount.
|
||||
attr_accessor :duration
|
||||
# A precise Unix timestamp for the discount to end. Must be in the future.
|
||||
attr_accessor :timestamp
|
||||
# The type of calculation made to determine when the discount ends.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(duration: nil, timestamp: nil, type: nil)
|
||||
@duration = duration
|
||||
@timestamp = timestamp
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
# ID of the coupon to create a new discount for.
|
||||
attr_accessor :coupon
|
||||
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
||||
attr_accessor :discount
|
||||
# Details to determine how long the discount should be applied for.
|
||||
attr_accessor :discount_end
|
||||
# ID of the promotion code to create a new discount for.
|
||||
attr_accessor :promotion_code
|
||||
|
||||
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
||||
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
||||
@coupon = coupon
|
||||
@discount = discount
|
||||
@discount_end = discount_end
|
||||
@promotion_code = promotion_code
|
||||
end
|
||||
end
|
||||
@ -92,7 +102,7 @@ module Stripe
|
||||
class PriceData < Stripe::RequestParams
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_accessor :currency
|
||||
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
|
||||
# The ID of the product that this price will belong to.
|
||||
attr_accessor :product
|
||||
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
||||
attr_accessor :tax_behavior
|
||||
@ -115,15 +125,6 @@ module Stripe
|
||||
@unit_amount_decimal = unit_amount_decimal
|
||||
end
|
||||
end
|
||||
|
||||
class Pricing < Stripe::RequestParams
|
||||
# The ID of the price object.
|
||||
attr_accessor :price
|
||||
|
||||
def initialize(price: nil)
|
||||
@price = price
|
||||
end
|
||||
end
|
||||
# The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
|
||||
attr_accessor :amount
|
||||
# An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
|
||||
@ -134,14 +135,16 @@ module Stripe
|
||||
attr_accessor :discounts
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item.
|
||||
attr_accessor :margins
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
# The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
|
||||
attr_accessor :period
|
||||
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
|
||||
# The ID of the price object. One of `price` or `price_data` is required.
|
||||
attr_accessor :price
|
||||
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
||||
attr_accessor :price_data
|
||||
# The pricing information for the invoice item.
|
||||
attr_accessor :pricing
|
||||
# Non-negative integer. The quantity of units for the invoice item.
|
||||
attr_accessor :quantity
|
||||
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
||||
@ -150,7 +153,9 @@ module Stripe
|
||||
attr_accessor :tax_code
|
||||
# The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates.
|
||||
attr_accessor :tax_rates
|
||||
# The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places.
|
||||
# The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
|
||||
attr_accessor :unit_amount
|
||||
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
||||
attr_accessor :unit_amount_decimal
|
||||
|
||||
def initialize(
|
||||
@ -159,14 +164,16 @@ module Stripe
|
||||
discountable: nil,
|
||||
discounts: nil,
|
||||
expand: nil,
|
||||
margins: nil,
|
||||
metadata: nil,
|
||||
period: nil,
|
||||
price: nil,
|
||||
price_data: nil,
|
||||
pricing: nil,
|
||||
quantity: nil,
|
||||
tax_behavior: nil,
|
||||
tax_code: nil,
|
||||
tax_rates: nil,
|
||||
unit_amount: nil,
|
||||
unit_amount_decimal: nil
|
||||
)
|
||||
@amount = amount
|
||||
@ -174,14 +181,16 @@ module Stripe
|
||||
@discountable = discountable
|
||||
@discounts = discounts
|
||||
@expand = expand
|
||||
@margins = margins
|
||||
@metadata = metadata
|
||||
@period = period
|
||||
@price = price
|
||||
@price_data = price_data
|
||||
@pricing = pricing
|
||||
@quantity = quantity
|
||||
@tax_behavior = tax_behavior
|
||||
@tax_code = tax_code
|
||||
@tax_rates = tax_rates
|
||||
@unit_amount = unit_amount
|
||||
@unit_amount_decimal = unit_amount_decimal
|
||||
end
|
||||
end
|
||||
@ -244,16 +253,44 @@ module Stripe
|
||||
|
||||
class CreateParams < Stripe::RequestParams
|
||||
class Discount < Stripe::RequestParams
|
||||
class DiscountEnd < Stripe::RequestParams
|
||||
class Duration < Stripe::RequestParams
|
||||
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
||||
attr_accessor :interval
|
||||
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
||||
attr_accessor :interval_count
|
||||
|
||||
def initialize(interval: nil, interval_count: nil)
|
||||
@interval = interval
|
||||
@interval_count = interval_count
|
||||
end
|
||||
end
|
||||
# Time span for the redeemed discount.
|
||||
attr_accessor :duration
|
||||
# A precise Unix timestamp for the discount to end. Must be in the future.
|
||||
attr_accessor :timestamp
|
||||
# The type of calculation made to determine when the discount ends.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(duration: nil, timestamp: nil, type: nil)
|
||||
@duration = duration
|
||||
@timestamp = timestamp
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
# ID of the coupon to create a new discount for.
|
||||
attr_accessor :coupon
|
||||
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
||||
attr_accessor :discount
|
||||
# Details to determine how long the discount should be applied for.
|
||||
attr_accessor :discount_end
|
||||
# ID of the promotion code to create a new discount for.
|
||||
attr_accessor :promotion_code
|
||||
|
||||
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
||||
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
||||
@coupon = coupon
|
||||
@discount = discount
|
||||
@discount_end = discount_end
|
||||
@promotion_code = promotion_code
|
||||
end
|
||||
end
|
||||
@ -273,7 +310,7 @@ module Stripe
|
||||
class PriceData < Stripe::RequestParams
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_accessor :currency
|
||||
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to.
|
||||
# The ID of the product that this price will belong to.
|
||||
attr_accessor :product
|
||||
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
||||
attr_accessor :tax_behavior
|
||||
@ -296,15 +333,6 @@ module Stripe
|
||||
@unit_amount_decimal = unit_amount_decimal
|
||||
end
|
||||
end
|
||||
|
||||
class Pricing < Stripe::RequestParams
|
||||
# The ID of the price object.
|
||||
attr_accessor :price
|
||||
|
||||
def initialize(price: nil)
|
||||
@price = price
|
||||
end
|
||||
end
|
||||
# The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice.
|
||||
attr_accessor :amount
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
@ -321,14 +349,16 @@ module Stripe
|
||||
attr_accessor :expand
|
||||
# The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice.
|
||||
attr_accessor :invoice
|
||||
# The ids of the margins to apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item.
|
||||
attr_accessor :margins
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
# The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
|
||||
attr_accessor :period
|
||||
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
|
||||
# The ID of the price object. One of `price` or `price_data` is required.
|
||||
attr_accessor :price
|
||||
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
||||
attr_accessor :price_data
|
||||
# The pricing information for the invoice item.
|
||||
attr_accessor :pricing
|
||||
# Non-negative integer. The quantity of units for the invoice item.
|
||||
attr_accessor :quantity
|
||||
# The ID of a subscription to add this invoice item to. When left blank, the invoice item is added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription.
|
||||
@ -339,7 +369,9 @@ module Stripe
|
||||
attr_accessor :tax_code
|
||||
# The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item.
|
||||
attr_accessor :tax_rates
|
||||
# The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places.
|
||||
# The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice.
|
||||
attr_accessor :unit_amount
|
||||
# Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
|
||||
attr_accessor :unit_amount_decimal
|
||||
|
||||
def initialize(
|
||||
@ -351,15 +383,17 @@ module Stripe
|
||||
discounts: nil,
|
||||
expand: nil,
|
||||
invoice: nil,
|
||||
margins: nil,
|
||||
metadata: nil,
|
||||
period: nil,
|
||||
price: nil,
|
||||
price_data: nil,
|
||||
pricing: nil,
|
||||
quantity: nil,
|
||||
subscription: nil,
|
||||
tax_behavior: nil,
|
||||
tax_code: nil,
|
||||
tax_rates: nil,
|
||||
unit_amount: nil,
|
||||
unit_amount_decimal: nil
|
||||
)
|
||||
@amount = amount
|
||||
@ -370,15 +404,17 @@ module Stripe
|
||||
@discounts = discounts
|
||||
@expand = expand
|
||||
@invoice = invoice
|
||||
@margins = margins
|
||||
@metadata = metadata
|
||||
@period = period
|
||||
@price = price
|
||||
@price_data = price_data
|
||||
@pricing = pricing
|
||||
@quantity = quantity
|
||||
@subscription = subscription
|
||||
@tax_behavior = tax_behavior
|
||||
@tax_code = tax_code
|
||||
@tax_rates = tax_rates
|
||||
@unit_amount = unit_amount
|
||||
@unit_amount_decimal = unit_amount_decimal
|
||||
end
|
||||
end
|
||||
@ -402,24 +438,34 @@ module Stripe
|
||||
attr_reader :invoice
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# The margins which apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item.
|
||||
attr_reader :margins
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
attr_reader :metadata
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# The parent that generated this invoice item.
|
||||
attr_reader :parent
|
||||
# Attribute for field period
|
||||
attr_reader :period
|
||||
# The pricing information of the invoice item.
|
||||
attr_reader :pricing
|
||||
# If the invoice item is a proration, the plan of the subscription that the proration was computed for.
|
||||
attr_reader :plan
|
||||
# The price of the invoice item.
|
||||
attr_reader :price
|
||||
# Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.
|
||||
attr_reader :proration
|
||||
# Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.
|
||||
attr_reader :quantity
|
||||
# The subscription that this invoice item has been created for, if any.
|
||||
attr_reader :subscription
|
||||
# The subscription item that this invoice item has been created for, if any.
|
||||
attr_reader :subscription_item
|
||||
# The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item.
|
||||
attr_reader :tax_rates
|
||||
# ID of the test clock this invoice item belongs to.
|
||||
attr_reader :test_clock
|
||||
# Unit amount (in the `currency` specified) of the invoice item.
|
||||
attr_reader :unit_amount
|
||||
# Same as `unit_amount`, but contains a decimal value with at most 12 decimal places.
|
||||
attr_reader :unit_amount_decimal
|
||||
# Always true for a deleted object
|
||||
attr_reader :deleted
|
||||
|
||||
@ -429,10 +475,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice.
|
||||
def self.delete(invoiceitem, params = {}, opts = {})
|
||||
def self.delete(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :delete,
|
||||
path: format("/v1/invoiceitems/%<invoiceitem>s", { invoiceitem: CGI.escape(invoiceitem) }),
|
||||
path: format("/v1/invoiceitems/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
@ -454,10 +500,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed.
|
||||
def self.update(invoiceitem, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/invoiceitems/%<invoiceitem>s", { invoiceitem: CGI.escape(invoiceitem) }),
|
||||
path: format("/v1/invoiceitems/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -5,7 +5,7 @@ module Stripe
|
||||
# Invoice Line Items represent the individual lines within an [invoice](https://stripe.com/docs/api/invoices) and only exist within the context of an invoice.
|
||||
#
|
||||
# Each line item is backed by either an [invoice item](https://stripe.com/docs/api/invoiceitems) or a [subscription item](https://stripe.com/docs/api/subscription_items).
|
||||
class InvoiceLineItem < APIResource
|
||||
class InvoiceLineItem < StripeObject
|
||||
include Stripe::APIOperations::Save
|
||||
|
||||
OBJECT_NAME = "line_item"
|
||||
@ -20,56 +20,11 @@ module Stripe
|
||||
attr_reader :discount
|
||||
end
|
||||
|
||||
class Parent < Stripe::StripeObject
|
||||
class InvoiceItemDetails < Stripe::StripeObject
|
||||
class ProrationDetails < Stripe::StripeObject
|
||||
class CreditedItems < Stripe::StripeObject
|
||||
# Invoice containing the credited invoice line items
|
||||
attr_reader :invoice
|
||||
# Credited invoice line items
|
||||
attr_reader :invoice_line_items
|
||||
end
|
||||
# For a credit proration `line_item`, the original debit line_items to which the credit proration applies.
|
||||
attr_reader :credited_items
|
||||
end
|
||||
# The invoice item that generated this line item
|
||||
attr_reader :invoice_item
|
||||
# Whether this is a proration
|
||||
attr_reader :proration
|
||||
# Additional details for proration line items
|
||||
attr_reader :proration_details
|
||||
# The subscription that the invoice item belongs to
|
||||
attr_reader :subscription
|
||||
end
|
||||
|
||||
class SubscriptionItemDetails < Stripe::StripeObject
|
||||
class ProrationDetails < Stripe::StripeObject
|
||||
class CreditedItems < Stripe::StripeObject
|
||||
# Invoice containing the credited invoice line items
|
||||
attr_reader :invoice
|
||||
# Credited invoice line items
|
||||
attr_reader :invoice_line_items
|
||||
end
|
||||
# For a credit proration `line_item`, the original debit line_items to which the credit proration applies.
|
||||
attr_reader :credited_items
|
||||
end
|
||||
# The invoice item that generated this line item
|
||||
attr_reader :invoice_item
|
||||
# Whether this is a proration
|
||||
attr_reader :proration
|
||||
# Additional details for proration line items
|
||||
attr_reader :proration_details
|
||||
# The subscription that the subscription item belongs to
|
||||
attr_reader :subscription
|
||||
# The subscription item that generated this line item
|
||||
attr_reader :subscription_item
|
||||
end
|
||||
# Details about the invoice item that generated this line item
|
||||
attr_reader :invoice_item_details
|
||||
# Details about the subscription item that generated this line item
|
||||
attr_reader :subscription_item_details
|
||||
# The type of parent that generated this line item
|
||||
attr_reader :type
|
||||
class MarginAmount < Stripe::StripeObject
|
||||
# The amount, in cents (or local equivalent), of the reduction in line item amount.
|
||||
attr_reader :amount
|
||||
# The margin that was applied to get this margin amount.
|
||||
attr_reader :margin
|
||||
end
|
||||
|
||||
class Period < Stripe::StripeObject
|
||||
@ -86,56 +41,76 @@ module Stripe
|
||||
attr_reader :credit_balance_transaction
|
||||
# The discount that was applied to get this pretax credit amount.
|
||||
attr_reader :discount
|
||||
# The margin that was applied to get this pretax credit amount.
|
||||
attr_reader :margin
|
||||
# Type of the pretax credit amount referenced.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class Pricing < Stripe::StripeObject
|
||||
class PriceDetails < Stripe::StripeObject
|
||||
# The ID of the price this item is associated with.
|
||||
attr_reader :price
|
||||
# The ID of the product this item is associated with.
|
||||
attr_reader :product
|
||||
class ProrationDetails < Stripe::StripeObject
|
||||
class CreditedItems < Stripe::StripeObject
|
||||
# Invoice containing the credited invoice line items
|
||||
attr_reader :invoice
|
||||
# Credited invoice line items
|
||||
attr_reader :invoice_line_items
|
||||
end
|
||||
# Attribute for field price_details
|
||||
attr_reader :price_details
|
||||
# The type of the pricing details.
|
||||
attr_reader :type
|
||||
# The unit amount (in the `currency` specified) of the item which contains a decimal value with at most 12 decimal places.
|
||||
attr_reader :unit_amount_decimal
|
||||
# For a credit proration `line_item`, the original debit line_items to which the credit proration applies.
|
||||
attr_reader :credited_items
|
||||
end
|
||||
|
||||
class Tax < Stripe::StripeObject
|
||||
class TaxRateDetails < Stripe::StripeObject
|
||||
# Attribute for field tax_rate
|
||||
attr_reader :tax_rate
|
||||
end
|
||||
# The amount of the tax, in cents (or local equivalent).
|
||||
class TaxAmount < Stripe::StripeObject
|
||||
# The amount, in cents (or local equivalent), of the tax.
|
||||
attr_reader :amount
|
||||
# Whether this tax is inclusive or exclusive.
|
||||
attr_reader :tax_behavior
|
||||
# Additional details about the tax rate. Only present when `type` is `tax_rate_details`.
|
||||
attr_reader :tax_rate_details
|
||||
# Whether this tax amount is inclusive or exclusive.
|
||||
attr_reader :inclusive
|
||||
# The tax rate that was applied to get this tax amount.
|
||||
attr_reader :tax_rate
|
||||
# The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
|
||||
attr_reader :taxability_reason
|
||||
# The amount on which tax is calculated, in cents (or local equivalent).
|
||||
attr_reader :taxable_amount
|
||||
# The type of tax information.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Discount < Stripe::RequestParams
|
||||
class DiscountEnd < Stripe::RequestParams
|
||||
class Duration < Stripe::RequestParams
|
||||
# Specifies a type of interval unit. Either `day`, `week`, `month` or `year`.
|
||||
attr_accessor :interval
|
||||
# The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration.
|
||||
attr_accessor :interval_count
|
||||
|
||||
def initialize(interval: nil, interval_count: nil)
|
||||
@interval = interval
|
||||
@interval_count = interval_count
|
||||
end
|
||||
end
|
||||
# Time span for the redeemed discount.
|
||||
attr_accessor :duration
|
||||
# A precise Unix timestamp for the discount to end. Must be in the future.
|
||||
attr_accessor :timestamp
|
||||
# The type of calculation made to determine when the discount ends.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(duration: nil, timestamp: nil, type: nil)
|
||||
@duration = duration
|
||||
@timestamp = timestamp
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
# ID of the coupon to create a new discount for.
|
||||
attr_accessor :coupon
|
||||
# ID of an existing discount on the object (or one of its ancestors) to reuse.
|
||||
attr_accessor :discount
|
||||
# Details to determine how long the discount should be applied for.
|
||||
attr_accessor :discount_end
|
||||
# ID of the promotion code to create a new discount for.
|
||||
attr_accessor :promotion_code
|
||||
|
||||
def initialize(coupon: nil, discount: nil, promotion_code: nil)
|
||||
def initialize(coupon: nil, discount: nil, discount_end: nil, promotion_code: nil)
|
||||
@coupon = coupon
|
||||
@discount = discount
|
||||
@discount_end = discount_end
|
||||
@promotion_code = promotion_code
|
||||
end
|
||||
end
|
||||
@ -175,9 +150,9 @@ module Stripe
|
||||
end
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_accessor :currency
|
||||
# The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. One of `product` or `product_data` is required.
|
||||
# The ID of the product that this price will belong to. One of `product` or `product_data` is required.
|
||||
attr_accessor :product
|
||||
# Data used to generate a new [Product](https://docs.stripe.com/api/products) object inline. One of `product` or `product_data` is required.
|
||||
# Data used to generate a new product object inline. One of `product` or `product_data` is required.
|
||||
attr_accessor :product_data
|
||||
# Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
|
||||
attr_accessor :tax_behavior
|
||||
@ -203,15 +178,6 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class Pricing < Stripe::RequestParams
|
||||
# The ID of the price object.
|
||||
attr_accessor :price
|
||||
|
||||
def initialize(price: nil)
|
||||
@price = price
|
||||
end
|
||||
end
|
||||
|
||||
class TaxAmount < Stripe::RequestParams
|
||||
class TaxRateData < Stripe::RequestParams
|
||||
# Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
|
||||
@ -224,8 +190,6 @@ module Stripe
|
||||
attr_accessor :inclusive
|
||||
# The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.
|
||||
attr_accessor :jurisdiction
|
||||
# The level of the jurisdiction that imposes this tax rate.
|
||||
attr_accessor :jurisdiction_level
|
||||
# The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero.
|
||||
attr_accessor :percentage
|
||||
# [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States.
|
||||
@ -239,7 +203,6 @@ module Stripe
|
||||
display_name: nil,
|
||||
inclusive: nil,
|
||||
jurisdiction: nil,
|
||||
jurisdiction_level: nil,
|
||||
percentage: nil,
|
||||
state: nil,
|
||||
tax_type: nil
|
||||
@ -249,7 +212,6 @@ module Stripe
|
||||
@display_name = display_name
|
||||
@inclusive = inclusive
|
||||
@jurisdiction = jurisdiction
|
||||
@jurisdiction_level = jurisdiction_level
|
||||
@percentage = percentage
|
||||
@state = state
|
||||
@tax_type = tax_type
|
||||
@ -261,15 +223,12 @@ module Stripe
|
||||
#
|
||||
# Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items.
|
||||
attr_accessor :tax_rate_data
|
||||
# The reasoning behind this tax, for example, if the product is tax exempt.
|
||||
attr_accessor :taxability_reason
|
||||
# The amount on which tax is calculated, in cents (or local equivalent).
|
||||
attr_accessor :taxable_amount
|
||||
|
||||
def initialize(amount: nil, tax_rate_data: nil, taxability_reason: nil, taxable_amount: nil)
|
||||
def initialize(amount: nil, tax_rate_data: nil, taxable_amount: nil)
|
||||
@amount = amount
|
||||
@tax_rate_data = tax_rate_data
|
||||
@taxability_reason = taxability_reason
|
||||
@taxable_amount = taxable_amount
|
||||
end
|
||||
end
|
||||
@ -283,14 +242,16 @@ module Stripe
|
||||
attr_accessor :discounts
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The IDs of the margins to apply to the line item. When set, the `default_margins` on the invoice do not apply to this line item.
|
||||
attr_accessor :margins
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For [type=subscription](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-type) line items, the incoming metadata specified on the request is directly used to set this value, in contrast to [type=invoiceitem](api/invoices/line_item#invoice_line_item_object-type) line items, where any existing metadata on the invoice line is merged with the incoming data.
|
||||
attr_accessor :metadata
|
||||
# The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
|
||||
attr_accessor :period
|
||||
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
|
||||
# The ID of the price object. One of `price` or `price_data` is required.
|
||||
attr_accessor :price
|
||||
# Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.
|
||||
attr_accessor :price_data
|
||||
# The pricing information for the invoice item.
|
||||
attr_accessor :pricing
|
||||
# Non-negative integer. The quantity of units for the line item.
|
||||
attr_accessor :quantity
|
||||
# A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts.
|
||||
@ -304,10 +265,11 @@ module Stripe
|
||||
discountable: nil,
|
||||
discounts: nil,
|
||||
expand: nil,
|
||||
margins: nil,
|
||||
metadata: nil,
|
||||
period: nil,
|
||||
price: nil,
|
||||
price_data: nil,
|
||||
pricing: nil,
|
||||
quantity: nil,
|
||||
tax_amounts: nil,
|
||||
tax_rates: nil
|
||||
@ -317,10 +279,11 @@ module Stripe
|
||||
@discountable = discountable
|
||||
@discounts = discounts
|
||||
@expand = expand
|
||||
@margins = margins
|
||||
@metadata = metadata
|
||||
@period = period
|
||||
@price = price
|
||||
@price_data = price_data
|
||||
@pricing = pricing
|
||||
@quantity = quantity
|
||||
@tax_amounts = tax_amounts
|
||||
@tax_rates = tax_rates
|
||||
@ -328,6 +291,8 @@ module Stripe
|
||||
end
|
||||
# The amount, in cents (or local equivalent).
|
||||
attr_reader :amount
|
||||
# The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts.
|
||||
attr_reader :amount_excluding_tax
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# An arbitrary string attached to the object. Often useful for displaying to users.
|
||||
@ -342,35 +307,53 @@ module Stripe
|
||||
attr_reader :id
|
||||
# The ID of the invoice that contains this line item.
|
||||
attr_reader :invoice
|
||||
# The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any.
|
||||
attr_reader :invoice_item
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# The amount of margin calculated per margin for this line item.
|
||||
attr_reader :margin_amounts
|
||||
# The margins applied to the line item. When set, the `default_margins` on the invoice do not apply to the line item. Use `expand[]=margins` to expand each margin.
|
||||
attr_reader :margins
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
|
||||
attr_reader :metadata
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# The parent that generated this line item.
|
||||
attr_reader :parent
|
||||
# Attribute for field period
|
||||
attr_reader :period
|
||||
# The plan of the subscription, if the line item is a subscription or a proration.
|
||||
attr_reader :plan
|
||||
# Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item.
|
||||
attr_reader :pretax_credit_amounts
|
||||
# The pricing information of the line item.
|
||||
attr_reader :pricing
|
||||
# The price of the line item.
|
||||
attr_reader :price
|
||||
# Whether this is a proration.
|
||||
attr_reader :proration
|
||||
# Additional details for proration line items
|
||||
attr_reader :proration_details
|
||||
# The quantity of the subscription, if the line item is a subscription or a proration.
|
||||
attr_reader :quantity
|
||||
# Attribute for field subscription
|
||||
# The subscription that the invoice item pertains to, if any.
|
||||
attr_reader :subscription
|
||||
# The tax information of the line item.
|
||||
attr_reader :taxes
|
||||
# The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription.
|
||||
attr_reader :subscription_item
|
||||
# The amount of tax calculated per tax rate for this line item
|
||||
attr_reader :tax_amounts
|
||||
# The tax rates which apply to the line item.
|
||||
attr_reader :tax_rates
|
||||
# A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`.
|
||||
attr_reader :type
|
||||
# The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts.
|
||||
attr_reader :unit_amount_excluding_tax
|
||||
|
||||
# Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item,
|
||||
# so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice
|
||||
# item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well.
|
||||
# Updating an invoice's line item is only possible before the invoice is finalized.
|
||||
def self.update(invoice, line_item_id, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/invoices/%<invoice>s/lines/%<line_item_id>s", { invoice: CGI.escape(invoice), line_item_id: CGI.escape(line_item_id) }),
|
||||
path: format("/v1/invoices/%<invoice>s/lines/%<id>s", { invoice: CGI.escape(invoice), id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -2,27 +2,20 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
# Invoice Payments represent payments made against invoices. Invoice Payments can
|
||||
# be accessed in two ways:
|
||||
# 1. By expanding the `payments` field on the [Invoice](https://stripe.com/docs/api#invoice) resource.
|
||||
# 2. By using the Invoice Payment retrieve and list endpoints.
|
||||
#
|
||||
# Invoice Payments include the mapping between payment objects, such as Payment Intent, and Invoices.
|
||||
# This resource and its endpoints allows you to easily track if a payment is associated with a specific invoice and
|
||||
# monitor the allocation details of the payments.
|
||||
# The invoice payment object
|
||||
class InvoicePayment < APIResource
|
||||
extend Stripe::APIOperations::List
|
||||
|
||||
OBJECT_NAME = "invoice_payment"
|
||||
def self.object_name
|
||||
"invoice_payment"
|
||||
end
|
||||
|
||||
class Payment < Stripe::StripeObject
|
||||
# ID of the successful charge for this payment when `type` is `charge`.Note: charge is only surfaced if the charge object is not associated with a payment intent. If the charge object does have a payment intent, the Invoice Payment surfaces the payment intent instead.
|
||||
# ID of the successful charge for this payment when `type` is `charge`.
|
||||
attr_reader :charge
|
||||
# ID of the PaymentIntent associated with this payment when `type` is `payment_intent`. Note: This property is only populated for invoices finalized on or after March 15th, 2019.
|
||||
attr_reader :payment_intent
|
||||
# ID of the PaymentRecord associated with this payment when `type` is `payment_record`.
|
||||
attr_reader :payment_record
|
||||
# Type of payment object associated with this invoice payment.
|
||||
attr_reader :type
|
||||
end
|
||||
@ -33,52 +26,8 @@ module Stripe
|
||||
# The time that the payment succeeded.
|
||||
attr_reader :paid_at
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
class Payment < Stripe::RequestParams
|
||||
# Only return invoice payments associated by this payment intent ID.
|
||||
attr_accessor :payment_intent
|
||||
# Only return invoice payments associated by this payment type.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(payment_intent: nil, type: nil)
|
||||
@payment_intent = payment_intent
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The identifier of the invoice whose payments to return.
|
||||
attr_accessor :invoice
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# The payment details of the invoice payments to return.
|
||||
attr_accessor :payment
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
# The status of the invoice payments to return.
|
||||
attr_accessor :status
|
||||
|
||||
def initialize(
|
||||
ending_before: nil,
|
||||
expand: nil,
|
||||
invoice: nil,
|
||||
limit: nil,
|
||||
payment: nil,
|
||||
starting_after: nil,
|
||||
status: nil
|
||||
)
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@invoice = invoice
|
||||
@limit = limit
|
||||
@payment = payment
|
||||
@starting_after = starting_after
|
||||
@status = status
|
||||
end
|
||||
end
|
||||
# Excess payment that was received for this invoice and credited to the customer’s `invoice_credit_balance`. This field is null until the payment is `paid`. Overpayment can happen when you attach more than one PaymentIntent to the invoice, and each of them succeeds. To avoid overpayment, cancel any PaymentIntents that you do not need before attaching more.
|
||||
attr_reader :amount_overpaid
|
||||
# Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is `paid`. This amount can be less than the `amount_requested` if the PaymentIntent’s `amount_received` is not sufficient to pay all of the invoices that it is attached to.
|
||||
attr_reader :amount_paid
|
||||
# Amount intended to be paid toward this invoice, in cents (or local equivalent)
|
||||
@ -103,10 +52,5 @@ module Stripe
|
||||
attr_reader :status
|
||||
# Attribute for field status_transitions
|
||||
attr_reader :status_transitions
|
||||
|
||||
# When retrieving an invoice, there is an includable payments property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of payments.
|
||||
def self.list(params = {}, opts = {})
|
||||
request_stripe_object(method: :get, path: "/v1/invoice_payments", params: params, opts: opts)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -33,6 +33,18 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Attribute for param field version
|
||||
attr_accessor :version
|
||||
|
||||
def initialize(expand: nil, version: nil)
|
||||
@expand = expand
|
||||
@version = version
|
||||
end
|
||||
end
|
||||
|
||||
class ArchiveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
@ -280,6 +280,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
@ -1122,8 +1131,8 @@ module Stripe
|
||||
# The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized.
|
||||
attr_reader :wallet
|
||||
|
||||
# [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
# [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
def approve(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -1134,8 +1143,8 @@ module Stripe
|
||||
end
|
||||
|
||||
deprecate :approve, :none, 2024, 3
|
||||
# [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
# [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
def self.approve(authorization, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -1150,8 +1159,8 @@ module Stripe
|
||||
deprecate :approve, :none, 2024, 3
|
||||
end
|
||||
|
||||
# [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
# [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
def decline(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -1162,8 +1171,8 @@ module Stripe
|
||||
end
|
||||
|
||||
deprecate :decline, :none, 2024, 3
|
||||
# [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://docs.stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
# [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow.
|
||||
# This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling).
|
||||
def self.decline(authorization, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -1189,10 +1198,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
def self.update(authorization, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/issuing/authorizations/%<authorization>s", { authorization: CGI.escape(authorization) }),
|
||||
path: format("/v1/issuing/authorizations/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -345,7 +345,7 @@ module Stripe
|
||||
attr_accessor :currency
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# The new financial account ID the card will be associated with. This field allows a card to be reassigned to a different financial account.
|
||||
# Attribute for param field financial_account
|
||||
attr_accessor :financial_account
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
@ -401,6 +401,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Pin < Stripe::RequestParams
|
||||
# The card's desired new PIN, encrypted under Stripe's public key.
|
||||
@ -682,10 +691,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
def self.update(card, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/issuing/cards/%<card>s", { card: CGI.escape(card) }),
|
||||
path: format("/v1/issuing/cards/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -366,7 +366,8 @@ module Stripe
|
||||
attr_accessor :metadata
|
||||
# The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. This field cannot contain any special characters or numbers.
|
||||
attr_accessor :name
|
||||
# The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details.
|
||||
# The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards.
|
||||
# While phone number is optional if the cardholder will not be creating EU cards, note that this cardholder will not be eligible for 3DS without a phone number. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details.
|
||||
attr_accessor :phone_number
|
||||
# The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`.
|
||||
# This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder.
|
||||
@ -407,6 +408,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Billing < Stripe::RequestParams
|
||||
class Address < Stripe::RequestParams
|
||||
@ -685,10 +695,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
def self.update(cardholder, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/issuing/cardholders/%<cardholder>s", { cardholder: CGI.escape(cardholder) }),
|
||||
path: format("/v1/issuing/cardholders/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
611
lib/stripe/resources/issuing/credit_underwriting_record.rb
Normal file
611
lib/stripe/resources/issuing/credit_underwriting_record.rb
Normal file
@ -0,0 +1,611 @@
|
||||
# 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
|
||||
|
||||
class Application < Stripe::StripeObject
|
||||
# The channel through which the applicant has submitted their application.
|
||||
attr_reader :application_method
|
||||
# Scope of demand made by the applicant.
|
||||
attr_reader :purpose
|
||||
# Date when the applicant submitted their application.
|
||||
attr_reader :submitted_at
|
||||
end
|
||||
|
||||
class CreditUser < Stripe::StripeObject
|
||||
# Email of the applicant or accountholder.
|
||||
attr_reader :email
|
||||
# Full name of the company or person.
|
||||
attr_reader :name
|
||||
end
|
||||
|
||||
class Decision < Stripe::StripeObject
|
||||
class ApplicationRejected < Stripe::StripeObject
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_reader :reason_other_explanation
|
||||
# List of reasons why the application was rejected up to 4 reasons, in order of importance.
|
||||
attr_reader :reasons
|
||||
end
|
||||
|
||||
class CreditLimitApproved < Stripe::StripeObject
|
||||
# Credit amount approved. An approved credit limit is required before you can set a amount in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy).
|
||||
attr_reader :amount
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
end
|
||||
|
||||
class CreditLimitDecreased < Stripe::StripeObject
|
||||
# Credit amount approved after decrease. An approved credit limit is required before you can set a amount in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy).
|
||||
attr_reader :amount
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_reader :reason_other_explanation
|
||||
# List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance.
|
||||
attr_reader :reasons
|
||||
end
|
||||
|
||||
class CreditLineClosed < Stripe::StripeObject
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_reader :reason_other_explanation
|
||||
# List of reasons why the existing account was closed, up to 4 reasons, in order of importance.
|
||||
attr_reader :reasons
|
||||
end
|
||||
# Details about a decision application_rejected.
|
||||
attr_reader :application_rejected
|
||||
# Details about a decision credit_limit_approved.
|
||||
attr_reader :credit_limit_approved
|
||||
# Details about a decision credit_limit_decreased.
|
||||
attr_reader :credit_limit_decreased
|
||||
# Details about a decision credit_line_closed.
|
||||
attr_reader :credit_line_closed
|
||||
# Outcome of the decision.
|
||||
attr_reader :type
|
||||
end
|
||||
|
||||
class UnderwritingException < Stripe::StripeObject
|
||||
# Written explanation for the exception.
|
||||
attr_reader :explanation
|
||||
# The decision before the exception was applied.
|
||||
attr_reader :original_decision_type
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
|
||||
def initialize(ending_before: nil, expand: nil, limit: nil, starting_after: nil)
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@limit = limit
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class CorrectParams < Stripe::RequestParams
|
||||
class Application < Stripe::RequestParams
|
||||
# The channel through which the applicant has submitted their application. Defaults to `online`.
|
||||
attr_accessor :application_method
|
||||
# Scope of demand made by the applicant.
|
||||
attr_accessor :purpose
|
||||
# Date when the applicant submitted their application.
|
||||
attr_accessor :submitted_at
|
||||
|
||||
def initialize(application_method: nil, purpose: nil, submitted_at: nil)
|
||||
@application_method = application_method
|
||||
@purpose = purpose
|
||||
@submitted_at = submitted_at
|
||||
end
|
||||
end
|
||||
|
||||
class CreditUser < Stripe::RequestParams
|
||||
# Email of the applicant or accountholder.
|
||||
attr_accessor :email
|
||||
# Full name of the company or person.
|
||||
attr_accessor :name
|
||||
|
||||
def initialize(email: nil, name: nil)
|
||||
@email = email
|
||||
@name = name
|
||||
end
|
||||
end
|
||||
|
||||
class Decision < Stripe::RequestParams
|
||||
class ApplicationRejected < Stripe::RequestParams
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_accessor :reason_other_explanation
|
||||
# List of reasons why the application was rejected, up to 4 reasons, in order of importance.
|
||||
attr_accessor :reasons
|
||||
|
||||
def initialize(reason_other_explanation: nil, reasons: nil)
|
||||
@reason_other_explanation = reason_other_explanation
|
||||
@reasons = reasons
|
||||
end
|
||||
end
|
||||
|
||||
class CreditLimitApproved < Stripe::RequestParams
|
||||
# The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
|
||||
attr_accessor :amount
|
||||
# The currency of the credit approved, will default to the Account's Issuing currency.
|
||||
attr_accessor :currency
|
||||
|
||||
def initialize(amount: nil, currency: nil)
|
||||
@amount = amount
|
||||
@currency = currency
|
||||
end
|
||||
end
|
||||
|
||||
class CreditLimitDecreased < Stripe::RequestParams
|
||||
# The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
|
||||
attr_accessor :amount
|
||||
# The currency of the credit approved, will default to the Account's Issuing currency.
|
||||
attr_accessor :currency
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_accessor :reason_other_explanation
|
||||
# List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance.
|
||||
attr_accessor :reasons
|
||||
|
||||
def initialize(amount: nil, currency: nil, reason_other_explanation: nil, reasons: nil)
|
||||
@amount = amount
|
||||
@currency = currency
|
||||
@reason_other_explanation = reason_other_explanation
|
||||
@reasons = reasons
|
||||
end
|
||||
end
|
||||
|
||||
class CreditLineClosed < Stripe::RequestParams
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_accessor :reason_other_explanation
|
||||
# List of reasons why the credit line was closed, up to 4 reasons, in order of importance.
|
||||
attr_accessor :reasons
|
||||
|
||||
def initialize(reason_other_explanation: nil, reasons: nil)
|
||||
@reason_other_explanation = reason_other_explanation
|
||||
@reasons = reasons
|
||||
end
|
||||
end
|
||||
# Details about the application rejection.
|
||||
attr_accessor :application_rejected
|
||||
# Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/)
|
||||
attr_accessor :credit_limit_approved
|
||||
# Details about the credit limit decreased.
|
||||
attr_accessor :credit_limit_decreased
|
||||
# Details about the credit line closed.
|
||||
attr_accessor :credit_line_closed
|
||||
# Outcome of the decision.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(
|
||||
application_rejected: nil,
|
||||
credit_limit_approved: nil,
|
||||
credit_limit_decreased: nil,
|
||||
credit_line_closed: nil,
|
||||
type: nil
|
||||
)
|
||||
@application_rejected = application_rejected
|
||||
@credit_limit_approved = credit_limit_approved
|
||||
@credit_limit_decreased = credit_limit_decreased
|
||||
@credit_line_closed = credit_line_closed
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
|
||||
class UnderwritingException < Stripe::RequestParams
|
||||
# Written explanation for the exception.
|
||||
attr_accessor :explanation
|
||||
# The decision before the exception was applied.
|
||||
attr_accessor :original_decision_type
|
||||
|
||||
def initialize(explanation: nil, original_decision_type: nil)
|
||||
@explanation = explanation
|
||||
@original_decision_type = original_decision_type
|
||||
end
|
||||
end
|
||||
# Details about the application submission.
|
||||
attr_accessor :application
|
||||
# Information about the company or person applying or holding the account.
|
||||
attr_accessor :credit_user
|
||||
# Date when a decision was made.
|
||||
attr_accessor :decided_at
|
||||
# Details about the decision.
|
||||
attr_accessor :decision
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
# File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). Optional if previously provided and no changes are needed.
|
||||
attr_accessor :regulatory_reporting_file
|
||||
# If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance.
|
||||
attr_accessor :underwriting_exception
|
||||
|
||||
def initialize(
|
||||
application: nil,
|
||||
credit_user: nil,
|
||||
decided_at: nil,
|
||||
decision: nil,
|
||||
expand: nil,
|
||||
metadata: nil,
|
||||
regulatory_reporting_file: nil,
|
||||
underwriting_exception: nil
|
||||
)
|
||||
@application = application
|
||||
@credit_user = credit_user
|
||||
@decided_at = decided_at
|
||||
@decision = decision
|
||||
@expand = expand
|
||||
@metadata = metadata
|
||||
@regulatory_reporting_file = regulatory_reporting_file
|
||||
@underwriting_exception = underwriting_exception
|
||||
end
|
||||
end
|
||||
|
||||
class ReportDecisionParams < Stripe::RequestParams
|
||||
class Decision < Stripe::RequestParams
|
||||
class ApplicationRejected < Stripe::RequestParams
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_accessor :reason_other_explanation
|
||||
# List of reasons why the application was rejected, up to 4 reasons, in order of importance.
|
||||
attr_accessor :reasons
|
||||
|
||||
def initialize(reason_other_explanation: nil, reasons: nil)
|
||||
@reason_other_explanation = reason_other_explanation
|
||||
@reasons = reasons
|
||||
end
|
||||
end
|
||||
|
||||
class CreditLimitApproved < Stripe::RequestParams
|
||||
# The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
|
||||
attr_accessor :amount
|
||||
# The currency of the credit approved, will default to the Account's Issuing currency.
|
||||
attr_accessor :currency
|
||||
|
||||
def initialize(amount: nil, currency: nil)
|
||||
@amount = amount
|
||||
@currency = currency
|
||||
end
|
||||
end
|
||||
# Details about the application rejection.
|
||||
attr_accessor :application_rejected
|
||||
# Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/)
|
||||
attr_accessor :credit_limit_approved
|
||||
# Outcome of the decision.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(application_rejected: nil, credit_limit_approved: nil, type: nil)
|
||||
@application_rejected = application_rejected
|
||||
@credit_limit_approved = credit_limit_approved
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
|
||||
class UnderwritingException < Stripe::RequestParams
|
||||
# Written explanation for the exception.
|
||||
attr_accessor :explanation
|
||||
# The decision before the exception was applied.
|
||||
attr_accessor :original_decision_type
|
||||
|
||||
def initialize(explanation: nil, original_decision_type: nil)
|
||||
@explanation = explanation
|
||||
@original_decision_type = original_decision_type
|
||||
end
|
||||
end
|
||||
# Date when a decision was made.
|
||||
attr_accessor :decided_at
|
||||
# Details about the decision.
|
||||
attr_accessor :decision
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
# File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions).
|
||||
attr_accessor :regulatory_reporting_file
|
||||
# If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance.
|
||||
attr_accessor :underwriting_exception
|
||||
|
||||
def initialize(
|
||||
decided_at: nil,
|
||||
decision: nil,
|
||||
expand: nil,
|
||||
metadata: nil,
|
||||
regulatory_reporting_file: nil,
|
||||
underwriting_exception: nil
|
||||
)
|
||||
@decided_at = decided_at
|
||||
@decision = decision
|
||||
@expand = expand
|
||||
@metadata = metadata
|
||||
@regulatory_reporting_file = regulatory_reporting_file
|
||||
@underwriting_exception = underwriting_exception
|
||||
end
|
||||
end
|
||||
|
||||
class CreateFromApplicationParams < Stripe::RequestParams
|
||||
class Application < Stripe::RequestParams
|
||||
# The channel through which the applicant has submitted their application. Defaults to `online`.
|
||||
attr_accessor :application_method
|
||||
# Scope of demand made by the applicant.
|
||||
attr_accessor :purpose
|
||||
# Date when the applicant submitted their application.
|
||||
attr_accessor :submitted_at
|
||||
|
||||
def initialize(application_method: nil, purpose: nil, submitted_at: nil)
|
||||
@application_method = application_method
|
||||
@purpose = purpose
|
||||
@submitted_at = submitted_at
|
||||
end
|
||||
end
|
||||
|
||||
class CreditUser < Stripe::RequestParams
|
||||
# Email of the applicant or accountholder.
|
||||
attr_accessor :email
|
||||
# Full name of the company or person.
|
||||
attr_accessor :name
|
||||
|
||||
def initialize(email: nil, name: nil)
|
||||
@email = email
|
||||
@name = name
|
||||
end
|
||||
end
|
||||
# Details about the application submission.
|
||||
attr_accessor :application
|
||||
# Information about the company or person applying or holding the account.
|
||||
attr_accessor :credit_user
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
|
||||
def initialize(application: nil, credit_user: nil, expand: nil, metadata: nil)
|
||||
@application = application
|
||||
@credit_user = credit_user
|
||||
@expand = expand
|
||||
@metadata = metadata
|
||||
end
|
||||
end
|
||||
|
||||
class CreateFromProactiveReviewParams < Stripe::RequestParams
|
||||
class CreditUser < Stripe::RequestParams
|
||||
# Email of the applicant or accountholder.
|
||||
attr_accessor :email
|
||||
# Full name of the company or person.
|
||||
attr_accessor :name
|
||||
|
||||
def initialize(email: nil, name: nil)
|
||||
@email = email
|
||||
@name = name
|
||||
end
|
||||
end
|
||||
|
||||
class Decision < Stripe::RequestParams
|
||||
class CreditLimitApproved < Stripe::RequestParams
|
||||
# The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
|
||||
attr_accessor :amount
|
||||
# The currency of the credit approved, will default to the Account's Issuing currency.
|
||||
attr_accessor :currency
|
||||
|
||||
def initialize(amount: nil, currency: nil)
|
||||
@amount = amount
|
||||
@currency = currency
|
||||
end
|
||||
end
|
||||
|
||||
class CreditLimitDecreased < Stripe::RequestParams
|
||||
# The credit approved, in the currency of the account and [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal).
|
||||
attr_accessor :amount
|
||||
# The currency of the credit approved, will default to the Account's Issuing currency.
|
||||
attr_accessor :currency
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_accessor :reason_other_explanation
|
||||
# List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance.
|
||||
attr_accessor :reasons
|
||||
|
||||
def initialize(amount: nil, currency: nil, reason_other_explanation: nil, reasons: nil)
|
||||
@amount = amount
|
||||
@currency = currency
|
||||
@reason_other_explanation = reason_other_explanation
|
||||
@reasons = reasons
|
||||
end
|
||||
end
|
||||
|
||||
class CreditLineClosed < Stripe::RequestParams
|
||||
# Details about the `reasons.other` when present.
|
||||
attr_accessor :reason_other_explanation
|
||||
# List of reasons why the credit line was closed, up to 4 reasons, in order of importance.
|
||||
attr_accessor :reasons
|
||||
|
||||
def initialize(reason_other_explanation: nil, reasons: nil)
|
||||
@reason_other_explanation = reason_other_explanation
|
||||
@reasons = reasons
|
||||
end
|
||||
end
|
||||
# Details about the credit limit approved. An approved credit limit is required before you can set a `credit_limit_amount` in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy/)
|
||||
attr_accessor :credit_limit_approved
|
||||
# Details about the credit limit decreased.
|
||||
attr_accessor :credit_limit_decreased
|
||||
# Details about the credit line closed.
|
||||
attr_accessor :credit_line_closed
|
||||
# Outcome of the decision.
|
||||
attr_accessor :type
|
||||
|
||||
def initialize(
|
||||
credit_limit_approved: nil,
|
||||
credit_limit_decreased: nil,
|
||||
credit_line_closed: nil,
|
||||
type: nil
|
||||
)
|
||||
@credit_limit_approved = credit_limit_approved
|
||||
@credit_limit_decreased = credit_limit_decreased
|
||||
@credit_line_closed = credit_line_closed
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
|
||||
class UnderwritingException < Stripe::RequestParams
|
||||
# Written explanation for the exception.
|
||||
attr_accessor :explanation
|
||||
# The decision before the exception was applied.
|
||||
attr_accessor :original_decision_type
|
||||
|
||||
def initialize(explanation: nil, original_decision_type: nil)
|
||||
@explanation = explanation
|
||||
@original_decision_type = original_decision_type
|
||||
end
|
||||
end
|
||||
# Information about the company or person applying or holding the account.
|
||||
attr_accessor :credit_user
|
||||
# Date when a decision was made.
|
||||
attr_accessor :decided_at
|
||||
# Details about the decision.
|
||||
attr_accessor :decision
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
|
||||
attr_accessor :metadata
|
||||
# File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions).
|
||||
attr_accessor :regulatory_reporting_file
|
||||
# If an exception to the usual underwriting criteria was made for this decision, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance.
|
||||
attr_accessor :underwriting_exception
|
||||
|
||||
def initialize(
|
||||
credit_user: nil,
|
||||
decided_at: nil,
|
||||
decision: nil,
|
||||
expand: nil,
|
||||
metadata: nil,
|
||||
regulatory_reporting_file: nil,
|
||||
underwriting_exception: nil
|
||||
)
|
||||
@credit_user = credit_user
|
||||
@decided_at = decided_at
|
||||
@decision = decision
|
||||
@expand = expand
|
||||
@metadata = metadata
|
||||
@regulatory_reporting_file = regulatory_reporting_file
|
||||
@underwriting_exception = underwriting_exception
|
||||
end
|
||||
end
|
||||
# For decisions triggered by an application, details about the submission.
|
||||
attr_reader :application
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# The event that triggered the underwriting.
|
||||
attr_reader :created_from
|
||||
# Attribute for field credit_user
|
||||
attr_reader :credit_user
|
||||
# Date when a decision was made.
|
||||
attr_reader :decided_at
|
||||
# Details about the decision.
|
||||
attr_reader :decision
|
||||
# For underwriting initiated by an application, a decision must be taken 30 days after the submission.
|
||||
attr_reader :decision_deadline
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
attr_reader :metadata
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions).
|
||||
attr_reader :regulatory_reporting_file
|
||||
# If an exception to the usual underwriting criteria was made for this application, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance.
|
||||
attr_reader :underwriting_exception
|
||||
|
||||
# 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(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
path: "/v1/issuing/credit_underwriting_records",
|
||||
params: params,
|
||||
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
|
@ -490,6 +490,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class Evidence < Stripe::RequestParams
|
||||
class Canceled < Stripe::RequestParams
|
||||
@ -797,7 +806,7 @@ module Stripe
|
||||
# [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts
|
||||
attr_reader :treasury
|
||||
|
||||
# Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
|
||||
# Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements.
|
||||
def self.create(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -817,7 +826,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
|
||||
# Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
|
||||
def submit(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -827,7 +836,7 @@ module Stripe
|
||||
)
|
||||
end
|
||||
|
||||
# Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://docs.stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
|
||||
# Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence).
|
||||
def self.submit(dispute, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
@ -838,10 +847,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string.
|
||||
def self.update(dispute, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/issuing/disputes/%<dispute>s", { dispute: CGI.escape(dispute) }),
|
||||
path: format("/v1/issuing/disputes/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
84
lib/stripe/resources/issuing/dispute_settlement_detail.rb
Normal file
84
lib/stripe/resources/issuing/dispute_settlement_detail.rb
Normal file
@ -0,0 +1,84 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
module Issuing
|
||||
# Represents a record from the card network of a money movement or change in state for an Issuing dispute. These records are included in the settlement reports that we receive from networks and expose to users as Settlement objects.
|
||||
class DisputeSettlementDetail < APIResource
|
||||
extend Stripe::APIOperations::List
|
||||
|
||||
OBJECT_NAME = "issuing.dispute_settlement_detail"
|
||||
def self.object_name
|
||||
"issuing.dispute_settlement_detail"
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# Select the Issuing dispute settlement details for the given settlement.
|
||||
attr_accessor :settlement
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
|
||||
def initialize(
|
||||
ending_before: nil,
|
||||
expand: nil,
|
||||
limit: nil,
|
||||
settlement: nil,
|
||||
starting_after: nil
|
||||
)
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@limit = limit
|
||||
@settlement = settlement
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Disputed amount in the card’s currency and in the smallest currency unit. Usually the amount of the transaction, but can differ (usually because of currency fluctuation).
|
||||
attr_reader :amount
|
||||
# The card used to make the original transaction.
|
||||
attr_reader :card
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# The currency the original transaction was made in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# The ID of the linked dispute.
|
||||
attr_reader :dispute
|
||||
# The type of event corresponding to this dispute settlement detail, representing the stage in the dispute network lifecycle.
|
||||
attr_reader :event_type
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# The card network for this dispute settlement detail. One of ["visa", "mastercard", "maestro"]
|
||||
attr_reader :network
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# The ID of the linked card network settlement.
|
||||
attr_reader :settlement
|
||||
|
||||
# Returns a list of Issuing DisputeSettlementDetail objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
||||
def self.list(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
path: "/v1/issuing/dispute_settlement_details",
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
95
lib/stripe/resources/issuing/fraud_liability_debit.rb
Normal file
95
lib/stripe/resources/issuing/fraud_liability_debit.rb
Normal file
@ -0,0 +1,95 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
module Issuing
|
||||
# A fraud liability debit occurs when Stripe debits a platform's account for fraud losses on Issuing transactions.
|
||||
class FraudLiabilityDebit < APIResource
|
||||
extend Stripe::APIOperations::List
|
||||
|
||||
OBJECT_NAME = "issuing.fraud_liability_debit"
|
||||
def self.object_name
|
||||
"issuing.fraud_liability_debit"
|
||||
end
|
||||
|
||||
class ListParams < Stripe::RequestParams
|
||||
class Created < Stripe::RequestParams
|
||||
# Minimum value to filter by (exclusive)
|
||||
attr_accessor :gt
|
||||
# Minimum value to filter by (inclusive)
|
||||
attr_accessor :gte
|
||||
# Maximum value to filter by (exclusive)
|
||||
attr_accessor :lt
|
||||
# Maximum value to filter by (inclusive)
|
||||
attr_accessor :lte
|
||||
|
||||
def initialize(gt: nil, gte: nil, lt: nil, lte: nil)
|
||||
@gt = gt
|
||||
@gte = gte
|
||||
@lt = lt
|
||||
@lte = lte
|
||||
end
|
||||
end
|
||||
# Only return Issuing Fraud Liability Debits that were created during the given date interval.
|
||||
attr_accessor :created
|
||||
# A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
|
||||
attr_accessor :ending_before
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
|
||||
def initialize(
|
||||
created: nil,
|
||||
ending_before: nil,
|
||||
expand: nil,
|
||||
limit: nil,
|
||||
starting_after: nil
|
||||
)
|
||||
@created = created
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@limit = limit
|
||||
@starting_after = starting_after
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Debited amount. This is equal to the disputed amount and is given in the card’s currency and in the smallest currency unit.
|
||||
attr_reader :amount
|
||||
# ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this debit.
|
||||
attr_reader :balance_transaction
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# The currency of the debit. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# The ID of the linked dispute.
|
||||
attr_reader :dispute
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
|
||||
# Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.
|
||||
def self.list(params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :get,
|
||||
path: "/v1/issuing/fraud_liability_debits",
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -154,6 +154,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
class CarrierText < Stripe::RequestParams
|
||||
# The footer body text of the carrier letter.
|
||||
@ -311,10 +320,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates a card personalization object.
|
||||
def self.update(personalization_design, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/issuing/personalization_designs/%<personalization_design>s", { personalization_design: CGI.escape(personalization_design) }),
|
||||
path: format("/v1/issuing/personalization_designs/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -51,6 +51,15 @@ module Stripe
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
# Attribute for field features
|
||||
attr_reader :features
|
||||
# Unique identifier for the object.
|
||||
|
49
lib/stripe/resources/issuing/settlement.rb
Normal file
49
lib/stripe/resources/issuing/settlement.rb
Normal file
@ -0,0 +1,49 @@
|
||||
# File generated from our OpenAPI spec
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Stripe
|
||||
module Issuing
|
||||
# When a non-stripe BIN is used, any use of an [issued card](https://stripe.com/docs/issuing) must be settled directly with the card network. The net amount owed is represented by an Issuing `Settlement` object.
|
||||
class Settlement < APIResource
|
||||
OBJECT_NAME = "issuing.settlement"
|
||||
def self.object_name
|
||||
"issuing.settlement"
|
||||
end
|
||||
|
||||
# The Bank Identification Number reflecting this settlement record.
|
||||
attr_reader :bin
|
||||
# The date that the transactions are cleared and posted to user's accounts.
|
||||
attr_reader :clearing_date
|
||||
# Time at which the object was created. Measured in seconds since the Unix epoch.
|
||||
attr_reader :created
|
||||
# Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
|
||||
attr_reader :currency
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# The total interchange received as reimbursement for the transactions.
|
||||
attr_reader :interchange_fees
|
||||
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
|
||||
attr_reader :livemode
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
attr_reader :metadata
|
||||
# The total net amount required to settle with the network.
|
||||
attr_reader :net_total
|
||||
# The card network for this settlement report. One of ["visa", "maestro"]
|
||||
attr_reader :network
|
||||
# The total amount of fees owed to the network.
|
||||
attr_reader :network_fees
|
||||
# The Settlement Identification Number assigned by the network.
|
||||
attr_reader :network_settlement_identifier
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# One of `international` or `uk_national_net`.
|
||||
attr_reader :settlement_service
|
||||
# The current processing status of this settlement.
|
||||
attr_reader :status
|
||||
# The total number of transactions reflected in this settlement.
|
||||
attr_reader :transaction_count
|
||||
# The total transaction amount reflected in this settlement.
|
||||
attr_reader :transaction_volume
|
||||
end
|
||||
end
|
||||
end
|
@ -143,6 +143,15 @@ module Stripe
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
@ -185,10 +194,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Attempts to update the specified Issuing Token object to the status specified.
|
||||
def self.update(token, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/issuing/tokens/%<token>s", { token: CGI.escape(token) }),
|
||||
path: format("/v1/issuing/tokens/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -215,6 +215,8 @@ module Stripe
|
||||
attr_accessor :expand
|
||||
# A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
|
||||
attr_accessor :limit
|
||||
# Only return transactions that are associated with the given settlement.
|
||||
attr_accessor :settlement
|
||||
# A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
|
||||
attr_accessor :starting_after
|
||||
# Only return transactions that have the given type. One of `capture` or `refund`.
|
||||
@ -227,6 +229,7 @@ module Stripe
|
||||
ending_before: nil,
|
||||
expand: nil,
|
||||
limit: nil,
|
||||
settlement: nil,
|
||||
starting_after: nil,
|
||||
type: nil
|
||||
)
|
||||
@ -236,11 +239,21 @@ module Stripe
|
||||
@ending_before = ending_before
|
||||
@expand = expand
|
||||
@limit = limit
|
||||
@settlement = settlement
|
||||
@starting_after = starting_after
|
||||
@type = type
|
||||
end
|
||||
end
|
||||
|
||||
class RetrieveParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
|
||||
def initialize(expand: nil)
|
||||
@expand = expand
|
||||
end
|
||||
end
|
||||
|
||||
class UpdateParams < Stripe::RequestParams
|
||||
# Specifies which fields in the response should be expanded.
|
||||
attr_accessor :expand
|
||||
@ -920,6 +933,8 @@ module Stripe
|
||||
attr_reader :object
|
||||
# Additional purchase information that is optionally provided by the merchant.
|
||||
attr_reader :purchase_details
|
||||
# Attribute for field settlement
|
||||
attr_reader :settlement
|
||||
# [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null.
|
||||
attr_reader :token
|
||||
# [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts
|
||||
@ -940,10 +955,10 @@ module Stripe
|
||||
end
|
||||
|
||||
# Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
||||
def self.update(transaction, params = {}, opts = {})
|
||||
def self.update(id, params = {}, opts = {})
|
||||
request_stripe_object(
|
||||
method: :post,
|
||||
path: format("/v1/issuing/transactions/%<transaction>s", { transaction: CGI.escape(transaction) }),
|
||||
path: format("/v1/issuing/transactions/%<id>s", { id: CGI.escape(id) }),
|
||||
params: params,
|
||||
opts: opts
|
||||
)
|
||||
|
@ -9,6 +9,15 @@ module Stripe
|
||||
"item"
|
||||
end
|
||||
|
||||
class AdjustableQuantity < Stripe::StripeObject
|
||||
# Attribute for field enabled
|
||||
attr_reader :enabled
|
||||
# Attribute for field maximum
|
||||
attr_reader :maximum
|
||||
# Attribute for field minimum
|
||||
attr_reader :minimum
|
||||
end
|
||||
|
||||
class Discount < Stripe::StripeObject
|
||||
# The amount discounted.
|
||||
attr_reader :amount
|
||||
@ -19,18 +28,29 @@ module Stripe
|
||||
attr_reader :discount
|
||||
end
|
||||
|
||||
class Display < Stripe::StripeObject
|
||||
# Attribute for field description
|
||||
attr_reader :description
|
||||
# Attribute for field images
|
||||
attr_reader :images
|
||||
# Attribute for field name
|
||||
attr_reader :name
|
||||
end
|
||||
|
||||
class Tax < Stripe::StripeObject
|
||||
# Amount of tax applied for this rate.
|
||||
attr_reader :amount
|
||||
# Tax rates can be applied to [invoices](/invoicing/taxes/tax-rates), [subscriptions](/billing/taxes/tax-rates) and [Checkout Sessions](/payments/checkout/use-manual-tax-rates) to collect tax.
|
||||
# Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.
|
||||
#
|
||||
# Related guide: [Tax rates](/billing/taxes/tax-rates)
|
||||
# Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates)
|
||||
attr_reader :rate
|
||||
# The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported.
|
||||
attr_reader :taxability_reason
|
||||
# The amount on which tax is calculated, in cents (or local equivalent).
|
||||
attr_reader :taxable_amount
|
||||
end
|
||||
# Attribute for field adjustable_quantity
|
||||
attr_reader :adjustable_quantity
|
||||
# Total discount amount applied. If no discounts were applied, defaults to 0.
|
||||
attr_reader :amount_discount
|
||||
# Total before any discounts or taxes are applied.
|
||||
@ -45,12 +65,20 @@ module Stripe
|
||||
attr_reader :description
|
||||
# The discounts applied to the line item.
|
||||
attr_reader :discounts
|
||||
# Attribute for field display
|
||||
attr_reader :display
|
||||
# Unique identifier for the object.
|
||||
attr_reader :id
|
||||
# Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
|
||||
attr_reader :metadata
|
||||
# String representing the object's type. Objects of the same type share the same value.
|
||||
attr_reader :object
|
||||
# The price used to generate the line item.
|
||||
attr_reader :price
|
||||
# The ID of the product for this line item.
|
||||
#
|
||||
# This will always be the same as `price.product`.
|
||||
attr_reader :product
|
||||
# The quantity of products being purchased.
|
||||
attr_reader :quantity
|
||||
# The taxes applied to the line item.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user