sw_fac 0.3.58 → 0.3.58.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 053a99ed90bd5eb61ab4616e19fd44ab13b314ceed21b85bfd4cbd5e62463fd4
4
- data.tar.gz: af3aba5ee6cf0b770e6d9abcb451c9ed580981e6e78fd3961b09848c18c3ebab
3
+ metadata.gz: 5eae8e8ff634c17390c533c6b652bdc12c7ac27be0ee4436111ba340d2ff1cad
4
+ data.tar.gz: 4b39fc66e28f553a5bd85911fdb6cf29a631d115fa690b946b62ff0ddf6fd558
5
5
  SHA512:
6
- metadata.gz: 8eb95930bb7aedad4aefb38cbe09a5ae10926d37ea28b33b125d2e9cdd0c7f51fbdfa45daeba94d24591e1dd556349258ef1adf04b9a7eb935b55b827149b585
7
- data.tar.gz: 263a17bdd4b379cc40c13a7b4a288652f5186a895cea66687e9061a6ed46d552824a0e1773a2c1e5ec791c164f11d5c71f934cceb1467abc0ddd065542bd5cd2
6
+ metadata.gz: 3933c3d8948006205e8373caccb6797083e12127b8cc6125ba692b40af58d65302c89df7fec1c0293e5c02f7935a6a7809977346e13f5099a702fdc3f3ede89d
7
+ data.tar.gz: d410c5841b3cd3deec5ca6cae62bff2c847db723c8d5f88e489736fd4b664b742b0fa1348570a3832f8e5647891f9fa7530699108aa7581df16541541b3134eb
data/lib/sw_fac/config.rb CHANGED
@@ -4,6 +4,8 @@ module SwFac
4
4
  attr_reader :pem, :serial, :cadena, :key_pass, :pem_cadena
5
5
 
6
6
  def initialize(production_token, development_token, rfc, razon, regimen, doc_key_path, key_pass, doc_cer_path, production=false)
7
+ puts "---- SwFacturacion:config:initialize"
8
+
7
9
  @production_token = production_token.to_s
8
10
  @dev_token = development_token.to_s
9
11
  @rfc = rfc.to_s
@@ -21,6 +23,8 @@ module SwFac
21
23
  end
22
24
 
23
25
  def key_to_pem
26
+ puts "---- SwFacturacion:config:key_to_pem"
27
+
24
28
  @pem = %x[openssl pkcs8 -inform DER -in #{@doc_key_path} -passin pass:#{@key_pass}]
25
29
  @pem_cadena = @pem.clone
26
30
  @pem_cadena.slice!("-----BEGIN PRIVATE KEY-----")
@@ -29,21 +33,27 @@ module SwFac
29
33
  end
30
34
 
31
35
  def serial_number
36
+ puts "---- SwFacturacion:config:serial_number"
37
+
32
38
  response = %x[openssl x509 -inform DER -in #{@doc_cer_path} -noout -serial]
33
39
  d_begin = response.index(/\d/)
34
40
  number = (response[d_begin..-1]).chomp
35
41
  final_serial = ""
36
42
 
37
43
  number.each_char.with_index do |s, index|
38
- if (index + 1).even?
39
- final_serial << s
40
- end
44
+ if (index + 1).even?
45
+ final_serial << s
46
+ end
41
47
  end
48
+
42
49
  @serial = final_serial
50
+
43
51
  end
44
52
 
45
53
 
46
54
  def cer_cadena
55
+ puts "---- SwFacturacion:config:cer_cadena"
56
+
47
57
  file = File.read(@doc_cer_path)
48
58
  text_certificate = OpenSSL::X509::Certificate.new(file)
49
59
  cert_string = text_certificate.to_s