moip-assinaturas 0.1.2 → 0.1.3
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.
@@ -66,11 +66,11 @@ module Moip::Assinaturas
|
|
66
66
|
end
|
67
67
|
|
68
68
|
def suspend_subscription(code)
|
69
|
-
peform_action!(:put, "/subscriptions/#{code}/suspend", { headers: { 'Content-Type' => 'application/json' } })
|
69
|
+
peform_action!(:put, "/subscriptions/#{code}/suspend", { headers: { 'Content-Type' => 'application/json' } }, true)
|
70
70
|
end
|
71
71
|
|
72
72
|
def activate_subscription(code)
|
73
|
-
peform_action!(:put, "/subscriptions/#{code}/activate", { headers: { 'Content-Type' => 'application/json' } })
|
73
|
+
peform_action!(:put, "/subscriptions/#{code}/activate", { headers: { 'Content-Type' => 'application/json' } }, true)
|
74
74
|
end
|
75
75
|
|
76
76
|
def list_invoices(subscription_code)
|
@@ -60,7 +60,7 @@ module Moip::Assinaturas
|
|
60
60
|
response = Moip::Assinaturas::Client.suspend_subscription(code)
|
61
61
|
|
62
62
|
case response.code
|
63
|
-
when
|
63
|
+
when 200
|
64
64
|
return { success: true }
|
65
65
|
else
|
66
66
|
raise(WebServerResponseError, "Ocorreu um erro no retorno do webservice")
|
@@ -71,7 +71,7 @@ module Moip::Assinaturas
|
|
71
71
|
response = Moip::Assinaturas::Client.activate_subscription(code)
|
72
72
|
|
73
73
|
case response.code
|
74
|
-
when
|
74
|
+
when 200
|
75
75
|
return { success: true }
|
76
76
|
else
|
77
77
|
raise(WebServerResponseError, "Ocorreu um erro no retorno do webservice")
|
@@ -46,15 +46,15 @@ describe Moip::Assinaturas::Subscription do
|
|
46
46
|
FakeWeb.register_uri(
|
47
47
|
:put,
|
48
48
|
"https://TOKEN:KEY@api.moip.com.br/assinaturas/v1/subscriptions/assinatura1/activate",
|
49
|
-
body: '
|
50
|
-
status: [
|
49
|
+
body: '',
|
50
|
+
status: [200, 'OK']
|
51
51
|
)
|
52
52
|
|
53
53
|
FakeWeb.register_uri(
|
54
54
|
:put,
|
55
55
|
"https://TOKEN:KEY@api.moip.com.br/assinaturas/v1/subscriptions/assinatura1/suspend",
|
56
|
-
body: '
|
57
|
-
status: [
|
56
|
+
body: '',
|
57
|
+
status: [200, 'OK']
|
58
58
|
)
|
59
59
|
end
|
60
60
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moip-assinaturas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
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: 2014-01-
|
12
|
+
date: 2014-01-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|