bseller_ruby 0.1.3 → 0.1.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f39d0e4d45bbe244904d06127ffbbd07174ef49
4
- data.tar.gz: ed636fff174817508b78b79ab7666a715a95463f
3
+ metadata.gz: fa7ca94a147a6f72d0071718e7b6eeb56fd1ba97
4
+ data.tar.gz: 0dbb9619a4863cbabca07733ae8624c85a43c4bf
5
5
  SHA512:
6
- metadata.gz: bb9a4b73d369fce85bdb147b6a184f6f4ba50fe3698873f4f48a1c17ea085e76d6ee224f84590252809648e8dc1762714158eeb233dd5bec9f75d7ece1e9b124
7
- data.tar.gz: 676ea2a3513371767aceb39c1c090b98887759fc1cc4ab94b4ca9a78fd0d65612aa055adf306ab5b048c6bb10db037e81dd4edd471f0c7c2f580c2995d2a89d5
6
+ metadata.gz: c04f920e27c85745352ce2103d0961598b46955191f26c887fbc877e60b83958f65377b5b99ad994d097581b8af59b1ed4e097515779db760eff830b240d9c3b
7
+ data.tar.gz: a86ba7a6088788a8594c64d75ae161b79213a68db45d4a7a5277efea115cd2da90b4d4239541bd732f6c501dc7218a09edbb1af51834f129a6d1165dce5331c6
@@ -82,18 +82,26 @@ module BsellerRuby
82
82
  end
83
83
 
84
84
  def self.api
85
- @api ||= Savon.client wsdl: "#{ws['soap_endpoint']}/CPPedido?wsdl", log: ws['log'], read_timeout: 600, open_timeout: 600 do
85
+ log "#{ws['soap_endpoint']}/#{get_wsdl}?wsdl"
86
+ @api ||= Savon.client wsdl: "#{ws['soap_endpoint']}/#{get_wsdl}?wsdl", log: ws['log'], read_timeout: 600, open_timeout: 600 do
86
87
  convert_request_keys_to :camelcase
87
88
  end
88
89
  end
89
90
 
91
+ def self.get_wsdl
92
+ @method =~ /pagamento/ ? 'CPPagamento' : 'CPPedido'
93
+ end
90
94
  def self.ws
91
95
  BsellerRuby.config['ws']
92
96
  end
93
97
 
94
98
  def self.authentication
95
- @authentication ||= { 'idCia' => ws['cia_id'], 'usuario' => ws['username'], 'senha' => ws['password'] }
96
- @method.to_s.end_with?('pedido') ? {} : @authentication
99
+ if @method =~ /pagamento/
100
+ @authentication ||= { 'idCia' => ws['cia_id'], 'credencial' => { 'usuario' => ws['username'], 'senha' => ws['password'] } }
101
+ else
102
+ @authentication ||= { 'idCia' => ws['cia_id'], 'usuario' => ws['username'], 'senha' => ws['password'] }
103
+ @method.to_s.end_with?('pedido') ? {} : @authentication
104
+ end
97
105
  end
98
106
  end
99
107
  end
@@ -14,6 +14,10 @@ module BsellerRuby
14
14
  call(:confirma_consulta_entrega, params).result
15
15
  end
16
16
 
17
+ def self.payment(params)
18
+ call(:analise_pagamento, params).result
19
+ end
20
+
17
21
  #def self.sent_purchase
18
22
  #end
19
23
  #
@@ -18,7 +18,7 @@ module BsellerRuby
18
18
  private
19
19
 
20
20
  def doc
21
- @method =~ /confirm|envia_pedido/ || savon_hash =~ /CallableStatementCallback|PED_CLIENTE|sucesso/ ? savon_hash : xml_parser(savon_hash)
21
+ @method =~ /confirm|envia_pedido/ || savon_hash =~ /CallableStatementCallback|sucesso/ ? savon_hash : xml_parser(savon_hash)
22
22
  end
23
23
 
24
24
  def xml_parser(xml)
@@ -1,3 +1,3 @@
1
1
  module BsellerRuby
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bseller_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wesley Conde
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-02 00:00:00.000000000 Z
11
+ date: 2015-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: savon