bseller_ruby 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bseller_ruby/base.rb +11 -3
- data/lib/bseller_ruby/order.rb +4 -0
- data/lib/bseller_ruby/response.rb +1 -1
- data/lib/bseller_ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa7ca94a147a6f72d0071718e7b6eeb56fd1ba97
|
4
|
+
data.tar.gz: 0dbb9619a4863cbabca07733ae8624c85a43c4bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c04f920e27c85745352ce2103d0961598b46955191f26c887fbc877e60b83958f65377b5b99ad994d097581b8af59b1ed4e097515779db760eff830b240d9c3b
|
7
|
+
data.tar.gz: a86ba7a6088788a8594c64d75ae161b79213a68db45d4a7a5277efea115cd2da90b4d4239541bd732f6c501dc7218a09edbb1af51834f129a6d1165dce5331c6
|
data/lib/bseller_ruby/base.rb
CHANGED
@@ -82,18 +82,26 @@ module BsellerRuby
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def self.api
|
85
|
-
|
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
|
-
@
|
96
|
-
|
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
|
data/lib/bseller_ruby/order.rb
CHANGED
@@ -18,7 +18,7 @@ module BsellerRuby
|
|
18
18
|
private
|
19
19
|
|
20
20
|
def doc
|
21
|
-
@method =~ /confirm|envia_pedido/ || savon_hash =~ /CallableStatementCallback|
|
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)
|
data/lib/bseller_ruby/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2015-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|