core_pro.rb 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +17 -10
- data/lib/core_pro/version.rb +1 -1
- data/lib/core_pro.rb +18 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 130b62b258a66f45f4d37795a3d33bce4d57bbc1c0ebcf1238afe2a0e4e2bf90
|
|
4
|
+
data.tar.gz: e5bb0ab3b6da965530a0b5cbe1e8505cc2d1e16ddb3adae4564f6ada38d5201a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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 [
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
* `
|
|
81
|
-
* `
|
|
82
|
-
* `
|
|
87
|
+
* `HELIX_KEY`
|
|
88
|
+
* `HELIX_SECRET`
|
|
89
|
+
* `HELIX_ENDPOINT` defaults to `https://api.helix.q2.com`
|
|
83
90
|
|
|
84
91
|
## Development
|
|
85
92
|
|
data/lib/core_pro/version.rb
CHANGED
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
|
-
|
|
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.
|
|
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:
|
|
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.
|
|
171
|
+
rubygems_version: 3.3.3
|
|
172
172
|
signing_key:
|
|
173
173
|
specification_version: 4
|
|
174
174
|
summary: CorePro Ruby SDK
|