stp_client 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +10 -10
- data/lib/stp/structs/account.rb +8 -5
- data/lib/stp/version.rb +1 -1
- data/spec/stp/account_create_spec.rb +3 -3
- data/spec/stp/account_delete_spec.rb +5 -5
- data/stp_client.gemspec +1 -1
- metadata +7 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31f09992066ba6228571a886be708005823a6ba2ac8582ee8d88c125f78de948
|
4
|
+
data.tar.gz: b0293665af046138faf6a4edb9f1ea5d5fe88b734e550ddcfb2f4348816f2fdb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2086240e685e235707f982b22f8d90f7e84368d42bd0d44a1146d4e5a99fbcf88d77a0c3a428b934219297d68069523d11926b5b145cbfa6365971d10518e26b
|
7
|
+
data.tar.gz: f37ff3bafb97b88083cc326708d6bb393d52d268565551c5dcbd395fdadd8f6504b1c7ed8d088e8122d815c61899f9ebbf28585a865ed29c1da33d6b605e379c
|
data/Gemfile.lock
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stp_client (0.4.
|
4
|
+
stp_client (0.4.3)
|
5
5
|
crypto_yellowme (~> 0.4)
|
6
6
|
faraday (~> 1.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (5.2.4.
|
12
|
-
activesupport (= 5.2.4.
|
13
|
-
activesupport (5.2.4.
|
11
|
+
activemodel (5.2.4.3)
|
12
|
+
activesupport (= 5.2.4.3)
|
13
|
+
activesupport (5.2.4.3)
|
14
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
15
|
i18n (>= 0.7, < 2)
|
16
16
|
minitest (~> 5.1)
|
@@ -18,7 +18,7 @@ GEM
|
|
18
18
|
addressable (2.7.0)
|
19
19
|
public_suffix (>= 2.0.2, < 5.0)
|
20
20
|
bcrypt (3.1.13)
|
21
|
-
concurrent-ruby (1.1.
|
21
|
+
concurrent-ruby (1.1.6)
|
22
22
|
crack (0.4.3)
|
23
23
|
safe_yaml (~> 1.0.0)
|
24
24
|
crypto_yellowme (0.4.0)
|
@@ -29,13 +29,13 @@ GEM
|
|
29
29
|
docile (1.3.2)
|
30
30
|
faker (2.10.0)
|
31
31
|
i18n (>= 1.6, < 1.8)
|
32
|
-
faraday (1.0.
|
32
|
+
faraday (1.0.1)
|
33
33
|
multipart-post (>= 1.2, < 3)
|
34
34
|
hashdiff (1.0.1)
|
35
|
-
i18n (1.7.
|
35
|
+
i18n (1.7.1)
|
36
36
|
concurrent-ruby (~> 1.0)
|
37
37
|
json (2.3.0)
|
38
|
-
minitest (5.14.
|
38
|
+
minitest (5.14.1)
|
39
39
|
multipart-post (2.1.1)
|
40
40
|
public_suffix (4.0.3)
|
41
41
|
rspec (3.9.0)
|
@@ -58,7 +58,7 @@ GEM
|
|
58
58
|
simplecov-html (~> 0.10.0)
|
59
59
|
simplecov-html (0.10.2)
|
60
60
|
thread_safe (0.3.6)
|
61
|
-
tzinfo (1.2.
|
61
|
+
tzinfo (1.2.7)
|
62
62
|
thread_safe (~> 0.1)
|
63
63
|
webmock (3.4.2)
|
64
64
|
addressable (>= 2.3.6)
|
@@ -76,4 +76,4 @@ DEPENDENCIES
|
|
76
76
|
webmock (~> 3.4.2)
|
77
77
|
|
78
78
|
BUNDLED WITH
|
79
|
-
2.
|
79
|
+
2.1.2
|
data/lib/stp/structs/account.rb
CHANGED
@@ -13,7 +13,7 @@ module STP
|
|
13
13
|
:economic_activity, # actividadEconomica
|
14
14
|
:street, # calle
|
15
15
|
:exterior_number, # numeroExterior
|
16
|
-
:
|
16
|
+
:interior_number, # numeroInterior
|
17
17
|
:neighborhood, # colonia
|
18
18
|
:municipality, # alcaldiaMunicipio
|
19
19
|
:zip_code, # cp
|
@@ -34,12 +34,15 @@ module STP
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def as_json(_options = {})
|
37
|
+
name = @name.present? ? I18n.transliterate(@name) : nil
|
38
|
+
paternal_surname = @paternal_surname.present? ? I18n.transliterate(@paternal_surname) : nil
|
39
|
+
maternal_surname = @maternal_surname.present? ? I18n.transliterate(@maternal_surname) : nil
|
37
40
|
{
|
38
41
|
cuenta: @account,
|
39
42
|
empresa: @company,
|
40
|
-
nombre:
|
41
|
-
apellidoPaterno:
|
42
|
-
apellidoMaterno:
|
43
|
+
nombre: name,
|
44
|
+
apellidoPaterno: paternal_surname,
|
45
|
+
apellidoMaterno: maternal_surname,
|
43
46
|
rfcCurp: @rfc,
|
44
47
|
fechaNacimiento: @birthdate,
|
45
48
|
genero: @sex,
|
@@ -47,7 +50,7 @@ module STP
|
|
47
50
|
actividadEconomica: @economic_activity,
|
48
51
|
calle: @street,
|
49
52
|
numeroExterior: @exterior_number,
|
50
|
-
numeroInterior: @
|
53
|
+
numeroInterior: @interior_number,
|
51
54
|
colonia: @neighborhood,
|
52
55
|
alcaldiaMunicipio: @municipality,
|
53
56
|
cp: @zip_code,
|
data/lib/stp/version.rb
CHANGED
@@ -21,7 +21,7 @@ RSpec.describe STP::Account do
|
|
21
21
|
account.economic_activity = 'programador'
|
22
22
|
account.street = Faker::Address.street_name
|
23
23
|
account.exterior_number = Faker::Address.building_number
|
24
|
-
account.
|
24
|
+
account.interior_number = Faker::Address.building_number
|
25
25
|
account.neighborhood = Faker::Address.community
|
26
26
|
account.municipality = Faker::Address.community
|
27
27
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -75,7 +75,7 @@ RSpec.describe STP::Account do
|
|
75
75
|
account.economic_activity = 'programador'
|
76
76
|
account.street = Faker::Address.street_name
|
77
77
|
account.exterior_number = Faker::Address.building_number
|
78
|
-
account.
|
78
|
+
account.interior_number = Faker::Address.building_number
|
79
79
|
account.neighborhood = Faker::Address.community
|
80
80
|
account.municipality = Faker::Address.community
|
81
81
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -109,7 +109,7 @@ RSpec.describe STP::Account do
|
|
109
109
|
account.economic_activity = 'programador'
|
110
110
|
account.street = Faker::Address.street_name
|
111
111
|
account.exterior_number = Faker::Address.building_number
|
112
|
-
account.
|
112
|
+
account.interior_number = Faker::Address.building_number
|
113
113
|
account.neighborhood = Faker::Address.community
|
114
114
|
account.municipality = Faker::Address.community
|
115
115
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -21,7 +21,7 @@ RSpec.describe STP::Account do
|
|
21
21
|
account.economic_activity = 'programador'
|
22
22
|
account.street = Faker::Address.street_name
|
23
23
|
account.exterior_number = Faker::Address.building_number
|
24
|
-
account.
|
24
|
+
account.interior_number = Faker::Address.building_number
|
25
25
|
account.neighborhood = Faker::Address.community
|
26
26
|
account.municipality = Faker::Address.community
|
27
27
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -41,7 +41,7 @@ RSpec.describe STP::Account do
|
|
41
41
|
allow(STP::Account).to receive(:create).
|
42
42
|
and_return(STPTestHelpers::ACCOUNT_DELETE_MOCK_SUCCESS())
|
43
43
|
end
|
44
|
-
|
44
|
+
|
45
45
|
before do
|
46
46
|
stub_request(:delete, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
47
47
|
body: JSON.dump(STPTestHelpers::ACCOUNT_DELETE_MOCK_SUCCESS()), status: 200
|
@@ -59,7 +59,7 @@ RSpec.describe STP::Account do
|
|
59
59
|
account.rfc = 'RFCURP'
|
60
60
|
account
|
61
61
|
end
|
62
|
-
|
62
|
+
|
63
63
|
before do
|
64
64
|
stub_request(:delete, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
65
65
|
body: JSON.dump(STPTestHelpers::ACCOUNT_DELETE_MOCK_SUCCESS()), status: 200
|
@@ -85,7 +85,7 @@ RSpec.describe STP::Account do
|
|
85
85
|
account.economic_activity = 'programador'
|
86
86
|
account.street = Faker::Address.street_name
|
87
87
|
account.exterior_number = Faker::Address.building_number
|
88
|
-
account.
|
88
|
+
account.interior_number = Faker::Address.building_number
|
89
89
|
account.neighborhood = Faker::Address.community
|
90
90
|
account.municipality = Faker::Address.community
|
91
91
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -95,7 +95,7 @@ RSpec.describe STP::Account do
|
|
95
95
|
account.phone = Faker::PhoneNumber.phone_number
|
96
96
|
account
|
97
97
|
end
|
98
|
-
|
98
|
+
|
99
99
|
before do
|
100
100
|
stub_request(:delete, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
101
101
|
body: JSON.dump(STPTestHelpers::ACCOUNT_DELETE_MOCK_ERROR(-2)), status: 200
|
data/stp_client.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.license = 'MIT'
|
20
20
|
|
21
21
|
spec.add_dependency "faraday", "~> 1.0"
|
22
|
-
spec.add_dependency "crypto_yellowme", "
|
22
|
+
spec.add_dependency "crypto_yellowme", ">= 0.4"
|
23
23
|
|
24
24
|
spec.add_development_dependency "rspec", "~> 3.8"
|
25
25
|
spec.add_development_dependency "faker", "~> 2.0"
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stp_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yellowme
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2019-12-10 00:00:00.000000000 Z
|
@@ -28,14 +28,14 @@ dependencies:
|
|
28
28
|
name: crypto_yellowme
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.4'
|
41
41
|
- !ruby/object:Gem::Dependency
|
@@ -127,7 +127,7 @@ homepage: https://github.com/yellowme/stp-client
|
|
127
127
|
licenses:
|
128
128
|
- MIT
|
129
129
|
metadata: {}
|
130
|
-
post_install_message:
|
130
|
+
post_install_message:
|
131
131
|
rdoc_options: []
|
132
132
|
require_paths:
|
133
133
|
- lib
|
@@ -142,9 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
|
146
|
-
|
147
|
-
signing_key:
|
145
|
+
rubygems_version: 3.1.2
|
146
|
+
signing_key:
|
148
147
|
specification_version: 4
|
149
148
|
summary: STP Client is a ruby integration to STP services
|
150
149
|
test_files:
|