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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YmIwYjQ1Njc4MTUxOWVkOTY1ZWY1Y2EzN2NlNWY0OTM5ZWM4M2U0MA==
4
+ YjA1NjU2OTYyZWUzYmVmZTM4NjMxY2QzOWNmMGYwYWI0OWYwZTUzYQ==
5
5
  data.tar.gz: !binary |-
6
- ZGYxYjcxZGRkMDU1MDk0NTMxMGQ2ZDUxYzhiNzNkYTgyY2YyOWZiOQ==
6
+ NDk3ZjM3ZTAzZjRiZDNkMjU4YThmMGNkMzAwYmE2MTIyNDA0ZTBmMA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDgxYTQ4NjFkNGE3NTAwYzJlNjI0OWY3ZjRiNGUzZjJiZTUzMGEyMGExNzFi
10
- NzdmZjZlZjNmMzAzNDA3NTdlNjNjNWMwZWNlNGQ5ZWNkNGE1NTgyYWYxN2Iw
11
- ZDdmY2E3YmZlMzk0NWVmYzhmZWYxYmIwNWZiNjRkZGUyOTgxMmY=
9
+ MWVkMDg4NTQzNjY5M2ZkYjgyNzNmYjExNDMyYjA3ODU3M2IxNjIxOTgzYTcx
10
+ YzFkZjVmNjlhMTFhNTQ4MGJhYjBhOThjNDA2MTYxZWJkYWNmMDNjNjUzZmZj
11
+ NDFkNDVjZTQzNzVkZmE1ZGY4OWI0MjJmM2UyOTY3NTc5YmE2ZmE=
12
12
  data.tar.gz: !binary |-
13
- ZjIwNDM3NmNhY2E4MmU3NzZmYmZkMjE4Y2MzMTZkYTczZmZlZmNiZmM0OGM1
14
- NDFiYTBmM2VkYWNjMTM0NWVhZTlkZjVkYTQwMjhiZjQyNDE2MmU5NmMwYmQ5
15
- MjhlYzU4YzgzYTkyMjYzOTYzZTVhZWYxMWI5ODMxYWRjNjczZWI=
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.27'
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"
@@ -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.post(base_url(:customers, :code => self.code, :status => "billing_infos"), default_header(billing_info.build_update.to_json)).parsed_response
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
@@ -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 = self.class.new
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.code), default_header).parsed_response
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(:subscription_code => self.code).payments
59
+ @payments ||= Moip::Payment.build(:invoice => self.id).payments
60
60
  end
61
61
 
62
62
  end
@@ -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 = self.class.new
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.subscription_code, :status => "payments"), default_header).parsed_response
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
 
@@ -45,7 +45,7 @@ class Moip::Plan < Moip::Model
45
45
  def plans= hash
46
46
  @plans = []
47
47
  hash.each do |e|
48
- plan = self.class.new
48
+ plan = Moip::Plan.new
49
49
  plan.set_parameters e
50
50
  @plans << plan
51
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-moip-assinaturas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.27
4
+ version: 0.2.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Douglas Rossignolli