stripe-ruby-mock 2.0.3 → 2.0.4
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.
data/README.md
CHANGED
@@ -25,7 +25,7 @@ module StripeMock
|
|
25
25
|
|
26
26
|
private
|
27
27
|
|
28
|
-
def self.redirect_to_mock_server(method, url, api_key, params={}, headers={})
|
28
|
+
def self.redirect_to_mock_server(method, url, api_key, params={}, headers={}, api_base_url=nil)
|
29
29
|
handler = Instance.handler_for_method_url("#{method} #{url}")
|
30
30
|
mock_error = client.error_queue.error_for_handler_name(handler[:name])
|
31
31
|
if mock_error
|
data/lib/stripe_mock/data.rb
CHANGED
@@ -22,7 +22,7 @@ module StripeMock
|
|
22
22
|
},
|
23
23
|
subscriptions: {
|
24
24
|
object: "list",
|
25
|
-
|
25
|
+
total_count: 0,
|
26
26
|
url: "/v1/customers/#{cus_id}/subscriptions",
|
27
27
|
data: []
|
28
28
|
},
|
@@ -209,6 +209,7 @@ module StripeMock
|
|
209
209
|
object: 'invoice',
|
210
210
|
attempted: false,
|
211
211
|
closed: false,
|
212
|
+
forgiven: false,
|
212
213
|
paid: false,
|
213
214
|
livemode: false,
|
214
215
|
attempt_count: 0,
|
data/lib/stripe_mock/instance.rb
CHANGED
@@ -58,7 +58,7 @@ module StripeMock
|
|
58
58
|
@base_strategy = TestStrategies::Base.new
|
59
59
|
end
|
60
60
|
|
61
|
-
def mock_request(method, url, api_key, params={}, headers={})
|
61
|
+
def mock_request(method, url, api_key, params={}, headers={}, api_base_url=nil)
|
62
62
|
return {} if method == :xtest
|
63
63
|
|
64
64
|
# Ensure params hash has symbols as keys
|
@@ -26,7 +26,7 @@ module StripeMock
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def add_subscription_to_customer(cus, sub)
|
29
|
-
cus[:subscriptions][:
|
29
|
+
cus[:subscriptions][:total_count] = (cus[:subscriptions][:total_count] || 0) + 1
|
30
30
|
cus[:subscriptions][:data].unshift sub
|
31
31
|
end
|
32
32
|
|
@@ -34,7 +34,7 @@ module StripeMock
|
|
34
34
|
cus[:subscriptions][:data].reject!{|sub|
|
35
35
|
sub[:id] == subscription[:id]
|
36
36
|
}
|
37
|
-
cus[:subscriptions][:
|
37
|
+
cus[:subscriptions][:total_count] -=1
|
38
38
|
end
|
39
39
|
|
40
40
|
# `intervals` is set to 1 when calculating current_period_end from current_period_start & plan
|
data/lib/stripe_mock/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stripe-ruby-mock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-02-
|
12
|
+
date: 2015-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: stripe
|