tochka_cyclops_api 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/tochka_cyclops_api/data_processor.rb +2 -3
- data/lib/tochka_cyclops_api/generators/initializer_generator.rb +5 -5
- data/lib/tochka_cyclops_api/generators/{model_generator.rb → models_generator.rb} +8 -9
- data/lib/tochka_cyclops_api/response.rb +3 -3
- data/lib/tochka_cyclops_api/version.rb +1 -1
- data/lib/tochka_cyclops_api.rb +3 -0
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2844cc465020d8597bfa869d80e33d850a2a33c26bd4f302adb7a620a9a71321
|
4
|
+
data.tar.gz: 35ed83f97f6d37d24d72fdceff93f11ac2057ea8d3df5b20487e9cafeacb1155
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bf2d583aa03a2e6758e6f5cd9d04a34f97baf307bb83244e07524256b61b7ab94337ac2e05aff8206a10f3ff83a7ecffce77d156c6392879da02b1bd753d447
|
7
|
+
data.tar.gz: 8a9f1760504c78697fd2e9d9f7691530d7270e0ec9a2cab87bba1611b8dcc88e15eceaff60a297507330b1d09601cfd0f46b819525ab741c48a1edc69f62e103
|
data/README.md
CHANGED
@@ -22,8 +22,8 @@ bundle add tochka_cylops_api
|
|
22
22
|
and run commands bellow to create the initializer, models and migrations:
|
23
23
|
|
24
24
|
```sh
|
25
|
-
rails generate
|
26
|
-
rails generate
|
25
|
+
rails generate tochka_cyclops_api:models
|
26
|
+
rails generate tochka_cyclops_api:initializer
|
27
27
|
```
|
28
28
|
|
29
29
|
### Settings
|
@@ -6,8 +6,7 @@ require 'securerandom'
|
|
6
6
|
require 'json'
|
7
7
|
|
8
8
|
require_relative 'request'
|
9
|
-
require_relative '
|
10
|
-
require_relative './schemas/requests/echo'
|
9
|
+
require_relative 'schemas/requests/echo'
|
11
10
|
|
12
11
|
module TochkaCyclopsApi
|
13
12
|
# Module for input data validation and subsequent request invocation
|
@@ -38,7 +37,7 @@ module TochkaCyclopsApi
|
|
38
37
|
end
|
39
38
|
|
40
39
|
def shape
|
41
|
-
require_relative "
|
40
|
+
require_relative "schemas/requests/#{@method}"
|
42
41
|
schema = ['TochkaCyclopsApi', 'Schemas', 'Requests', camel_case_method].join('::').constantize
|
43
42
|
|
44
43
|
schema.new
|
@@ -2,7 +2,7 @@ require 'rails/generators/base'
|
|
2
2
|
|
3
3
|
module TochkaCyclopsApi
|
4
4
|
module Generators
|
5
|
-
class
|
5
|
+
class InitializerGenerator < Rails::Generators::Base
|
6
6
|
desc 'It creates an initializer to set config data'
|
7
7
|
def create_initializer_file
|
8
8
|
create_file(
|
@@ -11,10 +11,10 @@ module TochkaCyclopsApi
|
|
11
11
|
# frozen_string_literal: true
|
12
12
|
|
13
13
|
TochkaCyclopsApi.configure do |config|
|
14
|
-
config.certificate = File.read(PATH TO TOCHKA CERTIFICATE
|
15
|
-
config.private_key = File.read(PATH TO TOCHKA PRIVATE KEY
|
16
|
-
config.sign_thumbprint = YOUR THUMBPRINT
|
17
|
-
config.sign_system = YOUR SYSTEM
|
14
|
+
config.certificate = File.read() # PATH TO TOCHKA CERTIFICATE
|
15
|
+
config.private_key = File.read() # PATH TO TOCHKA PRIVATE KEY
|
16
|
+
config.sign_thumbprint = '' # YOUR THUMBPRINT
|
17
|
+
config.sign_system = '' # YOUR SYSTEM
|
18
18
|
end
|
19
19
|
TOCHKA_CYCLOPS_API_INITIALIZER_TEXT
|
20
20
|
)
|
@@ -1,16 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# lib/generators/model_generator.rb
|
4
|
-
|
5
3
|
require 'rails/generators'
|
6
4
|
require 'rails/generators/migration'
|
7
5
|
|
8
|
-
require_relative '
|
9
|
-
require_relative '
|
10
|
-
require_relative '
|
11
|
-
require_relative '
|
12
|
-
require_relative '
|
13
|
-
require_relative '
|
6
|
+
require_relative 'templates/tochka_cyclops_error_model_template'
|
7
|
+
require_relative 'templates/tochka_cyclops_request_model_template'
|
8
|
+
require_relative 'templates/tochka_cyclops_response_model_template'
|
9
|
+
require_relative 'templates/tochka_cyclops_errors_migration_template'
|
10
|
+
require_relative 'templates/tochka_cyclops_requests_migration_template'
|
11
|
+
require_relative 'templates/tochka_cyclops_responses_migration_template'
|
14
12
|
|
15
13
|
module TochkaCyclopsApi
|
16
14
|
module Generators
|
@@ -29,7 +27,8 @@ module TochkaCyclopsApi
|
|
29
27
|
end
|
30
28
|
|
31
29
|
def create_migration_file
|
32
|
-
migration_template 'tochka_cyclops_errors_migration_template.rb',
|
30
|
+
migration_template 'tochka_cyclops_errors_migration_template.rb',
|
31
|
+
'db/migrate/create_tochka_cyclops_errors.rb'
|
33
32
|
migration_template 'tochka_cyclops_requests_migration_template.rb',
|
34
33
|
'db/migrate/create_tochka_cyclops_requests.rb'
|
35
34
|
migration_template 'tochka_cyclops_responses_migration_template.rb',
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '
|
3
|
+
require_relative 'schemas/responses/echo'
|
4
4
|
|
5
5
|
module TochkaCyclopsApi
|
6
6
|
# Class for processing the response received from the api bank
|
@@ -38,7 +38,7 @@ module TochkaCyclopsApi
|
|
38
38
|
|
39
39
|
def self.parse_error
|
40
40
|
@error = @body['error']
|
41
|
-
require_relative '
|
41
|
+
require_relative 'schemas/responses/error'
|
42
42
|
response_schema = 'TochkaCyclopsApi::Schemas::Responses::Error'.constantize
|
43
43
|
|
44
44
|
@response = TochkaCyclopsError.create(
|
@@ -53,7 +53,7 @@ module TochkaCyclopsApi
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def self.schema
|
56
|
-
require_relative "
|
56
|
+
require_relative "schemas/responses/#{@method}"
|
57
57
|
"TochkaCyclopsApi::Schemas::Responses::#{camel_case_method}".constantize
|
58
58
|
rescue StandardError => e
|
59
59
|
@errors = { error: e.message }
|
data/lib/tochka_cyclops_api.rb
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
require 'dry-types'
|
3
3
|
require 'dry-validation'
|
4
4
|
|
5
|
+
require_relative 'tochka_cyclops_api/generators/models_generator'
|
6
|
+
require_relative 'tochka_cyclops_api/generators/initializer_generator'
|
7
|
+
|
5
8
|
require_relative 'tochka_cyclops_api/data_processor'
|
6
9
|
require_relative 'tochka_cyclops_api/configuration'
|
7
10
|
require_relative 'tochka_cyclops_api/version'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tochka_cyclops_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- andrewgavrick
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.6'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: activesupport
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - '='
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 7.2.1.1
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - '='
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 7.2.1.1
|
55
41
|
description: em for working with the api of the bank Point
|
56
42
|
email:
|
57
43
|
- andrewgavrick@yandex.ru
|
@@ -66,7 +52,7 @@ files:
|
|
66
52
|
- lib/tochka_cyclops_api/configuration.rb
|
67
53
|
- lib/tochka_cyclops_api/data_processor.rb
|
68
54
|
- lib/tochka_cyclops_api/generators/initializer_generator.rb
|
69
|
-
- lib/tochka_cyclops_api/generators/
|
55
|
+
- lib/tochka_cyclops_api/generators/models_generator.rb
|
70
56
|
- lib/tochka_cyclops_api/generators/templates/tochka_cyclops_error_model_template.rb
|
71
57
|
- lib/tochka_cyclops_api/generators/templates/tochka_cyclops_errors_migration_template.rb
|
72
58
|
- lib/tochka_cyclops_api/generators/templates/tochka_cyclops_request_model_template.rb
|