coins_paid_api 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f347724eaccb1361f9082352da01fdcdcf6becc50ba56e98f4826cac56f92e87
4
- data.tar.gz: f018f55ad92352b0d10fe4ff5358876e8df68a5505f0fc7c49f7600f4c292fb6
3
+ metadata.gz: 020d45404c81037d89565ba5e7dcb231982db444abdbd00a6f1535bfd9e73170
4
+ data.tar.gz: 84f0ab1f61a80fe45dedca5cc0d0ce8467e5328315fc75d0f3812702e84774a4
5
5
  SHA512:
6
- metadata.gz: 37fdf652b56173c030c62a01fed2eb7fccded736e441da735bf60aa7ab0ea9a577072333f663ff4572db7775e6784f9656f2505992c4639ea8d8037e1a7ca5f4
7
- data.tar.gz: 1cbc72a4c4b5c45125c84a6b825a2cebe033a36ae4307608ae1bdf201847c555eb8385040624269908ceac14947059045ae83f52ba40ff1cef28cf6ed1cd1d78
6
+ metadata.gz: cfd4a488e8434dd0ccc78b68feed059545f1d193bbaf2b226e597da371b04b454f459c4a157f55d56750805181048135322ef1671c09f82c78bb8e83186fc50f
7
+ data.tar.gz: c7ad6dea7bc2c80882df508506df798d7864cb59073db39f14cf46df55ea8d904d20a4416daf4e26ce8c5eee44570cd3c41b8a451760b2642f1ad1b9dc6761b9
@@ -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 = '1.0.5'
4
+ s.version = '1.0.6'
5
5
  s.files = `git ls-files`.split("\n")
6
6
  s.summary = 'Coins Paid Integration'
7
7
  s.license = 'MIT'
@@ -9,6 +9,7 @@ module CoinsPaid
9
9
  attribute :currency, Types::String
10
10
  attribute :convert_to, Types::String
11
11
  attribute :address, Types::String
12
+ attribute? :tag, Types::String
12
13
  end
13
14
 
14
15
  class Response < Dry::Struct
@@ -42,11 +42,8 @@ module CoinsPaid
42
42
  )
43
43
  end
44
44
 
45
- def withdraw(foreign_id:, amount:, currency:, convert_to:, address:)
46
- Requester.call(
47
- Withdrawal,
48
- foreign_id: foreign_id, amount: amount, currency: currency, convert_to: convert_to, address: address
49
- )
45
+ def withdraw(data)
46
+ Requester.call(Withdrawal, data)
50
47
  end
51
48
 
52
49
  def currencies_list
@@ -2,15 +2,9 @@
2
2
 
3
3
  require_relative './request_examples'
4
4
 
5
- describe CoinsPaid::API, '.withdraw' do
5
+ RSpec.shared_examples 'CoinsPaid API withdrawal' do |request_data:|
6
6
  endpoint = 'https://app.coinspaid.com/api/v2/withdrawal/crypto'
7
- request_data = {
8
- foreign_id: 'user-id:2048',
9
- amount: '0.01',
10
- currency: 'EUR',
11
- convert_to: 'BTC',
12
- address: 'abc123'
13
- }
7
+
14
8
  include_context 'CoinsPaid API request', request_data: request_data
15
9
 
16
10
  let(:response_data) do
@@ -48,3 +42,21 @@ describe CoinsPaid::API, '.withdraw' do
48
42
  end
49
43
  end
50
44
  end
45
+
46
+ describe CoinsPaid::API, '.withdraw' do
47
+ base_request_data = {
48
+ foreign_id: 'user-id:2048',
49
+ amount: '0.01',
50
+ currency: 'EUR',
51
+ convert_to: 'BTC',
52
+ address: 'abc123'
53
+ }
54
+
55
+ context 'request includes tag parameter' do
56
+ it_behaves_like 'CoinsPaid API withdrawal', request_data: base_request_data.merge(tag: 'thetag')
57
+ end
58
+
59
+ context 'request does not include tag parameter' do
60
+ it_behaves_like 'CoinsPaid API withdrawal', request_data: base_request_data
61
+ end
62
+ 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: 1.0.5
4
+ version: 1.0.6
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: 2020-04-16 00:00:00.000000000 Z
12
+ date: 2021-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dry-struct
@@ -81,8 +81,8 @@ 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: []
@@ -112,11 +112,11 @@ files:
112
112
  - spec/support/shared/data.rb
113
113
  - spec/take_address_spec.rb
114
114
  - spec/withdrawal_spec.rb
115
- homepage:
115
+ homepage:
116
116
  licenses:
117
117
  - MIT
118
118
  metadata: {}
119
- post_install_message:
119
+ post_install_message:
120
120
  rdoc_options: []
121
121
  require_paths:
122
122
  - lib
@@ -131,9 +131,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  requirements: []
134
- rubyforge_project:
134
+ rubyforge_project:
135
135
  rubygems_version: 2.7.6
136
- signing_key:
136
+ signing_key:
137
137
  specification_version: 4
138
138
  summary: Coins Paid Integration
139
139
  test_files: []