core_pro.rb 0.0.3 → 0.0.4

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: 9cc3320dc6e0337106f9909f4e066b59f15a3c21048917896e070740183755e9
4
- data.tar.gz: d248316415db95b24fb932ff2dd98f7730cc81be574b5ebb790aa65f224412d7
3
+ metadata.gz: 130b62b258a66f45f4d37795a3d33bce4d57bbc1c0ebcf1238afe2a0e4e2bf90
4
+ data.tar.gz: e5bb0ab3b6da965530a0b5cbe1e8505cc2d1e16ddb3adae4564f6ada38d5201a
5
5
  SHA512:
6
- metadata.gz: 56b4389a3ce504bb9b3724ff4677cd937a3fb75a30ec3defff791691fa71a6d1c99f84258042ecbb3a0ca2170ae405f55fe8752b34f190cc24b0bd4e9057da9e
7
- data.tar.gz: 71b067af6335bbda34a81c769ec530b25b976b26fdb4707e34192a8dc2d5127bf09fd1c5fc8ed86d9851b531238a299215928f441a2445816d760632fd33b594
6
+ metadata.gz: b4a3880e631dc4a72d38f58a7f21892e5eba603e0c8c1447e0e8205deac302de3f33a5b473cf0565f14fdd988c614c18a8f30126e8429047834469bcd8d1fe7d
7
+ data.tar.gz: 2e029a79d634de155fb9353d650adab6ca1c245517cb7b6149b65092414feaced0c143c7e412d61db16ce4546c461bc4d00c445cd4a845c5e788d99246ae083d
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # CorePro API SDK
1
+ # Helix by Q2 (ex CorePro) API SDK
2
2
 
3
- Ruby SDK for working with [CorePro](https://docs.corepro.io)
3
+ Ruby SDK for working with [Helix Q2](https://docs.helix.q2.com)
4
4
 
5
5
  ## Installation
6
6
 
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- A subset of the CorePro resources are provided with this SDK:
23
+ A subset of the Helix/CorePro resources are provided with this SDK:
24
24
 
25
25
  * `CorePro::Program`
26
26
  * `CorePro::Customer`
@@ -34,6 +34,7 @@ These resources have implemented the following methods to allow API operations:
34
34
  * `#find`
35
35
  * `#create`
36
36
  * `#onboard(kyc_vendor)` (only for `CorePro::Customer`)
37
+ * `#by_tag` (only for `CorePro::Transaction`)
37
38
 
38
39
  Here's an example on how to create a customer, an account,
39
40
  and initiate a transfer:
@@ -66,10 +67,16 @@ transfer = CorePro::Transfer.create(
66
67
  )
67
68
 
68
69
  transactions = CorePro::Transaction.all(
69
- customerId,
70
- accountId,
71
- '2021-12-21',
72
- '2021-12-22'
70
+ [
71
+ customerId,
72
+ accountId,
73
+ '2021-12-21',
74
+ '2021-12-22'
75
+ ],
76
+ {
77
+ pageNumber: 0,
78
+ pageSize: 200
79
+ }
73
80
  )
74
81
  ```
75
82
 
@@ -77,9 +84,9 @@ transactions = CorePro::Transaction.all(
77
84
 
78
85
  The API keys will be loaded from your environment variables:
79
86
 
80
- * `COREPRO_KEY`
81
- * `COREPRO_SECRET`
82
- * `COREPRO_ENDPOINT` defaults to `https://api.corepro.io`
87
+ * `HELIX_KEY`
88
+ * `HELIX_SECRET`
89
+ * `HELIX_ENDPOINT` defaults to `https://api.helix.q2.com`
83
90
 
84
91
  ## Development
85
92
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CorePro
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
data/lib/core_pro.rb CHANGED
@@ -8,9 +8,16 @@ module CorePro
8
8
  class Resource < OpenStruct
9
9
  extend HTTP::RestClient::DSL
10
10
 
11
- endpoint(ENV['COREPRO_ENDPOINT'] || 'https://api.corepro.io')
12
11
  content_type 'application/json'
13
- basic_auth(user: ENV['COREPRO_KEY'], pass: ENV['COREPRO_SECRET'])
12
+ endpoint(
13
+ ENV['COREPRO_ENDPOINT'] ||
14
+ ENV['HELIX_ENDPOINT'] ||
15
+ 'https://api.helix.q2.com'
16
+ )
17
+ basic_auth(
18
+ user: ENV['COREPRO_KEY'] || ENV['HELIX_KEY'],
19
+ pass: ENV['COREPRO_SECRET'] || ENV['HELIX_SECRET']
20
+ )
14
21
 
15
22
  # Resource collection finder, uses the default limit
16
23
  #
@@ -146,5 +153,14 @@ module CorePro
146
153
  # Transaction endpoint resource
147
154
  class Transaction < Resource
148
155
  path '/transaction'
156
+
157
+ # By-tag finder method
158
+ #
159
+ # @param id_or_ids [String] resource indentifiers
160
+ # @param params [Hash] URI parameters to pass to the endpoint.
161
+ # @return [Object] instance
162
+ def self.by_tag(*id_or_ids)
163
+ objectify(request(:get, uri(:getByTag, *id_or_ids)))
164
+ end
149
165
  end
150
166
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: core_pro.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stas SUȘCOV
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-16 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http-rest_client
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  - !ruby/object:Gem::Version
169
169
  version: '0'
170
170
  requirements: []
171
- rubygems_version: 3.2.22
171
+ rubygems_version: 3.3.3
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: CorePro Ruby SDK