stripe-ruby-mock 2.3.1 → 2.5.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.env +2 -0
  3. data/.travis.yml +8 -4
  4. data/README.md +12 -5
  5. data/lib/stripe_mock/api/account_balance.rb +14 -0
  6. data/lib/stripe_mock/api/client.rb +4 -4
  7. data/lib/stripe_mock/api/conversion_rate.rb +14 -0
  8. data/lib/stripe_mock/api/errors.rb +25 -13
  9. data/lib/stripe_mock/api/instance.rb +16 -6
  10. data/lib/stripe_mock/api/webhooks.rb +8 -1
  11. data/lib/stripe_mock/client.rb +18 -2
  12. data/lib/stripe_mock/data/list.rb +14 -2
  13. data/lib/stripe_mock/data.rb +398 -58
  14. data/lib/stripe_mock/instance.rb +105 -9
  15. data/lib/stripe_mock/request_handlers/accounts.rb +41 -2
  16. data/lib/stripe_mock/request_handlers/balance.rb +17 -0
  17. data/lib/stripe_mock/request_handlers/balance_transactions.rb +18 -2
  18. data/lib/stripe_mock/request_handlers/charges.rb +44 -33
  19. data/lib/stripe_mock/request_handlers/country_spec.rb +22 -0
  20. data/lib/stripe_mock/request_handlers/coupons.rb +5 -4
  21. data/lib/stripe_mock/request_handlers/customers.rb +29 -11
  22. data/lib/stripe_mock/request_handlers/ephemeral_key.rb +13 -0
  23. data/lib/stripe_mock/request_handlers/external_accounts.rb +55 -0
  24. data/lib/stripe_mock/request_handlers/helpers/bank_account_helpers.rb +1 -1
  25. data/lib/stripe_mock/request_handlers/helpers/card_helpers.rb +9 -7
  26. data/lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb +10 -6
  27. data/lib/stripe_mock/request_handlers/helpers/external_account_helpers.rb +49 -0
  28. data/lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb +59 -16
  29. data/lib/stripe_mock/request_handlers/helpers/token_helpers.rb +3 -2
  30. data/lib/stripe_mock/request_handlers/invoices.rb +93 -14
  31. data/lib/stripe_mock/request_handlers/orders.rb +5 -5
  32. data/lib/stripe_mock/request_handlers/payouts.rb +32 -0
  33. data/lib/stripe_mock/request_handlers/plans.rb +1 -0
  34. data/lib/stripe_mock/request_handlers/products.rb +43 -0
  35. data/lib/stripe_mock/request_handlers/recipients.rb +12 -0
  36. data/lib/stripe_mock/request_handlers/refunds.rb +91 -0
  37. data/lib/stripe_mock/request_handlers/subscription_items.rb +36 -0
  38. data/lib/stripe_mock/request_handlers/subscriptions.rb +101 -39
  39. data/lib/stripe_mock/request_handlers/tax_rates.rb +36 -0
  40. data/lib/stripe_mock/request_handlers/tokens.rb +9 -3
  41. data/lib/stripe_mock/request_handlers/transfers.rb +11 -5
  42. data/lib/stripe_mock/request_handlers/validators/param_validators.rb +15 -1
  43. data/lib/stripe_mock/server.rb +14 -1
  44. data/lib/stripe_mock/test_strategies/base.rb +10 -5
  45. data/lib/stripe_mock/test_strategies/live.rb +5 -0
  46. data/lib/stripe_mock/test_strategies/mock.rb +8 -0
  47. data/lib/stripe_mock/util.rb +8 -2
  48. data/lib/stripe_mock/version.rb +1 -1
  49. data/lib/stripe_mock/webhook_fixtures/account.external_account.created.json +27 -0
  50. data/lib/stripe_mock/webhook_fixtures/account.external_account.deleted.json +27 -0
  51. data/lib/stripe_mock/webhook_fixtures/account.external_account.updated.json +27 -0
  52. data/lib/stripe_mock/webhook_fixtures/account.updated.json +1 -1
  53. data/lib/stripe_mock/webhook_fixtures/charge.dispute.funds_reinstated.json +88 -0
  54. data/lib/stripe_mock/webhook_fixtures/charge.dispute.funds_withdrawn.json +88 -0
  55. data/lib/stripe_mock/webhook_fixtures/charge.updated.json +58 -0
  56. data/lib/stripe_mock/webhook_fixtures/customer.subscription.created.json +40 -10
  57. data/lib/stripe_mock/webhook_fixtures/customer.subscription.deleted.json +39 -10
  58. data/lib/stripe_mock/webhook_fixtures/customer.subscription.trial_will_end.json +39 -10
  59. data/lib/stripe_mock/webhook_fixtures/customer.subscription.updated.json +40 -11
  60. data/lib/stripe_mock/webhook_fixtures/invoice.created.json +3 -2
  61. data/lib/stripe_mock/webhook_fixtures/invoice.payment_failed.json +1 -1
  62. data/lib/stripe_mock/webhook_fixtures/invoice.payment_succeeded.json +92 -85
  63. data/lib/stripe_mock/webhook_fixtures/invoice.updated.json +3 -2
  64. data/lib/stripe_mock/webhook_fixtures/plan.created.json +1 -1
  65. data/lib/stripe_mock/webhook_fixtures/plan.deleted.json +1 -1
  66. data/lib/stripe_mock/webhook_fixtures/plan.updated.json +1 -1
  67. data/lib/stripe_mock.rb +15 -0
  68. data/spec/api/instance_spec.rb +30 -0
  69. data/spec/instance_spec.rb +54 -4
  70. data/spec/integration_examples/prepare_error_examples.rb +6 -6
  71. data/spec/list_spec.rb +27 -10
  72. data/spec/readme_spec.rb +2 -0
  73. data/spec/server_spec.rb +7 -3
  74. data/spec/shared_stripe_examples/account_examples.rb +46 -0
  75. data/spec/shared_stripe_examples/balance_examples.rb +11 -0
  76. data/spec/shared_stripe_examples/balance_transaction_examples.rb +28 -0
  77. data/spec/shared_stripe_examples/bank_examples.rb +28 -1
  78. data/spec/shared_stripe_examples/card_examples.rb +23 -5
  79. data/spec/shared_stripe_examples/card_token_examples.rb +1 -0
  80. data/spec/shared_stripe_examples/charge_examples.rb +131 -26
  81. data/spec/shared_stripe_examples/country_specs_examples.rb +18 -0
  82. data/spec/shared_stripe_examples/coupon_examples.rb +8 -2
  83. data/spec/shared_stripe_examples/customer_examples.rb +90 -0
  84. data/spec/shared_stripe_examples/dispute_examples.rb +19 -8
  85. data/spec/shared_stripe_examples/ephemeral_key_examples.rb +17 -0
  86. data/spec/shared_stripe_examples/error_mock_examples.rb +15 -5
  87. data/spec/shared_stripe_examples/external_account_examples.rb +170 -0
  88. data/spec/shared_stripe_examples/extra_features_examples.rb +2 -0
  89. data/spec/shared_stripe_examples/invoice_examples.rb +314 -51
  90. data/spec/shared_stripe_examples/payout_examples.rb +68 -0
  91. data/spec/shared_stripe_examples/plan_examples.rb +47 -4
  92. data/spec/shared_stripe_examples/product_example.rb +65 -0
  93. data/spec/shared_stripe_examples/recipient_examples.rb +13 -7
  94. data/spec/shared_stripe_examples/refund_examples.rb +453 -84
  95. data/spec/shared_stripe_examples/subscription_examples.rb +477 -32
  96. data/spec/shared_stripe_examples/subscription_items_examples.rb +75 -0
  97. data/spec/shared_stripe_examples/tax_rate_examples.rb +42 -0
  98. data/spec/shared_stripe_examples/transfer_examples.rb +72 -23
  99. data/spec/shared_stripe_examples/webhook_event_examples.rb +74 -5
  100. data/spec/spec_helper.rb +7 -6
  101. data/spec/stripe_mock_spec.rb +16 -3
  102. data/spec/support/stripe_examples.rb +8 -1
  103. data/spec/util_spec.rb +35 -1
  104. data/stripe-ruby-mock.gemspec +1 -1
  105. metadata +44 -8
  106. data/ChangeLog.rdoc +0 -4
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe-ruby-mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.5.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilbert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-22 00:00:00.000000000 Z
11
+ date: 2019-06-25 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: '1.31'
19
+ version: 2.0.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: '1.31'
26
+ version: 2.0.3
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: multi_json
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -101,19 +101,21 @@ executables:
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
+ - .env
104
105
  - .gitignore
105
106
  - .rspec
106
107
  - .travis.yml
107
- - ChangeLog.rdoc
108
108
  - Gemfile
109
109
  - LICENSE.txt
110
110
  - README.md
111
111
  - Rakefile
112
112
  - bin/stripe-mock-server
113
113
  - lib/stripe_mock.rb
114
+ - lib/stripe_mock/api/account_balance.rb
114
115
  - lib/stripe_mock/api/bank_tokens.rb
115
116
  - lib/stripe_mock/api/card_tokens.rb
116
117
  - lib/stripe_mock/api/client.rb
118
+ - lib/stripe_mock/api/conversion_rate.rb
117
119
  - lib/stripe_mock/api/debug.rb
118
120
  - lib/stripe_mock/api/errors.rb
119
121
  - lib/stripe_mock/api/global_id_prefix.rb
@@ -134,26 +136,36 @@ files:
134
136
  - lib/stripe_mock/errors/unsupported_request_error.rb
135
137
  - lib/stripe_mock/instance.rb
136
138
  - lib/stripe_mock/request_handlers/accounts.rb
139
+ - lib/stripe_mock/request_handlers/balance.rb
137
140
  - lib/stripe_mock/request_handlers/balance_transactions.rb
138
141
  - lib/stripe_mock/request_handlers/cards.rb
139
142
  - lib/stripe_mock/request_handlers/charges.rb
143
+ - lib/stripe_mock/request_handlers/country_spec.rb
140
144
  - lib/stripe_mock/request_handlers/coupons.rb
141
145
  - lib/stripe_mock/request_handlers/customers.rb
142
146
  - lib/stripe_mock/request_handlers/disputes.rb
147
+ - lib/stripe_mock/request_handlers/ephemeral_key.rb
143
148
  - lib/stripe_mock/request_handlers/events.rb
149
+ - lib/stripe_mock/request_handlers/external_accounts.rb
144
150
  - lib/stripe_mock/request_handlers/helpers/bank_account_helpers.rb
145
151
  - lib/stripe_mock/request_handlers/helpers/card_helpers.rb
146
152
  - lib/stripe_mock/request_handlers/helpers/charge_helpers.rb
147
153
  - lib/stripe_mock/request_handlers/helpers/coupon_helpers.rb
154
+ - lib/stripe_mock/request_handlers/helpers/external_account_helpers.rb
148
155
  - lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb
149
156
  - lib/stripe_mock/request_handlers/helpers/token_helpers.rb
150
157
  - lib/stripe_mock/request_handlers/invoice_items.rb
151
158
  - lib/stripe_mock/request_handlers/invoices.rb
152
159
  - lib/stripe_mock/request_handlers/orders.rb
160
+ - lib/stripe_mock/request_handlers/payouts.rb
153
161
  - lib/stripe_mock/request_handlers/plans.rb
162
+ - lib/stripe_mock/request_handlers/products.rb
154
163
  - lib/stripe_mock/request_handlers/recipients.rb
164
+ - lib/stripe_mock/request_handlers/refunds.rb
155
165
  - lib/stripe_mock/request_handlers/sources.rb
166
+ - lib/stripe_mock/request_handlers/subscription_items.rb
156
167
  - lib/stripe_mock/request_handlers/subscriptions.rb
168
+ - lib/stripe_mock/request_handlers/tax_rates.rb
157
169
  - lib/stripe_mock/request_handlers/tokens.rb
158
170
  - lib/stripe_mock/request_handlers/transfers.rb
159
171
  - lib/stripe_mock/request_handlers/validators/param_validators.rb
@@ -164,14 +176,20 @@ files:
164
176
  - lib/stripe_mock/util.rb
165
177
  - lib/stripe_mock/version.rb
166
178
  - lib/stripe_mock/webhook_fixtures/account.application.deauthorized.json
179
+ - lib/stripe_mock/webhook_fixtures/account.external_account.created.json
180
+ - lib/stripe_mock/webhook_fixtures/account.external_account.deleted.json
181
+ - lib/stripe_mock/webhook_fixtures/account.external_account.updated.json
167
182
  - lib/stripe_mock/webhook_fixtures/account.updated.json
168
183
  - lib/stripe_mock/webhook_fixtures/balance.available.json
169
184
  - lib/stripe_mock/webhook_fixtures/charge.dispute.closed.json
170
185
  - lib/stripe_mock/webhook_fixtures/charge.dispute.created.json
186
+ - lib/stripe_mock/webhook_fixtures/charge.dispute.funds_reinstated.json
187
+ - lib/stripe_mock/webhook_fixtures/charge.dispute.funds_withdrawn.json
171
188
  - lib/stripe_mock/webhook_fixtures/charge.dispute.updated.json
172
189
  - lib/stripe_mock/webhook_fixtures/charge.failed.json
173
190
  - lib/stripe_mock/webhook_fixtures/charge.refunded.json
174
191
  - lib/stripe_mock/webhook_fixtures/charge.succeeded.json
192
+ - lib/stripe_mock/webhook_fixtures/charge.updated.json
175
193
  - lib/stripe_mock/webhook_fixtures/coupon.created.json
176
194
  - lib/stripe_mock/webhook_fixtures/coupon.deleted.json
177
195
  - lib/stripe_mock/webhook_fixtures/customer.created.json
@@ -203,6 +221,7 @@ files:
203
221
  - lib/stripe_mock/webhook_fixtures/transfer.updated.json
204
222
  - lib/trollop.rb
205
223
  - spec/_dummy/webhooks/dummy.event.json
224
+ - spec/api/instance_spec.rb
206
225
  - spec/fixtures/create_refund.yml
207
226
  - spec/fixtures/stripe_webhooks/account.updated.json
208
227
  - spec/fixtures/stripe_webhooks/custom.account.updated.json
@@ -214,23 +233,31 @@ files:
214
233
  - spec/readme_spec.rb
215
234
  - spec/server_spec.rb
216
235
  - spec/shared_stripe_examples/account_examples.rb
236
+ - spec/shared_stripe_examples/balance_examples.rb
217
237
  - spec/shared_stripe_examples/balance_transaction_examples.rb
218
238
  - spec/shared_stripe_examples/bank_examples.rb
219
239
  - spec/shared_stripe_examples/bank_token_examples.rb
220
240
  - spec/shared_stripe_examples/card_examples.rb
221
241
  - spec/shared_stripe_examples/card_token_examples.rb
222
242
  - spec/shared_stripe_examples/charge_examples.rb
243
+ - spec/shared_stripe_examples/country_specs_examples.rb
223
244
  - spec/shared_stripe_examples/coupon_examples.rb
224
245
  - spec/shared_stripe_examples/customer_examples.rb
225
246
  - spec/shared_stripe_examples/dispute_examples.rb
247
+ - spec/shared_stripe_examples/ephemeral_key_examples.rb
226
248
  - spec/shared_stripe_examples/error_mock_examples.rb
249
+ - spec/shared_stripe_examples/external_account_examples.rb
227
250
  - spec/shared_stripe_examples/extra_features_examples.rb
228
251
  - spec/shared_stripe_examples/invoice_examples.rb
229
252
  - spec/shared_stripe_examples/invoice_item_examples.rb
253
+ - spec/shared_stripe_examples/payout_examples.rb
230
254
  - spec/shared_stripe_examples/plan_examples.rb
255
+ - spec/shared_stripe_examples/product_example.rb
231
256
  - spec/shared_stripe_examples/recipient_examples.rb
232
257
  - spec/shared_stripe_examples/refund_examples.rb
233
258
  - spec/shared_stripe_examples/subscription_examples.rb
259
+ - spec/shared_stripe_examples/subscription_items_examples.rb
260
+ - spec/shared_stripe_examples/tax_rate_examples.rb
234
261
  - spec/shared_stripe_examples/transfer_examples.rb
235
262
  - spec/shared_stripe_examples/validation_examples.rb
236
263
  - spec/shared_stripe_examples/webhook_event_examples.rb
@@ -259,12 +286,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
286
  version: '0'
260
287
  requirements: []
261
288
  rubyforge_project:
262
- rubygems_version: 2.4.6
289
+ rubygems_version: 2.0.14.1
263
290
  signing_key:
264
291
  specification_version: 4
265
292
  summary: TDD with stripe
266
293
  test_files:
267
294
  - spec/_dummy/webhooks/dummy.event.json
295
+ - spec/api/instance_spec.rb
268
296
  - spec/fixtures/create_refund.yml
269
297
  - spec/fixtures/stripe_webhooks/account.updated.json
270
298
  - spec/fixtures/stripe_webhooks/custom.account.updated.json
@@ -276,23 +304,31 @@ test_files:
276
304
  - spec/readme_spec.rb
277
305
  - spec/server_spec.rb
278
306
  - spec/shared_stripe_examples/account_examples.rb
307
+ - spec/shared_stripe_examples/balance_examples.rb
279
308
  - spec/shared_stripe_examples/balance_transaction_examples.rb
280
309
  - spec/shared_stripe_examples/bank_examples.rb
281
310
  - spec/shared_stripe_examples/bank_token_examples.rb
282
311
  - spec/shared_stripe_examples/card_examples.rb
283
312
  - spec/shared_stripe_examples/card_token_examples.rb
284
313
  - spec/shared_stripe_examples/charge_examples.rb
314
+ - spec/shared_stripe_examples/country_specs_examples.rb
285
315
  - spec/shared_stripe_examples/coupon_examples.rb
286
316
  - spec/shared_stripe_examples/customer_examples.rb
287
317
  - spec/shared_stripe_examples/dispute_examples.rb
318
+ - spec/shared_stripe_examples/ephemeral_key_examples.rb
288
319
  - spec/shared_stripe_examples/error_mock_examples.rb
320
+ - spec/shared_stripe_examples/external_account_examples.rb
289
321
  - spec/shared_stripe_examples/extra_features_examples.rb
290
322
  - spec/shared_stripe_examples/invoice_examples.rb
291
323
  - spec/shared_stripe_examples/invoice_item_examples.rb
324
+ - spec/shared_stripe_examples/payout_examples.rb
292
325
  - spec/shared_stripe_examples/plan_examples.rb
326
+ - spec/shared_stripe_examples/product_example.rb
293
327
  - spec/shared_stripe_examples/recipient_examples.rb
294
328
  - spec/shared_stripe_examples/refund_examples.rb
295
329
  - spec/shared_stripe_examples/subscription_examples.rb
330
+ - spec/shared_stripe_examples/subscription_items_examples.rb
331
+ - spec/shared_stripe_examples/tax_rate_examples.rb
296
332
  - spec/shared_stripe_examples/transfer_examples.rb
297
333
  - spec/shared_stripe_examples/validation_examples.rb
298
334
  - spec/shared_stripe_examples/webhook_event_examples.rb
data/ChangeLog.rdoc DELETED
@@ -1,4 +0,0 @@
1
- === 0.1.0 / 2013-04-28
2
-
3
- * Initial release:
4
-