stripe-ruby-mock 2.2.1 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -0
  3. data/README.md +7 -1
  4. data/lib/stripe_mock.rb +2 -0
  5. data/lib/stripe_mock/api/errors.rb +1 -1
  6. data/lib/stripe_mock/api/server.rb +8 -1
  7. data/lib/stripe_mock/api/webhooks.rb +1 -0
  8. data/lib/stripe_mock/data.rb +208 -0
  9. data/lib/stripe_mock/instance.rb +7 -2
  10. data/lib/stripe_mock/request_handlers/accounts.rb +14 -2
  11. data/lib/stripe_mock/request_handlers/charges.rb +3 -1
  12. data/lib/stripe_mock/request_handlers/customers.rb +7 -0
  13. data/lib/stripe_mock/request_handlers/disputes.rb +35 -0
  14. data/lib/stripe_mock/request_handlers/events.rb +5 -0
  15. data/lib/stripe_mock/request_handlers/helpers/card_helpers.rb +1 -1
  16. data/lib/stripe_mock/request_handlers/helpers/subscription_helpers.rb +15 -8
  17. data/lib/stripe_mock/request_handlers/invoices.rb +1 -0
  18. data/lib/stripe_mock/request_handlers/orders.rb +80 -0
  19. data/lib/stripe_mock/request_handlers/plans.rb +2 -1
  20. data/lib/stripe_mock/version.rb +1 -1
  21. data/lib/stripe_mock/webhook_fixtures/charge.failed.json +1 -1
  22. data/lib/stripe_mock/webhook_fixtures/charge.refunded.json +1 -1
  23. data/lib/stripe_mock/webhook_fixtures/charge.succeeded.json +1 -1
  24. data/lib/stripe_mock/webhook_fixtures/customer.created.json +1 -1
  25. data/lib/stripe_mock/webhook_fixtures/customer.updated.json +2 -2
  26. data/spec/integration_examples/prepare_error_examples.rb +1 -1
  27. data/spec/shared_stripe_examples/account_examples.rb +21 -2
  28. data/spec/shared_stripe_examples/charge_examples.rb +30 -0
  29. data/spec/shared_stripe_examples/customer_examples.rb +25 -0
  30. data/spec/shared_stripe_examples/dispute_examples.rb +87 -0
  31. data/spec/shared_stripe_examples/plan_examples.rb +9 -0
  32. data/spec/shared_stripe_examples/subscription_examples.rb +26 -1
  33. data/spec/shared_stripe_examples/webhook_event_examples.rb +66 -0
  34. data/spec/support/stripe_examples.rb +3 -2
  35. metadata +6 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1a65b2647db5f0f6f73a77e652adff727dd79961
4
- data.tar.gz: c099d2e35303617b14ed7a7a02d26f62db3277fd
3
+ metadata.gz: 8a3f469690e470da019f337118d96a77c8c79e94
4
+ data.tar.gz: 814f1be8eb9b4705d71cd4fa499471a013e721ca
5
5
  SHA512:
6
- metadata.gz: e1740053ed12209ef9ffceb2df5a136226a3bee058e212b86a2cf0d0079b3ad12598cadc3e4912b14e3b53bbc892679d6c15c97404147cc4cad6cbcbab845902
7
- data.tar.gz: 16df616215aae851e27b6d16f18855a5c78bc1014448cdb83b14becc5e860b88c772a2e3f7c633227164c4069acc6b3314a5c5286d2b56c9dc3a4face61e0ded
6
+ metadata.gz: 5d239d1dee0fb1d15899117d338474425d582645a1d3672e5dc0cb878b65ce4731df1aa5c38038b822fab7de268d8f5b7e522ceadc6eeeec5a95dca5bce12a26
7
+ data.tar.gz: 0f92c4bc3175302ac010f34bf27357dd2e2f48080e3b8463edb1972a5a6d07a667583452878b44ce1713e05643cf3f7ed340faac6ee40c706c47611ac625d38b
@@ -3,6 +3,8 @@ rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
5
  - 2.1.6
6
+ before_install:
7
+ - gem install bundler
6
8
  before_script:
7
9
  - "sudo touch /var/log/stripe-mock-server.log"
8
10
  - "sudo chown travis /var/log/stripe-mock-server.log"
data/README.md CHANGED
@@ -12,7 +12,7 @@ This gem has unexpectedly grown in popularity and I've gotten pretty busy, so I'
12
12
 
13
13
  In your gemfile:
14
14
 
15
- gem 'stripe-ruby-mock', '~> 2.2.1', :require => 'stripe_mock'
15
+ gem 'stripe-ruby-mock', '~> 2.2.2', :require => 'stripe_mock'
16
16
 
17
17
  ## Features
18
18
 
@@ -292,6 +292,12 @@ it "mocks a stripe webhook" do
292
292
  expect(customer_object.default_card).to_not be_nil
293
293
  # etc.
294
294
  end
295
+
296
+ it "mocks stripe connect webhooks" do
297
+ event = StripeMock.mock_webhook_event('customer.created', user_id: 'acc_123123')
298
+
299
+ expect(event.user_id).to eq('acc_123123')
300
+ end
295
301
  ```
296
302
 
297
303
  ### Customizing Webhooks
@@ -48,9 +48,11 @@ require 'stripe_mock/request_handlers/cards.rb'
48
48
  require 'stripe_mock/request_handlers/sources.rb'
49
49
  require 'stripe_mock/request_handlers/customers.rb'
50
50
  require 'stripe_mock/request_handlers/coupons.rb'
51
+ require 'stripe_mock/request_handlers/disputes.rb'
51
52
  require 'stripe_mock/request_handlers/events.rb'
52
53
  require 'stripe_mock/request_handlers/invoices.rb'
53
54
  require 'stripe_mock/request_handlers/invoice_items.rb'
55
+ require 'stripe_mock/request_handlers/orders.rb'
54
56
  require 'stripe_mock/request_handlers/plans.rb'
55
57
  require 'stripe_mock/request_handlers/recipients.rb'
56
58
  require 'stripe_mock/request_handlers/transfers.rb'
@@ -34,7 +34,7 @@ module StripeMock
34
34
  card_declined: add_json_body(["The card was declined", nil, 'card_declined', 402]),
35
35
  missing: add_json_body(["There is no card on a customer that is being charged.", nil, 'missing', 402]),
36
36
  processing_error: add_json_body(["An error occurred while processing the card", nil, 'processing_error', 402]),
37
- card_error: add_json_body(['This card number looks invalid.', 'number', 'invalid_number', 402])
37
+ card_error: add_json_body(['The card number is not a valid credit card number.', 'number', 'invalid_number', 402])
38
38
  }
39
39
  end
40
40
 
@@ -21,7 +21,14 @@ module StripeMock
21
21
  ){
22
22
  StripeMock::Server.start_new(opts)
23
23
  }
24
- at_exit { kill_server(pid_path) }
24
+ at_exit {
25
+ begin
26
+ e = $! # last exception
27
+ kill_server(pid_path)
28
+ ensure
29
+ raise e if $! != e
30
+ end
31
+ }
25
32
  end
26
33
 
27
34
  def kill_server(pid_path=nil)
@@ -15,6 +15,7 @@ module StripeMock
15
15
 
16
16
  json = Stripe::Util.symbolize_names(json)
17
17
  params = Stripe::Util.symbolize_names(params)
18
+ json[:user_id] = params.delete(:user_id) if params.key?(:user_id)
18
19
  json[:data][:object] = Util.rmerge(json[:data][:object], params)
19
20
  json.delete(:id)
20
21
 
@@ -15,7 +15,79 @@ module StripeMock
15
15
  currencies_supported: [
16
16
  "usd"
17
17
  ],
18
+ default_currency: "usd",
19
+ country: "US",
20
+ object: "account",
21
+ business_name: "Stripe.com",
22
+ business_url: nil,
23
+ support_phone: nil,
24
+ managed: false,
25
+ product_description: nil,
26
+ debit_negative_balances: true,
27
+ bank_accounts: {
28
+ object: "list",
29
+ total_count: 0,
30
+ has_more: false,
31
+ url: "/v1/accounts/#{id}/bank_accounts",
32
+ data: [
18
33
 
34
+ ]
35
+ },
36
+ verification: {
37
+ fields_needed: [],
38
+ due_by: nil,
39
+ contacted: false
40
+ },
41
+ transfer_schedule: {
42
+ delay_days: 7,
43
+ interval: "daily"
44
+ },
45
+ tos_acceptance: {
46
+ ip: nil,
47
+ date: nil,
48
+ user_agent: nil
49
+ },
50
+ legal_entity: {
51
+ type: nil,
52
+ business_name: nil,
53
+ address: {
54
+ line1: nil,
55
+ line2: nil,
56
+ city: nil,
57
+ state: nil,
58
+ postal_code: nil,
59
+ country: "US"
60
+ },
61
+ first_name: nil,
62
+ last_name: nil,
63
+ personal_address: {
64
+ line1: nil,
65
+ line2: nil,
66
+ city: nil,
67
+ state: nil,
68
+ postal_code: nil,
69
+ country: nil
70
+ },
71
+ dob: {
72
+ day: nil,
73
+ month: nil,
74
+ year: nil
75
+ },
76
+ additional_owners: nil,
77
+ verification: {
78
+ status: "unverified",
79
+ document: nil,
80
+ details: nil
81
+ }
82
+ },
83
+ decline_charge_on: {
84
+ cvc_failure: false,
85
+ avs_failure: false
86
+ },
87
+ keys: {
88
+ secret: nil,
89
+ publishable: nil
90
+ }
19
91
  }.merge(params)
20
92
  end
21
93
 
@@ -32,6 +104,7 @@ module StripeMock
32
104
  delinquent: false,
33
105
  discount: nil,
34
106
  account_balance: 0,
107
+ currency: nil,
35
108
  sources: {
36
109
  object: "list",
37
110
  total_count: sources.size,
@@ -57,8 +130,15 @@ module StripeMock
57
130
  livemode: false,
58
131
  paid: true,
59
132
  amount: 0,
133
+ application_fee: nil,
60
134
  currency: "usd",
135
+ destination: nil,
136
+ fraud_details: {},
137
+ receipt_email: nil,
138
+ receipt_number: nil,
61
139
  refunded: false,
140
+ shipping: {},
141
+ statement_descriptor: "Charge #{charge_id}",
62
142
  status: 'succeeded',
63
143
  source: {
64
144
  object: "card",
@@ -89,6 +169,7 @@ module StripeMock
89
169
  url: "/v1/charges/#{charge_id}/refunds",
90
170
  data: []
91
171
  },
172
+ transfer: nil,
92
173
  balance_transaction: "txn_2dyYXXP90MN26R",
93
174
  failure_message: nil,
94
175
  failure_code: nil,
@@ -224,9 +305,17 @@ module StripeMock
224
305
  customer: "test_customer",
225
306
  object: 'invoice',
226
307
  attempted: false,
308
+ application_fee: nil,
227
309
  closed: false,
310
+ description: nil,
228
311
  forgiven: false,
312
+ metadata: {},
229
313
  paid: false,
314
+ receipt_number: nil,
315
+ statement_descriptor: nil,
316
+ tax: nil,
317
+ tax_percent: nil,
318
+ webhooks_delivered_at: 1349825350,
230
319
  livemode: false,
231
320
  attempt_count: 0,
232
321
  amount_due: lines.map {|line| line[:amount]}.reduce(0, :+),
@@ -248,12 +337,14 @@ module StripeMock
248
337
  livemode: false,
249
338
  amount: 1000,
250
339
  currency: "usd",
340
+ discountable: false,
251
341
  proration: false,
252
342
  period: {
253
343
  start: 1349738920,
254
344
  end: 1349738920
255
345
  },
256
346
  quantity: nil,
347
+ subscription: nil,
257
348
  plan: nil,
258
349
  description: "Test invoice item",
259
350
  metadata: {}
@@ -297,6 +388,54 @@ module StripeMock
297
388
  }
298
389
  end
299
390
 
391
+ def self.mock_order(order_items, params)
392
+ or_id = params[:id] || "test_or_default"
393
+ order_items << Data.mock_order_item if order_items.empty?
394
+ {
395
+ id: or_id,
396
+ object: "order",
397
+ amount: 5000,
398
+ application: nil,
399
+ application_fee: nil,
400
+ charge: nil,
401
+ created: 1448272783,
402
+ currency: "eur",
403
+ customer: nil,
404
+ email: nil,
405
+ items: order_items,
406
+ livemode: false,
407
+ metadata: {},
408
+ selected_shipping_method: nil,
409
+ shipping: {
410
+ address: {
411
+ city: "Anytown",
412
+ country: "US",
413
+ line1: "1234 Main street",
414
+ line2: nil,
415
+ postal_code: "123456",
416
+ state: nil
417
+ },
418
+ name: "Jenny Rosen",
419
+ phone: nil
420
+ },
421
+ shipping_methods: nil,
422
+ status: "created",
423
+ updated: 1448272783
424
+ }.merge(params)
425
+ end
426
+
427
+ def self.mock_order_item(params={})
428
+ {
429
+ object: "order_item",
430
+ amount: 5000,
431
+ currency: "eur",
432
+ description: "Anyitem",
433
+ parent: "sku_parent",
434
+ quantity: 1,
435
+ type: "sku"
436
+ }.merge(params)
437
+ end
438
+
300
439
  def self.mock_plan(params={})
301
440
  {
302
441
  interval: "month",
@@ -408,6 +547,75 @@ module StripeMock
408
547
  }.merge(params)
409
548
  end
410
549
 
550
+ def self.mock_disputes(ids=[])
551
+ disputes = {}
552
+ ids.each do |id|
553
+ disputes[id] = self.mock_dispute(id: id)
554
+ end
555
+ disputes
556
+ end
557
+
558
+ def self.mock_dispute(params={})
559
+ id = params[:id] || "dp_test_dispute"
560
+ {
561
+ :id => id,
562
+ :object => "dispute",
563
+ :amount => 195,
564
+ :balance_transactions => [],
565
+ :charge => "ch_15RsQR2eZvKYlo2CA8IfzCX0",
566
+ :created => 1422915137,
567
+ :currency => "usd",
568
+ :evidence => self.mock_dispute_evidence,
569
+ :evidence_details => self.mock_dispute_evidence_details,
570
+ :is_charge_refundable => false,
571
+ :livemode => false,
572
+ :metadata => {},
573
+ :reason => "general",
574
+ :status => "under_review"
575
+ }.merge(params)
576
+ end
577
+
578
+ def self.mock_dispute_evidence
579
+ {
580
+ :access_activity_log => nil,
581
+ :billing_address => nil,
582
+ :cancellation_policy => nil,
583
+ :cancellation_policy_disclosure => nil,
584
+ :cancellation_rebuttal => nil,
585
+ :customer_communication => nil,
586
+ :customer_email_address => nil,
587
+ :customer_name => nil,
588
+ :customer_purchase_ip => nil,
589
+ :customer_signature => nil,
590
+ :duplicate_charge_documentation => nil,
591
+ :duplicate_charge_explanation => nil,
592
+ :duplicate_charge_id => nil,
593
+ :product_description => nil,
594
+ :receipt => nil,
595
+ :refund_policy => nil,
596
+ :refund_policy_disclosure => nil,
597
+ :refund_refusal_explanation => nil,
598
+ :service_date => nil,
599
+ :service_documentation => nil,
600
+ :shipping_address => nil,
601
+ :shipping_carrier => nil,
602
+ :shipping_date => nil,
603
+ :shipping_documentation => nil,
604
+ :shipping_tracking_number => nil,
605
+ :uncategorized_file => nil,
606
+ :uncategorized_text => nil
607
+ }
608
+ end
609
+
610
+ def self.mock_dispute_evidence_details
611
+ {
612
+ :due_by => 1424303999,
613
+ :has_evidence => false,
614
+ :past_due => false,
615
+ :submission_count => 0
616
+ }
617
+ end
618
+
411
619
  def self.mock_transfer_array
412
620
  {
413
621
  :data => [test_transfer, test_transfer, test_transfer],
@@ -25,17 +25,20 @@ module StripeMock
25
25
  include StripeMock::RequestHandlers::Subscriptions # must be before Customers
26
26
  include StripeMock::RequestHandlers::Customers
27
27
  include StripeMock::RequestHandlers::Coupons
28
+ include StripeMock::RequestHandlers::Disputes
28
29
  include StripeMock::RequestHandlers::Events
29
30
  include StripeMock::RequestHandlers::Invoices
30
31
  include StripeMock::RequestHandlers::InvoiceItems
32
+ include StripeMock::RequestHandlers::Orders
31
33
  include StripeMock::RequestHandlers::Plans
32
34
  include StripeMock::RequestHandlers::Recipients
33
35
  include StripeMock::RequestHandlers::Transfers
34
36
  include StripeMock::RequestHandlers::Tokens
35
37
 
36
38
 
37
- attr_reader :accounts, :bank_tokens, :charges, :coupons, :customers, :events,
38
- :invoices, :invoice_items, :plans, :recipients, :transfers, :subscriptions
39
+ attr_reader :accounts, :bank_tokens, :charges, :coupons, :customers, :disputes, :events,
40
+ :invoices, :invoice_items, :orders, :plans, :recipients, :transfers,
41
+ :subscriptions
39
42
 
40
43
  attr_accessor :error_queue, :debug
41
44
 
@@ -46,9 +49,11 @@ module StripeMock
46
49
  @customers = {}
47
50
  @charges = {}
48
51
  @coupons = {}
52
+ @disputes = Data.mock_disputes(['dp_05RsQX2eZvKYlo2C0FRTGSSA','dp_15RsQX2eZvKYlo2C0ERTYUIA', 'dp_25RsQX2eZvKYlo2C0ZXCVBNM', 'dp_35RsQX2eZvKYlo2C0QAZXSWE', 'dp_45RsQX2eZvKYlo2C0EDCVFRT', 'dp_55RsQX2eZvKYlo2C0OIKLJUY', 'dp_65RsQX2eZvKYlo2C0ASDFGHJ', 'dp_75RsQX2eZvKYlo2C0EDCXSWQ', 'dp_85RsQX2eZvKYlo2C0UJMCDET', 'dp_95RsQX2eZvKYlo2C0EDFRYUI'])
49
53
  @events = {}
50
54
  @invoices = {}
51
55
  @invoice_items = {}
56
+ @orders = {}
52
57
  @plans = {}
53
58
  @recipients = {}
54
59
  @transfers = {}
@@ -13,12 +13,14 @@ module StripeMock
13
13
  def new_account(route, method_url, params, headers)
14
14
  params[:id] ||= new_id('acct')
15
15
  route =~ method_url
16
- accounts[ params[:id] ] ||= Data.mock_account(params)
16
+ accounts[params[:id]] ||= Data.mock_account(params)
17
17
  end
18
18
 
19
19
  def get_account(route, method_url, params, headers)
20
20
  route =~ method_url
21
- Data.mock_account
21
+ init_account
22
+ id = $1 || accounts.keys[0]
23
+ assert_existence :account, id, accounts[id]
22
24
  end
23
25
 
24
26
  def update_account(route, method_url, params, headers)
@@ -28,8 +30,18 @@ module StripeMock
28
30
  end
29
31
 
30
32
  def list_accounts(route, method_url, params, headers)
33
+ init_account
31
34
  Data.mock_list_object(accounts.values, params)
32
35
  end
36
+
37
+ private
38
+
39
+ def init_account
40
+ if accounts == {}
41
+ acc = Data.mock_account
42
+ accounts[acc[:id]] = acc
43
+ end
44
+ end
33
45
  end
34
46
  end
35
47
  end
@@ -44,7 +44,7 @@ module StripeMock
44
44
  raise Stripe::InvalidRequestError.new("Received unknown parameters: #{disallowed.join(', ')}" , '', 400)
45
45
  end
46
46
 
47
- charges[id] = charge.merge(params)
47
+ charges[id] = Util.rmerge(charge, params)
48
48
  end
49
49
 
50
50
  def get_charges(route, method_url, params, headers)
@@ -142,6 +142,8 @@ module StripeMock
142
142
  params[:refunds].has_key?(:data) && params[:refunds][:data].nil?)
143
143
  allowed << :refunds
144
144
  end
145
+
146
+ allowed
145
147
  end
146
148
  end
147
149
  end
@@ -62,6 +62,13 @@ module StripeMock
62
62
  # Delete those params if their value is nil. Workaround of the problematic way Stripe serialize objects
63
63
  params.delete(:sources) if params[:sources] && params[:sources][:data].nil?
64
64
  params.delete(:subscriptions) if params[:subscriptions] && params[:subscriptions][:data].nil?
65
+ # Delete those params if their values aren't valid. Workaround of the problematic way Stripe serialize objects
66
+ if params[:sources] && !params[:sources][:data].nil?
67
+ params.delete(:sources) unless params[:sources][:data].any?{ |v| !!v[:type]}
68
+ end
69
+ if params[:subscriptions] && !params[:subscriptions][:data].nil?
70
+ params.delete(:subscriptions) unless params[:subscriptions][:data].any?{ |v| !!v[:type]}
71
+ end
65
72
  cus.merge!(params)
66
73
 
67
74
  if params[:source]
@@ -0,0 +1,35 @@
1
+ module StripeMock
2
+ module RequestHandlers
3
+ module Disputes
4
+
5
+ def Disputes.included(klass)
6
+ klass.add_handler 'get /v1/disputes/(.*)', :get_dispute
7
+ klass.add_handler 'post /v1/disputes/(.*)/close', :close_dispute
8
+ klass.add_handler 'post /v1/disputes/(.*)', :update_dispute
9
+ klass.add_handler 'get /v1/disputes', :list_disputes
10
+ end
11
+
12
+ def get_dispute(route, method_url, params, headers)
13
+ route =~ method_url
14
+ assert_existence :dispute, $1, disputes[$1]
15
+ end
16
+
17
+ def update_dispute(route, method_url, params, headers)
18
+ dispute = get_dispute(route, method_url, params, headers)
19
+ dispute.merge!(params)
20
+ dispute
21
+ end
22
+
23
+ def close_dispute(route, method_url, params, headers)
24
+ dispute = get_dispute(route, method_url, params, headers)
25
+ dispute.merge!({:status => 'lost'})
26
+ dispute
27
+ end
28
+
29
+ def list_disputes(route, method_url, params, headers)
30
+ Data.mock_list_object(disputes.values, params)
31
+ end
32
+
33
+ end
34
+ end
35
+ end
@@ -4,6 +4,7 @@ module StripeMock
4
4
 
5
5
  def Events.included(klass)
6
6
  klass.add_handler 'get /v1/events/(.*)', :retrieve_event
7
+ klass.add_handler 'get /v1/events', :list_events
7
8
  end
8
9
 
9
10
  def retrieve_event(route, method_url, params, headers)
@@ -11,6 +12,10 @@ module StripeMock
11
12
  assert_existence :event, $1, events[$1]
12
13
  end
13
14
 
15
+ def list_events(route, method_url, params, headers)
16
+ Data.mock_list_object(events.values, params)
17
+ end
18
+
14
19
  end
15
20
  end
16
21
  end
@@ -29,7 +29,7 @@ module StripeMock
29
29
  object[:default_source] = card[:id] if is_customer
30
30
  cards_or_sources[:data] = [card]
31
31
  else
32
- cards_or_sources[:total_count] = cards_or_sources[:total_count] || 0 + 1
32
+ cards_or_sources[:total_count] = (cards_or_sources[:total_count] || 0) + 1
33
33
  (cards_or_sources[:data] ||= []) << card
34
34
  end
35
35
 
@@ -26,6 +26,13 @@ module StripeMock
26
26
  end
27
27
 
28
28
  def add_subscription_to_customer(cus, sub)
29
+ id = new_id('ch')
30
+ charges[id] = Data.mock_charge(:id => id, :customer => cus[:id], :amount => sub[:plan][:amount])
31
+ if cus[:currency].nil?
32
+ cus[:currency] = sub[:plan][:currency]
33
+ elsif cus[:currency] != sub[:plan][:currency]
34
+ raise Stripe::InvalidRequestError.new( "Can't combine currencies on a single customer. This customer has had a subscription, coupon, or invoice item with currency #{cus[:currency]}", 'currency', 400)
35
+ end
29
36
  cus[:subscriptions][:total_count] = (cus[:subscriptions][:total_count] || 0) + 1
30
37
  cus[:subscriptions][:data].unshift sub
31
38
  end
@@ -41,14 +48,14 @@ module StripeMock
41
48
  # `intervals` is set to 2 when calculating Stripe::Invoice.upcoming end from current_period_start & plan
42
49
  def get_ending_time(start_time, plan, intervals = 1)
43
50
  case plan[:interval]
44
- when "week"
45
- start_time + (604800 * (plan[:interval_count] || 1) * intervals)
46
- when "month"
47
- (Time.at(start_time).to_datetime >> ((plan[:interval_count] || 1) * intervals)).to_time.to_i
48
- when "year"
49
- (Time.at(start_time).to_datetime >> (12 * intervals)).to_time.to_i # max period is 1 year
50
- else
51
- start_time
51
+ when "week"
52
+ start_time + (604800 * (plan[:interval_count] || 1) * intervals)
53
+ when "month"
54
+ (Time.at(start_time).to_datetime >> ((plan[:interval_count] || 1) * intervals)).to_time.to_i
55
+ when "year"
56
+ (Time.at(start_time).to_datetime >> (12 * intervals)).to_time.to_i # max period is 1 year
57
+ else
58
+ start_time
52
59
  end
53
60
  end
54
61
 
@@ -85,6 +85,7 @@ module StripeMock
85
85
  type: "subscription",
86
86
  plan: subscription[:plan],
87
87
  amount: subscription[:plan][:amount],
88
+ discountable: true,
88
89
  quantity: 1,
89
90
  period: {
90
91
  start: subscription[:current_period_end],
@@ -0,0 +1,80 @@
1
+ module StripeMock
2
+ module RequestHandlers
3
+ module Orders
4
+
5
+ def Orders.included(klass)
6
+ klass.add_handler 'post /v1/orders', :new_order
7
+ klass.add_handler 'post /v1/orders/(.*)/pay', :pay_order
8
+ klass.add_handler 'post /v1/orders/(.*)', :update_order
9
+ klass.add_handler 'get /v1/orders/(.*)', :get_order
10
+ klass.add_handler 'get /v1/orders', :list_orders
11
+ end
12
+
13
+ def new_order(route, method_url, params, headers)
14
+ params[:id] ||= new_id('or')
15
+ order_items = []
16
+
17
+ unless params[:currency].to_s.size == 3
18
+ raise Stripe::InvalidRequestError.new('You must supply a currency', nil, 400)
19
+ end
20
+
21
+ if params[:items]
22
+ unless params[:items].is_a? Array
23
+ raise Stripe::InvalidRequestError.new('You must supply a list of items', nil, 400)
24
+ end
25
+
26
+ unless params[:items].first.is_a? Hash
27
+ raise Stripe::InvalidRequestError.new('You must supply an item', nil, 400)
28
+ end
29
+ end
30
+
31
+ orders[ params[:id] ] = Data.mock_order(order_items, params)
32
+
33
+ orders[ params[:id] ]
34
+ end
35
+
36
+ def update_order(route, method_url, params, headers)
37
+ route =~ method_url
38
+ order = assert_existence :order, $1, orders[$1]
39
+
40
+ if params[:metadata]
41
+ if params[:metadata].empty?
42
+ order[:metadata] = {}
43
+ else
44
+ order[:metadata].merge(params[:metadata])
45
+ end
46
+ end
47
+
48
+ if [:created, :paid, :canceled, :fulfilled, :returned].includes? params[:status]
49
+ order[:status] = params[:status]
50
+ end
51
+ order
52
+ end
53
+
54
+ def get_order(route, method_url, params, headers)
55
+ route =~ method_url
56
+ assert_existence :order, $1, orders[$1]
57
+ end
58
+
59
+ def pay_order(route, method_url, params, headers)
60
+ route =~ method_url
61
+ order = assert_existence :order, $1, orders[$1]
62
+
63
+ if params[:source].blank? && params[:customer].blank?
64
+ raise Stripe::InvalidRequestError.new('You must supply a source or customer', nil, 400)
65
+ end
66
+
67
+ charge_id = new_id('ch')
68
+ charges[charge_id] = Data.mock_charge(id: charge_id)
69
+ order[:charge] = charge_id
70
+ order[:status] = "paid"
71
+ order
72
+ end
73
+
74
+ def list_orders(route, method_url, params, headers)
75
+ Data.mock_list_object(orders.values, params)
76
+ end
77
+
78
+ end
79
+ end
80
+ end
@@ -32,7 +32,8 @@ module StripeMock
32
32
  end
33
33
 
34
34
  def list_plans(route, method_url, params, headers)
35
- Data.mock_list_object(plans.values)
35
+ limit = params[:limit] ? params[:limit] : 10
36
+ Data.mock_list_object(plans.values.first(limit), limit: limit)
36
37
  end
37
38
 
38
39
  end
@@ -1,4 +1,4 @@
1
1
  module StripeMock
2
2
  # stripe-ruby-mock version
3
- VERSION = "2.2.1"
3
+ VERSION = "2.2.2"
4
4
  end
@@ -14,7 +14,7 @@
14
14
  "amount": 1000,
15
15
  "currency": "usd",
16
16
  "refunded": false,
17
- "card": {
17
+ "source": {
18
18
  "id": "cc_00000000000000",
19
19
  "object": "card",
20
20
  "last4": "4242",
@@ -14,7 +14,7 @@
14
14
  "amount": 1000,
15
15
  "currency": "usd",
16
16
  "refunded": true,
17
- "card": {
17
+ "source": {
18
18
  "id": "cc_00000000000000",
19
19
  "object": "card",
20
20
  "last4": "4242",
@@ -14,7 +14,7 @@
14
14
  "amount": 1000,
15
15
  "currency": "usd",
16
16
  "refunded": false,
17
- "card": {
17
+ "source": {
18
18
  "id": "cc_00000000000000",
19
19
  "object": "card",
20
20
  "last4": "4242",
@@ -18,7 +18,7 @@
18
18
  "subscription": null,
19
19
  "discount": null,
20
20
  "account_balance": 0,
21
- "cards": {
21
+ "sources": {
22
22
  "object": "list",
23
23
  "count": 1,
24
24
  "url": "/v1/customers/cus_2I2AhGQOPmEFeu/cards",
@@ -18,7 +18,7 @@
18
18
  "subscription": null,
19
19
  "discount": null,
20
20
  "account_balance": 0,
21
- "cards": {
21
+ "sources": {
22
22
  "object": "list",
23
23
  "count": 1,
24
24
  "url": "/v1/customers/cus_2I2AhGQOPmEFeu/cards",
@@ -48,7 +48,7 @@
48
48
  }
49
49
  ]
50
50
  },
51
- "default_card": "cc_2I2akIhmladin5"
51
+ "default_source": "cc_2I2akIhmladin5"
52
52
  },
53
53
  "previous_attributes": {
54
54
  "description": "Old description"
@@ -32,7 +32,7 @@ shared_examples 'Card Error Prep' do
32
32
  expect(err[:type]).to eq 'card_error'
33
33
  expect(err[:param]).to eq 'number'
34
34
  expect(err[:code]).to eq 'invalid_number'
35
- expect(err[:message]).to eq 'This card number looks invalid.'
35
+ expect(err[:message]).to eq 'The card number is not a valid credit card number.'
36
36
  end
37
37
  end
38
38
  end
@@ -7,11 +7,30 @@ shared_examples 'Account API' do
7
7
  expect(account).to be_a Stripe::Account
8
8
  expect(account.id).to match /acct\_/
9
9
  end
10
+ it 'retrieves a specific stripe account' do
11
+ account = Stripe::Account.retrieve('acct_103ED82ePvKYlo2C')
10
12
 
11
- it 'all', live: true do
13
+ expect(account).to be_a Stripe::Account
14
+ expect(account.id).to match /acct\_/
15
+ end
16
+ it 'retrieves all' do
12
17
  accounts = Stripe::Account.all
13
18
 
14
19
  expect(accounts).to be_a Stripe::ListObject
15
- expect(accounts.data).to eq []
20
+ expect(accounts.data.count).to satisfy { |n| n >= 1 }
21
+ end
22
+ it 'creates one more account' do
23
+ account = Stripe::Account.create(email: 'lol@what.com')
24
+
25
+ expect(account).to be_a Stripe::Account
26
+ end
27
+ it 'updates account' do
28
+ account = Stripe::Account.retrieve
29
+ account.support_phone = '1234567'
30
+ account.save
31
+
32
+ account = Stripe::Account.retrieve
33
+
34
+ expect(account.support_phone).to eq '1234567'
16
35
  end
17
36
  end
@@ -156,6 +156,36 @@ shared_examples 'Charge API' do
156
156
  expect(updated.fraud_details.to_hash).to eq(charge.fraud_details.to_hash)
157
157
  end
158
158
 
159
+ it "marks a charge as safe" do
160
+ original = Stripe::Charge.create({
161
+ amount: 777,
162
+ currency: 'USD',
163
+ source: stripe_helper.generate_card_token
164
+ })
165
+ charge = Stripe::Charge.retrieve(original.id)
166
+
167
+ charge.mark_as_safe
168
+
169
+ updated = Stripe::Charge.retrieve(original.id)
170
+ expect(updated.fraud_details[:user_report]).to eq "safe"
171
+ end
172
+
173
+ it "does not lose data when updating a charge" do
174
+ original = Stripe::Charge.create({
175
+ amount: 777,
176
+ currency: 'USD',
177
+ source: stripe_helper.generate_card_token,
178
+ metadata: {:foo => "bar"}
179
+ })
180
+ original.metadata[:receipt_id] = 1234
181
+ original.save
182
+
183
+ updated = Stripe::Charge.retrieve(original.id)
184
+
185
+ expect(updated.metadata[:foo]).to eq "bar"
186
+ expect(updated.metadata[:receipt_id]).to eq 1234
187
+ end
188
+
159
189
  it "disallows most parameters on updating a stripe charge" do
160
190
  original = Stripe::Charge.create({
161
191
  amount: 777,
@@ -318,6 +318,31 @@ shared_examples 'Customer API' do
318
318
  expect(original.default_source).to_not eq(card.id)
319
319
  end
320
320
 
321
+ it "still has sources after save when sources unchanged" do
322
+ original = Stripe::Customer.create(source: gen_card_tk)
323
+ card = original.sources.data.first
324
+ card_id = card.id
325
+ expect(original.sources.total_count).to eq(1)
326
+
327
+ original.save
328
+
329
+ expect(original.sources.data.first.id).to eq(card_id)
330
+ expect(original.sources.total_count).to eq(1)
331
+ end
332
+
333
+ it "still has subscriptions after save when subscriptions unchanged" do
334
+ plan = stripe_helper.create_plan(id: 'silver')
335
+ original = Stripe::Customer.create(source: gen_card_tk, plan: 'silver')
336
+ subscription = original.subscriptions.data.first
337
+ subscription_id = subscription.id
338
+ expect(original.subscriptions.total_count).to eq(1)
339
+
340
+ original.save
341
+
342
+ expect(original.subscriptions.data.first.id).to eq(subscription_id)
343
+ expect(original.subscriptions.total_count).to eq(1)
344
+ end
345
+
321
346
  it "deletes a customer" do
322
347
  customer = Stripe::Customer.create(id: 'test_customer_sub')
323
348
  customer = customer.delete
@@ -0,0 +1,87 @@
1
+ require 'spec_helper'
2
+ require 'pp'
3
+
4
+ shared_examples 'Dispute API' do
5
+
6
+ it "returns an error if dispute does not exist" do
7
+ dispute_id = 'dp_xxxxxxxxxxxxxxxxxxxxxxxx'
8
+
9
+ expect {
10
+ Stripe::Dispute.retrieve(dispute_id)
11
+ }.to raise_error { |e|
12
+ expect(e).to be_a(Stripe::InvalidRequestError)
13
+ expect(e.message).to eq('No such dispute: ' + dispute_id)
14
+ }
15
+ end
16
+
17
+ it "retrieves a single dispute" do
18
+ dispute_id = 'dp_05RsQX2eZvKYlo2C0FRTGSSA'
19
+ dispute = Stripe::Dispute.retrieve(dispute_id)
20
+
21
+ expect(dispute).to be_a(Stripe::Dispute)
22
+ expect(dispute.id).to eq(dispute_id)
23
+ end
24
+
25
+ it "updates a dispute" do
26
+ dispute_id = 'dp_65RsQX2eZvKYlo2C0ASDFGHJ'
27
+ dispute = Stripe::Dispute.retrieve(dispute_id)
28
+
29
+ expect(dispute).to be_a(Stripe::Dispute)
30
+ expect(dispute.id).to eq(dispute_id)
31
+ expect(dispute.evidence.customer_name).to eq(nil)
32
+ expect(dispute.evidence.product_description).to eq(nil)
33
+ expect(dispute.evidence.shipping_documentation).to eq(nil)
34
+
35
+ dispute.evidence = {
36
+ :customer_name => 'Rebel Idealist',
37
+ :product_description => 'Lorem ipsum dolor sit amet.',
38
+ :shipping_documentation => 'fil_15BZxW2eZvKYlo2CvQbrn9dc',
39
+ }
40
+ dispute.save
41
+
42
+ dispute = Stripe::Dispute.retrieve(dispute_id)
43
+
44
+ expect(dispute).to be_a(Stripe::Dispute)
45
+ expect(dispute.id).to eq(dispute_id)
46
+ expect(dispute.evidence.customer_name).to eq('Rebel Idealist')
47
+ expect(dispute.evidence.product_description).to eq('Lorem ipsum dolor sit amet.')
48
+ expect(dispute.evidence.shipping_documentation).to eq('fil_15BZxW2eZvKYlo2CvQbrn9dc')
49
+ end
50
+
51
+ it "closes a dispute" do
52
+ dispute_id = 'dp_75RsQX2eZvKYlo2C0EDCXSWQ'
53
+
54
+ dispute = Stripe::Dispute.retrieve(dispute_id)
55
+
56
+ expect(dispute).to be_a(Stripe::Dispute)
57
+ expect(dispute.id).to eq(dispute_id)
58
+ expect(dispute.status).to eq('under_review')
59
+
60
+ dispute.close
61
+
62
+ dispute = Stripe::Dispute.retrieve(dispute_id)
63
+
64
+ expect(dispute).to be_a(Stripe::Dispute)
65
+ expect(dispute.id).to eq(dispute_id)
66
+ expect(dispute.status).to eq('lost')
67
+ end
68
+
69
+ describe "listing disputes" do
70
+
71
+ it "retrieves all disputes" do
72
+ disputes = Stripe::Dispute.all
73
+
74
+ expect(disputes.count).to eq(10)
75
+ expect(disputes.map &:id).to include('dp_05RsQX2eZvKYlo2C0FRTGSSA','dp_15RsQX2eZvKYlo2C0ERTYUIA', 'dp_25RsQX2eZvKYlo2C0ZXCVBNM', 'dp_35RsQX2eZvKYlo2C0QAZXSWE', 'dp_45RsQX2eZvKYlo2C0EDCVFRT', 'dp_55RsQX2eZvKYlo2C0OIKLJUY', 'dp_65RsQX2eZvKYlo2C0ASDFGHJ', 'dp_75RsQX2eZvKYlo2C0EDCXSWQ', 'dp_85RsQX2eZvKYlo2C0UJMCDET', 'dp_95RsQX2eZvKYlo2C0EDFRYUI')
76
+ end
77
+
78
+ it "retrieves disputes with a limit(3)" do
79
+ disputes = Stripe::Dispute.all(limit: 3)
80
+
81
+ expect(disputes.count).to eq(3)
82
+ expect(disputes.map &:id).to include('dp_05RsQX2eZvKYlo2C0FRTGSSA','dp_15RsQX2eZvKYlo2C0ERTYUIA', 'dp_25RsQX2eZvKYlo2C0ZXCVBNM')
83
+ end
84
+
85
+ end
86
+
87
+ end
@@ -101,6 +101,15 @@ shared_examples 'Plan API' do
101
101
  expect(all.map &:amount).to include(54321, 98765)
102
102
  end
103
103
 
104
+ it 'retrieves plans with limit' do
105
+ 101.times do | i|
106
+ stripe_helper.create_plan(id: "Plan #{i}", amount: 11)
107
+ end
108
+ all = Stripe::Plan.all(limit: 100)
109
+
110
+ expect(all.count).to eq(100)
111
+ end
112
+
104
113
 
105
114
  describe "Validation", :live => true do
106
115
  let(:params) { stripe_helper.create_plan_params }
@@ -8,7 +8,7 @@ shared_examples 'Customer Subscriptions' do
8
8
 
9
9
  context "creating a new subscription" do
10
10
  it "adds a new subscription to customer with none", :live => true do
11
- plan = stripe_helper.create_plan(id: 'silver', name: 'Silver Plan', amount: 4999)
11
+ plan = stripe_helper.create_plan(id: 'silver', name: 'Silver Plan', amount: 4999, currency: 'usd')
12
12
  customer = Stripe::Customer.create(source: gen_card_tk)
13
13
 
14
14
  expect(customer.subscriptions.data).to be_empty
@@ -25,13 +25,25 @@ shared_examples 'Customer Subscriptions' do
25
25
  expect(customer.subscriptions.data).to_not be_empty
26
26
  expect(customer.subscriptions.count).to eq(1)
27
27
  expect(customer.subscriptions.data.length).to eq(1)
28
+ expect(customer.charges.data.length).to eq(1)
29
+ expect(customer.currency).to eq( "usd" )
28
30
 
29
31
  expect(customer.subscriptions.data.first.id).to eq(sub.id)
30
32
  expect(customer.subscriptions.data.first.plan.to_hash).to eq(plan.to_hash)
31
33
  expect(customer.subscriptions.data.first.customer).to eq(customer.id)
32
34
  expect(customer.subscriptions.data.first.metadata.foo).to eq( "bar" )
33
35
  expect(customer.subscriptions.data.first.metadata.example).to eq( "yes" )
36
+ end
37
+
38
+ it 'creates a charge for the customer', live: true do
39
+ stripe_helper.create_plan(id: 'silver', name: 'Silver Plan', amount: 4999)
34
40
 
41
+ customer = Stripe::Customer.create(source: gen_card_tk)
42
+ customer.subscriptions.create({ :plan => 'silver', :metadata => { :foo => "bar", :example => "yes" } })
43
+ customer = Stripe::Customer.retrieve(customer.id)
44
+
45
+ expect(customer.charges.data.length).to eq(1)
46
+ expect(customer.charges.data.first.amount).to eq(4999)
35
47
  end
36
48
 
37
49
  it 'contains coupon object', live: true do
@@ -143,6 +155,19 @@ shared_examples 'Customer Subscriptions' do
143
155
  expect(customer.subscriptions.count).to eq(0)
144
156
  end
145
157
 
158
+ it "throws an error when subscribing the customer to a second plan in a different currency" do
159
+ usd_plan = stripe_helper.create_plan(id: 'enterprise_usd', amount: 499, currency: 'usd')
160
+ customer = Stripe::Customer.create(id: 'test_customer_sub', source: gen_card_tk)
161
+ usd_subscription = customer.subscriptions.create({ :plan => 'enterprise_usd' })
162
+
163
+ eur_plan = stripe_helper.create_plan(id: 'enterprise_eur', amount: 499, currency: 'eur')
164
+ expect { customer.subscriptions.create({ :plan => 'enterprise_eur' }) }.to raise_error {|e|
165
+ expect(e).to be_a Stripe::InvalidRequestError
166
+ expect(e.http_status).to eq(400)
167
+ expect(e.message).to_not be_nil
168
+ }
169
+ end
170
+
146
171
  it "subscribes a customer with no card to a plan with a free trial" do
147
172
  plan = stripe_helper.create_plan(id: 'trial', amount: 999, trial_period_days: 14)
148
173
  customer = Stripe::Customer.create(id: 'cardless')
@@ -70,6 +70,12 @@ shared_examples 'Webhook Events API' do
70
70
  expect(data[event_b.id][:id]).to eq(event_b.id)
71
71
  end
72
72
 
73
+ it "handles stripe connect event when user_id is present" do
74
+ acc_12314 = 'acc_12314'
75
+ event = StripeMock.mock_webhook_event('customer.created', user_id: acc_12314)
76
+ expect(event[:user_id]).to eq(acc_12314)
77
+ end
78
+
73
79
  it "retrieves an eveng using the event resource" do
74
80
  webhook_event = StripeMock.mock_webhook_event('plan.created')
75
81
  expect(webhook_event.id).to_not be_nil
@@ -123,4 +129,64 @@ shared_examples 'Webhook Events API' do
123
129
  }.to raise_error StripeMock::UnsupportedRequestError
124
130
  end
125
131
 
132
+ describe "listing events" do
133
+
134
+ it "retrieves all events" do
135
+ customer_created_event = StripeMock.mock_webhook_event('customer.created')
136
+ expect(customer_created_event).to be_a(Stripe::Event)
137
+ expect(customer_created_event.id).to_not be_nil
138
+
139
+ plan_created_event = StripeMock.mock_webhook_event('plan.created')
140
+ expect(plan_created_event).to be_a(Stripe::Event)
141
+ expect(plan_created_event.id).to_not be_nil
142
+
143
+ coupon_created_event = StripeMock.mock_webhook_event('coupon.created')
144
+ expect(coupon_created_event).to be_a(Stripe::Event)
145
+ expect(coupon_created_event).to_not be_nil
146
+
147
+ invoice_created_event = StripeMock.mock_webhook_event('invoice.created')
148
+ expect(invoice_created_event).to be_a(Stripe::Event)
149
+ expect(invoice_created_event).to_not be_nil
150
+
151
+ invoice_item_created_event = StripeMock.mock_webhook_event('invoiceitem.created')
152
+ expect(invoice_item_created_event).to be_a(Stripe::Event)
153
+ expect(invoice_item_created_event).to_not be_nil
154
+
155
+ events = Stripe::Event.all
156
+
157
+ expect(events.count).to eq(5)
158
+ expect(events.map &:id).to include(customer_created_event.id, plan_created_event.id, coupon_created_event.id, invoice_created_event.id, invoice_item_created_event.id)
159
+ expect(events.map &:type).to include('customer.created', 'plan.created', 'coupon.created', 'invoice.created', 'invoiceitem.created')
160
+ end
161
+
162
+ it "retrieves events with a limit(3)" do
163
+ customer_created_event = StripeMock.mock_webhook_event('customer.created')
164
+ expect(customer_created_event).to be_a(Stripe::Event)
165
+ expect(customer_created_event.id).to_not be_nil
166
+
167
+ plan_created_event = StripeMock.mock_webhook_event('plan.created')
168
+ expect(plan_created_event).to be_a(Stripe::Event)
169
+ expect(plan_created_event.id).to_not be_nil
170
+
171
+ coupon_created_event = StripeMock.mock_webhook_event('coupon.created')
172
+ expect(coupon_created_event).to be_a(Stripe::Event)
173
+ expect(coupon_created_event).to_not be_nil
174
+
175
+ invoice_created_event = StripeMock.mock_webhook_event('invoice.created')
176
+ expect(invoice_created_event).to be_a(Stripe::Event)
177
+ expect(invoice_created_event).to_not be_nil
178
+
179
+ invoice_item_created_event = StripeMock.mock_webhook_event('invoiceitem.created')
180
+ expect(invoice_item_created_event).to be_a(Stripe::Event)
181
+ expect(invoice_item_created_event).to_not be_nil
182
+
183
+ events = Stripe::Event.all(limit: 3)
184
+
185
+ expect(events.count).to eq(3)
186
+ expect(events.map &:id).to include(customer_created_event.id, plan_created_event.id, coupon_created_event.id)
187
+ expect(events.map &:type).to include('customer.created', 'plan.created', 'coupon.created')
188
+ end
189
+
190
+ end
191
+
126
192
  end
@@ -4,14 +4,15 @@ def require_stripe_examples
4
4
  Dir["./spec/integration_examples/**/*.rb"].each {|f| require f}
5
5
  end
6
6
 
7
- def it_behaves_like_stripe(&block)
7
+ def it_behaves_like_stripe(&block)
8
8
  it_behaves_like 'Account API', &block
9
9
  it_behaves_like 'Bank Account Token Mocking', &block
10
10
  it_behaves_like 'Card Token Mocking', &block
11
11
  it_behaves_like 'Card API', &block
12
12
  it_behaves_like 'Charge API', &block
13
13
  it_behaves_like 'Coupon API', &block
14
- it_behaves_like 'Customer API', &block
14
+ it_behaves_like 'Customer API', &block
15
+ it_behaves_like 'Dispute API', &block
15
16
  it_behaves_like 'Extra Features', &block
16
17
  it_behaves_like 'Invoice API', &block
17
18
  it_behaves_like 'Invoice Item API', &block
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stripe-ruby-mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilbert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-14 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: stripe
@@ -138,6 +138,7 @@ files:
138
138
  - lib/stripe_mock/request_handlers/charges.rb
139
139
  - lib/stripe_mock/request_handlers/coupons.rb
140
140
  - lib/stripe_mock/request_handlers/customers.rb
141
+ - lib/stripe_mock/request_handlers/disputes.rb
141
142
  - lib/stripe_mock/request_handlers/events.rb
142
143
  - lib/stripe_mock/request_handlers/helpers/card_helpers.rb
143
144
  - lib/stripe_mock/request_handlers/helpers/charge_helpers.rb
@@ -146,6 +147,7 @@ files:
146
147
  - lib/stripe_mock/request_handlers/helpers/token_helpers.rb
147
148
  - lib/stripe_mock/request_handlers/invoice_items.rb
148
149
  - lib/stripe_mock/request_handlers/invoices.rb
150
+ - lib/stripe_mock/request_handlers/orders.rb
149
151
  - lib/stripe_mock/request_handlers/plans.rb
150
152
  - lib/stripe_mock/request_handlers/recipients.rb
151
153
  - lib/stripe_mock/request_handlers/sources.rb
@@ -216,6 +218,7 @@ files:
216
218
  - spec/shared_stripe_examples/charge_examples.rb
217
219
  - spec/shared_stripe_examples/coupon_examples.rb
218
220
  - spec/shared_stripe_examples/customer_examples.rb
221
+ - spec/shared_stripe_examples/dispute_examples.rb
219
222
  - spec/shared_stripe_examples/error_mock_examples.rb
220
223
  - spec/shared_stripe_examples/extra_features_examples.rb
221
224
  - spec/shared_stripe_examples/invoice_examples.rb
@@ -275,6 +278,7 @@ test_files:
275
278
  - spec/shared_stripe_examples/charge_examples.rb
276
279
  - spec/shared_stripe_examples/coupon_examples.rb
277
280
  - spec/shared_stripe_examples/customer_examples.rb
281
+ - spec/shared_stripe_examples/dispute_examples.rb
278
282
  - spec/shared_stripe_examples/error_mock_examples.rb
279
283
  - spec/shared_stripe_examples/extra_features_examples.rb
280
284
  - spec/shared_stripe_examples/invoice_examples.rb