api-moip-assinaturas 0.2.27 → 0.2.32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/api_moip_assinaturas.gemspec +1 -1
- data/lib/moip/models/customer.rb +3 -2
- data/lib/moip/models/invoice.rb +3 -3
- data/lib/moip/models/payment.rb +2 -2
- data/lib/moip/models/plan.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjA1NjU2OTYyZWUzYmVmZTM4NjMxY2QzOWNmMGYwYWI0OWYwZTUzYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDk3ZjM3ZTAzZjRiZDNkMjU4YThmMGNkMzAwYmE2MTIyNDA0ZTBmMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWVkMDg4NTQzNjY5M2ZkYjgyNzNmYjExNDMyYjA3ODU3M2IxNjIxOTgzYTcx
|
10
|
+
YzFkZjVmNjlhMTFhNTQ4MGJhYjBhOThjNDA2MTYxZWJkYWNmMDNjNjUzZmZj
|
11
|
+
NDFkNDVjZTQzNzVkZmE1ZGY4OWI0MjJmM2UyOTY3NTc5YmE2ZmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZjljOGNhZWY4YzcxMTc5NmUwYWRjNjIzMmE5MjUwOTg3MjExZmIwNTdiMDEz
|
14
|
+
YWM1NDc2MTAxN2RkZjM4MzliODZiZjhmZGM2NDRjOTdmOWQyOTcxYjJhNDlj
|
15
|
+
YjQ4NmE4NDViOWVkMTgyM2I4Y2IzZjFiMjc1NWEzN2Y0YWYyM2I=
|
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'api-moip-assinaturas'
|
6
|
-
s.version = '0.2.
|
6
|
+
s.version = '0.2.32'
|
7
7
|
s.date = '2013-07-02'
|
8
8
|
s.summary = "Moip Assinaturas by Pixxel"
|
9
9
|
s.description = "Gem desenvolvida para atender aos requisitos do moip api de assinaturas"
|
data/lib/moip/models/customer.rb
CHANGED
@@ -76,7 +76,7 @@ class Moip::Customer < Moip::Model
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def validates_format_of_email
|
79
|
-
if self.email.match /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
|
79
|
+
if !self.email.nil? and self.email.match /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
|
80
80
|
true
|
81
81
|
else
|
82
82
|
self.errors.add :email, I18n.t("moip.errors.invalid_format") and return
|
@@ -115,7 +115,8 @@ class Moip::Customer < Moip::Model
|
|
115
115
|
# see http://moiplabs.github.io/assinaturas-docs/api.html#atualizar_cartao
|
116
116
|
def update_billing_info billing_info
|
117
117
|
if billing_info.valid?
|
118
|
-
response = self.class.
|
118
|
+
response = self.class.put(base_url(:customers, :code => self.code, :status => "billing_infos"), default_header(billing_info.build_update.to_json)).parsed_response
|
119
|
+
puts response
|
119
120
|
self.validate_response response
|
120
121
|
else
|
121
122
|
false
|
data/lib/moip/models/invoice.rb
CHANGED
@@ -23,7 +23,7 @@ class Moip::Invoice < Moip::Model
|
|
23
23
|
def invoices= hash
|
24
24
|
@invoices = []
|
25
25
|
hash.each do |e|
|
26
|
-
invoice =
|
26
|
+
invoice = Moip::Invoice.new
|
27
27
|
invoice.set_parameters e
|
28
28
|
@invoices << invoice
|
29
29
|
end
|
@@ -51,12 +51,12 @@ class Moip::Invoice < Moip::Model
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def find
|
54
|
-
response = self.class.get(base_url(:invoices, :code => self.
|
54
|
+
response = self.class.get(base_url(:invoices, :code => self.id), default_header).parsed_response
|
55
55
|
self.set_parameters response unless response.nil?
|
56
56
|
end
|
57
57
|
|
58
58
|
def payments
|
59
|
-
@payments ||= Moip::Payment.build(:
|
59
|
+
@payments ||= Moip::Payment.build(:invoice => self.id).payments
|
60
60
|
end
|
61
61
|
|
62
62
|
end
|
data/lib/moip/models/payment.rb
CHANGED
@@ -22,7 +22,7 @@ class Moip::Payment < Moip::Model
|
|
22
22
|
def payments= hash
|
23
23
|
@payments = []
|
24
24
|
hash.each do |e|
|
25
|
-
payment =
|
25
|
+
payment = Moip::Payment.new
|
26
26
|
payment.set_parameters e
|
27
27
|
@payments << payment
|
28
28
|
end
|
@@ -34,7 +34,7 @@ class Moip::Payment < Moip::Model
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def load
|
37
|
-
list = self.class.get(base_url(:invoices, :code => self.
|
37
|
+
list = self.class.get(base_url(:invoices, :code => self.invoice, :status => "payments"), default_header).parsed_response
|
38
38
|
self.payments = list["payments"]
|
39
39
|
end
|
40
40
|
|
data/lib/moip/models/plan.rb
CHANGED