tikkie-api 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +8 -5
- data/Gemfile +1 -1
- data/Gemfile.lock +15 -13
- data/README.md +5 -3
- data/lib/tikkie/api/requests/payment_requests.rb +5 -4
- data/lib/tikkie/api/responses/payment.rb +1 -1
- data/lib/tikkie/api/responses/payment_request.rb +1 -1
- data/lib/tikkie/api/version.rb +1 -1
- data/tikkie-api.gemspec +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10c4a5614f612f5644d20fc71952d57c7104086e8a2ab377183fea972a9f21fd
|
4
|
+
data.tar.gz: 66e49070354bc7fff4dd78ca1da2b37e404e47ba324502ecf22b7a68f4644a9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0c1ff2ba7627421270620a60a8510d8958261e0239f3650fc7f6e82242d846bf712051b65d3c5c7ede981b91b46fbb8b970e85f5a4d6a870becc18eed77db84
|
7
|
+
data.tar.gz: b5ca9fed8e11d329c76f3d90ea877f77b3c376e9b7b04897868fb21adc2b007fd00b0681276713f81b81d15948d2311adf12b309059c9be98a27012fa2583400
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tikkie-api (0.
|
4
|
+
tikkie-api (0.2.0)
|
5
5
|
jwt (>= 1.0)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,16 +9,17 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
addressable (2.5.2)
|
11
11
|
public_suffix (>= 2.0.2, < 4.0)
|
12
|
-
ast (2.
|
12
|
+
ast (2.4.0)
|
13
13
|
crack (0.4.3)
|
14
14
|
safe_yaml (~> 1.0.0)
|
15
15
|
diff-lcs (1.3)
|
16
16
|
hashdiff (0.3.7)
|
17
|
+
jaro_winkler (1.5.2)
|
17
18
|
jwt (2.1.0)
|
18
|
-
parallel (1.
|
19
|
-
parser (2.
|
20
|
-
ast (~> 2.
|
21
|
-
powerpack (0.1.
|
19
|
+
parallel (1.13.0)
|
20
|
+
parser (2.6.0.0)
|
21
|
+
ast (~> 2.4.0)
|
22
|
+
powerpack (0.1.2)
|
22
23
|
public_suffix (3.0.1)
|
23
24
|
rainbow (3.0.0)
|
24
25
|
rake (10.5.0)
|
@@ -35,17 +36,18 @@ GEM
|
|
35
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
36
37
|
rspec-support (~> 3.7.0)
|
37
38
|
rspec-support (3.7.0)
|
38
|
-
rubocop (0.
|
39
|
+
rubocop (0.63.1)
|
40
|
+
jaro_winkler (~> 1.5.1)
|
39
41
|
parallel (~> 1.10)
|
40
|
-
parser (>= 2.
|
42
|
+
parser (>= 2.5, != 2.5.1.1)
|
41
43
|
powerpack (~> 0.1)
|
42
44
|
rainbow (>= 2.2.2, < 4.0)
|
43
45
|
ruby-progressbar (~> 1.7)
|
44
|
-
unicode-display_width (~> 1.
|
45
|
-
ruby-progressbar (1.
|
46
|
+
unicode-display_width (~> 1.4.0)
|
47
|
+
ruby-progressbar (1.10.0)
|
46
48
|
safe_yaml (1.0.4)
|
47
49
|
timecop (0.9.1)
|
48
|
-
unicode-display_width (1.
|
50
|
+
unicode-display_width (1.4.1)
|
49
51
|
webmock (2.3.2)
|
50
52
|
addressable (>= 2.3.6)
|
51
53
|
crack (>= 0.3.2)
|
@@ -58,10 +60,10 @@ DEPENDENCIES
|
|
58
60
|
bundler (~> 1.16)
|
59
61
|
rake (~> 10.0)
|
60
62
|
rspec (~> 3.0)
|
61
|
-
rubocop (~> 0.
|
63
|
+
rubocop (~> 0.63.1)
|
62
64
|
tikkie-api!
|
63
65
|
timecop (~> 0.9)
|
64
66
|
webmock (~> 2.3)
|
65
67
|
|
66
68
|
BUNDLED WITH
|
67
|
-
1.
|
69
|
+
1.17.2
|
data/README.md
CHANGED
@@ -113,20 +113,22 @@ To retrieve a single payment request:
|
|
113
113
|
payment_request = client.payment_requests.get("platform_token", "user_token", "payment_request_token")
|
114
114
|
```
|
115
115
|
|
116
|
-
Create a new payment request for an existing user:
|
116
|
+
Create a new payment request (i.e. Tikkie) for an existing user:
|
117
117
|
|
118
118
|
```ruby
|
119
119
|
payment_request = client.payment_requests.create("platform_token", "user_token", "bank_account_token",
|
120
|
-
amount: "5.00",
|
120
|
+
amount: "5.00", # optional
|
121
121
|
currency: "EUR",
|
122
122
|
description: "Test",
|
123
|
-
external_id: "Invoice 12345" #
|
123
|
+
external_id: "Invoice 12345" # mandatory only when platform_usage is set to `FOR_MYSELF`
|
124
124
|
)
|
125
125
|
|
126
126
|
tikkie_url = payment_request.payment_request_url
|
127
127
|
payment_request_token = payment_request.payment_request_token
|
128
128
|
```
|
129
129
|
|
130
|
+
The parameter `amount` is optional. When omitted, it will create a payment request with an open amount, where the payer can decide on the amount.
|
131
|
+
|
130
132
|
### Error handling
|
131
133
|
|
132
134
|
All responses to an API request include the methods `success?` and `error?` to determine whether the API call was successful or not. When the API request was not successful, the method `errors` will return details about the error response.
|
@@ -33,11 +33,12 @@ module Tikkie
|
|
33
33
|
|
34
34
|
def create(platform_token, user_token, bank_account_token, options = {})
|
35
35
|
params = {
|
36
|
-
amountInCents: to_cents(options.fetch(:amount)),
|
37
36
|
currency: options.fetch(:currency),
|
38
|
-
description: options.fetch(:description)
|
39
|
-
externalId: options[:external_id]
|
37
|
+
description: options.fetch(:description)
|
40
38
|
}
|
39
|
+
params[:amountInCents] = to_cents(options[:amount]) if options.key?(:amount)
|
40
|
+
params[:externalId] = options[:external_id] if options.key?(:external_id)
|
41
|
+
|
41
42
|
response = @request.post("/tikkie/platforms/#{platform_token}/users/#{user_token}/bankaccounts/#{bank_account_token}/paymentrequests", params)
|
42
43
|
|
43
44
|
Tikkie::Api::Responses::PaymentRequestCreated.new(response)
|
@@ -46,7 +47,7 @@ module Tikkie
|
|
46
47
|
private
|
47
48
|
|
48
49
|
def to_cents(amount)
|
49
|
-
decimal = BigDecimal
|
50
|
+
decimal = BigDecimal(amount.to_s)
|
50
51
|
decimal *= 100 # to cents
|
51
52
|
decimal.to_i
|
52
53
|
end
|
data/lib/tikkie/api/version.rb
CHANGED
data/tikkie-api.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tikkie-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kentaa BV
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -160,8 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
- !ruby/object:Gem::Version
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
|
-
|
164
|
-
rubygems_version: 2.7.6
|
163
|
+
rubygems_version: 3.0.1
|
165
164
|
signing_key:
|
166
165
|
specification_version: 4
|
167
166
|
summary: Ruby library for communicating with the Tikkie API
|