fintecture 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +18 -17
- data/.rspec +3 -3
- data/.travis.yml +7 -7
- data/CODE_OF_CONDUCT.md +74 -74
- data/Gemfile +8 -8
- data/Gemfile.lock +59 -59
- data/LICENSE.txt +674 -674
- data/README.md +405 -408
- data/Rakefile +8 -8
- data/bin/console +15 -15
- data/bin/setup +8 -8
- data/exemples/ais.rb +53 -53
- data/exemples/config_ais.json +7 -7
- data/exemples/config_pis.json +5 -5
- data/exemples/pis.rb +148 -148
- data/exemples/ressources.rb +23 -23
- data/fintecture.gemspec +44 -44
- data/lib/fintecture/ais_client.rb +94 -94
- data/lib/fintecture/api/ais/account_holders.rb +61 -61
- data/lib/fintecture/api/ais/accounts.rb +63 -63
- data/lib/fintecture/api/ais/authorize.rb +72 -72
- data/lib/fintecture/api/ais/authorize_decoupled.rb +68 -68
- data/lib/fintecture/api/ais/connect.rb +65 -65
- data/lib/fintecture/api/ais/delete_customer.rb +53 -53
- data/lib/fintecture/api/ais/transactions.rb +64 -64
- data/lib/fintecture/api/auth/authentication.rb +78 -78
- data/lib/fintecture/api/pis/connect.rb +84 -77
- data/lib/fintecture/api/pis/initiate.rb +52 -52
- data/lib/fintecture/api/pis/payments.rb +54 -48
- data/lib/fintecture/api/pis/refund.rb +67 -67
- data/lib/fintecture/api/pis/request_to_pay.rb +63 -63
- data/lib/fintecture/api/pis/settlements.rb +50 -50
- data/lib/fintecture/api/ressources/applications.rb +57 -57
- data/lib/fintecture/api/ressources/providers.rb +61 -61
- data/lib/fintecture/api/ressources/test_accounts.rb +60 -60
- data/lib/fintecture/base_url.rb +26 -26
- data/lib/fintecture/endpoints/ais.rb +17 -17
- data/lib/fintecture/endpoints/authentication.rb +13 -13
- data/lib/fintecture/endpoints/pis.rb +16 -16
- data/lib/fintecture/endpoints/ressources.rb +13 -13
- data/lib/fintecture/exceptions.rb +48 -48
- data/lib/fintecture/faraday/authentication/connection.rb +140 -140
- data/lib/fintecture/pis_client.rb +100 -100
- data/lib/fintecture/utils/constants.rb +11 -11
- data/lib/fintecture/utils/crypto.rb +75 -75
- data/lib/fintecture/utils/date.rb +15 -15
- data/lib/fintecture/utils/validation.rb +32 -32
- data/lib/fintecture/version.rb +5 -5
- data/lib/fintecture.rb +65 -65
- metadata +12 -6
data/README.md
CHANGED
@@ -1,408 +1,405 @@
|
|
1
|
-
# Fintecture
|
2
|
-
|
3
|
-
Fintecture is connected with most European banks and enables a user to initiate a payment directly from their bank account. This results to a bank transfer sent from the user's bank account directly to your bank account, skipping all intermediaries. Within the SEPA region, transfers take between 10 seconds to 1 business day to arrive on your bank account. No hidden fees. Check out [our website](https://fintecture.com/).
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'fintecture'
|
11
|
-
```
|
12
|
-
|
13
|
-
|
14
|
-
And then execute:
|
15
|
-
|
16
|
-
$ bundle
|
17
|
-
|
18
|
-
Or install it yourself as:
|
19
|
-
|
20
|
-
$ gem install fintecture
|
21
|
-
|
22
|
-
## Usage
|
23
|
-
|
24
|
-
Get started by subscribing to a free developer account. Join today to get access to our sandbox by registering on the [developer console](https://console.fintecture.com) by creating your first sets of API Keys. When creating an account, specify you are an ECOMMERCE. When you’re ready to deploy to production, just go through the Activation Form in your console. Once the Fintecture Team activates your account, you’ll be ready to start receiving real bank transfers directly on the bank account specified during activation.
|
25
|
-
|
26
|
-
By default `sandbox` is the initial environment, but you can change to
|
27
|
-
|
28
|
-
Initialize your PIS client
|
29
|
-
|
30
|
-
```ruby
|
31
|
-
pis_client = Fintecture::PisClient.new({
|
32
|
-
environment: 'sandbox', # => ["sandbox", "test", "production"]
|
33
|
-
app_id: 'your_app_id',
|
34
|
-
app_secret: 'your_app_secret',
|
35
|
-
private_key: %q(your_private_key)
|
36
|
-
})
|
37
|
-
```
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
Initialize your AIS client
|
42
|
-
|
43
|
-
```ruby
|
44
|
-
ais_client = Fintecture::AisClient.new({
|
45
|
-
environment: 'sandbox', # => ["sandbox", "test", "production"]
|
46
|
-
app_id: 'your_app_id',
|
47
|
-
app_secret: 'your_app_secret',
|
48
|
-
private_key: %q(your_private_key)
|
49
|
-
})
|
50
|
-
```
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
## PIS
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
pis_client.
|
59
|
-
pis_client.
|
60
|
-
pis_client.
|
61
|
-
pis_client.
|
62
|
-
pis_client.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
#
|
100
|
-
#
|
101
|
-
|
102
|
-
response = pis_client.
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
```
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
```
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
response = pis_client.settlements
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
```
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
ais_client.
|
169
|
-
ais_client.
|
170
|
-
ais_client.
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
```
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
```
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
#
|
250
|
-
#
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
Documentation
|
260
|
-
|
261
|
-
|
262
|
-
```ruby
|
263
|
-
# transactions (customer_id:, account_id:, remove_nulls: nil, convert_dates: nil, filters: nil)
|
264
|
-
# customer_id: string
|
265
|
-
# account_id: string
|
266
|
-
# remove_nulls: boolean
|
267
|
-
# convert_dates: boolean
|
268
|
-
# filters: {}
|
269
|
-
|
270
|
-
transactions_filters = {
|
271
|
-
"filter[date_to]": "2020-01-01",
|
272
|
-
'filter[date_from]': "max" # Date or 'max'
|
273
|
-
}
|
274
|
-
response = ais_client.transactions customer_id: customer_id, account_id: "b71722204d1a3f5ecd895", remove_nulls: true, convert_dates: true, filters: transactions_filters
|
275
|
-
```
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
'
|
320
|
-
'
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
## Code of Conduct
|
407
|
-
|
408
|
-
Everyone interacting in the Fintecture project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Fintecture/fintecture-sdk-ruby/blob/master/CODE_OF_CONDUCT.md).
|
1
|
+
# Fintecture
|
2
|
+
|
3
|
+
Fintecture is connected with most European banks and enables a user to initiate a payment directly from their bank account. This results to a bank transfer sent from the user's bank account directly to your bank account, skipping all intermediaries. Within the SEPA region, transfers take between 10 seconds to 1 business day to arrive on your bank account. No hidden fees. Check out [our website](https://fintecture.com/).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'fintecture'
|
11
|
+
```
|
12
|
+
|
13
|
+
|
14
|
+
And then execute:
|
15
|
+
|
16
|
+
$ bundle
|
17
|
+
|
18
|
+
Or install it yourself as:
|
19
|
+
|
20
|
+
$ gem install fintecture
|
21
|
+
|
22
|
+
## Usage
|
23
|
+
|
24
|
+
Get started by subscribing to a free developer account. Join today to get access to our sandbox by registering on the [developer console](https://console.fintecture.com) by creating your first sets of API Keys. When creating an account, specify you are an ECOMMERCE. When you’re ready to deploy to production, just go through the Activation Form in your console. Once the Fintecture Team activates your account, you’ll be ready to start receiving real bank transfers directly on the bank account specified during activation.
|
25
|
+
|
26
|
+
By default `sandbox` is the initial environment, but you can change to production when initializing your PIS or AIS client:
|
27
|
+
|
28
|
+
### Initialize your PIS client
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
pis_client = Fintecture::PisClient.new({
|
32
|
+
environment: 'sandbox', # => ["sandbox", "test", "production"]
|
33
|
+
app_id: 'your_app_id',
|
34
|
+
app_secret: 'your_app_secret',
|
35
|
+
private_key: %q(your_private_key)
|
36
|
+
})
|
37
|
+
```
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
### Initialize your AIS client
|
42
|
+
|
43
|
+
```ruby
|
44
|
+
ais_client = Fintecture::AisClient.new({
|
45
|
+
environment: 'sandbox', # => ["sandbox", "test", "production"]
|
46
|
+
app_id: 'your_app_id',
|
47
|
+
app_secret: 'your_app_secret',
|
48
|
+
private_key: %q(your_private_key)
|
49
|
+
})
|
50
|
+
```
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
## PIS
|
55
|
+
|
56
|
+
PIS client properties
|
57
|
+
```ruby
|
58
|
+
pis_client.app_id
|
59
|
+
pis_client.app_secret
|
60
|
+
pis_client.private_key
|
61
|
+
pis_client.environment
|
62
|
+
pis_client.token
|
63
|
+
pis_client.token_expires_in
|
64
|
+
```
|
65
|
+
|
66
|
+
### Access token
|
67
|
+
This method return the token and store it in the client for future requests
|
68
|
+
```ruby
|
69
|
+
pis_client.generate_token
|
70
|
+
```
|
71
|
+
|
72
|
+
|
73
|
+
### POST /connect
|
74
|
+
|
75
|
+
Creates a connect session for a PSU to initiate a payment.
|
76
|
+
|
77
|
+
Documentation:
|
78
|
+
- https://doc.fintecture.com/reference/createpisv2connect
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
# connect (payload, state, redirect_uri = nil, origin_uri = nil, with_virtualbeneficiary: false)
|
82
|
+
# payload: {}
|
83
|
+
# state: string
|
84
|
+
# redirect_uri: string
|
85
|
+
# origin_uri: string
|
86
|
+
|
87
|
+
response = pis_client.connect payload, "my-state", "https://www.my-redirect-uri.fr", "https://www.my-origine-uri.fr", with_virtualbeneficiary: true
|
88
|
+
```
|
89
|
+
|
90
|
+
### GET /payments
|
91
|
+
|
92
|
+
Get the details of all transfers or of a specific transfer, with virtual beneficiary information if required.
|
93
|
+
|
94
|
+
Documentation:
|
95
|
+
- Get all payments: https://doc.fintecture.com/reference/getpisv2payments
|
96
|
+
- Get a specific payment: https://doc.fintecture.com/reference/getpaymentsession
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
# payments (session_id = nil, with_virtualbeneficiary: false)
|
100
|
+
# session_id: string
|
101
|
+
|
102
|
+
response = pis_client.payments
|
103
|
+
# OR
|
104
|
+
response = pis_client.payments "7f47d3675f5d4964bc416b43af63b06e"
|
105
|
+
# OR
|
106
|
+
response = pis_client.payments "7f47d3675f5d4964bc416b43af63b06e", with_virtualbeneficiary: true
|
107
|
+
```
|
108
|
+
|
109
|
+
### POST /refund
|
110
|
+
|
111
|
+
Initiates a refund. If the amount is not specified, refunds the total.
|
112
|
+
|
113
|
+
Documentation:
|
114
|
+
- https://doc.fintecture.com/reference/createpisv2refund
|
115
|
+
|
116
|
+
```ruby
|
117
|
+
# refund (session_id, amount = nil, user_id = nil))
|
118
|
+
# session_id: string
|
119
|
+
# amount: number
|
120
|
+
# user_id: string
|
121
|
+
|
122
|
+
response = pis_client.refund "7f47d3675f5d4964bc416b43af63b06e", 5.75, "8886aaa4-527d-4253-8951-a07d8bf4cf52"
|
123
|
+
```
|
124
|
+
|
125
|
+
### POST /request-to-pay
|
126
|
+
|
127
|
+
Creates a request to pay that merchant can then share by link, mail or sms to a customer for asynchronous payment.
|
128
|
+
|
129
|
+
Documentation:
|
130
|
+
- https://doc.fintecture.com/reference/createpisv2requesttopay
|
131
|
+
|
132
|
+
```ruby
|
133
|
+
# refund (payload, x_language, redirect_uri = nil)
|
134
|
+
# payload: {}
|
135
|
+
# x_language: string
|
136
|
+
# redirect_uri: string
|
137
|
+
|
138
|
+
response = pis_client.request_to_pay payload, 'fr', "https://www.my-redirect-uri.fr"
|
139
|
+
```
|
140
|
+
|
141
|
+
### GET /settlements
|
142
|
+
|
143
|
+
Get the details of all settlements or of a specific settlement.
|
144
|
+
|
145
|
+
Documentation:
|
146
|
+
- Get all settlements: https://doc.fintecture.com/reference/getpisv2settlements
|
147
|
+
- Get a specific settlement: https://doc.fintecture.com/reference/getpisv2settlement
|
148
|
+
|
149
|
+
```ruby
|
150
|
+
# settlements (settlement_id = nil, include_payments = false)
|
151
|
+
# settlement_id: string
|
152
|
+
# include_payments: boolean
|
153
|
+
|
154
|
+
response = pis_client.settlements
|
155
|
+
OR
|
156
|
+
response = pis_client.settlements "127335fdeb073e0eb2313ba0bd71ad44"
|
157
|
+
OR
|
158
|
+
response = pis_client.settlements "127335fdeb073e0eb2313ba0bd71ad44", true
|
159
|
+
```
|
160
|
+
|
161
|
+
## AIS
|
162
|
+
AIS client properties
|
163
|
+
```ruby
|
164
|
+
ais_client.app_id
|
165
|
+
ais_client.app_secret
|
166
|
+
ais_client.private_key
|
167
|
+
ais_client.environment
|
168
|
+
ais_client.token
|
169
|
+
ais_client.refresh_token
|
170
|
+
ais_client.token_expires_in
|
171
|
+
```
|
172
|
+
### GET /connect
|
173
|
+
|
174
|
+
Get a connect session for a PSU to create a connection that will enable access to AIS features.
|
175
|
+
|
176
|
+
Documentation:
|
177
|
+
- https://doc.fintecture.com/reference/getaisv2connect
|
178
|
+
|
179
|
+
```ruby
|
180
|
+
# connect (state, redirect_uri, scope = nil)
|
181
|
+
# state: string
|
182
|
+
# redirect_uri: string
|
183
|
+
# scope: string
|
184
|
+
|
185
|
+
response = ais_client.connect "my-state", "https://www.my-redirect-uri.fr"
|
186
|
+
```
|
187
|
+
When you follow the returned url, you'll be redirect with "customer_id" & "code" parameters
|
188
|
+
```ruby
|
189
|
+
customer_id = "fa51058b5f8306f1e048f1adda5488a9"
|
190
|
+
code = "f66ec660b0bbd2797bf6847fb4b98454"
|
191
|
+
```
|
192
|
+
|
193
|
+
### Access token
|
194
|
+
|
195
|
+
Returns the token and store it in the client for future requests.
|
196
|
+
|
197
|
+
Documentation:
|
198
|
+
- https://doc.fintecture.com/reference/createaccesstoken
|
199
|
+
|
200
|
+
```ruby
|
201
|
+
ais_client.generate_token code
|
202
|
+
```
|
203
|
+
|
204
|
+
### Refresh token
|
205
|
+
|
206
|
+
Returns the token and store it in the client for future requests.
|
207
|
+
If you do not pass the refreshtoken as a parameter, the client refreshtoken will be used.
|
208
|
+
|
209
|
+
Documentation:
|
210
|
+
- https://doc.fintecture.com/reference/createrefreshtoken
|
211
|
+
|
212
|
+
```ruby
|
213
|
+
# generate_refresh_token (refresh_token = nil)
|
214
|
+
# refresh_token: string
|
215
|
+
|
216
|
+
ais_client.generate_refresh_token
|
217
|
+
```
|
218
|
+
|
219
|
+
### GET /authorize
|
220
|
+
|
221
|
+
Authenticates your customer to their Bank for AIS access
|
222
|
+
|
223
|
+
Documentation:
|
224
|
+
- https://doc.fintecture.com/reference/getaisv1providerauthorization
|
225
|
+
|
226
|
+
```ruby
|
227
|
+
# authorize (app_id_auth: false, provider_id:, redirect_uri:, state: nil, x_psu_id: nil, x_psu_ip_address: nil)
|
228
|
+
# app_id_auth: boolean
|
229
|
+
# provider_id: string
|
230
|
+
# redirect_uri: string
|
231
|
+
# state: string
|
232
|
+
# x_psu_id: string
|
233
|
+
# x_psu_ip_address: string
|
234
|
+
|
235
|
+
response = ais_client.authorize app_id_auth: false, provider_id: "agfbfr", redirect_uri: "https://www.google.fr", state: "ok", x_psu_id: "123456", x_psu_ip_address: "192.168.1.1"
|
236
|
+
```
|
237
|
+
|
238
|
+
### GET /accounts
|
239
|
+
|
240
|
+
Get all accounts linked to a specific AIS connection.
|
241
|
+
|
242
|
+
Documentation:
|
243
|
+
- https://doc.fintecture.com/reference/getaisv1customeraccounts
|
244
|
+
|
245
|
+
```ruby
|
246
|
+
# accounts (customer_id:, account_id: nil, remove_nulls: nil, withBalances: nil)
|
247
|
+
# customer_id: string
|
248
|
+
# account_id: string
|
249
|
+
# remove_nulls: boolean
|
250
|
+
# withBalances: boolean
|
251
|
+
|
252
|
+
response = ais_client.accounts customer_id: customer_id, account_id: nil, remove_nulls: nil, withBalances: nil
|
253
|
+
```
|
254
|
+
|
255
|
+
### GET /transactions
|
256
|
+
|
257
|
+
Get all transactions linked to a specific AIS connection for a specific account.
|
258
|
+
|
259
|
+
Documentation:
|
260
|
+
- https://doc.fintecture.com/reference/getaisv1customeraccounttransactions
|
261
|
+
|
262
|
+
```ruby
|
263
|
+
# transactions (customer_id:, account_id:, remove_nulls: nil, convert_dates: nil, filters: nil)
|
264
|
+
# customer_id: string
|
265
|
+
# account_id: string
|
266
|
+
# remove_nulls: boolean
|
267
|
+
# convert_dates: boolean
|
268
|
+
# filters: {}
|
269
|
+
|
270
|
+
transactions_filters = {
|
271
|
+
"filter[date_to]": "2020-01-01",
|
272
|
+
'filter[date_from]': "max" # Date or 'max'
|
273
|
+
}
|
274
|
+
response = ais_client.transactions customer_id: customer_id, account_id: "b71722204d1a3f5ecd895", remove_nulls: true, convert_dates: true, filters: transactions_filters
|
275
|
+
```
|
276
|
+
|
277
|
+
### GET /accountholders
|
278
|
+
|
279
|
+
Retrieves all personal information of the client such as name, address and contact details for all the beneficiary owners.
|
280
|
+
|
281
|
+
Documentation:
|
282
|
+
- https://doc.fintecture.com/reference/getaisv1customeraccountholders
|
283
|
+
|
284
|
+
```ruby
|
285
|
+
# account_holders (customer_id:, remove_nulls: nil)
|
286
|
+
# customer_id: string
|
287
|
+
# remove_nulls: boolean
|
288
|
+
|
289
|
+
response = ais_client.account_holders customer_id: customer_id, remove_nulls: true
|
290
|
+
```
|
291
|
+
|
292
|
+
### DELETE /customer
|
293
|
+
|
294
|
+
Deletes all active access tokens and all PSU data linked to requested connection.
|
295
|
+
|
296
|
+
Documentation:
|
297
|
+
- https://doc.fintecture.com/reference/deleteaisv1customer
|
298
|
+
|
299
|
+
```ruby
|
300
|
+
# account_holders (customer_id:)
|
301
|
+
# customer_id: string
|
302
|
+
|
303
|
+
response = ais_client.delete_customer customer_id: customer_id
|
304
|
+
```
|
305
|
+
## RESSOURCES
|
306
|
+
Use the PIS client to get ressources. The "generate_token" step is not needed for this calls
|
307
|
+
|
308
|
+
### GET /providers
|
309
|
+
|
310
|
+
Documentation:
|
311
|
+
- https://doc.fintecture.com/reference/getresv1providers
|
312
|
+
|
313
|
+
```ruby
|
314
|
+
# providers (provider_id: nil, paramsProviders: nil)
|
315
|
+
# provider_id: string
|
316
|
+
# paramsProviders: string
|
317
|
+
|
318
|
+
paramsProviders = {
|
319
|
+
'filter[country]': 'FR',
|
320
|
+
'filter[pis]': 'SEPA',
|
321
|
+
'filter[ais]': 'Accounts',
|
322
|
+
'filter[psu_type]': 'retail',
|
323
|
+
'filter[auth_model]': 'redirect',
|
324
|
+
'sort[name]': 'DESC',
|
325
|
+
'sort[full_name]': 'DESC',
|
326
|
+
'sort[country]': 'DESC',
|
327
|
+
'sort[provider_id]': 'DESC'
|
328
|
+
}
|
329
|
+
response = pis_client.providers provider_id: 'agfbfr', paramsProviders: paramsProviders
|
330
|
+
```
|
331
|
+
|
332
|
+
### GET /applications
|
333
|
+
|
334
|
+
Documentation:
|
335
|
+
- https://doc.fintecture.com/reference/getresv1applications
|
336
|
+
|
337
|
+
```ruby
|
338
|
+
# applications ()
|
339
|
+
|
340
|
+
response = pis_client.applications
|
341
|
+
```
|
342
|
+
|
343
|
+
## API Errors handling
|
344
|
+
Hash version
|
345
|
+
```ruby
|
346
|
+
begin
|
347
|
+
pis_client.refund "7f47d3675f5d4964bc416b43af63b06e", 1
|
348
|
+
rescue => e
|
349
|
+
error = JSON.parse e.to_s
|
350
|
+
puts error
|
351
|
+
end
|
352
|
+
```
|
353
|
+
|
354
|
+
```ruby
|
355
|
+
{
|
356
|
+
"type"=>"Fintecture api",
|
357
|
+
"status"=>401,
|
358
|
+
"errors"=>[
|
359
|
+
{
|
360
|
+
"code"=>"invalid_token",
|
361
|
+
"title"=>"Invalid Token",
|
362
|
+
"message"=>"The token is either invalid or expired."
|
363
|
+
}
|
364
|
+
],
|
365
|
+
"error_string"=>"\nFintecture server errors : \n status: 401 \n code: unauthorized\n id : 3006ddbf-2f97-44d8-9f63-35711b78e8a6\n\n code: invalid_token\n title: Invalid Token\n message: The token is either invalid or expired.\n\n"
|
366
|
+
}
|
367
|
+
```
|
368
|
+
Text version
|
369
|
+
```ruby
|
370
|
+
begin
|
371
|
+
pis_client.refund "7f47d3675f5d4964bc416b43af63b06e", 1
|
372
|
+
rescue => e
|
373
|
+
error = JSON.parse e.to_s
|
374
|
+
puts error['error_string']
|
375
|
+
end
|
376
|
+
```
|
377
|
+
|
378
|
+
```ruby
|
379
|
+
Fintecture server errors :
|
380
|
+
status: 401
|
381
|
+
code: unauthorized
|
382
|
+
id : 2adb9e35-ff0d-4477-959e-b1b1a7d7c812
|
383
|
+
|
384
|
+
code: invalid_token
|
385
|
+
title: Invalid Token
|
386
|
+
message: The token is either invalid or expired.
|
387
|
+
|
388
|
+
```
|
389
|
+
## Development
|
390
|
+
|
391
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
392
|
+
|
393
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
394
|
+
|
395
|
+
## Contributing
|
396
|
+
|
397
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/Fintecture/fintecture-sdk-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
398
|
+
|
399
|
+
## License
|
400
|
+
|
401
|
+
The gem is available as open source under the terms of the [GPL-3.0 License](http://www.gnu.org/licenses/gpl-3.0.txt).
|
402
|
+
|
403
|
+
## Code of Conduct
|
404
|
+
|
405
|
+
Everyone interacting in the Fintecture project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Fintecture/fintecture-sdk-ruby/blob/master/CODE_OF_CONDUCT.md).
|