stripe-ruby-mock 2.5.8 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.github/workflows/rspec_tests.yml +38 -0
- data/.gitignore +1 -1
- data/.rspec +2 -1
- data/CHANGELOG.md +77 -0
- data/Gemfile +1 -5
- data/README.md +19 -11
- data/lib/stripe_mock/api/client.rb +2 -2
- data/lib/stripe_mock/api/errors.rb +34 -28
- data/lib/stripe_mock/api/instance.rb +1 -1
- data/lib/stripe_mock/api/webhooks.rb +68 -24
- data/lib/stripe_mock/client.rb +2 -1
- data/lib/stripe_mock/data/list.rb +42 -9
- data/lib/stripe_mock/data.rb +359 -21
- data/lib/stripe_mock/instance.rb +23 -5
- data/lib/stripe_mock/request_handlers/account_links.rb +15 -0
- data/lib/stripe_mock/request_handlers/accounts.rb +17 -6
- data/lib/stripe_mock/request_handlers/balance_transactions.rb +2 -2
- data/lib/stripe_mock/request_handlers/charges.rb +31 -5
- data/lib/stripe_mock/request_handlers/checkout_session.rb +179 -0
- data/lib/stripe_mock/request_handlers/customers.rb +47 -19
- data/lib/stripe_mock/request_handlers/ephemeral_key.rb +1 -1
- data/lib/stripe_mock/request_handlers/events.rb +30 -3
- data/lib/stripe_mock/request_handlers/express_login_links.rb +15 -0
- data/lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb +6 -0
- data/lib/stripe_mock/request_handlers/helpers/search_helpers.rb +67 -0
- data/lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb +36 -12
- data/lib/stripe_mock/request_handlers/helpers/token_helpers.rb +1 -1
- data/lib/stripe_mock/request_handlers/invoices.rb +26 -6
- data/lib/stripe_mock/request_handlers/payment_intents.rb +202 -0
- data/lib/stripe_mock/request_handlers/payment_methods.rb +124 -0
- data/lib/stripe_mock/request_handlers/plans.rb +1 -1
- data/lib/stripe_mock/request_handlers/prices.rb +71 -0
- data/lib/stripe_mock/request_handlers/products.rb +15 -5
- data/lib/stripe_mock/request_handlers/promotion_codes.rb +43 -0
- data/lib/stripe_mock/request_handlers/refunds.rb +13 -2
- data/lib/stripe_mock/request_handlers/setup_intents.rb +100 -0
- data/lib/stripe_mock/request_handlers/sources.rb +12 -6
- data/lib/stripe_mock/request_handlers/subscriptions.rb +146 -25
- data/lib/stripe_mock/request_handlers/tokens.rb +6 -4
- data/lib/stripe_mock/request_handlers/transfers.rb +12 -1
- data/lib/stripe_mock/request_handlers/validators/param_validators.rb +124 -9
- data/lib/stripe_mock/server.rb +2 -2
- data/lib/stripe_mock/test_strategies/base.rb +98 -12
- data/lib/stripe_mock/test_strategies/live.rb +23 -12
- data/lib/stripe_mock/test_strategies/mock.rb +6 -2
- data/lib/stripe_mock/version.rb +1 -1
- data/lib/stripe_mock/webhook_fixtures/account.updated.json +1 -1
- data/lib/stripe_mock/webhook_fixtures/balance.available.json +27 -15
- data/lib/stripe_mock/webhook_fixtures/charge.captured.json +143 -0
- data/lib/stripe_mock/webhook_fixtures/charge.dispute.created.json +63 -16
- data/lib/stripe_mock/webhook_fixtures/charge.failed.json +101 -44
- data/lib/stripe_mock/webhook_fixtures/charge.refund.updated.json +35 -0
- data/lib/stripe_mock/webhook_fixtures/charge.refunded.json +145 -50
- data/lib/stripe_mock/webhook_fixtures/charge.succeeded.json +114 -43
- data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.json +79 -0
- data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.payment_mode.json +53 -0
- data/lib/stripe_mock/webhook_fixtures/checkout.session.completed.setup_mode.json +45 -0
- data/lib/stripe_mock/webhook_fixtures/customer.created.json +37 -45
- data/lib/stripe_mock/webhook_fixtures/customer.deleted.json +36 -32
- data/lib/stripe_mock/webhook_fixtures/customer.source.created.json +31 -22
- data/lib/stripe_mock/webhook_fixtures/customer.source.updated.json +36 -25
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.created.json +135 -47
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.deleted.json +134 -45
- data/lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json +135 -56
- data/lib/stripe_mock/webhook_fixtures/customer.updated.json +38 -46
- data/lib/stripe_mock/webhook_fixtures/invoice.created.json +176 -49
- data/lib/stripe_mock/webhook_fixtures/invoice.finalized.json +171 -0
- data/lib/stripe_mock/webhook_fixtures/invoice.paid.json +171 -0
- data/lib/stripe_mock/webhook_fixtures/invoice.payment_action_required.json +171 -0
- data/lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json +149 -83
- data/lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json +149 -90
- data/lib/stripe_mock/webhook_fixtures/invoice.upcoming.json +70 -0
- data/lib/stripe_mock/webhook_fixtures/invoice.updated.json +178 -50
- data/lib/stripe_mock/webhook_fixtures/invoiceitem.created.json +87 -13
- data/lib/stripe_mock/webhook_fixtures/invoiceitem.updated.json +88 -14
- data/lib/stripe_mock/webhook_fixtures/mandate.updated.json +34 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.amount_capturable_updated.json +170 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.canceled.json +73 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.created.json +86 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.payment_failed.json +225 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.processing.json +162 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.requires_action.json +191 -0
- data/lib/stripe_mock/webhook_fixtures/payment_intent.succeeded.json +196 -0
- data/lib/stripe_mock/webhook_fixtures/payment_link.created.json +47 -0
- data/lib/stripe_mock/webhook_fixtures/payment_link.updated.json +50 -0
- data/lib/stripe_mock/webhook_fixtures/payment_method.attached.json +63 -0
- data/lib/stripe_mock/webhook_fixtures/payment_method.detached.json +62 -0
- data/lib/stripe_mock/webhook_fixtures/payout.created.json +40 -0
- data/lib/stripe_mock/webhook_fixtures/payout.paid.json +40 -0
- data/lib/stripe_mock/webhook_fixtures/payout.updated.json +46 -0
- data/lib/stripe_mock/webhook_fixtures/plan.created.json +30 -13
- data/lib/stripe_mock/webhook_fixtures/plan.deleted.json +30 -13
- data/lib/stripe_mock/webhook_fixtures/plan.updated.json +34 -14
- data/lib/stripe_mock/webhook_fixtures/price.created.json +42 -0
- data/lib/stripe_mock/webhook_fixtures/price.deleted.json +42 -0
- data/lib/stripe_mock/webhook_fixtures/price.updated.json +48 -0
- data/lib/stripe_mock/webhook_fixtures/product.created.json +40 -0
- data/lib/stripe_mock/webhook_fixtures/product.deleted.json +40 -0
- data/lib/stripe_mock/webhook_fixtures/product.updated.json +47 -0
- data/lib/stripe_mock/webhook_fixtures/quote.accepted.json +92 -0
- data/lib/stripe_mock/webhook_fixtures/quote.canceled.json +92 -0
- data/lib/stripe_mock/webhook_fixtures/quote.created.json +92 -0
- data/lib/stripe_mock/webhook_fixtures/quote.finalized.json +92 -0
- data/lib/stripe_mock/webhook_fixtures/setup_intent.canceled.json +46 -0
- data/lib/stripe_mock/webhook_fixtures/setup_intent.created.json +51 -0
- data/lib/stripe_mock/webhook_fixtures/setup_intent.setup_failed.json +100 -0
- data/lib/stripe_mock/webhook_fixtures/setup_intent.succeeded.json +46 -0
- data/lib/stripe_mock/webhook_fixtures/subscription_schedule.canceled.json +119 -0
- data/lib/stripe_mock/webhook_fixtures/subscription_schedule.created.json +114 -0
- data/lib/stripe_mock/webhook_fixtures/subscription_schedule.released.json +111 -0
- data/lib/stripe_mock/webhook_fixtures/subscription_schedule.updated.json +125 -0
- data/lib/stripe_mock/webhook_fixtures/tax_rate.created.json +32 -0
- data/lib/stripe_mock/webhook_fixtures/tax_rate.updated.json +37 -0
- data/lib/stripe_mock.rb +11 -0
- data/spec/instance_spec.rb +13 -13
- data/spec/integration_examples/completing_checkout_sessions_example.rb +37 -0
- data/spec/list_spec.rb +38 -0
- data/spec/readme_spec.rb +1 -1
- data/spec/server_spec.rb +6 -3
- data/spec/shared_stripe_examples/account_examples.rb +10 -2
- data/spec/shared_stripe_examples/account_link_examples.rb +16 -0
- data/spec/shared_stripe_examples/balance_examples.rb +6 -0
- data/spec/shared_stripe_examples/balance_transaction_examples.rb +3 -3
- data/spec/shared_stripe_examples/bank_examples.rb +3 -3
- data/spec/shared_stripe_examples/bank_token_examples.rb +5 -7
- data/spec/shared_stripe_examples/card_examples.rb +4 -4
- data/spec/shared_stripe_examples/card_token_examples.rb +17 -21
- data/spec/shared_stripe_examples/charge_examples.rb +106 -22
- data/spec/shared_stripe_examples/checkout_session_examples.rb +99 -0
- data/spec/shared_stripe_examples/coupon_examples.rb +1 -1
- data/spec/shared_stripe_examples/customer_examples.rb +149 -53
- data/spec/shared_stripe_examples/dispute_examples.rb +2 -2
- data/spec/shared_stripe_examples/error_mock_examples.rb +8 -7
- data/spec/shared_stripe_examples/express_login_link_examples.rb +12 -0
- data/spec/shared_stripe_examples/external_account_examples.rb +3 -3
- data/spec/shared_stripe_examples/invoice_examples.rb +148 -40
- data/spec/shared_stripe_examples/invoice_item_examples.rb +1 -1
- data/spec/shared_stripe_examples/payment_intent_examples.rb +283 -0
- data/spec/shared_stripe_examples/payment_method_examples.rb +454 -0
- data/spec/shared_stripe_examples/payout_examples.rb +2 -2
- data/spec/shared_stripe_examples/plan_examples.rb +135 -92
- data/spec/shared_stripe_examples/price_examples.rb +292 -0
- data/spec/shared_stripe_examples/product_examples.rb +215 -0
- data/spec/shared_stripe_examples/promotion_code_examples.rb +68 -0
- data/spec/shared_stripe_examples/refund_examples.rb +38 -21
- data/spec/shared_stripe_examples/setup_intent_examples.rb +85 -0
- data/spec/shared_stripe_examples/subscription_examples.rb +706 -324
- data/spec/shared_stripe_examples/subscription_items_examples.rb +3 -2
- data/spec/shared_stripe_examples/transfer_examples.rb +16 -7
- data/spec/shared_stripe_examples/webhook_event_examples.rb +62 -16
- data/spec/spec_helper.rb +8 -5
- data/spec/stripe_mock_spec.rb +4 -4
- data/spec/support/shared_contexts/stripe_validator_spec.rb +8 -0
- data/spec/support/stripe_examples.rb +11 -1
- data/stripe-ruby-mock.gemspec +9 -5
- metadata +115 -47
- data/.travis.yml +0 -28
- data/spec/shared_stripe_examples/product_example.rb +0 -65
metadata
CHANGED
@@ -1,99 +1,91 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe-ruby-mock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilbert
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stripe
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '5'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '12'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ">"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '5'
|
30
|
+
- - "<"
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: '12'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: multi_json
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - ~>
|
37
|
+
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
39
|
version: '1.0'
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - ~>
|
44
|
+
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
46
|
version: '1.0'
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: dante
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
|
-
- -
|
51
|
+
- - ">="
|
46
52
|
- !ruby/object:Gem::Version
|
47
53
|
version: 0.2.0
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
|
-
- -
|
58
|
+
- - ">="
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: 0.2.0
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rspec
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
|
-
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 3.1.0
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ~>
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 3.1.0
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rubygems-tasks
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ~>
|
65
|
+
- - "~>"
|
74
66
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
67
|
+
version: 3.13.0
|
76
68
|
type: :development
|
77
69
|
prerelease: false
|
78
70
|
version_requirements: !ruby/object:Gem::Requirement
|
79
71
|
requirements:
|
80
|
-
- - ~>
|
72
|
+
- - "~>"
|
81
73
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
74
|
+
version: 3.13.0
|
83
75
|
- !ruby/object:Gem::Dependency
|
84
76
|
name: thin
|
85
77
|
requirement: !ruby/object:Gem::Requirement
|
86
78
|
requirements:
|
87
|
-
- - ~>
|
79
|
+
- - "~>"
|
88
80
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
81
|
+
version: 1.8.1
|
90
82
|
type: :development
|
91
83
|
prerelease: false
|
92
84
|
version_requirements: !ruby/object:Gem::Requirement
|
93
85
|
requirements:
|
94
|
-
- - ~>
|
86
|
+
- - "~>"
|
95
87
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
88
|
+
version: 1.8.1
|
97
89
|
description: A drop-in library to test stripe without hitting their servers
|
98
90
|
email: gilbertbgarza@gmail.com
|
99
91
|
executables:
|
@@ -101,10 +93,11 @@ executables:
|
|
101
93
|
extensions: []
|
102
94
|
extra_rdoc_files: []
|
103
95
|
files:
|
104
|
-
- .env
|
105
|
-
- .
|
106
|
-
- .
|
107
|
-
- .
|
96
|
+
- ".env"
|
97
|
+
- ".github/workflows/rspec_tests.yml"
|
98
|
+
- ".gitignore"
|
99
|
+
- ".rspec"
|
100
|
+
- CHANGELOG.md
|
108
101
|
- Gemfile
|
109
102
|
- LICENSE.txt
|
110
103
|
- README.md
|
@@ -135,33 +128,42 @@ files:
|
|
135
128
|
- lib/stripe_mock/errors/unstarted_state_error.rb
|
136
129
|
- lib/stripe_mock/errors/unsupported_request_error.rb
|
137
130
|
- lib/stripe_mock/instance.rb
|
131
|
+
- lib/stripe_mock/request_handlers/account_links.rb
|
138
132
|
- lib/stripe_mock/request_handlers/accounts.rb
|
139
133
|
- lib/stripe_mock/request_handlers/balance.rb
|
140
134
|
- lib/stripe_mock/request_handlers/balance_transactions.rb
|
141
135
|
- lib/stripe_mock/request_handlers/cards.rb
|
142
136
|
- lib/stripe_mock/request_handlers/charges.rb
|
137
|
+
- lib/stripe_mock/request_handlers/checkout_session.rb
|
143
138
|
- lib/stripe_mock/request_handlers/country_spec.rb
|
144
139
|
- lib/stripe_mock/request_handlers/coupons.rb
|
145
140
|
- lib/stripe_mock/request_handlers/customers.rb
|
146
141
|
- lib/stripe_mock/request_handlers/disputes.rb
|
147
142
|
- lib/stripe_mock/request_handlers/ephemeral_key.rb
|
148
143
|
- lib/stripe_mock/request_handlers/events.rb
|
144
|
+
- lib/stripe_mock/request_handlers/express_login_links.rb
|
149
145
|
- lib/stripe_mock/request_handlers/external_accounts.rb
|
150
146
|
- lib/stripe_mock/request_handlers/helpers/bank_account_helpers.rb
|
151
147
|
- lib/stripe_mock/request_handlers/helpers/card_helpers.rb
|
152
148
|
- lib/stripe_mock/request_handlers/helpers/charge_helpers.rb
|
153
149
|
- lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb
|
154
150
|
- lib/stripe_mock/request_handlers/helpers/external_account_helpers.rb
|
151
|
+
- lib/stripe_mock/request_handlers/helpers/search_helpers.rb
|
155
152
|
- lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb
|
156
153
|
- lib/stripe_mock/request_handlers/helpers/token_helpers.rb
|
157
154
|
- lib/stripe_mock/request_handlers/invoice_items.rb
|
158
155
|
- lib/stripe_mock/request_handlers/invoices.rb
|
159
156
|
- lib/stripe_mock/request_handlers/orders.rb
|
157
|
+
- lib/stripe_mock/request_handlers/payment_intents.rb
|
158
|
+
- lib/stripe_mock/request_handlers/payment_methods.rb
|
160
159
|
- lib/stripe_mock/request_handlers/payouts.rb
|
161
160
|
- lib/stripe_mock/request_handlers/plans.rb
|
161
|
+
- lib/stripe_mock/request_handlers/prices.rb
|
162
162
|
- lib/stripe_mock/request_handlers/products.rb
|
163
|
+
- lib/stripe_mock/request_handlers/promotion_codes.rb
|
163
164
|
- lib/stripe_mock/request_handlers/recipients.rb
|
164
165
|
- lib/stripe_mock/request_handlers/refunds.rb
|
166
|
+
- lib/stripe_mock/request_handlers/setup_intents.rb
|
165
167
|
- lib/stripe_mock/request_handlers/sources.rb
|
166
168
|
- lib/stripe_mock/request_handlers/subscription_items.rb
|
167
169
|
- lib/stripe_mock/request_handlers/subscriptions.rb
|
@@ -181,15 +183,20 @@ files:
|
|
181
183
|
- lib/stripe_mock/webhook_fixtures/account.external_account.updated.json
|
182
184
|
- lib/stripe_mock/webhook_fixtures/account.updated.json
|
183
185
|
- lib/stripe_mock/webhook_fixtures/balance.available.json
|
186
|
+
- lib/stripe_mock/webhook_fixtures/charge.captured.json
|
184
187
|
- lib/stripe_mock/webhook_fixtures/charge.dispute.closed.json
|
185
188
|
- lib/stripe_mock/webhook_fixtures/charge.dispute.created.json
|
186
189
|
- lib/stripe_mock/webhook_fixtures/charge.dispute.funds_reinstated.json
|
187
190
|
- lib/stripe_mock/webhook_fixtures/charge.dispute.funds_withdrawn.json
|
188
191
|
- lib/stripe_mock/webhook_fixtures/charge.dispute.updated.json
|
189
192
|
- lib/stripe_mock/webhook_fixtures/charge.failed.json
|
193
|
+
- lib/stripe_mock/webhook_fixtures/charge.refund.updated.json
|
190
194
|
- lib/stripe_mock/webhook_fixtures/charge.refunded.json
|
191
195
|
- lib/stripe_mock/webhook_fixtures/charge.succeeded.json
|
192
196
|
- lib/stripe_mock/webhook_fixtures/charge.updated.json
|
197
|
+
- lib/stripe_mock/webhook_fixtures/checkout.session.completed.json
|
198
|
+
- lib/stripe_mock/webhook_fixtures/checkout.session.completed.payment_mode.json
|
199
|
+
- lib/stripe_mock/webhook_fixtures/checkout.session.completed.setup_mode.json
|
193
200
|
- lib/stripe_mock/webhook_fixtures/coupon.created.json
|
194
201
|
- lib/stripe_mock/webhook_fixtures/coupon.deleted.json
|
195
202
|
- lib/stripe_mock/webhook_fixtures/customer.created.json
|
@@ -206,15 +213,54 @@ files:
|
|
206
213
|
- lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json
|
207
214
|
- lib/stripe_mock/webhook_fixtures/customer.updated.json
|
208
215
|
- lib/stripe_mock/webhook_fixtures/invoice.created.json
|
216
|
+
- lib/stripe_mock/webhook_fixtures/invoice.finalized.json
|
217
|
+
- lib/stripe_mock/webhook_fixtures/invoice.paid.json
|
218
|
+
- lib/stripe_mock/webhook_fixtures/invoice.payment_action_required.json
|
209
219
|
- lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json
|
210
220
|
- lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json
|
221
|
+
- lib/stripe_mock/webhook_fixtures/invoice.upcoming.json
|
211
222
|
- lib/stripe_mock/webhook_fixtures/invoice.updated.json
|
212
223
|
- lib/stripe_mock/webhook_fixtures/invoiceitem.created.json
|
213
224
|
- lib/stripe_mock/webhook_fixtures/invoiceitem.deleted.json
|
214
225
|
- lib/stripe_mock/webhook_fixtures/invoiceitem.updated.json
|
226
|
+
- lib/stripe_mock/webhook_fixtures/mandate.updated.json
|
227
|
+
- lib/stripe_mock/webhook_fixtures/payment_intent.amount_capturable_updated.json
|
228
|
+
- lib/stripe_mock/webhook_fixtures/payment_intent.canceled.json
|
229
|
+
- lib/stripe_mock/webhook_fixtures/payment_intent.created.json
|
230
|
+
- lib/stripe_mock/webhook_fixtures/payment_intent.payment_failed.json
|
231
|
+
- lib/stripe_mock/webhook_fixtures/payment_intent.processing.json
|
232
|
+
- lib/stripe_mock/webhook_fixtures/payment_intent.requires_action.json
|
233
|
+
- lib/stripe_mock/webhook_fixtures/payment_intent.succeeded.json
|
234
|
+
- lib/stripe_mock/webhook_fixtures/payment_link.created.json
|
235
|
+
- lib/stripe_mock/webhook_fixtures/payment_link.updated.json
|
236
|
+
- lib/stripe_mock/webhook_fixtures/payment_method.attached.json
|
237
|
+
- lib/stripe_mock/webhook_fixtures/payment_method.detached.json
|
238
|
+
- lib/stripe_mock/webhook_fixtures/payout.created.json
|
239
|
+
- lib/stripe_mock/webhook_fixtures/payout.paid.json
|
240
|
+
- lib/stripe_mock/webhook_fixtures/payout.updated.json
|
215
241
|
- lib/stripe_mock/webhook_fixtures/plan.created.json
|
216
242
|
- lib/stripe_mock/webhook_fixtures/plan.deleted.json
|
217
243
|
- lib/stripe_mock/webhook_fixtures/plan.updated.json
|
244
|
+
- lib/stripe_mock/webhook_fixtures/price.created.json
|
245
|
+
- lib/stripe_mock/webhook_fixtures/price.deleted.json
|
246
|
+
- lib/stripe_mock/webhook_fixtures/price.updated.json
|
247
|
+
- lib/stripe_mock/webhook_fixtures/product.created.json
|
248
|
+
- lib/stripe_mock/webhook_fixtures/product.deleted.json
|
249
|
+
- lib/stripe_mock/webhook_fixtures/product.updated.json
|
250
|
+
- lib/stripe_mock/webhook_fixtures/quote.accepted.json
|
251
|
+
- lib/stripe_mock/webhook_fixtures/quote.canceled.json
|
252
|
+
- lib/stripe_mock/webhook_fixtures/quote.created.json
|
253
|
+
- lib/stripe_mock/webhook_fixtures/quote.finalized.json
|
254
|
+
- lib/stripe_mock/webhook_fixtures/setup_intent.canceled.json
|
255
|
+
- lib/stripe_mock/webhook_fixtures/setup_intent.created.json
|
256
|
+
- lib/stripe_mock/webhook_fixtures/setup_intent.setup_failed.json
|
257
|
+
- lib/stripe_mock/webhook_fixtures/setup_intent.succeeded.json
|
258
|
+
- lib/stripe_mock/webhook_fixtures/subscription_schedule.canceled.json
|
259
|
+
- lib/stripe_mock/webhook_fixtures/subscription_schedule.created.json
|
260
|
+
- lib/stripe_mock/webhook_fixtures/subscription_schedule.released.json
|
261
|
+
- lib/stripe_mock/webhook_fixtures/subscription_schedule.updated.json
|
262
|
+
- lib/stripe_mock/webhook_fixtures/tax_rate.created.json
|
263
|
+
- lib/stripe_mock/webhook_fixtures/tax_rate.updated.json
|
218
264
|
- lib/stripe_mock/webhook_fixtures/transfer.created.json
|
219
265
|
- lib/stripe_mock/webhook_fixtures/transfer.failed.json
|
220
266
|
- lib/stripe_mock/webhook_fixtures/transfer.paid.json
|
@@ -227,12 +273,14 @@ files:
|
|
227
273
|
- spec/fixtures/stripe_webhooks/custom.account.updated.json
|
228
274
|
- spec/instance_spec.rb
|
229
275
|
- spec/integration_examples/charge_token_examples.rb
|
276
|
+
- spec/integration_examples/completing_checkout_sessions_example.rb
|
230
277
|
- spec/integration_examples/customer_card_examples.rb
|
231
278
|
- spec/integration_examples/prepare_error_examples.rb
|
232
279
|
- spec/list_spec.rb
|
233
280
|
- spec/readme_spec.rb
|
234
281
|
- spec/server_spec.rb
|
235
282
|
- spec/shared_stripe_examples/account_examples.rb
|
283
|
+
- spec/shared_stripe_examples/account_link_examples.rb
|
236
284
|
- spec/shared_stripe_examples/balance_examples.rb
|
237
285
|
- spec/shared_stripe_examples/balance_transaction_examples.rb
|
238
286
|
- spec/shared_stripe_examples/bank_examples.rb
|
@@ -240,21 +288,28 @@ files:
|
|
240
288
|
- spec/shared_stripe_examples/card_examples.rb
|
241
289
|
- spec/shared_stripe_examples/card_token_examples.rb
|
242
290
|
- spec/shared_stripe_examples/charge_examples.rb
|
291
|
+
- spec/shared_stripe_examples/checkout_session_examples.rb
|
243
292
|
- spec/shared_stripe_examples/country_specs_examples.rb
|
244
293
|
- spec/shared_stripe_examples/coupon_examples.rb
|
245
294
|
- spec/shared_stripe_examples/customer_examples.rb
|
246
295
|
- spec/shared_stripe_examples/dispute_examples.rb
|
247
296
|
- spec/shared_stripe_examples/ephemeral_key_examples.rb
|
248
297
|
- spec/shared_stripe_examples/error_mock_examples.rb
|
298
|
+
- spec/shared_stripe_examples/express_login_link_examples.rb
|
249
299
|
- spec/shared_stripe_examples/external_account_examples.rb
|
250
300
|
- spec/shared_stripe_examples/extra_features_examples.rb
|
251
301
|
- spec/shared_stripe_examples/invoice_examples.rb
|
252
302
|
- spec/shared_stripe_examples/invoice_item_examples.rb
|
303
|
+
- spec/shared_stripe_examples/payment_intent_examples.rb
|
304
|
+
- spec/shared_stripe_examples/payment_method_examples.rb
|
253
305
|
- spec/shared_stripe_examples/payout_examples.rb
|
254
306
|
- spec/shared_stripe_examples/plan_examples.rb
|
255
|
-
- spec/shared_stripe_examples/
|
307
|
+
- spec/shared_stripe_examples/price_examples.rb
|
308
|
+
- spec/shared_stripe_examples/product_examples.rb
|
309
|
+
- spec/shared_stripe_examples/promotion_code_examples.rb
|
256
310
|
- spec/shared_stripe_examples/recipient_examples.rb
|
257
311
|
- spec/shared_stripe_examples/refund_examples.rb
|
312
|
+
- spec/shared_stripe_examples/setup_intent_examples.rb
|
258
313
|
- spec/shared_stripe_examples/subscription_examples.rb
|
259
314
|
- spec/shared_stripe_examples/subscription_items_examples.rb
|
260
315
|
- spec/shared_stripe_examples/tax_rate_examples.rb
|
@@ -263,31 +318,34 @@ files:
|
|
263
318
|
- spec/shared_stripe_examples/webhook_event_examples.rb
|
264
319
|
- spec/spec_helper.rb
|
265
320
|
- spec/stripe_mock_spec.rb
|
321
|
+
- spec/support/shared_contexts/stripe_validator_spec.rb
|
266
322
|
- spec/support/stripe_examples.rb
|
267
323
|
- spec/util_spec.rb
|
268
324
|
- stripe-ruby-mock.gemspec
|
269
|
-
homepage: https://github.com/
|
325
|
+
homepage: https://github.com/stripe-ruby-mock/stripe-ruby-mock
|
270
326
|
licenses:
|
271
327
|
- MIT
|
272
|
-
metadata:
|
273
|
-
|
328
|
+
metadata:
|
329
|
+
bug_tracker_uri: https://github.com/stripe-ruby-mock/stripe-ruby-mock/issues
|
330
|
+
changelog_uri: https://github.com/stripe-ruby-mock/stripe-ruby-mock/blob/master/CHANGELOG.md
|
331
|
+
source_code_uri: https://github.com/stripe-ruby-mock/stripe-ruby-mock
|
332
|
+
post_install_message:
|
274
333
|
rdoc_options: []
|
275
334
|
require_paths:
|
276
335
|
- lib
|
277
336
|
required_ruby_version: !ruby/object:Gem::Requirement
|
278
337
|
requirements:
|
279
|
-
- -
|
338
|
+
- - ">="
|
280
339
|
- !ruby/object:Gem::Version
|
281
340
|
version: '0'
|
282
341
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
283
342
|
requirements:
|
284
|
-
- -
|
343
|
+
- - ">="
|
285
344
|
- !ruby/object:Gem::Version
|
286
345
|
version: '0'
|
287
346
|
requirements: []
|
288
|
-
|
289
|
-
|
290
|
-
signing_key:
|
347
|
+
rubygems_version: 3.4.19
|
348
|
+
signing_key:
|
291
349
|
specification_version: 4
|
292
350
|
summary: TDD with stripe
|
293
351
|
test_files:
|
@@ -298,12 +356,14 @@ test_files:
|
|
298
356
|
- spec/fixtures/stripe_webhooks/custom.account.updated.json
|
299
357
|
- spec/instance_spec.rb
|
300
358
|
- spec/integration_examples/charge_token_examples.rb
|
359
|
+
- spec/integration_examples/completing_checkout_sessions_example.rb
|
301
360
|
- spec/integration_examples/customer_card_examples.rb
|
302
361
|
- spec/integration_examples/prepare_error_examples.rb
|
303
362
|
- spec/list_spec.rb
|
304
363
|
- spec/readme_spec.rb
|
305
364
|
- spec/server_spec.rb
|
306
365
|
- spec/shared_stripe_examples/account_examples.rb
|
366
|
+
- spec/shared_stripe_examples/account_link_examples.rb
|
307
367
|
- spec/shared_stripe_examples/balance_examples.rb
|
308
368
|
- spec/shared_stripe_examples/balance_transaction_examples.rb
|
309
369
|
- spec/shared_stripe_examples/bank_examples.rb
|
@@ -311,21 +371,28 @@ test_files:
|
|
311
371
|
- spec/shared_stripe_examples/card_examples.rb
|
312
372
|
- spec/shared_stripe_examples/card_token_examples.rb
|
313
373
|
- spec/shared_stripe_examples/charge_examples.rb
|
374
|
+
- spec/shared_stripe_examples/checkout_session_examples.rb
|
314
375
|
- spec/shared_stripe_examples/country_specs_examples.rb
|
315
376
|
- spec/shared_stripe_examples/coupon_examples.rb
|
316
377
|
- spec/shared_stripe_examples/customer_examples.rb
|
317
378
|
- spec/shared_stripe_examples/dispute_examples.rb
|
318
379
|
- spec/shared_stripe_examples/ephemeral_key_examples.rb
|
319
380
|
- spec/shared_stripe_examples/error_mock_examples.rb
|
381
|
+
- spec/shared_stripe_examples/express_login_link_examples.rb
|
320
382
|
- spec/shared_stripe_examples/external_account_examples.rb
|
321
383
|
- spec/shared_stripe_examples/extra_features_examples.rb
|
322
384
|
- spec/shared_stripe_examples/invoice_examples.rb
|
323
385
|
- spec/shared_stripe_examples/invoice_item_examples.rb
|
386
|
+
- spec/shared_stripe_examples/payment_intent_examples.rb
|
387
|
+
- spec/shared_stripe_examples/payment_method_examples.rb
|
324
388
|
- spec/shared_stripe_examples/payout_examples.rb
|
325
389
|
- spec/shared_stripe_examples/plan_examples.rb
|
326
|
-
- spec/shared_stripe_examples/
|
390
|
+
- spec/shared_stripe_examples/price_examples.rb
|
391
|
+
- spec/shared_stripe_examples/product_examples.rb
|
392
|
+
- spec/shared_stripe_examples/promotion_code_examples.rb
|
327
393
|
- spec/shared_stripe_examples/recipient_examples.rb
|
328
394
|
- spec/shared_stripe_examples/refund_examples.rb
|
395
|
+
- spec/shared_stripe_examples/setup_intent_examples.rb
|
329
396
|
- spec/shared_stripe_examples/subscription_examples.rb
|
330
397
|
- spec/shared_stripe_examples/subscription_items_examples.rb
|
331
398
|
- spec/shared_stripe_examples/tax_rate_examples.rb
|
@@ -334,5 +401,6 @@ test_files:
|
|
334
401
|
- spec/shared_stripe_examples/webhook_event_examples.rb
|
335
402
|
- spec/spec_helper.rb
|
336
403
|
- spec/stripe_mock_spec.rb
|
404
|
+
- spec/support/shared_contexts/stripe_validator_spec.rb
|
337
405
|
- spec/support/stripe_examples.rb
|
338
406
|
- spec/util_spec.rb
|
data/.travis.yml
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
dist: trusty
|
2
|
-
group: deprecated-2017Q2
|
3
|
-
sudo: required
|
4
|
-
language: ruby
|
5
|
-
rvm:
|
6
|
-
- 2.0.0
|
7
|
-
- 2.1.10
|
8
|
-
- 2.2.7
|
9
|
-
- 2.3.4
|
10
|
-
before_install:
|
11
|
-
- rvm 2.1.10 do gem install mime-types -v 2.6.2
|
12
|
-
- gem install bundler
|
13
|
-
before_script:
|
14
|
-
- "sudo touch /var/log/stripe-mock-server.log"
|
15
|
-
- "sudo chown travis /var/log/stripe-mock-server.log"
|
16
|
-
script: "bundle exec rspec && bundle exec rspec -t live"
|
17
|
-
|
18
|
-
env:
|
19
|
-
global:
|
20
|
-
- IS_TRAVIS=true STRIPE_TEST_SECRET_KEY_A=sk_test_Ut2MSlZANdT3iDALdGhyLymy STRIPE_TEST_SECRET_KEY_B=sk_test_JXtzss9tHOG1ofIyEZgoUP4Q STRIPE_TEST_SECRET_KEY_C=sk_test_ZR5nVz9p3ivsqVa7mYB0sFep STRIPE_TEST_SECRET_KEY_D=sk_test_ZR5nVz9p3ivsqVa7mYB0sFep
|
21
|
-
|
22
|
-
notifications:
|
23
|
-
webhooks:
|
24
|
-
urls:
|
25
|
-
- https://webhooks.gitter.im/e/44a1f4718ae2efb67eac
|
26
|
-
on_success: change # options: [always|never|change] default: always
|
27
|
-
on_failure: always # options: [always|never|change] default: always
|
28
|
-
on_start: false # default: false
|
@@ -1,65 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
shared_examples 'Product API' do
|
4
|
-
it 'creates a product' do
|
5
|
-
product = Stripe::Product.create(
|
6
|
-
name: 'my awesome product',
|
7
|
-
type: 'service'
|
8
|
-
)
|
9
|
-
|
10
|
-
expect(product.name).to eq 'my awesome product'
|
11
|
-
expect(product.type).to eq 'service'
|
12
|
-
end
|
13
|
-
|
14
|
-
it 'retrieves a product' do
|
15
|
-
Stripe::Product.create(
|
16
|
-
id: 'test_prod_1',
|
17
|
-
name: 'my awesome product',
|
18
|
-
type: 'service'
|
19
|
-
)
|
20
|
-
|
21
|
-
product = Stripe::Product.retrieve('test_prod_1')
|
22
|
-
|
23
|
-
expect(product.name).to eq 'my awesome product'
|
24
|
-
expect(product.type).to eq 'service'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'updates a product' do
|
28
|
-
Stripe::Product.create(
|
29
|
-
id: 'test_prod_1',
|
30
|
-
name: 'my awesome product',
|
31
|
-
type: 'service'
|
32
|
-
)
|
33
|
-
|
34
|
-
Stripe::Product.update('test_prod_1', name: 'my lame product')
|
35
|
-
|
36
|
-
product = Stripe::Product.retrieve('test_prod_1')
|
37
|
-
|
38
|
-
expect(product.name).to eq 'my lame product'
|
39
|
-
end
|
40
|
-
|
41
|
-
it 'lists all products' do
|
42
|
-
2.times do |n|
|
43
|
-
Stripe::Product.create(
|
44
|
-
name: "product #{n}",
|
45
|
-
type: 'service'
|
46
|
-
)
|
47
|
-
end
|
48
|
-
|
49
|
-
products = Stripe::Product.list
|
50
|
-
|
51
|
-
expect(products.map(&:name)).to match_array ['product 0', 'product 1']
|
52
|
-
end
|
53
|
-
|
54
|
-
it 'destroys a product', live: true do
|
55
|
-
Stripe::Product.create(
|
56
|
-
id: 'test_prod_1',
|
57
|
-
name: 'my awesome product',
|
58
|
-
type: 'service'
|
59
|
-
)
|
60
|
-
|
61
|
-
Stripe::Product.delete('test_prod_1')
|
62
|
-
|
63
|
-
expect { Stripe::Product.retrieve('test_prod_1') }. to raise_error(Stripe::InvalidRequestError)
|
64
|
-
end
|
65
|
-
end
|