stp_client 0.2.1 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +20 -8
- data/lib/stp.rb +10 -0
- data/lib/stp/account.rb +5 -2
- data/lib/stp/errors/account_already_exists.rb +6 -0
- data/lib/stp/errors/stp_error.rb +18 -0
- data/lib/stp/structs/account.rb +5 -5
- data/lib/stp/version.rb +1 -1
- data/spec/spec_helper.rb +17 -16
- data/spec/stp/account_create_spec.rb +52 -27
- data/spec/stp/account_delete_spec.rb +24 -23
- data/spec/stp/payment_order_spec.rb +1 -1
- data/spec/support/stp_test_helpers.rb +4 -4
- data/stp_client.gemspec +1 -0
- metadata +18 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 261c9f866c7ceb1621dcfd05ebc51a2a23fa73f816c30089b34745a1e8f16458
|
4
|
+
data.tar.gz: 897297e8713a5a081dc11d6a0642dd86299e09256d551217e426b514fee95e17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b269d1b5c55ca547639b53ff7a2f3b11a6e99900ed87f794e7143702f8934a84337577b975ed94674794a0d3e0b3e85174ff4993f2520ac80528b486dda9421a
|
7
|
+
data.tar.gz: f49256bcb78005b6c0debe661eae877f77bb5dc9070cebcfa1f70701de40a7f0c77920f423373b36326b50495b196353155451f0912086e971e0157f9e115efc
|
data/Gemfile.lock
CHANGED
@@ -1,22 +1,26 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
stp_client (0.2
|
4
|
+
stp_client (0.4.2)
|
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)
|
17
17
|
tzinfo (~> 1.1)
|
18
|
+
addressable (2.7.0)
|
19
|
+
public_suffix (>= 2.0.2, < 5.0)
|
18
20
|
bcrypt (3.1.13)
|
19
|
-
concurrent-ruby (1.1.
|
21
|
+
concurrent-ruby (1.1.6)
|
22
|
+
crack (0.4.3)
|
23
|
+
safe_yaml (~> 1.0.0)
|
20
24
|
crypto_yellowme (0.4.0)
|
21
25
|
activemodel (~> 5.2)
|
22
26
|
activesupport (~> 5.0)
|
@@ -27,11 +31,13 @@ GEM
|
|
27
31
|
i18n (>= 1.6, < 1.8)
|
28
32
|
faraday (1.0.0)
|
29
33
|
multipart-post (>= 1.2, < 3)
|
30
|
-
|
34
|
+
hashdiff (1.0.1)
|
35
|
+
i18n (1.7.1)
|
31
36
|
concurrent-ruby (~> 1.0)
|
32
37
|
json (2.3.0)
|
33
|
-
minitest (5.
|
38
|
+
minitest (5.14.1)
|
34
39
|
multipart-post (2.1.1)
|
40
|
+
public_suffix (4.0.3)
|
35
41
|
rspec (3.9.0)
|
36
42
|
rspec-core (~> 3.9.0)
|
37
43
|
rspec-expectations (~> 3.9.0)
|
@@ -45,14 +51,19 @@ GEM
|
|
45
51
|
diff-lcs (>= 1.2.0, < 2.0)
|
46
52
|
rspec-support (~> 3.9.0)
|
47
53
|
rspec-support (3.9.2)
|
54
|
+
safe_yaml (1.0.5)
|
48
55
|
simplecov (0.17.1)
|
49
56
|
docile (~> 1.1)
|
50
57
|
json (>= 1.8, < 3)
|
51
58
|
simplecov-html (~> 0.10.0)
|
52
59
|
simplecov-html (0.10.2)
|
53
60
|
thread_safe (0.3.6)
|
54
|
-
tzinfo (1.2.
|
61
|
+
tzinfo (1.2.7)
|
55
62
|
thread_safe (~> 0.1)
|
63
|
+
webmock (3.4.2)
|
64
|
+
addressable (>= 2.3.6)
|
65
|
+
crack (>= 0.3.2)
|
66
|
+
hashdiff
|
56
67
|
|
57
68
|
PLATFORMS
|
58
69
|
ruby
|
@@ -62,6 +73,7 @@ DEPENDENCIES
|
|
62
73
|
rspec (~> 3.8)
|
63
74
|
simplecov (~> 0.17)
|
64
75
|
stp_client!
|
76
|
+
webmock (~> 3.4.2)
|
65
77
|
|
66
78
|
BUNDLED WITH
|
67
79
|
2.0.2
|
data/lib/stp.rb
CHANGED
@@ -5,6 +5,8 @@ require 'stp/structs/account'
|
|
5
5
|
require 'stp/structs/payment_order'
|
6
6
|
require 'stp/account'
|
7
7
|
require 'stp/payment_order'
|
8
|
+
require 'stp/errors/stp_error'
|
9
|
+
require 'stp/errors/account_already_exists'
|
8
10
|
|
9
11
|
module STP
|
10
12
|
def self.config
|
@@ -42,4 +44,12 @@ module STP
|
|
42
44
|
def self.company
|
43
45
|
@company
|
44
46
|
end
|
47
|
+
|
48
|
+
def self.verbose
|
49
|
+
@verbose
|
50
|
+
end
|
51
|
+
|
52
|
+
def self.verbose=(verbose)
|
53
|
+
@verbose = verbose
|
54
|
+
end
|
45
55
|
end
|
data/lib/stp/account.rb
CHANGED
@@ -8,8 +8,10 @@ module STP
|
|
8
8
|
req.headers['Content-Type'] = 'application/json'
|
9
9
|
req.body = account.to_json
|
10
10
|
end
|
11
|
+
puts response.body if STP.verbose
|
11
12
|
hash = JSON.parse(response.body)
|
12
|
-
hash
|
13
|
+
raise STP::Errors::AccountAlreadyExists.new(hash['id'], hash['descripcion']) if hash['id'] == 1 && hash['descripcion'] == 'Cuenta Duplicada'
|
14
|
+
raise STP::Errors::STPError.new(hash['id'], hash['descripcion']) unless hash['id'] == 0
|
13
15
|
end
|
14
16
|
|
15
17
|
def self.delete(account)
|
@@ -20,8 +22,9 @@ module STP
|
|
20
22
|
req.headers['Content-Type'] = 'application/json'
|
21
23
|
req.body = account.to_json
|
22
24
|
end
|
25
|
+
puts response.body if STP.verbose
|
23
26
|
hash = JSON.parse(response.body)
|
24
|
-
hash
|
27
|
+
raise STP::Errors::STPError.new(hash['id'], hash['descripcion']) unless hash['id'] == 0
|
25
28
|
end
|
26
29
|
end
|
27
30
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module STP
|
2
|
+
module Errors
|
3
|
+
class STPError < StandardError
|
4
|
+
def initialize(code = nil, message = nil)
|
5
|
+
@code = code
|
6
|
+
@message = message
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_h
|
10
|
+
{ code: @code, message: @message }
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_s
|
14
|
+
to_h.to_s
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
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
|
@@ -37,9 +37,9 @@ module STP
|
|
37
37
|
{
|
38
38
|
cuenta: @account,
|
39
39
|
empresa: @company,
|
40
|
-
nombre: @name,
|
41
|
-
apellidoPaterno: @paternal_surname,
|
42
|
-
apellidoMaterno: @maternal_surname,
|
40
|
+
nombre: I18n.transliterate(@name),
|
41
|
+
apellidoPaterno: I18n.transliterate(@paternal_surname),
|
42
|
+
apellidoMaterno: I18n.transliterate(@maternal_surname),
|
43
43
|
rfcCurp: @rfc,
|
44
44
|
fechaNacimiento: @birthdate,
|
45
45
|
genero: @sex,
|
@@ -47,7 +47,7 @@ module STP
|
|
47
47
|
actividadEconomica: @economic_activity,
|
48
48
|
calle: @street,
|
49
49
|
numeroExterior: @exterior_number,
|
50
|
-
numeroInterior: @
|
50
|
+
numeroInterior: @interior_number,
|
51
51
|
colonia: @neighborhood,
|
52
52
|
alcaldiaMunicipio: @municipality,
|
53
53
|
cp: @zip_code,
|
data/lib/stp/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,27 +1,28 @@
|
|
1
1
|
require 'rspec'
|
2
2
|
require 'simplecov'
|
3
3
|
require 'faker'
|
4
|
+
require 'webmock/rspec'
|
4
5
|
|
5
6
|
require 'stp'
|
6
7
|
|
7
8
|
STP.config do |c|
|
8
|
-
c.api_uri = '
|
9
|
+
c.api_uri = 'https://demo_url.com:8080/'
|
9
10
|
c.private_key = %q(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
11
|
+
-----BEGIN RSA PRIVATE KEY-----
|
12
|
+
MIICXgIBAAKBgQDO6dcS4k8Sz//09ISLLCIqHjCYNpHUbtauyu4+N3bvTOxgyX9R
|
13
|
+
fC9hQ0HyL6VjcAoY67BNF1gvLPTRB0ijwMPpl2uEyv2y1pPwxmDoH4dH0aoRrWUW
|
14
|
+
zSejnfVn4NoHIchiu8umIofDFuGb/cIDnVBikKNFBTf6HxPePUW2p35Q9wIDAQAB
|
15
|
+
AoGBAJm4jqmf6mEumJkyw/nlauhhj3a2K/dn9STc7MzaRgkY3BA4AtfV7BlVb3vv
|
16
|
+
O+85QLcs+sj7S++YdbWJtMS7pI/jYQPEiR2pQ9aHx/Hacor92Oi7zEzn6QLr/VKA
|
17
|
+
K2qPAiRicPItrY4zWkrEwmwX0SBUPjAD3Ffjf8T6cETE8puxAkEA7aijTnkK8FzM
|
18
|
+
TxXDl6UMxSwjcJeP/vJcN+im+aphliIGJykL1kcXT5B9R3OUyqsbySgmjsG2yNEm
|
19
|
+
psCEd/rZKQJBAN7hxnVGAeVl1q2NWgL+lCgvgwaoPqE2NzcFsIxs5EOpKXn0fZuR
|
20
|
+
oH7l09Giv61NmdNAJT1oMxdLVQ9QJ1UNfR8CQQC9ACr3Yk2vv6z/i+hjte/E8ogw
|
21
|
+
p2ftsaJjGBOKY9R9yAsqo3r1as4ACYGIDEQdNRzAybx4NVf+tk5NuLbgj86ZAkEA
|
22
|
+
h3BpmgA1zMHK5+H6rdEoFRdyJsx8api4it4RP/Q37gnQ44Q4BB5Find89WpR0i1S
|
23
|
+
6bWUK7GzQleL0+dgT2YH/wJAByKN5rEvP/XLiwSu68lQtloDAJxQfD4CSHlC97Mw
|
24
|
+
9bIAmsKrvYVL4B40Nb3jPNXCKm8zRqFu//WX/G1uy5Q6nQ==
|
25
|
+
-----END RSA PRIVATE KEY-----
|
25
26
|
)
|
26
27
|
c.private_key_password = '12345678'
|
27
28
|
c.company = 'xxxxx'
|
@@ -2,8 +2,7 @@ require 'support/stp_test_helpers'
|
|
2
2
|
|
3
3
|
RSpec.describe STP::Account do
|
4
4
|
subject do
|
5
|
-
|
6
|
-
response
|
5
|
+
STP::Account.create(account_obj)
|
7
6
|
end
|
8
7
|
|
9
8
|
describe 'account create' do
|
@@ -22,7 +21,7 @@ RSpec.describe STP::Account do
|
|
22
21
|
account.economic_activity = 'programador'
|
23
22
|
account.street = Faker::Address.street_name
|
24
23
|
account.exterior_number = Faker::Address.building_number
|
25
|
-
account.
|
24
|
+
account.interior_number = Faker::Address.building_number
|
26
25
|
account.neighborhood = Faker::Address.community
|
27
26
|
account.municipality = Faker::Address.community
|
28
27
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -32,18 +31,14 @@ RSpec.describe STP::Account do
|
|
32
31
|
account.phone = Faker::PhoneNumber.phone_number
|
33
32
|
account
|
34
33
|
end
|
35
|
-
|
34
|
+
|
36
35
|
before do
|
37
|
-
|
38
|
-
|
36
|
+
stub_request(:put, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
37
|
+
body: JSON.dump(STPTestHelpers::ACCOUNT_CREATE_MOCK_SUCCESS()), status: 200
|
38
|
+
)
|
39
39
|
end
|
40
40
|
|
41
|
-
it
|
42
|
-
response = subject
|
43
|
-
expect(response['id']).not_to be_nil
|
44
|
-
expect(response['id']).to be 0
|
45
|
-
expect(response['descripcionError']).to be_nil
|
46
|
-
end
|
41
|
+
it { expect{subject}.not_to raise_error }
|
47
42
|
end
|
48
43
|
|
49
44
|
context 'with minimal data' do
|
@@ -54,23 +49,19 @@ RSpec.describe STP::Account do
|
|
54
49
|
account.rfc = 'RFCURP'
|
55
50
|
account
|
56
51
|
end
|
57
|
-
|
52
|
+
|
58
53
|
before do
|
59
|
-
|
60
|
-
|
54
|
+
stub_request(:put, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
55
|
+
body: JSON.dump(STPTestHelpers::ACCOUNT_CREATE_MOCK_SUCCESS()), status: 200
|
56
|
+
)
|
61
57
|
end
|
62
58
|
|
63
|
-
it
|
64
|
-
response = subject
|
65
|
-
expect(response['id']).not_to be_nil
|
66
|
-
expect(response['id']).to be 0
|
67
|
-
expect(response['descripcionError']).to be_nil
|
68
|
-
end
|
59
|
+
it { expect{subject}.not_to raise_error }
|
69
60
|
end
|
70
61
|
end
|
71
62
|
|
72
63
|
context 'fails when' do
|
73
|
-
context '
|
64
|
+
context 'random error' do
|
74
65
|
let(:account_obj) do
|
75
66
|
account = STP::Structs::Account.new
|
76
67
|
account.account = '01010101'
|
@@ -84,7 +75,7 @@ RSpec.describe STP::Account do
|
|
84
75
|
account.economic_activity = 'programador'
|
85
76
|
account.street = Faker::Address.street_name
|
86
77
|
account.exterior_number = Faker::Address.building_number
|
87
|
-
account.
|
78
|
+
account.interior_number = Faker::Address.building_number
|
88
79
|
account.neighborhood = Faker::Address.community
|
89
80
|
account.municipality = Faker::Address.community
|
90
81
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -94,14 +85,48 @@ RSpec.describe STP::Account do
|
|
94
85
|
account.phone = Faker::PhoneNumber.phone_number
|
95
86
|
account
|
96
87
|
end
|
88
|
+
|
89
|
+
before do
|
90
|
+
stub_request(:put, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
91
|
+
body: JSON.dump(STPTestHelpers::ACCOUNT_CREATE_MOCK_ERROR(1)), status: 200
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
95
|
+
it { expect {subject}.to raise_error(STP::Errors::STPError) }
|
96
|
+
end
|
97
97
|
|
98
|
+
context 'repeating account and rfcCurp' do
|
99
|
+
let(:account_obj) do
|
100
|
+
account = STP::Structs::Account.new
|
101
|
+
account.account = '01010101'
|
102
|
+
account.name = Faker::Name.first_name
|
103
|
+
account.paternal_surname = Faker::Name.last_name
|
104
|
+
account.maternal_surname = Faker::Name.last_name
|
105
|
+
account.rfc = 'RFC'
|
106
|
+
account.birthdate = Faker::Date.birthday(min_age: 6, max_age: 65)
|
107
|
+
account.sex = 'male'
|
108
|
+
account.state = 'Mérida'
|
109
|
+
account.economic_activity = 'programador'
|
110
|
+
account.street = Faker::Address.street_name
|
111
|
+
account.exterior_number = Faker::Address.building_number
|
112
|
+
account.interior_number = Faker::Address.building_number
|
113
|
+
account.neighborhood = Faker::Address.community
|
114
|
+
account.municipality = Faker::Address.community
|
115
|
+
account.zip_code = Faker::Number.number(digits: 5)
|
116
|
+
account.country = 'México'
|
117
|
+
account.email = Faker::Internet.email
|
118
|
+
account.identification_id = 'id'
|
119
|
+
account.phone = Faker::PhoneNumber.phone_number
|
120
|
+
account
|
121
|
+
end
|
122
|
+
|
98
123
|
before do
|
99
|
-
|
100
|
-
|
124
|
+
stub_request(:put, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
125
|
+
body: JSON.dump(STPTestHelpers::ACCOUNT_CREATE_MOCK_ERROR(1, 'Cuenta Duplicada')), status: 200
|
126
|
+
)
|
101
127
|
end
|
102
128
|
|
103
|
-
it { expect
|
104
|
-
it { expect(subject['descripcionError']).not_to be_nil }
|
129
|
+
it { expect {subject}.to raise_error(STP::Errors::AccountAlreadyExists) }
|
105
130
|
end
|
106
131
|
end
|
107
132
|
end
|
@@ -2,8 +2,7 @@ require 'support/stp_test_helpers'
|
|
2
2
|
|
3
3
|
RSpec.describe STP::Account do
|
4
4
|
subject do
|
5
|
-
|
6
|
-
response
|
5
|
+
STP::Account.delete(account_obj)
|
7
6
|
end
|
8
7
|
|
9
8
|
describe 'account delete' do
|
@@ -22,7 +21,7 @@ RSpec.describe STP::Account do
|
|
22
21
|
account.economic_activity = 'programador'
|
23
22
|
account.street = Faker::Address.street_name
|
24
23
|
account.exterior_number = Faker::Address.building_number
|
25
|
-
account.
|
24
|
+
account.interior_number = Faker::Address.building_number
|
26
25
|
account.neighborhood = Faker::Address.community
|
27
26
|
account.municipality = Faker::Address.community
|
28
27
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -38,12 +37,18 @@ RSpec.describe STP::Account do
|
|
38
37
|
and_return(STPTestHelpers::ACCOUNT_DELETE_MOCK_SUCCESS())
|
39
38
|
end
|
40
39
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
before do
|
41
|
+
allow(STP::Account).to receive(:create).
|
42
|
+
and_return(STPTestHelpers::ACCOUNT_DELETE_MOCK_SUCCESS())
|
43
|
+
end
|
44
|
+
|
45
|
+
before do
|
46
|
+
stub_request(:delete, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
47
|
+
body: JSON.dump(STPTestHelpers::ACCOUNT_DELETE_MOCK_SUCCESS()), status: 200
|
48
|
+
)
|
46
49
|
end
|
50
|
+
|
51
|
+
it { expect{subject}.not_to raise_error }
|
47
52
|
end
|
48
53
|
|
49
54
|
context 'with minimal data' do
|
@@ -54,18 +59,14 @@ RSpec.describe STP::Account do
|
|
54
59
|
account.rfc = 'RFCURP'
|
55
60
|
account
|
56
61
|
end
|
57
|
-
|
62
|
+
|
58
63
|
before do
|
59
|
-
|
60
|
-
|
64
|
+
stub_request(:delete, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
65
|
+
body: JSON.dump(STPTestHelpers::ACCOUNT_DELETE_MOCK_SUCCESS()), status: 200
|
66
|
+
)
|
61
67
|
end
|
62
68
|
|
63
|
-
it
|
64
|
-
response = subject
|
65
|
-
expect(response['id']).not_to be_nil
|
66
|
-
expect(response['id']).to be 0
|
67
|
-
expect(response['descripcionError']).to be_nil
|
68
|
-
end
|
69
|
+
it { expect{subject}.not_to raise_error }
|
69
70
|
end
|
70
71
|
end
|
71
72
|
|
@@ -84,7 +85,7 @@ RSpec.describe STP::Account do
|
|
84
85
|
account.economic_activity = 'programador'
|
85
86
|
account.street = Faker::Address.street_name
|
86
87
|
account.exterior_number = Faker::Address.building_number
|
87
|
-
account.
|
88
|
+
account.interior_number = Faker::Address.building_number
|
88
89
|
account.neighborhood = Faker::Address.community
|
89
90
|
account.municipality = Faker::Address.community
|
90
91
|
account.zip_code = Faker::Number.number(digits: 5)
|
@@ -94,14 +95,14 @@ RSpec.describe STP::Account do
|
|
94
95
|
account.phone = Faker::PhoneNumber.phone_number
|
95
96
|
account
|
96
97
|
end
|
97
|
-
|
98
|
+
|
98
99
|
before do
|
99
|
-
|
100
|
-
|
100
|
+
stub_request(:delete, "#{STP.api_uri}/cuentaModule/fisica").to_return(
|
101
|
+
body: JSON.dump(STPTestHelpers::ACCOUNT_DELETE_MOCK_ERROR(-2)), status: 200
|
102
|
+
)
|
101
103
|
end
|
102
104
|
|
103
|
-
it { expect
|
104
|
-
it { expect(subject['descripcionError']).not_to be_nil }
|
105
|
+
it { expect {subject}.to raise_error(STP::Errors::STPError) }
|
105
106
|
end
|
106
107
|
end
|
107
108
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module STPTestHelpers
|
2
2
|
def self.PAYMENT_ORDER_MOCK_ERROR(error_code)
|
3
3
|
{
|
4
|
-
'
|
4
|
+
'descripcion' => 'regular error msg',
|
5
5
|
'id' => error_code,
|
6
6
|
}
|
7
7
|
end
|
@@ -16,9 +16,9 @@ module STPTestHelpers
|
|
16
16
|
}
|
17
17
|
end
|
18
18
|
|
19
|
-
def self.ACCOUNT_CREATE_MOCK_ERROR(error_code)
|
19
|
+
def self.ACCOUNT_CREATE_MOCK_ERROR(error_code, message='regular error msg')
|
20
20
|
{
|
21
|
-
'
|
21
|
+
'descripcion' => message,
|
22
22
|
'id' => error_code,
|
23
23
|
}
|
24
24
|
end
|
@@ -32,7 +32,7 @@ module STPTestHelpers
|
|
32
32
|
|
33
33
|
def self.ACCOUNT_DELETE_MOCK_ERROR(error_code)
|
34
34
|
{
|
35
|
-
'
|
35
|
+
'descripcion' => 'regular error msg',
|
36
36
|
'id' => error_code,
|
37
37
|
}
|
38
38
|
end
|
data/stp_client.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stp_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yellowme
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0.17'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: webmock
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 3.4.2
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 3.4.2
|
83
97
|
description: STP Client is a lib for consuming STP services
|
84
98
|
email: hola@yellowme.mx
|
85
99
|
executables: []
|
@@ -95,6 +109,8 @@ files:
|
|
95
109
|
- Rakefile
|
96
110
|
- lib/stp.rb
|
97
111
|
- lib/stp/account.rb
|
112
|
+
- lib/stp/errors/account_already_exists.rb
|
113
|
+
- lib/stp/errors/stp_error.rb
|
98
114
|
- lib/stp/payment_order.rb
|
99
115
|
- lib/stp/structs/account.rb
|
100
116
|
- lib/stp/structs/payment_order.rb
|
@@ -126,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
142
|
- !ruby/object:Gem::Version
|
127
143
|
version: '0'
|
128
144
|
requirements: []
|
129
|
-
|
130
|
-
rubygems_version: 2.7.6
|
145
|
+
rubygems_version: 3.1.2
|
131
146
|
signing_key:
|
132
147
|
specification_version: 4
|
133
148
|
summary: STP Client is a ruby integration to STP services
|