apimatic-ci-cd-test 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +1168 -0
- data/lib/payments_api.rb +49 -0
- data/lib/payments_api/api_helper.rb +277 -0
- data/lib/payments_api/client.rb +42 -0
- data/lib/payments_api/configuration.rb +116 -0
- data/lib/payments_api/controllers/base_controller.rb +49 -0
- data/lib/payments_api/controllers/payments_controller.rb +272 -0
- data/lib/payments_api/controllers/quotes_controller.rb +213 -0
- data/lib/payments_api/exceptions/api_exception.rb +20 -0
- data/lib/payments_api/exceptions/request_error_exception.rb +29 -0
- data/lib/payments_api/http/auth/custom_header_auth.rb +16 -0
- data/lib/payments_api/http/faraday_client.rb +70 -0
- data/lib/payments_api/http/http_call_back.rb +24 -0
- data/lib/payments_api/http/http_client.rb +104 -0
- data/lib/payments_api/http/http_method_enum.rb +13 -0
- data/lib/payments_api/http/http_request.rb +50 -0
- data/lib/payments_api/http/http_response.rb +29 -0
- data/lib/payments_api/models/address.rb +80 -0
- data/lib/payments_api/models/bank.rb +63 -0
- data/lib/payments_api/models/bank_account.rb +48 -0
- data/lib/payments_api/models/base_model.rb +47 -0
- data/lib/payments_api/models/beneficiary.rb +62 -0
- data/lib/payments_api/models/originator.rb +44 -0
- data/lib/payments_api/models/payment.rb +127 -0
- data/lib/payments_api/models/payment_details.rb +53 -0
- data/lib/payments_api/models/payment_status.rb +44 -0
- data/lib/payments_api/models/quote.rb +104 -0
- data/lib/payments_api/utilities/date_time_helper.rb +156 -0
- data/lib/payments_api/utilities/file_wrapper.rb +17 -0
- metadata +155 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1bef76bf230a404fe6b2fa542cc4ff6201a6669510de58fd330684adbe432759
|
4
|
+
data.tar.gz: 0b9ce138687c5c1a678d2331bb74379c8f6463dd6d81f4689c5e1357fa970d3c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: fc2942682817eab19adcc6d35ad1108b1163d09caafc49f76507cce770d9f60497d8e266f4e7cf85ca9c51b22f6e68bc935adf9ed327891a0102c95d1b8bfc17
|
7
|
+
data.tar.gz: 61e666b4c3e36b07fa3da30a36165a2adad7f23e9f9bc5a7e006bfb6e594f43468661ecabc6f8add4c4c64e67b3012690362c441068e33f9ce3e5e3f9a331127
|
data/LICENSE
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
License:
|
2
|
+
========
|
3
|
+
The MIT License (MIT)
|
4
|
+
http://opensource.org/licenses/MIT
|
5
|
+
|
6
|
+
Copyright (c) 2014 - 2020 APIMATIC Limited
|
7
|
+
|
8
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
|
+
of this software and associated documentation files (the "Software"), to deal
|
10
|
+
in the Software without restriction, including without limitation the rights
|
11
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
12
|
+
copies of the Software, and to permit persons to whom the Software is
|
13
|
+
furnished to do so, subject to the following conditions:
|
14
|
+
|
15
|
+
The above copyright notice and this permission notice shall be included in
|
16
|
+
all copies or substantial portions of the Software.
|
17
|
+
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
19
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
20
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
21
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24
|
+
THE SOFTWARE.
|
25
|
+
|
26
|
+
Trade Mark:
|
27
|
+
==========
|
28
|
+
APIMATIC is a trade mark for APIMATIC Limited
|
data/README.md
ADDED
@@ -0,0 +1,1168 @@
|
|
1
|
+
# Getting Started with PaymentsAPI
|
2
|
+
|
3
|
+
## Getting Started
|
4
|
+
|
5
|
+
### Introduction
|
6
|
+
|
7
|
+
API for sending and managing payments
|
8
|
+
|
9
|
+
### Install the Package
|
10
|
+
|
11
|
+
Install the gem from the command line:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem install apimatic-ci-cd-test -v 1.0.0
|
15
|
+
```
|
16
|
+
|
17
|
+
Or add the gem to your Gemfile and run `bundle`:
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
gem 'apimatic-ci-cd-test', '1.0.0'
|
21
|
+
```
|
22
|
+
|
23
|
+
For additional gem details, see the [RubyGems page for the apimatic-ci-cd-test gem](https://rubygems.org/gems/apimatic-ci-cd-test/versions/1.0.0).
|
24
|
+
|
25
|
+
### Initialize the API Client
|
26
|
+
|
27
|
+
The following parameters are configurable for the API Client:
|
28
|
+
|
29
|
+
| Parameter | Type | Description |
|
30
|
+
| --- | --- | --- |
|
31
|
+
| `x_api_key` | `String` | API Key |
|
32
|
+
| `timeout` | `Float` | The value to use for connection timeout. <br> **Default: 60** |
|
33
|
+
| `max_retries` | `Integer` | The number of times to retry an endpoint call if it fails. <br> **Default: 0** |
|
34
|
+
| `retry_interval` | `Float` | Pause in seconds between retries. <br> **Default: 1** |
|
35
|
+
| `backoff_factor` | `Float` | The amount to multiply each successive retry's interval amount by in order to provide backoff. <br> **Default: 2** |
|
36
|
+
| `retry_statuses` | `Array` | A list of HTTP statuses to retry. <br> **Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524]** |
|
37
|
+
| `retry_methods` | `Array` | A list of HTTP methods to retry. <br> **Default: %i[get put]** |
|
38
|
+
|
39
|
+
The API client can be initialized as follows:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
client = PaymentsApi::Client.new(
|
43
|
+
x_api_key: 'x-api-key',
|
44
|
+
)
|
45
|
+
```
|
46
|
+
|
47
|
+
### Authorization
|
48
|
+
|
49
|
+
This API uses `Custom Header Signature`.
|
50
|
+
|
51
|
+
## Client Class Documentation
|
52
|
+
|
53
|
+
### PaymentsAPI Client
|
54
|
+
|
55
|
+
The gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK.
|
56
|
+
|
57
|
+
### Controllers
|
58
|
+
|
59
|
+
| Name | Description |
|
60
|
+
| --- | --- |
|
61
|
+
| quotes | Gets QuotesController |
|
62
|
+
| payments | Gets PaymentsController |
|
63
|
+
|
64
|
+
## API Reference
|
65
|
+
|
66
|
+
### List of APIs
|
67
|
+
|
68
|
+
* [Quotes](#quotes)
|
69
|
+
* [Payments](#payments)
|
70
|
+
|
71
|
+
### Quotes
|
72
|
+
|
73
|
+
#### Overview
|
74
|
+
|
75
|
+
Quotes
|
76
|
+
|
77
|
+
##### Get instance
|
78
|
+
|
79
|
+
An instance of the `QuotesController` class can be accessed from the API Client.
|
80
|
+
|
81
|
+
```
|
82
|
+
quotes_controller = client.quotes
|
83
|
+
```
|
84
|
+
|
85
|
+
#### Create Quote
|
86
|
+
|
87
|
+
Create new Quote
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
def create_quote(bank_id,
|
91
|
+
body)
|
92
|
+
```
|
93
|
+
|
94
|
+
##### Parameters
|
95
|
+
|
96
|
+
| Parameter | Type | Tags | Description |
|
97
|
+
| --- | --- | --- | --- |
|
98
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
99
|
+
| `body` | [`Quote`](#quote) | Body, Required | Quote data |
|
100
|
+
|
101
|
+
##### Response Type
|
102
|
+
|
103
|
+
[`Quote`](#quote)
|
104
|
+
|
105
|
+
##### Example Usage
|
106
|
+
|
107
|
+
```ruby
|
108
|
+
bank_id = 'bankId0'
|
109
|
+
body = Quote.new
|
110
|
+
body.id = 0
|
111
|
+
body.beneficiary_amount = 12345.67
|
112
|
+
body.beneficiary_currency = 'EUR'
|
113
|
+
body.originator_amount = 76543.21
|
114
|
+
body.originator_amount_is_fixed = true
|
115
|
+
body.exchange_rate = 1.2345
|
116
|
+
body.locked = false
|
117
|
+
body.revision = 1
|
118
|
+
|
119
|
+
result = quotes_controller.create_quote(bank_id, body)
|
120
|
+
```
|
121
|
+
|
122
|
+
##### Example Response *(as JSON)*
|
123
|
+
|
124
|
+
```json
|
125
|
+
{
|
126
|
+
"id": 0,
|
127
|
+
"beneficiaryAmount": 12345.67,
|
128
|
+
"beneficiaryCurrency": "EUR",
|
129
|
+
"originatorAmount": 76543.21,
|
130
|
+
"originatorAmountIsFixed": true,
|
131
|
+
"exchangeRate": 1.2345,
|
132
|
+
"locked": false,
|
133
|
+
"revision": 1
|
134
|
+
}
|
135
|
+
```
|
136
|
+
|
137
|
+
##### Errors
|
138
|
+
|
139
|
+
| HTTP Status Code | Error Description | Exception Class |
|
140
|
+
| --- | --- | --- |
|
141
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
142
|
+
| 403 | Forbidden | `APIException` |
|
143
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
144
|
+
|
145
|
+
#### Cancel Quote
|
146
|
+
|
147
|
+
Attempts to cancel a Quote
|
148
|
+
|
149
|
+
```ruby
|
150
|
+
def cancel_quote(bank_id,
|
151
|
+
quote_id)
|
152
|
+
```
|
153
|
+
|
154
|
+
##### Parameters
|
155
|
+
|
156
|
+
| Parameter | Type | Tags | Description |
|
157
|
+
| --- | --- | --- | --- |
|
158
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
159
|
+
| `quote_id` | `Integer` | Template, Required | ID of quote to refresh |
|
160
|
+
|
161
|
+
##### Response Type
|
162
|
+
|
163
|
+
`void`
|
164
|
+
|
165
|
+
##### Example Usage
|
166
|
+
|
167
|
+
```ruby
|
168
|
+
bank_id = 'bankId0'
|
169
|
+
quote_id = 124
|
170
|
+
|
171
|
+
result = quotes_controller.cancel_quote(bank_id, quote_id)
|
172
|
+
```
|
173
|
+
|
174
|
+
##### Errors
|
175
|
+
|
176
|
+
| HTTP Status Code | Error Description | Exception Class |
|
177
|
+
| --- | --- | --- |
|
178
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
179
|
+
| 403 | Forbidden | `APIException` |
|
180
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
181
|
+
|
182
|
+
#### Lock Quote
|
183
|
+
|
184
|
+
Lock the rate for a given Quote
|
185
|
+
|
186
|
+
```ruby
|
187
|
+
def lock_quote(bank_id,
|
188
|
+
quote_id)
|
189
|
+
```
|
190
|
+
|
191
|
+
##### Parameters
|
192
|
+
|
193
|
+
| Parameter | Type | Tags | Description |
|
194
|
+
| --- | --- | --- | --- |
|
195
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
196
|
+
| `quote_id` | `Integer` | Template, Required | ID of quote to lock |
|
197
|
+
|
198
|
+
##### Response Type
|
199
|
+
|
200
|
+
`void`
|
201
|
+
|
202
|
+
##### Example Usage
|
203
|
+
|
204
|
+
```ruby
|
205
|
+
bank_id = 'bankId0'
|
206
|
+
quote_id = 124
|
207
|
+
|
208
|
+
result = quotes_controller.lock_quote(bank_id, quote_id)
|
209
|
+
```
|
210
|
+
|
211
|
+
##### Errors
|
212
|
+
|
213
|
+
| HTTP Status Code | Error Description | Exception Class |
|
214
|
+
| --- | --- | --- |
|
215
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
216
|
+
| 403 | Forbidden | `APIException` |
|
217
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
218
|
+
|
219
|
+
#### Refresh Quote
|
220
|
+
|
221
|
+
Refresh the rates for an existing Quote
|
222
|
+
|
223
|
+
```ruby
|
224
|
+
def refresh_quote(bank_id,
|
225
|
+
quote_id)
|
226
|
+
```
|
227
|
+
|
228
|
+
##### Parameters
|
229
|
+
|
230
|
+
| Parameter | Type | Tags | Description |
|
231
|
+
| --- | --- | --- | --- |
|
232
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
233
|
+
| `quote_id` | `Integer` | Template, Required | ID of quote to refresh |
|
234
|
+
|
235
|
+
##### Response Type
|
236
|
+
|
237
|
+
[`Quote`](#quote)
|
238
|
+
|
239
|
+
##### Example Usage
|
240
|
+
|
241
|
+
```ruby
|
242
|
+
bank_id = 'bankId0'
|
243
|
+
quote_id = 124
|
244
|
+
|
245
|
+
result = quotes_controller.refresh_quote(bank_id, quote_id)
|
246
|
+
```
|
247
|
+
|
248
|
+
##### Example Response *(as JSON)*
|
249
|
+
|
250
|
+
```json
|
251
|
+
{
|
252
|
+
"id": 0,
|
253
|
+
"beneficiaryAmount": 12345.67,
|
254
|
+
"beneficiaryCurrency": "EUR",
|
255
|
+
"originatorAmount": 76543.21,
|
256
|
+
"originatorAmountIsFixed": true,
|
257
|
+
"exchangeRate": 1.2345,
|
258
|
+
"locked": false,
|
259
|
+
"revision": 1
|
260
|
+
}
|
261
|
+
```
|
262
|
+
|
263
|
+
##### Errors
|
264
|
+
|
265
|
+
| HTTP Status Code | Error Description | Exception Class |
|
266
|
+
| --- | --- | --- |
|
267
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
268
|
+
| 403 | Forbidden | `APIException` |
|
269
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
270
|
+
|
271
|
+
### Payments
|
272
|
+
|
273
|
+
#### Overview
|
274
|
+
|
275
|
+
Payments
|
276
|
+
|
277
|
+
##### Get instance
|
278
|
+
|
279
|
+
An instance of the `PaymentsController` class can be accessed from the API Client.
|
280
|
+
|
281
|
+
```
|
282
|
+
payments_controller = client.payments
|
283
|
+
```
|
284
|
+
|
285
|
+
#### Create Payment
|
286
|
+
|
287
|
+
Creates a new Payment
|
288
|
+
|
289
|
+
```ruby
|
290
|
+
def create_payment(bank_id,
|
291
|
+
body)
|
292
|
+
```
|
293
|
+
|
294
|
+
##### Parameters
|
295
|
+
|
296
|
+
| Parameter | Type | Tags | Description |
|
297
|
+
| --- | --- | --- | --- |
|
298
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
299
|
+
| `body` | [`Payment`](#payment) | Body, Required | Create Payment Body Data |
|
300
|
+
|
301
|
+
##### Response Type
|
302
|
+
|
303
|
+
[`Payment`](#payment)
|
304
|
+
|
305
|
+
##### Example Usage
|
306
|
+
|
307
|
+
```ruby
|
308
|
+
bank_id = 'bankId0'
|
309
|
+
body = Payment.new
|
310
|
+
body.id = 987654
|
311
|
+
body.quote_id = 123456
|
312
|
+
body.originator = Originator.new
|
313
|
+
body.originator.name = 'Jake Johnson'
|
314
|
+
body.originator.address = Address.new
|
315
|
+
body.originator.address.address1 = '555 South North Lane'
|
316
|
+
body.originator.address.address2 = 'Floor 5'
|
317
|
+
body.originator.address.city = 'Springfield'
|
318
|
+
body.originator.address.state = 'VA'
|
319
|
+
body.originator.address.postal_code = '47060'
|
320
|
+
body.originator.address.country = 'US'
|
321
|
+
body.originator_bank_account = BankAccount.new
|
322
|
+
body.originator_bank_account.account_number = 'DE89370400440532013000'
|
323
|
+
body.originator_bank_account.bank = Bank.new
|
324
|
+
body.originator_bank_account.bank.name = 'Bank of America'
|
325
|
+
body.originator_bank_account.bank.address = Address.new
|
326
|
+
body.originator_bank_account.bank.address.address1 = '555 South North Lane'
|
327
|
+
body.originator_bank_account.bank.address.address2 = 'Floor 5'
|
328
|
+
body.originator_bank_account.bank.address.city = 'Springfield'
|
329
|
+
body.originator_bank_account.bank.address.state = 'VA'
|
330
|
+
body.originator_bank_account.bank.address.postal_code = '47060'
|
331
|
+
body.originator_bank_account.bank.address.country = 'US'
|
332
|
+
body.originator_bank_account.bank.routing_code = 'string'
|
333
|
+
body.originator_bank_account.bank.swift_code = 'AGCAAM22'
|
334
|
+
body.beneficiary = Beneficiary.new
|
335
|
+
body.beneficiary.name = 'Jake Johnson'
|
336
|
+
body.beneficiary.address = Address.new
|
337
|
+
body.beneficiary.address.address1 = '555 South North Lane'
|
338
|
+
body.beneficiary.address.address2 = 'Floor 5'
|
339
|
+
body.beneficiary.address.city = 'Springfield'
|
340
|
+
body.beneficiary.address.state = 'VA'
|
341
|
+
body.beneficiary.address.postal_code = '47060'
|
342
|
+
body.beneficiary.address.country = 'US'
|
343
|
+
body.beneficiary.email = 'beneficiary@example.com'
|
344
|
+
body.beneficiary.phone_number = '111-111-1111'
|
345
|
+
body.beneficiary_bank_account = BankAccount.new
|
346
|
+
body.beneficiary_bank_account.account_number = 'DE89370400440532013000'
|
347
|
+
body.beneficiary_bank_account.bank = Bank.new
|
348
|
+
body.beneficiary_bank_account.bank.name = 'Bank of America'
|
349
|
+
body.beneficiary_bank_account.bank.address = Address.new
|
350
|
+
body.beneficiary_bank_account.bank.address.address1 = '555 South North Lane'
|
351
|
+
body.beneficiary_bank_account.bank.address.address2 = 'Floor 5'
|
352
|
+
body.beneficiary_bank_account.bank.address.city = 'Springfield'
|
353
|
+
body.beneficiary_bank_account.bank.address.state = 'VA'
|
354
|
+
body.beneficiary_bank_account.bank.address.postal_code = '47060'
|
355
|
+
body.beneficiary_bank_account.bank.address.country = 'US'
|
356
|
+
body.beneficiary_bank_account.bank.routing_code = 'string'
|
357
|
+
body.beneficiary_bank_account.bank.swift_code = 'AGCAAM22'
|
358
|
+
body.intermediary_bank_account = BankAccount.new
|
359
|
+
body.intermediary_bank_account.account_number = 'DE89370400440532013000'
|
360
|
+
body.intermediary_bank_account.bank = Bank.new
|
361
|
+
body.intermediary_bank_account.bank.name = 'Bank of America'
|
362
|
+
body.intermediary_bank_account.bank.address = Address.new
|
363
|
+
body.intermediary_bank_account.bank.address.address1 = '555 South North Lane'
|
364
|
+
body.intermediary_bank_account.bank.address.address2 = 'Floor 5'
|
365
|
+
body.intermediary_bank_account.bank.address.city = 'Springfield'
|
366
|
+
body.intermediary_bank_account.bank.address.state = 'VA'
|
367
|
+
body.intermediary_bank_account.bank.address.postal_code = '47060'
|
368
|
+
body.intermediary_bank_account.bank.address.country = 'US'
|
369
|
+
body.intermediary_bank_account.bank.routing_code = 'string'
|
370
|
+
body.intermediary_bank_account.bank.swift_code = 'AGCAAM22'
|
371
|
+
body.details = PaymentDetails.new
|
372
|
+
body.details.purpose_of_payment = 'Purchase of Goods'
|
373
|
+
body.details.memo = 'Invoice 12345678'
|
374
|
+
body.details.payment_reference = '1234567890'
|
375
|
+
body.status = PaymentStatus.new
|
376
|
+
body.status.approved = false
|
377
|
+
body.status.sent = false
|
378
|
+
|
379
|
+
result = payments_controller.create_payment(bank_id, body)
|
380
|
+
```
|
381
|
+
|
382
|
+
##### Example Response *(as JSON)*
|
383
|
+
|
384
|
+
```json
|
385
|
+
{
|
386
|
+
"id": 987654,
|
387
|
+
"quoteId": 123456,
|
388
|
+
"originator": {
|
389
|
+
"name": "Jake Johnson",
|
390
|
+
"address": {
|
391
|
+
"address1": "555 South North Lane",
|
392
|
+
"address2": "Floor 5",
|
393
|
+
"city": "Springfield",
|
394
|
+
"state": "VA",
|
395
|
+
"postalCode": "47060",
|
396
|
+
"country": "US"
|
397
|
+
}
|
398
|
+
},
|
399
|
+
"originatorBankAccount": {
|
400
|
+
"accountNumber": "DE89370400440532013000",
|
401
|
+
"bank": {
|
402
|
+
"name": "Bank of America",
|
403
|
+
"address": {
|
404
|
+
"address1": "555 South North Lane",
|
405
|
+
"address2": "Floor 5",
|
406
|
+
"city": "Springfield",
|
407
|
+
"state": "VA",
|
408
|
+
"postalCode": "47060",
|
409
|
+
"country": "US"
|
410
|
+
},
|
411
|
+
"routingCode": "string",
|
412
|
+
"swiftCode": "AGCAAM22"
|
413
|
+
}
|
414
|
+
},
|
415
|
+
"beneficiary": {
|
416
|
+
"name": "Jake Johnson",
|
417
|
+
"address": {
|
418
|
+
"address1": "555 South North Lane",
|
419
|
+
"address2": "Floor 5",
|
420
|
+
"city": "Springfield",
|
421
|
+
"state": "VA",
|
422
|
+
"postalCode": "47060",
|
423
|
+
"country": "US"
|
424
|
+
},
|
425
|
+
"email": "beneficiary@example.com",
|
426
|
+
"phoneNumber": "111-111-1111"
|
427
|
+
},
|
428
|
+
"beneficiaryBankAccount": {
|
429
|
+
"accountNumber": "DE89370400440532013000",
|
430
|
+
"bank": {
|
431
|
+
"name": "Bank of America",
|
432
|
+
"address": {
|
433
|
+
"address1": "555 South North Lane",
|
434
|
+
"address2": "Floor 5",
|
435
|
+
"city": "Springfield",
|
436
|
+
"state": "VA",
|
437
|
+
"postalCode": "47060",
|
438
|
+
"country": "US"
|
439
|
+
},
|
440
|
+
"routingCode": "string",
|
441
|
+
"swiftCode": "AGCAAM22"
|
442
|
+
}
|
443
|
+
},
|
444
|
+
"intermediaryBankAccount": {
|
445
|
+
"accountNumber": "DE89370400440532013000",
|
446
|
+
"bank": {
|
447
|
+
"name": "Bank of America",
|
448
|
+
"address": {
|
449
|
+
"address1": "555 South North Lane",
|
450
|
+
"address2": "Floor 5",
|
451
|
+
"city": "Springfield",
|
452
|
+
"state": "VA",
|
453
|
+
"postalCode": "47060",
|
454
|
+
"country": "US"
|
455
|
+
},
|
456
|
+
"routingCode": "string",
|
457
|
+
"swiftCode": "AGCAAM22"
|
458
|
+
}
|
459
|
+
},
|
460
|
+
"details": {
|
461
|
+
"purposeOfPayment": "Purchase of Goods",
|
462
|
+
"memo": "Invoice 12345678",
|
463
|
+
"paymentReference": "1234567890"
|
464
|
+
},
|
465
|
+
"status": {
|
466
|
+
"approved": false,
|
467
|
+
"sent": false
|
468
|
+
}
|
469
|
+
}
|
470
|
+
```
|
471
|
+
|
472
|
+
##### Errors
|
473
|
+
|
474
|
+
| HTTP Status Code | Error Description | Exception Class |
|
475
|
+
| --- | --- | --- |
|
476
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
477
|
+
| 403 | Forbidden | `APIException` |
|
478
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
479
|
+
|
480
|
+
#### Cancel Payment
|
481
|
+
|
482
|
+
Attempts to cancel a Payment. Does not automatically cancel the linked Quote.
|
483
|
+
|
484
|
+
```ruby
|
485
|
+
def cancel_payment(bank_id,
|
486
|
+
payment_id)
|
487
|
+
```
|
488
|
+
|
489
|
+
##### Parameters
|
490
|
+
|
491
|
+
| Parameter | Type | Tags | Description |
|
492
|
+
| --- | --- | --- | --- |
|
493
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
494
|
+
| `payment_id` | `Integer` | Template, Required | ID of payment to cancel |
|
495
|
+
|
496
|
+
##### Response Type
|
497
|
+
|
498
|
+
`void`
|
499
|
+
|
500
|
+
##### Example Usage
|
501
|
+
|
502
|
+
```ruby
|
503
|
+
bank_id = 'bankId0'
|
504
|
+
payment_id = 250
|
505
|
+
|
506
|
+
result = payments_controller.cancel_payment(bank_id, payment_id)
|
507
|
+
```
|
508
|
+
|
509
|
+
##### Errors
|
510
|
+
|
511
|
+
| HTTP Status Code | Error Description | Exception Class |
|
512
|
+
| --- | --- | --- |
|
513
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
514
|
+
| 403 | Forbidden | `APIException` |
|
515
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
516
|
+
|
517
|
+
#### Update Payment
|
518
|
+
|
519
|
+
Update the data for a Payment before it is approved or sent
|
520
|
+
|
521
|
+
```ruby
|
522
|
+
def update_payment(bank_id,
|
523
|
+
payment_id,
|
524
|
+
body)
|
525
|
+
```
|
526
|
+
|
527
|
+
##### Parameters
|
528
|
+
|
529
|
+
| Parameter | Type | Tags | Description |
|
530
|
+
| --- | --- | --- | --- |
|
531
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
532
|
+
| `payment_id` | `Integer` | Template, Required | ID of payment to update |
|
533
|
+
| `body` | [`Payment`](#payment) | Body, Required | Update Payment Body Data |
|
534
|
+
|
535
|
+
##### Response Type
|
536
|
+
|
537
|
+
[`Payment`](#payment)
|
538
|
+
|
539
|
+
##### Example Usage
|
540
|
+
|
541
|
+
```ruby
|
542
|
+
bank_id = 'bankId0'
|
543
|
+
payment_id = 250
|
544
|
+
body = Payment.new
|
545
|
+
body.id = 987654
|
546
|
+
body.quote_id = 123456
|
547
|
+
body.originator = Originator.new
|
548
|
+
body.originator.name = 'Jake Johnson'
|
549
|
+
body.originator.address = Address.new
|
550
|
+
body.originator.address.address1 = '555 South North Lane'
|
551
|
+
body.originator.address.address2 = 'Floor 5'
|
552
|
+
body.originator.address.city = 'Springfield'
|
553
|
+
body.originator.address.state = 'VA'
|
554
|
+
body.originator.address.postal_code = '47060'
|
555
|
+
body.originator.address.country = 'US'
|
556
|
+
body.originator_bank_account = BankAccount.new
|
557
|
+
body.originator_bank_account.account_number = 'DE89370400440532013000'
|
558
|
+
body.originator_bank_account.bank = Bank.new
|
559
|
+
body.originator_bank_account.bank.name = 'Bank of America'
|
560
|
+
body.originator_bank_account.bank.address = Address.new
|
561
|
+
body.originator_bank_account.bank.address.address1 = '555 South North Lane'
|
562
|
+
body.originator_bank_account.bank.address.address2 = 'Floor 5'
|
563
|
+
body.originator_bank_account.bank.address.city = 'Springfield'
|
564
|
+
body.originator_bank_account.bank.address.state = 'VA'
|
565
|
+
body.originator_bank_account.bank.address.postal_code = '47060'
|
566
|
+
body.originator_bank_account.bank.address.country = 'US'
|
567
|
+
body.originator_bank_account.bank.routing_code = 'string'
|
568
|
+
body.originator_bank_account.bank.swift_code = 'AGCAAM22'
|
569
|
+
body.beneficiary = Beneficiary.new
|
570
|
+
body.beneficiary.name = 'Jake Johnson'
|
571
|
+
body.beneficiary.address = Address.new
|
572
|
+
body.beneficiary.address.address1 = '555 South North Lane'
|
573
|
+
body.beneficiary.address.address2 = 'Floor 5'
|
574
|
+
body.beneficiary.address.city = 'Springfield'
|
575
|
+
body.beneficiary.address.state = 'VA'
|
576
|
+
body.beneficiary.address.postal_code = '47060'
|
577
|
+
body.beneficiary.address.country = 'US'
|
578
|
+
body.beneficiary.email = 'beneficiary@example.com'
|
579
|
+
body.beneficiary.phone_number = '111-111-1111'
|
580
|
+
body.beneficiary_bank_account = BankAccount.new
|
581
|
+
body.beneficiary_bank_account.account_number = 'DE89370400440532013000'
|
582
|
+
body.beneficiary_bank_account.bank = Bank.new
|
583
|
+
body.beneficiary_bank_account.bank.name = 'Bank of America'
|
584
|
+
body.beneficiary_bank_account.bank.address = Address.new
|
585
|
+
body.beneficiary_bank_account.bank.address.address1 = '555 South North Lane'
|
586
|
+
body.beneficiary_bank_account.bank.address.address2 = 'Floor 5'
|
587
|
+
body.beneficiary_bank_account.bank.address.city = 'Springfield'
|
588
|
+
body.beneficiary_bank_account.bank.address.state = 'VA'
|
589
|
+
body.beneficiary_bank_account.bank.address.postal_code = '47060'
|
590
|
+
body.beneficiary_bank_account.bank.address.country = 'US'
|
591
|
+
body.beneficiary_bank_account.bank.routing_code = 'string'
|
592
|
+
body.beneficiary_bank_account.bank.swift_code = 'AGCAAM22'
|
593
|
+
body.intermediary_bank_account = BankAccount.new
|
594
|
+
body.intermediary_bank_account.account_number = 'DE89370400440532013000'
|
595
|
+
body.intermediary_bank_account.bank = Bank.new
|
596
|
+
body.intermediary_bank_account.bank.name = 'Bank of America'
|
597
|
+
body.intermediary_bank_account.bank.address = Address.new
|
598
|
+
body.intermediary_bank_account.bank.address.address1 = '555 South North Lane'
|
599
|
+
body.intermediary_bank_account.bank.address.address2 = 'Floor 5'
|
600
|
+
body.intermediary_bank_account.bank.address.city = 'Springfield'
|
601
|
+
body.intermediary_bank_account.bank.address.state = 'VA'
|
602
|
+
body.intermediary_bank_account.bank.address.postal_code = '47060'
|
603
|
+
body.intermediary_bank_account.bank.address.country = 'US'
|
604
|
+
body.intermediary_bank_account.bank.routing_code = 'string'
|
605
|
+
body.intermediary_bank_account.bank.swift_code = 'AGCAAM22'
|
606
|
+
body.details = PaymentDetails.new
|
607
|
+
body.details.purpose_of_payment = 'Purchase of Goods'
|
608
|
+
body.details.memo = 'Invoice 12345678'
|
609
|
+
body.details.payment_reference = '1234567890'
|
610
|
+
body.status = PaymentStatus.new
|
611
|
+
body.status.approved = false
|
612
|
+
body.status.sent = false
|
613
|
+
|
614
|
+
result = payments_controller.update_payment(bank_id, payment_id, body)
|
615
|
+
```
|
616
|
+
|
617
|
+
##### Errors
|
618
|
+
|
619
|
+
| HTTP Status Code | Error Description | Exception Class |
|
620
|
+
| --- | --- | --- |
|
621
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
622
|
+
| 403 | Forbidden | `APIException` |
|
623
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
624
|
+
|
625
|
+
#### Approve Payment
|
626
|
+
|
627
|
+
Approves a Payment to be sent
|
628
|
+
|
629
|
+
```ruby
|
630
|
+
def approve_payment(bank_id,
|
631
|
+
payment_id)
|
632
|
+
```
|
633
|
+
|
634
|
+
##### Parameters
|
635
|
+
|
636
|
+
| Parameter | Type | Tags | Description |
|
637
|
+
| --- | --- | --- | --- |
|
638
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
639
|
+
| `payment_id` | `Integer` | Template, Required | ID of payment to approve |
|
640
|
+
|
641
|
+
##### Response Type
|
642
|
+
|
643
|
+
`void`
|
644
|
+
|
645
|
+
##### Example Usage
|
646
|
+
|
647
|
+
```ruby
|
648
|
+
bank_id = 'bankId0'
|
649
|
+
payment_id = 250
|
650
|
+
|
651
|
+
result = payments_controller.approve_payment(bank_id, payment_id)
|
652
|
+
```
|
653
|
+
|
654
|
+
##### Errors
|
655
|
+
|
656
|
+
| HTTP Status Code | Error Description | Exception Class |
|
657
|
+
| --- | --- | --- |
|
658
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
659
|
+
| 403 | Forbidden | `APIException` |
|
660
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
661
|
+
|
662
|
+
#### Validate Iban
|
663
|
+
|
664
|
+
Validates an IBAN and returns the bank account information
|
665
|
+
|
666
|
+
```ruby
|
667
|
+
def validate_iban(bank_id,
|
668
|
+
iban)
|
669
|
+
```
|
670
|
+
|
671
|
+
##### Parameters
|
672
|
+
|
673
|
+
| Parameter | Type | Tags | Description |
|
674
|
+
| --- | --- | --- | --- |
|
675
|
+
| `bank_id` | `String` | Header, Required | Bank ID (Routing Number)<br>**Constraints**: *Pattern*: `^\d{9}$` |
|
676
|
+
| `iban` | `String` | Query, Required | Currency that is required by the client, sell foreign currency in exchange for local currency<br>**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `35` |
|
677
|
+
|
678
|
+
##### Response Type
|
679
|
+
|
680
|
+
[`BankAccount`](#bank-account)
|
681
|
+
|
682
|
+
##### Example Usage
|
683
|
+
|
684
|
+
```ruby
|
685
|
+
bank_id = 'bankId0'
|
686
|
+
iban = 'iban4'
|
687
|
+
|
688
|
+
result = payments_controller.validate_iban(bank_id, iban)
|
689
|
+
```
|
690
|
+
|
691
|
+
##### Example Response *(as JSON)*
|
692
|
+
|
693
|
+
```json
|
694
|
+
{
|
695
|
+
"accountNumber": "DE89370400440532013000",
|
696
|
+
"bank": {
|
697
|
+
"name": "Bank of America",
|
698
|
+
"address": {
|
699
|
+
"address1": "555 South North Lane",
|
700
|
+
"address2": "Floor 5",
|
701
|
+
"city": "Springfield",
|
702
|
+
"state": "VA",
|
703
|
+
"postalCode": "47060",
|
704
|
+
"country": "US"
|
705
|
+
},
|
706
|
+
"routingCode": "string",
|
707
|
+
"swiftCode": "AGCAAM22"
|
708
|
+
}
|
709
|
+
}
|
710
|
+
```
|
711
|
+
|
712
|
+
##### Errors
|
713
|
+
|
714
|
+
| HTTP Status Code | Error Description | Exception Class |
|
715
|
+
| --- | --- | --- |
|
716
|
+
| 400 | Error in Request | [`RequestErrorException`](#request-error) |
|
717
|
+
| 403 | Forbidden | `APIException` |
|
718
|
+
| 500 | System Error | [`RequestErrorException`](#request-error) |
|
719
|
+
|
720
|
+
## Model Reference
|
721
|
+
|
722
|
+
### Structures
|
723
|
+
|
724
|
+
* [Address](#address)
|
725
|
+
* [Bank](#bank)
|
726
|
+
* [Bank Account](#bank-account)
|
727
|
+
* [Beneficiary](#beneficiary)
|
728
|
+
* [Originator](#originator)
|
729
|
+
* [Payment](#payment)
|
730
|
+
* [Payment Details](#payment-details)
|
731
|
+
* [Payment Status](#payment-status)
|
732
|
+
* [Quote](#quote)
|
733
|
+
|
734
|
+
#### Address
|
735
|
+
|
736
|
+
Address Information
|
737
|
+
|
738
|
+
##### Class Name
|
739
|
+
|
740
|
+
`Address`
|
741
|
+
|
742
|
+
##### Fields
|
743
|
+
|
744
|
+
| Name | Type | Tags | Description |
|
745
|
+
| --- | --- | --- | --- |
|
746
|
+
| `address_1` | `String` | Required | Address Line 1<br>**Constraints**: *Maximum Length*: `35` |
|
747
|
+
| `address_2` | `String` | Optional | Address Line 2<br>**Constraints**: *Maximum Length*: `35` |
|
748
|
+
| `city` | `String` | Required | City<br>**Constraints**: *Maximum Length*: `35` |
|
749
|
+
| `state` | `String` | Optional | State / Province<br>**Constraints**: *Maximum Length*: `60` |
|
750
|
+
| `postal_code` | `String` | Required | Postal Code<br>**Constraints**: *Maximum Length*: `12` |
|
751
|
+
| `country` | `String` | Required | Country (ISO 3166-1 Alpha-2 Code)<br>**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2`, *Pattern*: `^[A-Z]{2}$` |
|
752
|
+
|
753
|
+
##### Example (as JSON)
|
754
|
+
|
755
|
+
```json
|
756
|
+
{
|
757
|
+
"address1": "555 South North Lane",
|
758
|
+
"address2": "Floor 5",
|
759
|
+
"city": "Springfield",
|
760
|
+
"state": "VA",
|
761
|
+
"postalCode": "47060",
|
762
|
+
"country": "US"
|
763
|
+
}
|
764
|
+
```
|
765
|
+
|
766
|
+
#### Bank
|
767
|
+
|
768
|
+
Bank Information Object
|
769
|
+
|
770
|
+
##### Class Name
|
771
|
+
|
772
|
+
`Bank`
|
773
|
+
|
774
|
+
##### Fields
|
775
|
+
|
776
|
+
| Name | Type | Tags | Description |
|
777
|
+
| --- | --- | --- | --- |
|
778
|
+
| `name` | `String` | Required | Bank Name<br>**Constraints**: *Maximum Length*: `50` |
|
779
|
+
| `address` | [`Address`](#address) | Required | Address Information |
|
780
|
+
| `routing_code` | `String` | Optional | Routing Code. Currently only supported for USD wires. When using, please only provide SWIFT code OR routing code (not both)<br>**Constraints**: *Maximum Length*: `35` |
|
781
|
+
| `swift_code` | `String` | Optional | SWIFT BIC<br>**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `11`, *Pattern*: `^[A-Za-z0-9]{4}[A-Za-z]{2}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$` |
|
782
|
+
|
783
|
+
##### Example (as JSON)
|
784
|
+
|
785
|
+
```json
|
786
|
+
{
|
787
|
+
"name": "Bank of America",
|
788
|
+
"address": {
|
789
|
+
"address1": "555 South North Lane",
|
790
|
+
"address2": "Floor 5",
|
791
|
+
"city": "Springfield",
|
792
|
+
"state": "VA",
|
793
|
+
"postalCode": "47060",
|
794
|
+
"country": "US"
|
795
|
+
},
|
796
|
+
"routingCode": "string",
|
797
|
+
"swiftCode": "AGCAAM22"
|
798
|
+
}
|
799
|
+
```
|
800
|
+
|
801
|
+
#### Bank Account
|
802
|
+
|
803
|
+
Bank Account Information Object.**NOTE** - originatorBankAccount bank data should not be provided when creating a new Payment. This information is retrieved from the database based on the provided bank ID.**NOTE** - bank object is required for all BankAccount objects except originatorBankAccount
|
804
|
+
|
805
|
+
##### Class Name
|
806
|
+
|
807
|
+
`BankAccount`
|
808
|
+
|
809
|
+
##### Fields
|
810
|
+
|
811
|
+
| Name | Type | Tags | Description |
|
812
|
+
| --- | --- | --- | --- |
|
813
|
+
| `account_number` | `String` | Optional | Bank Account Number / IBAN. Required for Beneficiary Bank. Optional for Intermediary Bank.<br>**Constraints**: *Maximum Length*: `35` |
|
814
|
+
| `bank` | [`Bank`](#bank) | Optional | Bank Information Object |
|
815
|
+
|
816
|
+
##### Example (as JSON)
|
817
|
+
|
818
|
+
```json
|
819
|
+
{
|
820
|
+
"accountNumber": "DE89370400440532013000",
|
821
|
+
"bank": {
|
822
|
+
"name": "Bank of America",
|
823
|
+
"address": {
|
824
|
+
"address1": "555 South North Lane",
|
825
|
+
"address2": "Floor 5",
|
826
|
+
"city": "Springfield",
|
827
|
+
"state": "VA",
|
828
|
+
"postalCode": "47060",
|
829
|
+
"country": "US"
|
830
|
+
},
|
831
|
+
"routingCode": "string",
|
832
|
+
"swiftCode": "AGCAAM22"
|
833
|
+
}
|
834
|
+
}
|
835
|
+
```
|
836
|
+
|
837
|
+
#### Beneficiary
|
838
|
+
|
839
|
+
Beneficiary Information Object
|
840
|
+
|
841
|
+
##### Class Name
|
842
|
+
|
843
|
+
`Beneficiary`
|
844
|
+
|
845
|
+
##### Fields
|
846
|
+
|
847
|
+
| Name | Type | Tags | Description |
|
848
|
+
| --- | --- | --- | --- |
|
849
|
+
| `name` | `String` | Required | Beneficiary Name<br>**Constraints**: *Maximum Length*: `80` |
|
850
|
+
| `address` | [`Address`](#address) | Required | Address Information |
|
851
|
+
| `email` | `String` | Optional | Beneficiary Email Address<br>**Constraints**: *Maximum Length*: `35` |
|
852
|
+
| `phone_number` | `String` | Optional | Beneficiary Phone Number<br>**Constraints**: *Maximum Length*: `35` |
|
853
|
+
|
854
|
+
##### Example (as JSON)
|
855
|
+
|
856
|
+
```json
|
857
|
+
{
|
858
|
+
"name": "Jake Johnson",
|
859
|
+
"address": {
|
860
|
+
"address1": "555 South North Lane",
|
861
|
+
"address2": "Floor 5",
|
862
|
+
"city": "Springfield",
|
863
|
+
"state": "VA",
|
864
|
+
"postalCode": "47060",
|
865
|
+
"country": "US"
|
866
|
+
},
|
867
|
+
"email": "beneficiary@example.com",
|
868
|
+
"phoneNumber": "111-111-1111"
|
869
|
+
}
|
870
|
+
```
|
871
|
+
|
872
|
+
#### Originator
|
873
|
+
|
874
|
+
Originator Information Object
|
875
|
+
|
876
|
+
##### Class Name
|
877
|
+
|
878
|
+
`Originator`
|
879
|
+
|
880
|
+
##### Fields
|
881
|
+
|
882
|
+
| Name | Type | Tags | Description |
|
883
|
+
| --- | --- | --- | --- |
|
884
|
+
| `name` | `String` | Required | Originator Name<br>**Constraints**: *Maximum Length*: `80` |
|
885
|
+
| `address` | [`Address`](#address) | Required | Address Information |
|
886
|
+
|
887
|
+
##### Example (as JSON)
|
888
|
+
|
889
|
+
```json
|
890
|
+
{
|
891
|
+
"name": "Jake Johnson",
|
892
|
+
"address": {
|
893
|
+
"address1": "555 South North Lane",
|
894
|
+
"address2": "Floor 5",
|
895
|
+
"city": "Springfield",
|
896
|
+
"state": "VA",
|
897
|
+
"postalCode": "47060",
|
898
|
+
"country": "US"
|
899
|
+
}
|
900
|
+
}
|
901
|
+
```
|
902
|
+
|
903
|
+
#### Payment
|
904
|
+
|
905
|
+
Payment Information Object
|
906
|
+
|
907
|
+
##### Class Name
|
908
|
+
|
909
|
+
`Payment`
|
910
|
+
|
911
|
+
##### Fields
|
912
|
+
|
913
|
+
| Name | Type | Tags | Description |
|
914
|
+
| --- | --- | --- | --- |
|
915
|
+
| `id` | `Integer` | Optional | Payment ID |
|
916
|
+
| `quote_id` | `Integer` | Required | Quote ID |
|
917
|
+
| `originator` | [`Originator`](#originator) | Required | Originator Information Object |
|
918
|
+
| `originator_bank_account` | [`BankAccount`](#bank-account) | Optional | Bank Account Information Object.**NOTE** - originatorBankAccount bank data should not be provided when creating a new Payment. This information is retrieved from the database based on the provided bank ID.**NOTE** - bank object is required for all BankAccount objects except originatorBankAccount |
|
919
|
+
| `beneficiary` | [`Beneficiary`](#beneficiary) | Required | Beneficiary Information Object |
|
920
|
+
| `beneficiary_bank_account` | [`BankAccount`](#bank-account) | Required | Bank Account Information Object.**NOTE** - originatorBankAccount bank data should not be provided when creating a new Payment. This information is retrieved from the database based on the provided bank ID.**NOTE** - bank object is required for all BankAccount objects except originatorBankAccount |
|
921
|
+
| `intermediary_bank_account` | [`BankAccount`](#bank-account) | Optional | Bank Account Information Object.**NOTE** - originatorBankAccount bank data should not be provided when creating a new Payment. This information is retrieved from the database based on the provided bank ID.**NOTE** - bank object is required for all BankAccount objects except originatorBankAccount |
|
922
|
+
| `details` | [`PaymentDetails`](#payment-details) | Required | Payment Information Data |
|
923
|
+
| `status` | [`PaymentStatus`](#payment-status) | Optional | Payment Information Data |
|
924
|
+
|
925
|
+
##### Example (as JSON)
|
926
|
+
|
927
|
+
```json
|
928
|
+
{
|
929
|
+
"id": 987654,
|
930
|
+
"quoteId": 123456,
|
931
|
+
"originator": {
|
932
|
+
"name": "Jake Johnson",
|
933
|
+
"address": {
|
934
|
+
"address1": "555 South North Lane",
|
935
|
+
"address2": "Floor 5",
|
936
|
+
"city": "Springfield",
|
937
|
+
"state": "VA",
|
938
|
+
"postalCode": "47060",
|
939
|
+
"country": "US"
|
940
|
+
}
|
941
|
+
},
|
942
|
+
"originatorBankAccount": {
|
943
|
+
"accountNumber": "DE89370400440532013000",
|
944
|
+
"bank": {
|
945
|
+
"name": "Bank of America",
|
946
|
+
"address": {
|
947
|
+
"address1": "555 South North Lane",
|
948
|
+
"address2": "Floor 5",
|
949
|
+
"city": "Springfield",
|
950
|
+
"state": "VA",
|
951
|
+
"postalCode": "47060",
|
952
|
+
"country": "US"
|
953
|
+
},
|
954
|
+
"routingCode": "string",
|
955
|
+
"swiftCode": "AGCAAM22"
|
956
|
+
}
|
957
|
+
},
|
958
|
+
"beneficiary": {
|
959
|
+
"name": "Jake Johnson",
|
960
|
+
"address": {
|
961
|
+
"address1": "555 South North Lane",
|
962
|
+
"address2": "Floor 5",
|
963
|
+
"city": "Springfield",
|
964
|
+
"state": "VA",
|
965
|
+
"postalCode": "47060",
|
966
|
+
"country": "US"
|
967
|
+
},
|
968
|
+
"email": "beneficiary@example.com",
|
969
|
+
"phoneNumber": "111-111-1111"
|
970
|
+
},
|
971
|
+
"beneficiaryBankAccount": {
|
972
|
+
"accountNumber": "DE89370400440532013000",
|
973
|
+
"bank": {
|
974
|
+
"name": "Bank of America",
|
975
|
+
"address": {
|
976
|
+
"address1": "555 South North Lane",
|
977
|
+
"address2": "Floor 5",
|
978
|
+
"city": "Springfield",
|
979
|
+
"state": "VA",
|
980
|
+
"postalCode": "47060",
|
981
|
+
"country": "US"
|
982
|
+
},
|
983
|
+
"routingCode": "string",
|
984
|
+
"swiftCode": "AGCAAM22"
|
985
|
+
}
|
986
|
+
},
|
987
|
+
"intermediaryBankAccount": {
|
988
|
+
"accountNumber": "DE89370400440532013000",
|
989
|
+
"bank": {
|
990
|
+
"name": "Bank of America",
|
991
|
+
"address": {
|
992
|
+
"address1": "555 South North Lane",
|
993
|
+
"address2": "Floor 5",
|
994
|
+
"city": "Springfield",
|
995
|
+
"state": "VA",
|
996
|
+
"postalCode": "47060",
|
997
|
+
"country": "US"
|
998
|
+
},
|
999
|
+
"routingCode": "string",
|
1000
|
+
"swiftCode": "AGCAAM22"
|
1001
|
+
}
|
1002
|
+
},
|
1003
|
+
"details": {
|
1004
|
+
"purposeOfPayment": "Purchase of Goods",
|
1005
|
+
"memo": "Invoice 12345678",
|
1006
|
+
"paymentReference": "1234567890"
|
1007
|
+
},
|
1008
|
+
"status": {
|
1009
|
+
"approved": false,
|
1010
|
+
"sent": false
|
1011
|
+
}
|
1012
|
+
}
|
1013
|
+
```
|
1014
|
+
|
1015
|
+
#### Payment Details
|
1016
|
+
|
1017
|
+
Payment Information Data
|
1018
|
+
|
1019
|
+
##### Class Name
|
1020
|
+
|
1021
|
+
`PaymentDetails`
|
1022
|
+
|
1023
|
+
##### Fields
|
1024
|
+
|
1025
|
+
| Name | Type | Tags | Description |
|
1026
|
+
| --- | --- | --- | --- |
|
1027
|
+
| `purpose_of_payment` | `String` | Required | Purpose of payment<br>**Constraints**: *Maximum Length*: `30` |
|
1028
|
+
| `memo` | `String` | Optional | Memo from Originator to Beneficiary<br>**Constraints**: *Maximum Length*: `140` |
|
1029
|
+
| `payment_reference` | `String` | Optional | Payment Reference Information. Typically includes FI to FI notes<br>**Constraints**: *Maximum Length*: `140` |
|
1030
|
+
|
1031
|
+
##### Example (as JSON)
|
1032
|
+
|
1033
|
+
```json
|
1034
|
+
{
|
1035
|
+
"purposeOfPayment": "Purchase of Goods",
|
1036
|
+
"memo": "Invoice 12345678",
|
1037
|
+
"paymentReference": "1234567890"
|
1038
|
+
}
|
1039
|
+
```
|
1040
|
+
|
1041
|
+
#### Payment Status
|
1042
|
+
|
1043
|
+
Payment Information Data
|
1044
|
+
|
1045
|
+
##### Class Name
|
1046
|
+
|
1047
|
+
`PaymentStatus`
|
1048
|
+
|
1049
|
+
##### Fields
|
1050
|
+
|
1051
|
+
| Name | Type | Tags | Description |
|
1052
|
+
| --- | --- | --- | --- |
|
1053
|
+
| `approved` | `Boolean` | Optional | Set to true once the payment has been approved |
|
1054
|
+
| `sent` | `Boolean` | Optional | Set to true once the payment has been sent |
|
1055
|
+
|
1056
|
+
##### Example (as JSON)
|
1057
|
+
|
1058
|
+
```json
|
1059
|
+
{
|
1060
|
+
"approved": false,
|
1061
|
+
"sent": false
|
1062
|
+
}
|
1063
|
+
```
|
1064
|
+
|
1065
|
+
#### Quote
|
1066
|
+
|
1067
|
+
Quote Information Object
|
1068
|
+
|
1069
|
+
##### Class Name
|
1070
|
+
|
1071
|
+
`Quote`
|
1072
|
+
|
1073
|
+
##### Fields
|
1074
|
+
|
1075
|
+
| Name | Type | Tags | Description |
|
1076
|
+
| --- | --- | --- | --- |
|
1077
|
+
| `id` | `Integer` | Optional | Quote ID |
|
1078
|
+
| `beneficiary_amount` | `Float` | Optional | Amount to send in beneficiary currency. Not required if originatorAmount is provided. |
|
1079
|
+
| `beneficiary_currency` | `String` | Required | Beneficiary currency code in ISO 4217 format<br>**Constraints**: *Minimum Length*: `3`, *Maximum Length*: `3`, *Pattern*: `^[A-Z]{3}$` |
|
1080
|
+
| `originator_amount` | `Float` | Optional | Amount to send in originator currency. Not required if beneficiaryAmount is provided |
|
1081
|
+
| `originator_amount_is_fixed` | `Boolean` | Optional | If true, then the originator amount is fixed to the provided value. If false, then the beneficiary amount is fixed to the provided value. This field is automatically set based on whether the originator or beneficary amount was provided. |
|
1082
|
+
| `exchange_rate` | `Float` | Optional | The exchange rate for the quote |
|
1083
|
+
| `locked` | `Boolean` | Optional | Set to true if the quote rate is locked |
|
1084
|
+
| `revision` | `Integer` | Optional | Quote revision number. This is automatically incremented each time the quote is refreshed or updated, and starts from 1 |
|
1085
|
+
|
1086
|
+
##### Example (as JSON)
|
1087
|
+
|
1088
|
+
```json
|
1089
|
+
{
|
1090
|
+
"id": 0,
|
1091
|
+
"beneficiaryAmount": 12345.67,
|
1092
|
+
"beneficiaryCurrency": "EUR",
|
1093
|
+
"originatorAmount": 76543.21,
|
1094
|
+
"originatorAmountIsFixed": true,
|
1095
|
+
"exchangeRate": 1.2345,
|
1096
|
+
"locked": false,
|
1097
|
+
"revision": 1
|
1098
|
+
}
|
1099
|
+
```
|
1100
|
+
|
1101
|
+
### Exceptions
|
1102
|
+
|
1103
|
+
* [Request Error](#request-error)
|
1104
|
+
|
1105
|
+
#### Request Error
|
1106
|
+
|
1107
|
+
Format for 400 Errors
|
1108
|
+
|
1109
|
+
##### Class Name
|
1110
|
+
|
1111
|
+
`RequestErrorException`
|
1112
|
+
|
1113
|
+
##### Fields
|
1114
|
+
|
1115
|
+
| Name | Type | Tags | Description |
|
1116
|
+
| --- | --- | --- | --- |
|
1117
|
+
| `message` | `String` | Optional | Message indicating the source of the error in the request |
|
1118
|
+
|
1119
|
+
##### Example (as JSON)
|
1120
|
+
|
1121
|
+
```json
|
1122
|
+
{
|
1123
|
+
"message": "Error occured while performing field validation"
|
1124
|
+
}
|
1125
|
+
```
|
1126
|
+
|
1127
|
+
## Utility Classes Documentation
|
1128
|
+
|
1129
|
+
### ApiHelper Class
|
1130
|
+
|
1131
|
+
API utility class.
|
1132
|
+
|
1133
|
+
### Methods
|
1134
|
+
|
1135
|
+
| Name | Return Type | Description |
|
1136
|
+
| --- | --- | --- |
|
1137
|
+
| json_deserialize | Hash | Deserializes a JSON string to a Ruby Hash. |
|
1138
|
+
| rfc3339 | DateTime | Safely converts a string into an RFC3339 DateTime object. |
|
1139
|
+
|
1140
|
+
## Common Code Documentation
|
1141
|
+
|
1142
|
+
### HttpResponse
|
1143
|
+
|
1144
|
+
Http response received.
|
1145
|
+
|
1146
|
+
#### Properties
|
1147
|
+
|
1148
|
+
| Name | Type | Description |
|
1149
|
+
| --- | --- | --- |
|
1150
|
+
| status_code | Integer | The status code returned by the server. |
|
1151
|
+
| reason_phrase | String | The reason phrase returned by the server. |
|
1152
|
+
| headers | Hash | Response headers. |
|
1153
|
+
| raw_body | String | Response body. |
|
1154
|
+
| request | HttpRequest | The request that resulted in this response. |
|
1155
|
+
|
1156
|
+
### HttpRequest
|
1157
|
+
|
1158
|
+
Represents a single Http Request.
|
1159
|
+
|
1160
|
+
#### Properties
|
1161
|
+
|
1162
|
+
| Name | Type | Tag | Description |
|
1163
|
+
| --- | --- | --- | --- |
|
1164
|
+
| http_method | HttpMethodEnum | | The HTTP method of the request. |
|
1165
|
+
| query_url | String | | The endpoint URL for the API request. |
|
1166
|
+
| headers | Hash | Optional | Request headers. |
|
1167
|
+
| parameters | Hash | Optional | Request body. |
|
1168
|
+
|