cieloz 0.0.15 → 0.0.16

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: 8fa10e8fb7d7ceb3ccf85ed8400c8cb6385a588a
4
- data.tar.gz: f852b5fc5c6649645ab1103b56c8dab3e5e38e5a
3
+ metadata.gz: bc58d2aeb4dcfa87510aebee7ec575afd4fd9a71
4
+ data.tar.gz: 7694e9c7a5290050fa512af92f197879354cebc2
5
5
  SHA512:
6
- metadata.gz: ef0d3965f96503fa4537d6c0d60fb665e00e873cf1ba296daf5bb405211689d3fa5b90176f3b89ec44cbf1c51def6323261b272ff1231d07b1aa912589938303
7
- data.tar.gz: 8f7b69358249d027ca89498c08469dabc39353db12a13f503bcab9dc401fdd877b2d4f30061c0b5fc97fbc45c08fee970ef03e5e1fcd1abbb921302e31eb6735
6
+ metadata.gz: c60d28b5fcab2951fc0d3008154f460ba16060ddc42a83e82bb15a4979b963ca0d4b716efe1d3f953f3dcaa05e73b13d324a44fd819ee1420ded6a7bccbddc45
7
+ data.tar.gz: b3b664d72fcb6792f0607b26ac2e56ea1423d487a2b60a4ec022c9f06697198d7781d50bae9711f7cd5f80ff014354c3b46aa5ae7b5f370853941db7517344d4
@@ -15,7 +15,7 @@ class Cieloz::Requisicao
15
15
  x = Builder::XmlMarkup.new
16
16
  x.instruct!
17
17
  name = self.class.name.demodulize
18
- x.tag! name.underscore.dasherize, id: id, versao: versao do
18
+ @xml = x.tag! name.underscore.dasherize, id: id, versao: versao do
19
19
  attributes.each { |attr, value|
20
20
  next if value.nil?
21
21
 
@@ -61,6 +61,15 @@ class Cieloz::Requisicao
61
61
  response_class.from body
62
62
  end
63
63
 
64
+ def requested_xml
65
+ if @xml
66
+ doc = Nokogiri::XML @xml
67
+ portador = '//requisicao-transacao//dados-portador'
68
+ doc.xpath(portador).children.each {|node| node.content = "*" }
69
+ doc.to_xml
70
+ end
71
+ end
72
+
64
73
  private
65
74
  def dash value
66
75
  value.to_s.gsub("@", "").dasherize
@@ -40,6 +40,12 @@ class Cieloz::RequisicaoTransacao
40
40
  indicador_nao_informado! if codigo_seguranca.blank?
41
41
  end
42
42
 
43
+ def mascara
44
+ num = numero.to_s
45
+ mask_size = num.length - 6
46
+ ("*" * mask_size) + num[mask_size..-1]
47
+ end
48
+
43
49
  def codigo_seguranca= codigo
44
50
  @indicador = INDICADOR_INFORMADO
45
51
  @codigo_seguranca = codigo
@@ -71,14 +77,14 @@ class Cieloz::RequisicaoTransacao
71
77
  end
72
78
 
73
79
  module TEST
74
- VISA = DadosPortador.new numero: 4012001037141112
75
- MACSTERCARD = DadosPortador.new numero: 5453010000066167
76
- VISA_NO_AUTH = DadosPortador.new numero: 4012001038443335
77
- MASTERCARD_NO_AUTH = DadosPortador.new numero: 5453010000066167
78
- AMEX = DadosPortador.new numero: 376449047333005
79
- ELO = DadosPortador.new numero: 6362970000457013
80
- DINERS = DadosPortador.new numero: 36490102462661
81
- DISCOVERY = DadosPortador.new numero: 6011020000245045
80
+ VISA_AUTH = DadosPortador.new numero: 4012001037141112
81
+ MASTERCARD_AUTH = DadosPortador.new numero: 5453010000066167
82
+ VISA = DadosPortador.new numero: 4012001038443335
83
+ MASTERCARD = DadosPortador.new numero: 5453010000066167
84
+ AMEX = DadosPortador.new numero: 376449047333005
85
+ ELO = DadosPortador.new numero: 6362970000457013
86
+ DINERS = DadosPortador.new numero: 36490102462661
87
+ DISCOVERY = DadosPortador.new numero: 6011020000245045
82
88
 
83
89
  constants.each { |c|
84
90
  flag = const_get c
@@ -1,3 +1,3 @@
1
1
  module Cieloz
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cieloz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fábio Luiz Nery de Miranda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-17 00:00:00.000000000 Z
11
+ date: 2013-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri