pagseguro-transparente 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab229b6f3625d815fcacfabd2141da3a26c5cb40
4
- data.tar.gz: 8625ca7d6d42ca4b921de0296d9dbe78d76952ed
3
+ metadata.gz: dc60e1846eeb8d5e1d717456936b2bad5d4d15a7
4
+ data.tar.gz: 9dbe4daa795770f44fedcfa2146b676a1095f89b
5
5
  SHA512:
6
- metadata.gz: 3599ad6440a6c63bd9c9d7ec5d82ca2aec3cca74645d5a6a470a6eab3ac7ffabb46dde4f390c461419e60cc03c29f12d9b97d29fbbadcd34fe285df07f312289
7
- data.tar.gz: 049105aa8cc58c8a7e09ad48c679b0dbdcef4b0d3cbe1263b37ae04a11a37f0e92cdf11bbb5a6015c6ccb300647caa2bbfabf1d88b7d54731420bf87beb7bff8
6
+ metadata.gz: 7bce6f42009c9611d2265a0ee4d5192aaf8634ae0f7b8317b3387f26668133a96a3bf425feac64d2c636bbbcb6722e28d44886f94527c23c4450154481b84b6b
7
+ data.tar.gz: f97787a57e8bf52baecc52ca75927cad8dbe406a40c092d3d6956e4cee79bec32f891f5362575641ff08c9d20ce59405026196a9fa234d244fe1e991ae770bc9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pagseguro-transparente (0.0.3)
4
+ pagseguro-transparente (0.0.5)
5
5
  activemodel
6
6
  httparty
7
7
  json
@@ -38,12 +38,12 @@ GEM
38
38
  i18n (0.6.9)
39
39
  json (1.8.1)
40
40
  mime-types (2.2)
41
- mini_portile (0.6.0)
41
+ mini_portile (0.5.3)
42
42
  minitest (5.3.3)
43
43
  multi_json (1.10.0)
44
44
  multi_xml (0.5.5)
45
- nokogiri (1.6.2.1)
46
- mini_portile (= 0.6.0)
45
+ nokogiri (1.6.1)
46
+ mini_portile (~> 0.5.0)
47
47
  rake (10.3.1)
48
48
  rest-client (1.6.7)
49
49
  mime-types (>= 1.16)
@@ -10,7 +10,7 @@ module PagSeguro
10
10
  end
11
11
 
12
12
  def transaction
13
- PagSeguro::Transaction.new get("/transactions/notifications/#{code}", email, token)
13
+ PagSeguro::Transaction.new get("/transactions/notifications/#{code}")
14
14
  end
15
15
  end
16
16
  end
@@ -7,8 +7,6 @@ module PagSeguro
7
7
  validates_presence_of :credit_card, if: :paid_with_card?
8
8
  validates_inclusion_of :payment_method, in: %w(creditCard boleto eft)
9
9
 
10
- attr_accessor :email, :token
11
-
12
10
  # Determines for which url PagSeguro will send the order related
13
11
  # notifications codes.
14
12
  # Optional. Any change happens in the transaction status, a new notification
@@ -64,12 +62,10 @@ module PagSeguro
64
62
  # Calls the PagSeguro web service and register this request for payment.
65
63
  def transaction
66
64
  params = Serializer.new(self).to_params
67
- PagSeguro::Transaction.new post('/transactions', email, token, params)
65
+ PagSeguro::Transaction.new post('/transactions', params)
68
66
  end
69
67
 
70
68
  def initialize(options = {})
71
- @email = options[:email]
72
- @token = options[:token]
73
69
  @currency = "BRL"
74
70
  @payment_mode = 'default'
75
71
  @notification_url = options[:notification_url]
@@ -7,28 +7,28 @@ module PagSeguro
7
7
 
8
8
  base_uri "https://ws.pagseguro.uol.com.br/v2/"
9
9
 
10
- def get(path, email, token)
10
+ def get(path)
11
11
  options = { query: {
12
- email: email || PagSeguro.email,
13
- token: token || PagSeguro.token
12
+ email: PagSeguro.email,
13
+ token: PagSeguro.token
14
14
  }
15
15
  }
16
16
  self.class.get(path, options)
17
17
  end
18
18
 
19
- def post(path, email, token, params = {})
20
- options = add_credencials(email, token, params)
19
+ def post(path, params = {})
20
+ options = add_credencials(params)
21
21
 
22
22
  response = self.class.post(path, options)
23
23
  response.parsed_response
24
24
  end
25
25
 
26
26
  private
27
- def add_credencials(email, token, params)
27
+ def add_credencials(params)
28
28
  options = { body:
29
29
  {
30
- email: email || PagSeguro.email,
31
- token: token || PagSeguro.token
30
+ email: PagSeguro.email,
31
+ token: PagSeguro.token
32
32
  }
33
33
  }
34
34
  options[:body].merge!(params)
@@ -1,14 +1,7 @@
1
1
  module PagSeguro
2
2
  class Session < Request
3
- attr_accessor :token, :email
4
-
5
3
  def create
6
- Response.new post('/sessions', email, token)
7
- end
8
-
9
- def initialize(email = nil, token = nil)
10
- @email = email
11
- @token = token
4
+ Response.new post('/sessions')
12
5
  end
13
6
  end
14
7
  end
@@ -1,3 +1,3 @@
1
1
  module PagSeguro
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -24,18 +24,5 @@ describe PagSeguro::Notification do
24
24
 
25
25
  it { should be_a_kind_of(PagSeguro::Transaction) }
26
26
  end
27
-
28
- context "with custom credencials" do
29
- subject { notification.transaction }
30
-
31
- let(:notification) { PagSeguro::Notification.new(code, type, 'custom_email', 'custom_token') }
32
-
33
- before do
34
- stub_request(:get, "https://ws.pagseguro.uol.com.br/v2/transactions/notifications/766B9C-AD4B044B04DA-77742F5FA653-E1AB24?email=custom_email&token=custom_token").
35
- to_return(:status => 200, :body => "", :headers => {})
36
- end
37
-
38
- it { should be_a_kind_of(PagSeguro::Transaction) }
39
- end
40
27
  end
41
28
  end
@@ -22,15 +22,5 @@ describe PagSeguro::Session do
22
22
 
23
23
  it { should be_a_kind_of(PagSeguro::Session::Response) }
24
24
  end
25
-
26
- context 'with custom email and token' do
27
- let(:session) { PagSeguro::Session.new('custom_email', 'custom_token') }
28
- before do
29
- stub_request(:post, "https://ws.pagseguro.uol.com.br/v2/sessions").
30
- with(body: "email=custom_email&token=custom_token").to_return(status: 200)
31
- end
32
-
33
- it { should be_a_kind_of(PagSeguro::Session::Response) }
34
- end
35
25
  end
36
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pagseguro-transparente
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cirdes Henrique