pag_seguro 0.3.0 → 0.3.1

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
@@ -81,7 +81,7 @@ O código da notificação é enviado pelo PagSeguro através do parâmentro `no
81
81
  def create
82
82
  email = "seu_email_cadastrado@nopagseguro.com.br"
83
83
  token = "SEU_TOKEN_GERADO_NO_PAG_SEGURO"
84
- notification_code = params(:notificationCode)
84
+ notification_code = params[:notificationCode]
85
85
 
86
86
  notification = PagSeguro::Notification.new(email, token, notification_code)
87
87
 
@@ -19,11 +19,11 @@ module PagSeguro
19
19
 
20
20
  def name
21
21
  return nil unless valid_name?
22
- @name[0..49]
22
+ @name.gsub(/ +/, " ")[0..49]
23
23
  end
24
24
 
25
25
  def valid_name?
26
- @name =~ /\S+ \S+/
26
+ @name =~ /\S+ +\S+/
27
27
  end
28
28
 
29
29
  def phone_ddd
@@ -1,3 +1,3 @@
1
1
  module PagSeguro
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
@@ -9,7 +9,7 @@ def create_valid_payment
9
9
  PagSeguro::Item.new(id: 95, description: "A Towel", amount: "69.35", quantity: "2", weight: 400),
10
10
  PagSeguro::Item.new(id: 17, description: "A pipe", amount: "3.00", quantity: "89")
11
11
  ]
12
- payment.sender = PagSeguro::Sender.new(name: "Stefano Diem Benatti", email: "stefano@heavenstudio.com.br", phone_ddd: "11", phone_number: "93430994")
12
+ payment.sender = PagSeguro::Sender.new(name: "María Isabel Andrade ", email: "stefano@heavenstudio.com.br", phone_ddd: "11", phone_number: "93430994")
13
13
  payment.shipping = PagSeguro::Shipping.new(
14
14
  type: PagSeguro::Shipping::SEDEX,
15
15
  state: "SP",
@@ -64,6 +64,11 @@ describe PagSeguro::Sender do
64
64
  @sender.name.should == "a" * 50
65
65
  end
66
66
 
67
+ it "should crop spaces (because double spaces raises errors on pagseguro)" do
68
+ @sender.name = "Stefano Benatti"
69
+ @sender.name.should == "Stefano Benatti"
70
+ end
71
+
67
72
  it "should not show invalid phone ddd's" do
68
73
  @sender.phone_ddd = "111"
69
74
  @sender.phone_ddd.should be_nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pag_seguro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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: 2012-06-04 00:00:00.000000000 Z
12
+ date: 2012-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel