coins_paid_api 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.semaphore/semaphore.yml +53 -0
- data/coins_paid_api.gemspec +1 -1
- data/lib/coins_paid/api/withdrawal.rb +1 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/withdrawal_spec.rb +8 -5
- metadata +10 -11
- data/.circleci/config.yml +0 -108
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 260803735b1d42b79cef17dcedd7c0a7e5fc3dd448651467cd532ab14bb96b29
|
4
|
+
data.tar.gz: c43acc80ec9ae13d4c467a9e842a31265b4e2393cea90750f45b23eeb5895ee3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42eb5f8e6a79eeda063e26d805f0aa0d7713bdab969239f2eb7a31c3a8373579b4d2bd2b5d51cbe1d7b490cd73e45b2fbbb426dbf95e24f0233b477089e0ad54
|
7
|
+
data.tar.gz: 9d6d1eb7b2ae14885fc37195a7ab9160cdfdba9581f3c89a5c8998d9d4f32f9d2dd1d0e6771692b59ee166117863da4412bc1f19e30f8a7b4c4469f5803a66d1
|
@@ -0,0 +1,53 @@
|
|
1
|
+
version: v1.0
|
2
|
+
name: Web Application
|
3
|
+
agent:
|
4
|
+
machine:
|
5
|
+
type: e1-standard-2
|
6
|
+
os_image: ubuntu2004
|
7
|
+
auto_cancel:
|
8
|
+
running:
|
9
|
+
when: "branch != 'master'"
|
10
|
+
blocks:
|
11
|
+
- name: Install dependencies
|
12
|
+
task:
|
13
|
+
jobs:
|
14
|
+
- name: Run Bundler
|
15
|
+
commands:
|
16
|
+
- checkout
|
17
|
+
- cache restore gems-$SEMAPHORE_GIT_SHA
|
18
|
+
- sem-version ruby 2.7.5
|
19
|
+
- bundle config set --local path 'vendor/bundle'
|
20
|
+
- bundle install --jobs=4 --retry=3
|
21
|
+
- cache store gems-$SEMAPHORE_GIT_SHA vendor/bundle
|
22
|
+
- name: Download CC
|
23
|
+
commands:
|
24
|
+
- mkdir -p cc/
|
25
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-0.7.0-linux-amd64 > ~/cc/cc-test-reporter
|
26
|
+
- chmod +x ~/cc/cc-test-reporter
|
27
|
+
- cache store cc-test-reporter ~/cc/cc-test-reporter
|
28
|
+
- name: Run Tests
|
29
|
+
task:
|
30
|
+
env_vars:
|
31
|
+
- name: COVERAGE
|
32
|
+
value: '1'
|
33
|
+
jobs:
|
34
|
+
- name: Run Rspec
|
35
|
+
commands:
|
36
|
+
- checkout
|
37
|
+
- cache restore cc-test-reporter
|
38
|
+
- cache restore gems-$SEMAPHORE_GIT_SHA
|
39
|
+
- sem-version ruby 2.7.5
|
40
|
+
- bundle config set --local path 'vendor/bundle'
|
41
|
+
- bundle exec rspec spec
|
42
|
+
- ~/cc/cc-test-reporter format-coverage -t simplecov -o ~/cc/codeclimate.rspec.json tmp/coverage/.resultset.json
|
43
|
+
- cache store rspec-report-$SEMAPHORE_GIT_SHA ~/cc/codeclimate.rspec.json
|
44
|
+
- name: Upload CC report
|
45
|
+
task:
|
46
|
+
secrets:
|
47
|
+
- name: private-repo
|
48
|
+
jobs:
|
49
|
+
- name: Upload coverage result
|
50
|
+
commands:
|
51
|
+
- cache restore cc-test-reporter
|
52
|
+
- cache restore rspec-report-$SEMAPHORE_GIT_SHA
|
53
|
+
- ~/cc/cc-test-reporter upload-coverage -i ~/cc/codeclimate.rspec.json
|
data/coins_paid_api.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'coins_paid_api'
|
3
3
|
s.authors = ['Artem Biserov(artembiserov)', 'Oleg Ivanov(morhekil)']
|
4
|
-
s.version = '
|
4
|
+
s.version = '2.0.0'
|
5
5
|
s.files = `git ls-files`.split("\n")
|
6
6
|
s.summary = 'Coins Paid Integration'
|
7
7
|
s.license = 'MIT'
|
@@ -7,14 +7,13 @@ module CoinsPaid
|
|
7
7
|
attribute :foreign_id, Types::Coercible::String
|
8
8
|
attribute :amount, Types::Coercible::String
|
9
9
|
attribute :currency, Types::String
|
10
|
-
attribute :convert_to, Types::String
|
11
10
|
attribute :address, Types::String
|
11
|
+
attribute? :convert_to, Types::String
|
12
12
|
attribute? :tag, Types::String
|
13
13
|
end
|
14
14
|
|
15
15
|
class Response < Dry::Struct
|
16
16
|
attribute :external_id, Types::Integer
|
17
|
-
attribute :receiver_amount, Types::Coercible::Float
|
18
17
|
end
|
19
18
|
|
20
19
|
PATH = 'withdrawal/crypto'
|
data/spec/spec_helper.rb
CHANGED
data/spec/withdrawal_spec.rb
CHANGED
@@ -25,7 +25,6 @@ RSpec.shared_examples 'CoinsPaid API withdrawal' do
|
|
25
25
|
let(:expected_withdrawal_attributes) do
|
26
26
|
{
|
27
27
|
external_id: 1,
|
28
|
-
receiver_amount: 0.001
|
29
28
|
}
|
30
29
|
end
|
31
30
|
subject(:withdraw) { described_class.withdraw(request_data) }
|
@@ -48,20 +47,24 @@ describe CoinsPaid::API, '.withdraw' do
|
|
48
47
|
{
|
49
48
|
foreign_id: 'user-id:2048',
|
50
49
|
amount: '0.01',
|
51
|
-
currency: '
|
52
|
-
convert_to: 'BTC',
|
50
|
+
currency: 'BTC',
|
53
51
|
address: 'abc123'
|
54
52
|
}
|
55
53
|
end
|
56
54
|
let(:request_body) { request_data.to_json }
|
57
55
|
|
56
|
+
context 'request does not include tag parameter or convert_to' do
|
57
|
+
let(:request_data) { base_request_data }
|
58
|
+
it_behaves_like 'CoinsPaid API withdrawal'
|
59
|
+
end
|
60
|
+
|
58
61
|
context 'request includes tag parameter' do
|
59
62
|
let(:request_data) { base_request_data.merge(tag: 'thetag') }
|
60
63
|
it_behaves_like 'CoinsPaid API withdrawal'
|
61
64
|
end
|
62
65
|
|
63
|
-
context 'request
|
64
|
-
let(:request_data) { base_request_data }
|
66
|
+
context 'request includes convert_to' do
|
67
|
+
let(:request_data) { base_request_data.merge(currency: 'EUR', convert_to: 'BTC') }
|
65
68
|
it_behaves_like 'CoinsPaid API withdrawal'
|
66
69
|
end
|
67
70
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coins_paid_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Biserov(artembiserov)
|
8
8
|
- Oleg Ivanov(morhekil)
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-struct
|
@@ -81,16 +81,16 @@ dependencies:
|
|
81
81
|
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '3.7'
|
84
|
-
description:
|
85
|
-
email:
|
84
|
+
description:
|
85
|
+
email:
|
86
86
|
executables: []
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|
89
89
|
files:
|
90
|
-
- ".circleci/config.yml"
|
91
90
|
- ".gitignore"
|
92
91
|
- ".rspec"
|
93
92
|
- ".rubocop.yml"
|
93
|
+
- ".semaphore/semaphore.yml"
|
94
94
|
- Gemfile
|
95
95
|
- coins_paid_api.gemspec
|
96
96
|
- lib/coins_paid/api.rb
|
@@ -113,11 +113,11 @@ files:
|
|
113
113
|
- spec/support/shared/data.rb
|
114
114
|
- spec/take_address_spec.rb
|
115
115
|
- spec/withdrawal_spec.rb
|
116
|
-
homepage:
|
116
|
+
homepage:
|
117
117
|
licenses:
|
118
118
|
- MIT
|
119
119
|
metadata: {}
|
120
|
-
post_install_message:
|
120
|
+
post_install_message:
|
121
121
|
rdoc_options: []
|
122
122
|
require_paths:
|
123
123
|
- lib
|
@@ -132,9 +132,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
|
-
|
136
|
-
|
137
|
-
signing_key:
|
135
|
+
rubygems_version: 3.1.6
|
136
|
+
signing_key:
|
138
137
|
specification_version: 4
|
139
138
|
summary: Coins Paid Integration
|
140
139
|
test_files: []
|
data/.circleci/config.yml
DELETED
@@ -1,108 +0,0 @@
|
|
1
|
-
version: 2.0
|
2
|
-
defaults: &defaults
|
3
|
-
docker:
|
4
|
-
- image: circleci/ruby:2.5-stretch-node
|
5
|
-
working_directory: ~/coins_paid_api
|
6
|
-
|
7
|
-
jobs:
|
8
|
-
checkout_code:
|
9
|
-
<<: *defaults
|
10
|
-
steps:
|
11
|
-
- checkout
|
12
|
-
- run: mkdir log
|
13
|
-
- save_cache:
|
14
|
-
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
|
15
|
-
paths:
|
16
|
-
- ~/coins_paid_api
|
17
|
-
|
18
|
-
download_cc_reporter:
|
19
|
-
<<: *defaults
|
20
|
-
steps:
|
21
|
-
- run:
|
22
|
-
name: Download cc-test-reporter
|
23
|
-
command: |
|
24
|
-
mkdir -p cc/
|
25
|
-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc/cc-test-reporter
|
26
|
-
chmod +x ./cc/cc-test-reporter
|
27
|
-
- persist_to_workspace:
|
28
|
-
root: ~/coins_paid_api
|
29
|
-
paths:
|
30
|
-
- cc/cc-test-reporter
|
31
|
-
|
32
|
-
run_bundler:
|
33
|
-
<<: *defaults
|
34
|
-
steps:
|
35
|
-
- restore_cache:
|
36
|
-
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
|
37
|
-
- restore_cache:
|
38
|
-
key: v1-bundle-{{ checksum "Gemfile" }}
|
39
|
-
- run: echo "export rvm_ignore_gemsets_flag=1" >> ~/.rvmrc
|
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
|
42
|
-
- save_cache:
|
43
|
-
key: v1-bundle-{{ checksum "Gemfile" }}
|
44
|
-
paths:
|
45
|
-
- ~/coins_paid_api/vendor/bundle
|
46
|
-
|
47
|
-
run_rspec_tests:
|
48
|
-
<<: *defaults
|
49
|
-
docker:
|
50
|
-
- image: circleci/ruby:2.5-stretch-node
|
51
|
-
environment:
|
52
|
-
RACK_ENV: "test"
|
53
|
-
CIRCLE_ARTIFACTS: "./tmp"
|
54
|
-
steps:
|
55
|
-
- restore_cache:
|
56
|
-
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
|
57
|
-
- restore_cache:
|
58
|
-
key: v1-bundle-{{ checksum "Gemfile" }}
|
59
|
-
- attach_workspace:
|
60
|
-
at: ~/coins_paid_api
|
61
|
-
- run: sudo apt-get update && sudo apt-get install -y libsodium-dev
|
62
|
-
- run: bundle check --path vendor/bundle
|
63
|
-
- run: bundle exec rspec spec
|
64
|
-
- run: ./cc/cc-test-reporter format-coverage -t simplecov -o cc/codeclimate.rspec.json tmp/coverage/.resultset.json
|
65
|
-
- persist_to_workspace:
|
66
|
-
root: ~/coins_paid_api
|
67
|
-
paths:
|
68
|
-
- cc/codeclimate.rspec.json
|
69
|
-
|
70
|
-
upload_cc_coverage:
|
71
|
-
<<: *defaults
|
72
|
-
steps:
|
73
|
-
- attach_workspace:
|
74
|
-
at: ~/coins_paid_api
|
75
|
-
- run:
|
76
|
-
name: Upload coverage results to Code Climate
|
77
|
-
command: |
|
78
|
-
./cc/cc-test-reporter upload-coverage -i cc/codeclimate.rspec.json
|
79
|
-
|
80
|
-
deploy:
|
81
|
-
<<: *defaults
|
82
|
-
steps:
|
83
|
-
- restore_cache:
|
84
|
-
key: v1-repo-{{ .Environment.CIRCLE_SHA1 }}
|
85
|
-
- restore_cache:
|
86
|
-
key: v1-bundle-{{ checksum "Gemfile" }}
|
87
|
-
- run: mkdir -p ~/.ssh && ssh-keyscan -H github.com >> ~/.ssh/known_hosts
|
88
|
-
- run: sudo apt-get update && sudo apt-get install -y libsodium-dev
|
89
|
-
- run: bundle check --path vendor/bundle
|
90
|
-
- run: bundle exec rake deploy:branch_or_label
|
91
|
-
|
92
|
-
workflows:
|
93
|
-
version: 2
|
94
|
-
build_test_deploy:
|
95
|
-
jobs:
|
96
|
-
- checkout_code
|
97
|
-
- download_cc_reporter:
|
98
|
-
requires:
|
99
|
-
- checkout_code
|
100
|
-
- run_bundler:
|
101
|
-
requires:
|
102
|
-
- download_cc_reporter
|
103
|
-
- run_rspec_tests:
|
104
|
-
requires:
|
105
|
-
- run_bundler
|
106
|
-
- upload_cc_coverage:
|
107
|
-
requires:
|
108
|
-
- run_rspec_tests
|