coins_paid_rails 1.0.0 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +9 -9
- data/.gitignore +0 -1
- data/.ruby-version +1 -0
- data/Gemfile.lock +147 -0
- data/coins_paid_rails.gemspec +2 -3
- data/lib/coins_paid.rb +9 -2
- data/lib/coins_paid/address.rb +5 -3
- data/lib/coins_paid/qr_code.rb +1 -1
- data/lib/coins_paid_rails.rb +1 -0
- data/spec/spec_helper.rb +0 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca1acc712539224bd9600c8c093b27df63ff221cd6429b8e6ea9c7518a95b99f
|
4
|
+
data.tar.gz: 0e78adb0b3a02f21d54cc66c81de396c7a2e8201c35ca692953055c66e011337
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a75ccbe6564df90c140aa4bbf76039819a744cdb1181e27d4bfd83c14ec3b594273c85f411d0165e10537791a20c14bb89f947b2a451a94f0de3490be0721bc
|
7
|
+
data.tar.gz: 420f371a7800e275c953a6dbd039b9e0a30509829139de1d0dfd0b229641d46b0fb1b704b0aaa3813deada9ecdd6f1d7cf2af7a80e7855c9d31748e8c6b85231
|
data/.circleci/config.yml
CHANGED
@@ -11,7 +11,7 @@ jobs:
|
|
11
11
|
- checkout
|
12
12
|
- run: mkdir log
|
13
13
|
- save_cache:
|
14
|
-
key:
|
14
|
+
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
|
15
15
|
paths:
|
16
16
|
- ~/coins_paid
|
17
17
|
|
@@ -33,14 +33,14 @@ jobs:
|
|
33
33
|
<<: *defaults
|
34
34
|
steps:
|
35
35
|
- restore_cache:
|
36
|
-
key:
|
36
|
+
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
|
37
37
|
- restore_cache:
|
38
|
-
key:
|
38
|
+
key: v4-bundle-{{ checksum "Gemfile.lock" }}
|
39
39
|
- run: echo "export rvm_ignore_gemsets_flag=1" >> ~/.rvmrc
|
40
40
|
- run: sudo apt-get update && sudo apt-get install -y libsodium-dev
|
41
|
-
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
|
41
|
+
- run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
|
42
42
|
- save_cache:
|
43
|
-
key:
|
43
|
+
key: v4-bundle-{{ checksum "Gemfile.lock" }}
|
44
44
|
paths:
|
45
45
|
- ~/coins_paid/vendor/bundle
|
46
46
|
|
@@ -53,9 +53,9 @@ jobs:
|
|
53
53
|
CIRCLE_ARTIFACTS: "./tmp"
|
54
54
|
steps:
|
55
55
|
- restore_cache:
|
56
|
-
key:
|
56
|
+
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
|
57
57
|
- restore_cache:
|
58
|
-
key:
|
58
|
+
key: v4-bundle-{{ checksum "Gemfile.lock" }}
|
59
59
|
- attach_workspace:
|
60
60
|
at: ~/coins_paid
|
61
61
|
- run: sudo apt-get update && sudo apt-get install -y libsodium-dev
|
@@ -81,9 +81,9 @@ jobs:
|
|
81
81
|
<<: *defaults
|
82
82
|
steps:
|
83
83
|
- restore_cache:
|
84
|
-
key:
|
84
|
+
key: v4-repo-{{ .Environment.CIRCLE_SHA1 }}
|
85
85
|
- restore_cache:
|
86
|
-
key:
|
86
|
+
key: v4-bundle-{{ checksum "Gemfile.lock" }}
|
87
87
|
- run: mkdir -p ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts
|
88
88
|
- run: sudo apt-get update && sudo apt-get install -y libsodium-dev
|
89
89
|
- run: bundle check --path vendor/bundle
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.1
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
coins_paid_rails (1.1.3)
|
5
|
+
activerecord (>= 4.2.0)
|
6
|
+
coins_paid_api (~> 1.0)
|
7
|
+
dry-initializer (~> 3.0)
|
8
|
+
dry-struct (~> 1.0)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: http://www.rubygems.org/
|
12
|
+
specs:
|
13
|
+
actionpack (5.2.4.4)
|
14
|
+
actionview (= 5.2.4.4)
|
15
|
+
activesupport (= 5.2.4.4)
|
16
|
+
rack (~> 2.0, >= 2.0.8)
|
17
|
+
rack-test (>= 0.6.3)
|
18
|
+
rails-dom-testing (~> 2.0)
|
19
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
20
|
+
actionview (5.2.4.4)
|
21
|
+
activesupport (= 5.2.4.4)
|
22
|
+
builder (~> 3.1)
|
23
|
+
erubi (~> 1.4)
|
24
|
+
rails-dom-testing (~> 2.0)
|
25
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
26
|
+
activemodel (5.2.4.4)
|
27
|
+
activesupport (= 5.2.4.4)
|
28
|
+
activerecord (5.2.4.4)
|
29
|
+
activemodel (= 5.2.4.4)
|
30
|
+
activesupport (= 5.2.4.4)
|
31
|
+
arel (>= 9.0)
|
32
|
+
activesupport (5.2.4.4)
|
33
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
34
|
+
i18n (>= 0.7, < 2)
|
35
|
+
minitest (~> 5.1)
|
36
|
+
tzinfo (~> 1.1)
|
37
|
+
arel (9.0.0)
|
38
|
+
builder (3.2.4)
|
39
|
+
coins_paid_api (1.0.5)
|
40
|
+
dry-struct (~> 1.0)
|
41
|
+
faraday (~> 0.12)
|
42
|
+
faraday_middleware (~> 0.11)
|
43
|
+
concurrent-ruby (1.1.7)
|
44
|
+
crass (1.0.6)
|
45
|
+
diff-lcs (1.4.4)
|
46
|
+
docile (1.1.5)
|
47
|
+
dry-configurable (0.12.1)
|
48
|
+
concurrent-ruby (~> 1.0)
|
49
|
+
dry-core (~> 0.5, >= 0.5.0)
|
50
|
+
dry-container (0.7.2)
|
51
|
+
concurrent-ruby (~> 1.0)
|
52
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
53
|
+
dry-core (0.5.0)
|
54
|
+
concurrent-ruby (~> 1.0)
|
55
|
+
dry-inflector (0.2.0)
|
56
|
+
dry-initializer (3.0.4)
|
57
|
+
dry-logic (1.1.0)
|
58
|
+
concurrent-ruby (~> 1.0)
|
59
|
+
dry-core (~> 0.5, >= 0.5)
|
60
|
+
dry-struct (1.4.0)
|
61
|
+
dry-core (~> 0.5, >= 0.5)
|
62
|
+
dry-types (~> 1.5)
|
63
|
+
ice_nine (~> 0.11)
|
64
|
+
dry-types (1.5.1)
|
65
|
+
concurrent-ruby (~> 1.0)
|
66
|
+
dry-container (~> 0.3)
|
67
|
+
dry-core (~> 0.5, >= 0.5)
|
68
|
+
dry-inflector (~> 0.1, >= 0.1.2)
|
69
|
+
dry-logic (~> 1.0, >= 1.0.2)
|
70
|
+
erubi (1.10.0)
|
71
|
+
faraday (0.17.4)
|
72
|
+
multipart-post (>= 1.2, < 3)
|
73
|
+
faraday_middleware (0.14.0)
|
74
|
+
faraday (>= 0.7.4, < 1.0)
|
75
|
+
i18n (1.8.5)
|
76
|
+
concurrent-ruby (~> 1.0)
|
77
|
+
ice_nine (0.11.2)
|
78
|
+
json (2.3.0)
|
79
|
+
loofah (2.8.0)
|
80
|
+
crass (~> 1.0.2)
|
81
|
+
nokogiri (>= 1.5.9)
|
82
|
+
method_source (1.0.0)
|
83
|
+
mini_portile2 (2.5.0)
|
84
|
+
minitest (5.14.2)
|
85
|
+
multipart-post (2.1.1)
|
86
|
+
nokogiri (1.11.1)
|
87
|
+
mini_portile2 (~> 2.5.0)
|
88
|
+
racc (~> 1.4)
|
89
|
+
racc (1.5.2)
|
90
|
+
rack (2.2.3)
|
91
|
+
rack-test (1.1.0)
|
92
|
+
rack (>= 1.0, < 3)
|
93
|
+
rails-dom-testing (2.0.3)
|
94
|
+
activesupport (>= 4.2.0)
|
95
|
+
nokogiri (>= 1.6)
|
96
|
+
rails-html-sanitizer (1.3.0)
|
97
|
+
loofah (~> 2.3)
|
98
|
+
railties (5.2.4.4)
|
99
|
+
actionpack (= 5.2.4.4)
|
100
|
+
activesupport (= 5.2.4.4)
|
101
|
+
method_source
|
102
|
+
rake (>= 0.8.7)
|
103
|
+
thor (>= 0.19.0, < 2.0)
|
104
|
+
rake (13.0.1)
|
105
|
+
rspec-core (3.10.0)
|
106
|
+
rspec-support (~> 3.10.0)
|
107
|
+
rspec-expectations (3.10.0)
|
108
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
109
|
+
rspec-support (~> 3.10.0)
|
110
|
+
rspec-its (1.3.0)
|
111
|
+
rspec-core (>= 3.0.0)
|
112
|
+
rspec-expectations (>= 3.0.0)
|
113
|
+
rspec-mocks (3.10.0)
|
114
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
115
|
+
rspec-support (~> 3.10.0)
|
116
|
+
rspec-rails (4.0.1)
|
117
|
+
actionpack (>= 4.2)
|
118
|
+
activesupport (>= 4.2)
|
119
|
+
railties (>= 4.2)
|
120
|
+
rspec-core (~> 3.9)
|
121
|
+
rspec-expectations (~> 3.9)
|
122
|
+
rspec-mocks (~> 3.9)
|
123
|
+
rspec-support (~> 3.9)
|
124
|
+
rspec-support (3.10.0)
|
125
|
+
simplecov (0.13.0)
|
126
|
+
docile (~> 1.1.0)
|
127
|
+
json (>= 1.8, < 3)
|
128
|
+
simplecov-html (~> 0.10.0)
|
129
|
+
simplecov-html (0.10.2)
|
130
|
+
sqlite3 (1.4.2)
|
131
|
+
thor (1.0.1)
|
132
|
+
thread_safe (0.3.6)
|
133
|
+
tzinfo (1.2.8)
|
134
|
+
thread_safe (~> 0.1)
|
135
|
+
|
136
|
+
PLATFORMS
|
137
|
+
ruby
|
138
|
+
|
139
|
+
DEPENDENCIES
|
140
|
+
coins_paid_rails!
|
141
|
+
rspec-its
|
142
|
+
rspec-rails
|
143
|
+
simplecov
|
144
|
+
sqlite3
|
145
|
+
|
146
|
+
BUNDLED WITH
|
147
|
+
1.17.1
|
data/coins_paid_rails.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'coins_paid_rails'
|
3
3
|
s.authors = ['Artem Biserov(artembiserov)', 'Oleg Ivanov(morhekil)']
|
4
|
-
s.version = '1.
|
4
|
+
s.version = '1.1.4'
|
5
5
|
s.files = `git ls-files`.split("\n")
|
6
6
|
s.summary = 'CoinsPaid Rails Integration'
|
7
7
|
s.license = 'MIT'
|
@@ -10,6 +10,5 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.add_runtime_dependency 'activerecord', '>= 4.2.0'
|
11
11
|
s.add_runtime_dependency 'dry-initializer', '~> 3.0'
|
12
12
|
s.add_runtime_dependency 'dry-struct', '~> 1.0'
|
13
|
-
s.add_development_dependency 'rspec-rails'
|
13
|
+
s.add_development_dependency 'rspec-rails'
|
14
14
|
end
|
15
|
-
|
data/lib/coins_paid.rb
CHANGED
@@ -12,10 +12,17 @@ module CoinsPaid
|
|
12
12
|
|
13
13
|
DEFAULT_CONVERT_TO = ENV['COINS_PAID_CURRENCY']
|
14
14
|
|
15
|
-
|
15
|
+
ADDRESS_PREFIXES = {
|
16
16
|
'BTC' => 'bitcoin',
|
17
|
+
'BCH' => 'bitcoincash',
|
18
|
+
'DOGE' => 'doge',
|
17
19
|
'ETH' => 'ethereum',
|
18
|
-
'
|
20
|
+
'EURTE' => 'ethereum',
|
21
|
+
'LTC' => 'litecoin',
|
22
|
+
'USDT' => 'bitcoin',
|
23
|
+
'USDTE' => 'ethereum',
|
24
|
+
'TRX' => 'tron',
|
25
|
+
'USDTT' => 'tron'
|
19
26
|
}.freeze
|
20
27
|
|
21
28
|
def address(foreign_id, currency:)
|
data/lib/coins_paid/address.rb
CHANGED
@@ -17,9 +17,11 @@ module CoinsPaid
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def call
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
ActiveRecord::Base.transaction do
|
21
|
+
CoinsPaidAddress.lock.find_or_create_by!(request_data.attributes.slice(:foreign_id, :currency)) do |address|
|
22
|
+
response = CoinsPaid::API.take_address(request_data.attributes)
|
23
|
+
address.assign_attributes(response.attributes)
|
24
|
+
end
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
data/lib/coins_paid/qr_code.rb
CHANGED
data/lib/coins_paid_rails.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coins_paid_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Biserov(artembiserov)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: coins_paid_api
|
@@ -71,16 +71,16 @@ dependencies:
|
|
71
71
|
name: rspec-rails
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '0'
|
84
84
|
description:
|
85
85
|
email:
|
86
86
|
executables: []
|
@@ -90,7 +90,9 @@ files:
|
|
90
90
|
- ".circleci/config.yml"
|
91
91
|
- ".gitignore"
|
92
92
|
- ".rspec"
|
93
|
+
- ".ruby-version"
|
93
94
|
- Gemfile
|
95
|
+
- Gemfile.lock
|
94
96
|
- coins_paid_rails.gemspec
|
95
97
|
- lib/coins_paid.rb
|
96
98
|
- lib/coins_paid/address.rb
|