Afip 0.3.0 → 0.3.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/Afip/padron.rb +11 -19
- data/lib/Afip/version.rb +1 -1
- metadata +2 -6
- data/Afip-0.1.0.gem +0 -0
- data/Afip-0.1.3.gem +0 -0
- data/Afip-0.1.4.gem +0 -0
- data/Afip-0.1.6.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ad6e3b7e1309ccfa7507b5c5395b8c0d0175be9
|
|
4
|
+
data.tar.gz: 2213ff8e7d2ce4d7a01fa3e7e0760f9cf515cae0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 29a1dd2992dccd22fc6c7003333d1347dab0c505a4511d23926a2ac9e13fc3a94b86fdf168b6f4d144ee06714d1411ed2a4ea1b95e4b1a43b6f6074b2c049632
|
|
7
|
+
data.tar.gz: 62ed82b730b767c0f2efbaf8b8a6a6695a9c40ab3478eaafdc306dab6a0982af6fc3ddbbf21b714712034907bdfd3402ae108fa9cfcd8ac2126ec3999cab12af
|
data/Gemfile.lock
CHANGED
data/lib/Afip/padron.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module Afip
|
|
2
2
|
class Padron
|
|
3
|
-
attr_reader :client, :body, :fault_code
|
|
4
|
-
attr_accessor :dni, :tipo
|
|
3
|
+
attr_reader :client, :body, :fault_code
|
|
4
|
+
attr_accessor :dni, :tipo, :data
|
|
5
5
|
def initialize(attrs = {})
|
|
6
6
|
Afip::AuthData.environment = Afip.environment || :production
|
|
7
7
|
url = Afip::AuthData.environment == :production ? "aws" : "awshomo"
|
|
@@ -22,24 +22,16 @@ module Afip
|
|
|
22
22
|
|
|
23
23
|
@dni = attrs[:dni].rjust(8, "0")
|
|
24
24
|
@tipo = attrs[:tipo]
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def get_persona_without_tipo
|
|
28
|
-
@tipo = "F"
|
|
29
|
-
fem = get_data
|
|
30
|
-
@tipo = "M"
|
|
31
|
-
masc = get_data
|
|
32
|
-
return [fem, masc]
|
|
25
|
+
@cuit = get_cuit
|
|
33
26
|
end
|
|
34
27
|
|
|
35
28
|
def get_persona
|
|
36
|
-
@cuit = get_cuit
|
|
37
29
|
body = setup_body
|
|
38
30
|
|
|
39
31
|
response = client.call(:get_persona,message: body)
|
|
40
32
|
rescue Savon::SOAPFault => error
|
|
41
33
|
if !error.blank?
|
|
42
|
-
|
|
34
|
+
@fault_code = error.to_hash[:fault][:faultstring]
|
|
43
35
|
else
|
|
44
36
|
@fault_code = nil
|
|
45
37
|
end
|
|
@@ -48,7 +40,7 @@ module Afip
|
|
|
48
40
|
|
|
49
41
|
def get_data
|
|
50
42
|
@data = get_persona
|
|
51
|
-
if
|
|
43
|
+
if fault_code.nil?
|
|
52
44
|
set_data
|
|
53
45
|
else
|
|
54
46
|
return nil
|
|
@@ -57,7 +49,7 @@ module Afip
|
|
|
57
49
|
end
|
|
58
50
|
|
|
59
51
|
def set_data
|
|
60
|
-
data.body
|
|
52
|
+
pp data.body
|
|
61
53
|
if not data.body[:get_persona_response][:persona_return][:persona][:actividad].nil?
|
|
62
54
|
{
|
|
63
55
|
:last_name => data.body[:get_persona_response][:persona_return][:persona][:apellido],
|
|
@@ -75,11 +67,11 @@ module Afip
|
|
|
75
67
|
:last_name => Padron.divide_name(data.body[:get_persona_response][:persona_return][:persona][:apellido])[0],
|
|
76
68
|
:first_name => Padron.divide_name(data.body[:get_persona_response][:persona_return][:persona][:apellido])[1],
|
|
77
69
|
:cuit => data.body[:get_persona_response][:persona_return][:persona][:id_persona],
|
|
78
|
-
:cp => data.body[:get_persona_response][:persona_return][:persona][:domicilio]
|
|
79
|
-
:address => data.body[:get_persona_response][:persona_return][:persona][:domicilio]
|
|
80
|
-
:city_id => data.body[:get_persona_response][:persona_return][:persona][:domicilio]
|
|
81
|
-
:city => PROVINCIAS[data.body[:get_persona_response][:persona_return][:persona][:domicilio]
|
|
82
|
-
:locality => data.body[:get_persona_response][:persona_return][:persona][:domicilio]
|
|
70
|
+
:cp => data.body[:get_persona_response][:persona_return][:persona].try(:[], :domicilio).try(:[], :cod_postal),
|
|
71
|
+
:address => data.body[:get_persona_response][:persona_return][:persona].try(:[], :domicilio).try(:[], :direccion),
|
|
72
|
+
:city_id => data.body[:get_persona_response][:persona_return][:persona].try(:[], :domicilio).try(:[], :id_provincia),
|
|
73
|
+
:city => PROVINCIAS[data.body[:get_persona_response][:persona_return][:persona].try(:[], :domicilio).try(:[], :id_provincia)],
|
|
74
|
+
:locality => data.body[:get_persona_response][:persona_return][:persona].try(:[], :domicilio).try(:[], :localidad),
|
|
83
75
|
:birthday => data.body[:get_persona_response][:persona_return][:persona][:fecha_nacimiento].to_date
|
|
84
76
|
}
|
|
85
77
|
end
|
data/lib/Afip/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: Afip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Facundo A. Díaz Martínez
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-08-
|
|
11
|
+
date: 2018-08-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: savon
|
|
@@ -75,10 +75,6 @@ extra_rdoc_files: []
|
|
|
75
75
|
files:
|
|
76
76
|
- ".DS_Store"
|
|
77
77
|
- ".gitignore"
|
|
78
|
-
- Afip-0.1.0.gem
|
|
79
|
-
- Afip-0.1.3.gem
|
|
80
|
-
- Afip-0.1.4.gem
|
|
81
|
-
- Afip-0.1.6.gem
|
|
82
78
|
- Afip.gemspec
|
|
83
79
|
- Gemfile
|
|
84
80
|
- Gemfile.lock
|
data/Afip-0.1.0.gem
DELETED
|
Binary file
|
data/Afip-0.1.3.gem
DELETED
|
Binary file
|
data/Afip-0.1.4.gem
DELETED
|
Binary file
|
data/Afip-0.1.6.gem
DELETED
|
Binary file
|