@mojaloop/sdk-scheme-adapter 13.0.3 → 15.0.0
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.
- package/.circleci/config.yml +1 -1
- package/.nvmrc +1 -1
- package/CHANGELOG.md +29 -0
- package/Dockerfile +2 -2
- package/audit-resolve.json +109 -19
- package/package.json +4 -10
- package/src/OutboundServer/api.yaml +370 -44
- package/src/lib/model/OutboundBulkQuotesModel.js +4 -4
- package/src/lib/model/OutboundBulkTransfersModel.js +4 -4
- package/src/lib/model/OutboundRequestToPayTransferModel.js +9 -10
- package/src/lib/model/OutboundTransfersModel.js +2 -2
- package/test/unit/lib/model/OutboundBulkQuotesModel.test.js +8 -5
- package/test/unit/lib/model/OutboundBulkTransfersModel.test.js +8 -5
- package/test/unit/lib/model/OutboundTransfersModel.test.js +8 -5
package/.circleci/config.yml
CHANGED
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
v16.
|
|
1
|
+
v16.15.0
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
# Changelog: [mojaloop/thirdparty-api-svc](https://github.com/mojaloop/thirdparty-api-svc)
|
|
2
|
+
## [15.0.0](https://github.com/mojaloop/sdk-scheme-adapter/compare/v14.0.0...v15.0.0) (2022-06-17)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### ⚠ BREAKING CHANGES
|
|
6
|
+
|
|
7
|
+
* added outbound bulk api (#320)
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* added outbound bulk api ([#320](https://github.com/mojaloop/sdk-scheme-adapter/issues/320)) ([e2e83e9](https://github.com/mojaloop/sdk-scheme-adapter/commit/e2e83e99048a755b49123e91faa3acc03dded029))
|
|
12
|
+
|
|
13
|
+
## [14.0.0](https://github.com/mojaloop/sdk-scheme-adapter/compare/v13.0.4...v14.0.0) (2022-05-19)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### ⚠ BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
* bump nodejs version and update central services (#319)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* bump nodejs version and update central services ([#319](https://github.com/mojaloop/sdk-scheme-adapter/issues/319)) ([ee5a6da](https://github.com/mojaloop/sdk-scheme-adapter/commit/ee5a6da0650aa186114755c88889c441da6dfe8a))
|
|
23
|
+
|
|
24
|
+
### [13.0.4](https://github.com/mojaloop/sdk-scheme-adapter/compare/v13.0.3...v13.0.4) (2022-05-13)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* reformat error information response ([#318](https://github.com/mojaloop/sdk-scheme-adapter/issues/318)) ([ed844b1](https://github.com/mojaloop/sdk-scheme-adapter/commit/ed844b1d2da6c58d3c61622c07c326bda3ca3b86))
|
|
30
|
+
|
|
2
31
|
### [13.0.3](https://github.com/mojaloop/sdk-scheme-adapter/compare/v13.0.2...v13.0.3) (2022-05-12)
|
|
3
32
|
|
|
4
33
|
|
package/Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM node:16-alpine as builder
|
|
1
|
+
FROM node:16.15.0-alpine as builder
|
|
2
2
|
|
|
3
3
|
RUN apk add --no-cache git python3 build-base
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ WORKDIR /src
|
|
|
12
12
|
COPY ./package.json .
|
|
13
13
|
COPY ./package-lock.json .
|
|
14
14
|
RUN npm ci --only=production
|
|
15
|
-
FROM node:16-alpine
|
|
15
|
+
FROM node:16.15.0-alpine
|
|
16
16
|
|
|
17
17
|
ARG BUILD_DATE
|
|
18
18
|
ARG VCS_URL
|
package/audit-resolve.json
CHANGED
|
@@ -407,8 +407,8 @@
|
|
|
407
407
|
},
|
|
408
408
|
"1068310|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
|
|
409
409
|
"decision": "ignore",
|
|
410
|
-
"madeAt":
|
|
411
|
-
"expiresAt":
|
|
410
|
+
"madeAt": 1654208208192,
|
|
411
|
+
"expiresAt": 1656800189114
|
|
412
412
|
},
|
|
413
413
|
"1067946|ajv": {
|
|
414
414
|
"decision": "ignore",
|
|
@@ -417,13 +417,13 @@
|
|
|
417
417
|
},
|
|
418
418
|
"1070030|@mojaloop/central-services-shared>widdershins>markdown-it": {
|
|
419
419
|
"decision": "ignore",
|
|
420
|
-
"madeAt":
|
|
421
|
-
"expiresAt":
|
|
420
|
+
"madeAt": 1652982823332,
|
|
421
|
+
"expiresAt": 1655574816261
|
|
422
422
|
},
|
|
423
423
|
"1070030|@mojaloop/central-services-shared>shins>markdown-it": {
|
|
424
424
|
"decision": "ignore",
|
|
425
|
-
"madeAt":
|
|
426
|
-
"expiresAt":
|
|
425
|
+
"madeAt": 1654208210848,
|
|
426
|
+
"expiresAt": 1656800189114
|
|
427
427
|
},
|
|
428
428
|
"1068154|@mojaloop/central-services-shared>shins>sanitize-html": {
|
|
429
429
|
"decision": "ignore",
|
|
@@ -432,8 +432,8 @@
|
|
|
432
432
|
},
|
|
433
433
|
"1068155|@mojaloop/central-services-shared>shins>sanitize-html": {
|
|
434
434
|
"decision": "ignore",
|
|
435
|
-
"madeAt":
|
|
436
|
-
"expiresAt":
|
|
435
|
+
"madeAt": 1654208203284,
|
|
436
|
+
"expiresAt": 1656800189114
|
|
437
437
|
},
|
|
438
438
|
"1070245|@mojaloop/central-services-shared>@mojaloop/event-sdk>moment": {
|
|
439
439
|
"decision": "ignore",
|
|
@@ -452,8 +452,8 @@
|
|
|
452
452
|
},
|
|
453
453
|
"1070030|widdershins>markdown-it": {
|
|
454
454
|
"decision": "ignore",
|
|
455
|
-
"madeAt":
|
|
456
|
-
"expiresAt":
|
|
455
|
+
"madeAt": 1654209004788,
|
|
456
|
+
"expiresAt": 1656800991863
|
|
457
457
|
},
|
|
458
458
|
"1068154|@mojaloop/central-services-shared>@mojaloop/event-sdk>moment>shins>markdown-it>sanitize-html": {
|
|
459
459
|
"decision": "ignore",
|
|
@@ -487,25 +487,115 @@
|
|
|
487
487
|
},
|
|
488
488
|
"1067553|swagger2openapi>better-ajv-errors>jsonpointer": {
|
|
489
489
|
"decision": "ignore",
|
|
490
|
-
"madeAt":
|
|
491
|
-
"expiresAt":
|
|
490
|
+
"madeAt": 1654209013381,
|
|
491
|
+
"expiresAt": 1656800991863
|
|
492
492
|
},
|
|
493
493
|
"1067946|swagger2openapi>better-ajv-errors>jsonpointer>oas-validator>ajv": {
|
|
494
494
|
"decision": "ignore",
|
|
495
|
-
"madeAt":
|
|
496
|
-
"expiresAt":
|
|
495
|
+
"madeAt": 1654209015474,
|
|
496
|
+
"expiresAt": 1656800991863
|
|
497
497
|
},
|
|
498
498
|
"1068310|widdershins>markdown-it>yargs>yargs-parser": {
|
|
499
499
|
"decision": "ignore",
|
|
500
|
-
"madeAt":
|
|
501
|
-
"expiresAt":
|
|
500
|
+
"madeAt": 1654209017825,
|
|
501
|
+
"expiresAt": 1656800991863
|
|
502
502
|
},
|
|
503
503
|
"1070260|@mojaloop/central-services-shared>shins>sanitize-html": {
|
|
504
504
|
"decision": "ignore",
|
|
505
|
-
"madeAt":
|
|
506
|
-
"expiresAt":
|
|
505
|
+
"madeAt": 1654208205836,
|
|
506
|
+
"expiresAt": 1656800189114
|
|
507
|
+
},
|
|
508
|
+
"1068155|@mojaloop/central-services-shared>shins>markdown-it>sanitize-html": {
|
|
509
|
+
"decision": "ignore",
|
|
510
|
+
"madeAt": 1652981366297,
|
|
511
|
+
"expiresAt": 1655573359219
|
|
512
|
+
},
|
|
513
|
+
"1070260|@mojaloop/central-services-shared>shins>markdown-it>sanitize-html": {
|
|
514
|
+
"decision": "ignore",
|
|
515
|
+
"madeAt": 1652981367363,
|
|
516
|
+
"expiresAt": 1655573359219
|
|
517
|
+
},
|
|
518
|
+
"1070030|shins>markdown-it": {
|
|
519
|
+
"decision": "ignore",
|
|
520
|
+
"madeAt": 1654872421648,
|
|
521
|
+
"expiresAt": 1657464405390
|
|
522
|
+
},
|
|
523
|
+
"1068310|@mojaloop/central-services-shared>widdershins>markdown-it>yargs>yargs-parser": {
|
|
524
|
+
"decision": "ignore",
|
|
525
|
+
"madeAt": 1652982824567,
|
|
526
|
+
"expiresAt": 1655574816261
|
|
527
|
+
},
|
|
528
|
+
"1068155|shins>markdown-it>sanitize-html": {
|
|
529
|
+
"decision": "ignore",
|
|
530
|
+
"madeAt": 1652982826025,
|
|
531
|
+
"expiresAt": 1655574816261
|
|
532
|
+
},
|
|
533
|
+
"1070260|shins>markdown-it>sanitize-html": {
|
|
534
|
+
"decision": "ignore",
|
|
535
|
+
"madeAt": 1652982827137,
|
|
536
|
+
"expiresAt": 1655574816261
|
|
537
|
+
},
|
|
538
|
+
"1067553|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
|
|
539
|
+
"decision": "ignore",
|
|
540
|
+
"madeAt": 1654208197641,
|
|
541
|
+
"expiresAt": 1656800189114
|
|
542
|
+
},
|
|
543
|
+
"1067553|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
|
|
544
|
+
"decision": "ignore",
|
|
545
|
+
"madeAt": 1654208197642,
|
|
546
|
+
"expiresAt": 1656800189114
|
|
547
|
+
},
|
|
548
|
+
"1067946|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
|
|
549
|
+
"decision": "ignore",
|
|
550
|
+
"madeAt": 1654208200360,
|
|
551
|
+
"expiresAt": 1656800189114
|
|
552
|
+
},
|
|
553
|
+
"1070412|@mojaloop/central-services-shared>shins>ejs": {
|
|
554
|
+
"decision": "ignore",
|
|
555
|
+
"madeAt": 1654208217831,
|
|
556
|
+
"expiresAt": 1656800189114
|
|
557
|
+
},
|
|
558
|
+
"1070449|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs": {
|
|
559
|
+
"decision": "ignore",
|
|
560
|
+
"madeAt": 1654209002758,
|
|
561
|
+
"expiresAt": 1656800991863
|
|
562
|
+
},
|
|
563
|
+
"1070030|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it": {
|
|
564
|
+
"decision": "ignore",
|
|
565
|
+
"madeAt": 1654209004788,
|
|
566
|
+
"expiresAt": 1656800991863
|
|
567
|
+
},
|
|
568
|
+
"1068155|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it>sanitize-html": {
|
|
569
|
+
"decision": "ignore",
|
|
570
|
+
"madeAt": 1654209006663,
|
|
571
|
+
"expiresAt": 1656800991863
|
|
572
|
+
},
|
|
573
|
+
"1070260|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>shins>markdown-it>sanitize-html": {
|
|
574
|
+
"decision": "ignore",
|
|
575
|
+
"madeAt": 1654209008676,
|
|
576
|
+
"expiresAt": 1656800991863
|
|
577
|
+
},
|
|
578
|
+
"1070412|ejs": {
|
|
579
|
+
"decision": "ignore",
|
|
580
|
+
"madeAt": 1654209011201,
|
|
581
|
+
"expiresAt": 1656800991863
|
|
582
|
+
},
|
|
583
|
+
"1070483|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs": {
|
|
584
|
+
"decision": "ignore",
|
|
585
|
+
"madeAt": 1654872419659,
|
|
586
|
+
"expiresAt": 1657464405390
|
|
587
|
+
},
|
|
588
|
+
"1070030|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>widdershins>markdown-it": {
|
|
589
|
+
"decision": "ignore",
|
|
590
|
+
"madeAt": 1654872421648,
|
|
591
|
+
"expiresAt": 1657464405390
|
|
592
|
+
},
|
|
593
|
+
"1068310|@mojaloop/central-services-shared>@mojaloop/event-sdk>grpc>protobufjs>widdershins>markdown-it>yargs>yargs-parser": {
|
|
594
|
+
"decision": "ignore",
|
|
595
|
+
"madeAt": 1654872423852,
|
|
596
|
+
"expiresAt": 1657464405390
|
|
507
597
|
}
|
|
508
598
|
},
|
|
509
599
|
"rules": {},
|
|
510
600
|
"version": 1
|
|
511
|
-
}
|
|
601
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mojaloop/sdk-scheme-adapter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "An adapter for connecting to Mojaloop API enabled switches.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -54,15 +54,9 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@koa/cors": "^3.1.0",
|
|
57
|
-
"@mojaloop/central-services-
|
|
58
|
-
"@mojaloop/
|
|
59
|
-
"
|
|
60
|
-
"@mojaloop/central-services-metrics": "11.0.0",
|
|
61
|
-
"@mojaloop/central-services-shared": "14.0.0",
|
|
62
|
-
"@mojaloop/event-sdk": "10.7.1",
|
|
63
|
-
"@mojaloop/sdk-standard-components": "^16.0.0",
|
|
64
|
-
"ajv": "8.6.3",
|
|
65
|
-
"ajv-keywords": "5.0.0",
|
|
57
|
+
"@mojaloop/central-services-shared": "17.0.2",
|
|
58
|
+
"@mojaloop/sdk-standard-components": "^17.0.1",
|
|
59
|
+
"ajv": "8.11.0",
|
|
66
60
|
"axios": "^0.21.4",
|
|
67
61
|
"co-body": "^6.1.0",
|
|
68
62
|
"dotenv": "^10.0.0",
|
|
@@ -17,8 +17,8 @@ info:
|
|
|
17
17
|
the term "FSP" is equal to the term "DFSP".
|
|
18
18
|
license:
|
|
19
19
|
name: 'Apache License Version 2.0, January 2004'
|
|
20
|
-
url: '
|
|
21
|
-
version:
|
|
20
|
+
url: 'https://github.com/mojaloop/documentation/blob/master/LICENSE.md'
|
|
21
|
+
version: 2.0.0
|
|
22
22
|
paths:
|
|
23
23
|
/:
|
|
24
24
|
get:
|
|
@@ -165,33 +165,37 @@ paths:
|
|
|
165
165
|
$ref: '#/components/schemas/bulkTransferRequest'
|
|
166
166
|
required: true
|
|
167
167
|
responses:
|
|
168
|
-
'
|
|
169
|
-
$ref: '#/components/responses/
|
|
168
|
+
'202':
|
|
169
|
+
$ref: '#/components/responses/bulkTransferAccepted'
|
|
170
170
|
'400':
|
|
171
171
|
$ref: '#/components/responses/bulkTransferBadRequest'
|
|
172
172
|
'500':
|
|
173
|
-
$ref: '#/components/
|
|
174
|
-
'504':
|
|
175
|
-
$ref: '#/components/responses/bulkTransferTimeout'
|
|
173
|
+
$ref: '#/components/schemas/errorResponse'
|
|
176
174
|
'/bulkTransfers/{bulkTransferId}':
|
|
177
|
-
|
|
178
|
-
summary:
|
|
175
|
+
put:
|
|
176
|
+
summary: Amends the bulk transfer request
|
|
179
177
|
description: >-
|
|
180
|
-
The HTTP request `
|
|
181
|
-
information regarding a bulk transfer
|
|
182
|
-
|
|
178
|
+
The HTTP request `PUT /bulkTransfers/{bulkTransferId}` is used to amend
|
|
179
|
+
information regarding a bulk transfer, i.e. when autoAcceptParty or autoAcceptQuote
|
|
180
|
+
is false then the payer need to provide confirmation to proceed with further processing
|
|
181
|
+
of the request. The `{bulkTransferId}` in the URI should contain the `bulkTransferId` that
|
|
183
182
|
was used for the creation of the bulk transfer.
|
|
184
183
|
tags:
|
|
185
184
|
- BulkTransfers
|
|
186
185
|
parameters:
|
|
187
186
|
- $ref: '#/components/parameters/bulkTransferId'
|
|
187
|
+
requestBody:
|
|
188
|
+
content:
|
|
189
|
+
application/json:
|
|
190
|
+
schema:
|
|
191
|
+
oneOf:
|
|
192
|
+
- $ref: '#/components/schemas/bulkTransferContinuationAcceptParty'
|
|
193
|
+
- $ref: '#/components/schemas/bulkTransferContinuationAcceptQuote'
|
|
188
194
|
responses:
|
|
189
|
-
'
|
|
190
|
-
description: Bulk transfer information successfully
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
schema:
|
|
194
|
-
$ref: '#/components/schemas/bulkTransferStatusResponse'
|
|
195
|
+
'202':
|
|
196
|
+
description: Bulk transfer information successfully amended
|
|
197
|
+
'400':
|
|
198
|
+
$ref: '#/components/responses/bulkTransferPutBadRequest'
|
|
195
199
|
'500':
|
|
196
200
|
description: An error occurred processing the bulk transfer
|
|
197
201
|
content:
|
|
@@ -470,6 +474,31 @@ paths:
|
|
|
470
474
|
$ref: '#/components/responses/simpleTransfersServerError'
|
|
471
475
|
components:
|
|
472
476
|
schemas:
|
|
477
|
+
autoAcceptPartyOption:
|
|
478
|
+
type: object
|
|
479
|
+
required:
|
|
480
|
+
- enabled
|
|
481
|
+
properties:
|
|
482
|
+
enabled:
|
|
483
|
+
type: boolean
|
|
484
|
+
enum:
|
|
485
|
+
- false
|
|
486
|
+
- true
|
|
487
|
+
autoAcceptQuote:
|
|
488
|
+
type: object
|
|
489
|
+
required:
|
|
490
|
+
- enabled
|
|
491
|
+
properties:
|
|
492
|
+
enabled:
|
|
493
|
+
type: boolean
|
|
494
|
+
enum:
|
|
495
|
+
- true
|
|
496
|
+
- false
|
|
497
|
+
perTransferFeeLimits:
|
|
498
|
+
type: array
|
|
499
|
+
minItems: 0
|
|
500
|
+
items:
|
|
501
|
+
$ref: '#/components/schemas/bulkPerTransferFeeLimit'
|
|
473
502
|
TransactionInitiatorType:
|
|
474
503
|
title: TransactionInitiatorType
|
|
475
504
|
type: string
|
|
@@ -724,6 +753,191 @@ components:
|
|
|
724
753
|
$ref: '#/components/schemas/Extension'
|
|
725
754
|
minItems: 0
|
|
726
755
|
maxItems: 16
|
|
756
|
+
bulkPartyLookupResponse:
|
|
757
|
+
description: >-
|
|
758
|
+
The object sent back to the payer for confirmation of payee parties.
|
|
759
|
+
It's basically the same object as the original bulk transfer request
|
|
760
|
+
with party information is added for all the payees
|
|
761
|
+
type: object
|
|
762
|
+
required:
|
|
763
|
+
- bulkHomeTransactionID
|
|
764
|
+
- from
|
|
765
|
+
- individualTransfers
|
|
766
|
+
properties:
|
|
767
|
+
bulkHomeTransactionID:
|
|
768
|
+
type: string
|
|
769
|
+
description: >-
|
|
770
|
+
Transaction ID from the DFSP backend, used to reconcile transactions
|
|
771
|
+
between the Switch and DFSP backend systems.
|
|
772
|
+
options:
|
|
773
|
+
$ref: '#/components/schemas/bulkTransferOptions'
|
|
774
|
+
from:
|
|
775
|
+
$ref: '#/components/schemas/Party'
|
|
776
|
+
individualTransfers:
|
|
777
|
+
description: List of individual transfers in a bulk transfer.
|
|
778
|
+
type: array
|
|
779
|
+
minItems: 1
|
|
780
|
+
maxItems: 1000
|
|
781
|
+
items:
|
|
782
|
+
allOf:
|
|
783
|
+
- $ref: '#/components/schemas/individualTransfer'
|
|
784
|
+
- type: object
|
|
785
|
+
required:
|
|
786
|
+
- transactionId
|
|
787
|
+
properties:
|
|
788
|
+
transactionId:
|
|
789
|
+
$ref: '#/components/schemas/CorrelationId'
|
|
790
|
+
|
|
791
|
+
extensions:
|
|
792
|
+
$ref: '#/components/schemas/ExtensionList'
|
|
793
|
+
lastError:
|
|
794
|
+
description: >
|
|
795
|
+
Object representing the last error to occur during a party discovery process.
|
|
796
|
+
This may be a Mojaloop API error returned from another entity in the
|
|
797
|
+
scheme or an object representing other types of error e.g.
|
|
798
|
+
exceptions that may occur inside the scheme adapter.
|
|
799
|
+
$ref: '#/components/schemas/partyError'
|
|
800
|
+
bulkQuoteRequestResponse:
|
|
801
|
+
description: >-
|
|
802
|
+
The object sent back to the payer for confirmation of quotes.
|
|
803
|
+
It's basically the same object as the original bulk transfer request
|
|
804
|
+
with quote information added for all the transfers
|
|
805
|
+
type: object
|
|
806
|
+
required:
|
|
807
|
+
- bulkHomeTransactionID
|
|
808
|
+
- from
|
|
809
|
+
- individualTransfers
|
|
810
|
+
properties:
|
|
811
|
+
bulkHomeTransactionID:
|
|
812
|
+
type: string
|
|
813
|
+
description: >-
|
|
814
|
+
Transaction ID from the DFSP backend, used to reconcile transactions
|
|
815
|
+
between the Switch and DFSP backend systems.
|
|
816
|
+
options:
|
|
817
|
+
$ref: '#/components/schemas/bulkTransferOptions'
|
|
818
|
+
from:
|
|
819
|
+
$ref: '#/components/schemas/Party'
|
|
820
|
+
individualTransfers:
|
|
821
|
+
description: List of individual transfers in a bulk transfer.
|
|
822
|
+
type: array
|
|
823
|
+
minItems: 1
|
|
824
|
+
maxItems: 1000
|
|
825
|
+
items:
|
|
826
|
+
allOf:
|
|
827
|
+
- $ref: '#/components/schemas/individualTransfer'
|
|
828
|
+
- type: object
|
|
829
|
+
required:
|
|
830
|
+
- transactionId
|
|
831
|
+
properties:
|
|
832
|
+
transactionId:
|
|
833
|
+
$ref: '#/components/schemas/CorrelationId'
|
|
834
|
+
- type: object
|
|
835
|
+
required:
|
|
836
|
+
- quoteResponse
|
|
837
|
+
properties:
|
|
838
|
+
quoteResponse:
|
|
839
|
+
$ref: '#/components/schemas/QuotesIDPutResponse'
|
|
840
|
+
extensions:
|
|
841
|
+
$ref: '#/components/schemas/ExtensionList'
|
|
842
|
+
lastError:
|
|
843
|
+
description: >
|
|
844
|
+
Object representing the last error to occur during a party discovery process.
|
|
845
|
+
This may be a Mojaloop API error returned from another entity in the
|
|
846
|
+
scheme or an object representing other types of error e.g.
|
|
847
|
+
exceptions that may occur inside the scheme adapter.
|
|
848
|
+
$ref: '#/components/schemas/partyError'
|
|
849
|
+
|
|
850
|
+
bulkTransferContinuationAcceptParty:
|
|
851
|
+
description: >-
|
|
852
|
+
The object sent back as confirmation of payee parties when autoAcceptParty is false.
|
|
853
|
+
type: object
|
|
854
|
+
required:
|
|
855
|
+
- bulkHomeTransactionID
|
|
856
|
+
- individualTransfers
|
|
857
|
+
properties:
|
|
858
|
+
bulkHomeTransactionID:
|
|
859
|
+
type: string
|
|
860
|
+
description: >-
|
|
861
|
+
Transaction ID from the DFSP backend, used to reconcile transactions
|
|
862
|
+
between the Switch and DFSP backend systems.
|
|
863
|
+
individualTransfers:
|
|
864
|
+
description: List of individual transfers in a bulk transfer with accept party information.
|
|
865
|
+
type: array
|
|
866
|
+
minItems: 1
|
|
867
|
+
maxItems: 1000
|
|
868
|
+
items:
|
|
869
|
+
allOf:
|
|
870
|
+
- $ref: '#/components/schemas/individualTransferAccept'
|
|
871
|
+
- $ref: '#/components/schemas/transferContinuationAcceptParty'
|
|
872
|
+
bulkTransferContinuationAcceptQuote:
|
|
873
|
+
description: >-
|
|
874
|
+
The object sent back as confirmation of quotes when autoAcceptQuotes is false.
|
|
875
|
+
type: object
|
|
876
|
+
required:
|
|
877
|
+
- bulkHomeTransactionID
|
|
878
|
+
- individualTransfers
|
|
879
|
+
properties:
|
|
880
|
+
bulkHomeTransactionID:
|
|
881
|
+
type: string
|
|
882
|
+
description: >-
|
|
883
|
+
Transaction ID from the DFSP backend, used to reconcile transactions
|
|
884
|
+
between the Switch and DFSP backend systems.
|
|
885
|
+
individualTransfers:
|
|
886
|
+
description: List of individual transfers in a bulk transfer.
|
|
887
|
+
type: array
|
|
888
|
+
minItems: 1
|
|
889
|
+
maxItems: 1000
|
|
890
|
+
items:
|
|
891
|
+
allOf:
|
|
892
|
+
- $ref: '#/components/schemas/individualTransferAccept'
|
|
893
|
+
- $ref: '#/components/schemas/transferContinuationAcceptQuote'
|
|
894
|
+
bulkTransferOptions:
|
|
895
|
+
type: object
|
|
896
|
+
required:
|
|
897
|
+
- autoAcceptParty
|
|
898
|
+
- autoAcceptQuote
|
|
899
|
+
- bulkExpiration
|
|
900
|
+
properties:
|
|
901
|
+
onlyValidateParty:
|
|
902
|
+
description: >-
|
|
903
|
+
Set to true if only party validation is required.
|
|
904
|
+
This means the quotes and transfers will not run. This is useful
|
|
905
|
+
for only party resolution.
|
|
906
|
+
type: boolean
|
|
907
|
+
autoAcceptParty:
|
|
908
|
+
$ref: '#/components/schemas/autoAcceptPartyOption'
|
|
909
|
+
autoAcceptQuote:
|
|
910
|
+
description: >-
|
|
911
|
+
Set to true if the quote response is accepted without confirmation from the payer.
|
|
912
|
+
The fees applied by the payee will be acceptable to the payer abiding by the limits
|
|
913
|
+
set by optional 'perTransferFeeLimits' array.
|
|
914
|
+
type: object
|
|
915
|
+
oneOf:
|
|
916
|
+
- $ref: '#/components/schemas/autoAcceptQuote'
|
|
917
|
+
skipPartyLookup:
|
|
918
|
+
description: >-
|
|
919
|
+
Set to true if supplying an FSPID for the payee party and no party
|
|
920
|
+
resolution is needed. This may be useful if a previous party
|
|
921
|
+
resolution has been performed.
|
|
922
|
+
type: boolean
|
|
923
|
+
synchronous:
|
|
924
|
+
description: >-
|
|
925
|
+
Set to true if the bulkTransfer requests need be handled synchronous.
|
|
926
|
+
Otherwise the requests will be handled asynchronously, meaning there will
|
|
927
|
+
be callbacks whenever the processing is done
|
|
928
|
+
type: boolean
|
|
929
|
+
bulkExpiration:
|
|
930
|
+
$ref: '#/components/schemas/DateTime'
|
|
931
|
+
bulkPerTransferFeeLimit:
|
|
932
|
+
type: object
|
|
933
|
+
required:
|
|
934
|
+
- currency
|
|
935
|
+
- amount
|
|
936
|
+
properties:
|
|
937
|
+
currency:
|
|
938
|
+
$ref: '#/components/schemas/Currency'
|
|
939
|
+
amount:
|
|
940
|
+
$ref: '#/components/schemas/Amount'
|
|
727
941
|
transferParty:
|
|
728
942
|
type: object
|
|
729
943
|
required:
|
|
@@ -1005,7 +1219,7 @@ components:
|
|
|
1005
1219
|
skipPartyLookup:
|
|
1006
1220
|
description: >-
|
|
1007
1221
|
Set to true if supplying an FSPID for the payee party and no party
|
|
1008
|
-
resolution is needed. This may be useful
|
|
1222
|
+
resolution is needed. This may be useful if a previous party
|
|
1009
1223
|
resolution has been performed.
|
|
1010
1224
|
type: boolean
|
|
1011
1225
|
CorrelationId:
|
|
@@ -1243,6 +1457,39 @@ components:
|
|
|
1243
1457
|
asynchronous Mojaloop API exchange, this property will contain the
|
|
1244
1458
|
underlying Mojaloop API error object.
|
|
1245
1459
|
$ref: '#/components/schemas/mojaloopError'
|
|
1460
|
+
validationError:
|
|
1461
|
+
type: object
|
|
1462
|
+
description: >-
|
|
1463
|
+
This object represents an error occurred during the initial validation of individual transfers in bulk
|
|
1464
|
+
properties:
|
|
1465
|
+
httpStatusCode:
|
|
1466
|
+
type: integer
|
|
1467
|
+
description: >-
|
|
1468
|
+
The HTTP status code returned to the caller. This is the same as the
|
|
1469
|
+
actual HTTP status code returned with the response.
|
|
1470
|
+
mojaloopError:
|
|
1471
|
+
description: >-
|
|
1472
|
+
If a transfer process results in an error callback during the
|
|
1473
|
+
asynchronous Mojaloop API exchange, this property will contain the
|
|
1474
|
+
underlying Mojaloop API error object.
|
|
1475
|
+
$ref: '#/components/schemas/mojaloopError'
|
|
1476
|
+
partyError:
|
|
1477
|
+
type: object
|
|
1478
|
+
description: >-
|
|
1479
|
+
This object represents a Mojaloop API error received at any time during
|
|
1480
|
+
the party discovery process
|
|
1481
|
+
properties:
|
|
1482
|
+
httpStatusCode:
|
|
1483
|
+
type: integer
|
|
1484
|
+
description: >-
|
|
1485
|
+
The HTTP status code returned to the caller. This is the same as the
|
|
1486
|
+
actual HTTP status code returned with the response.
|
|
1487
|
+
mojaloopError:
|
|
1488
|
+
description: >-
|
|
1489
|
+
If a transfer process results in an error callback during the
|
|
1490
|
+
asynchronous Mojaloop API exchange, this property will contain the
|
|
1491
|
+
underlying Mojaloop API error object.
|
|
1492
|
+
$ref: '#/components/schemas/mojaloopError'
|
|
1246
1493
|
transferResponse:
|
|
1247
1494
|
type: object
|
|
1248
1495
|
required:
|
|
@@ -1323,7 +1570,7 @@ components:
|
|
|
1323
1570
|
skipPartyLookup:
|
|
1324
1571
|
description: >-
|
|
1325
1572
|
Set to true if supplying an FSPID for the payee party and no party
|
|
1326
|
-
resolution is needed. This may be useful
|
|
1573
|
+
resolution is needed. This may be useful if a previous party
|
|
1327
1574
|
resolution has been performed.
|
|
1328
1575
|
type: boolean
|
|
1329
1576
|
errorResponse:
|
|
@@ -1388,44 +1635,73 @@ components:
|
|
|
1388
1635
|
type: object
|
|
1389
1636
|
description: Data model for the complex type 'individualTransfer'.
|
|
1390
1637
|
properties:
|
|
1391
|
-
|
|
1638
|
+
homeTransactionId:
|
|
1392
1639
|
$ref: '#/components/schemas/CorrelationId'
|
|
1393
1640
|
to:
|
|
1394
|
-
$ref: '#/components/schemas/
|
|
1641
|
+
$ref: '#/components/schemas/Party'
|
|
1642
|
+
reference:
|
|
1643
|
+
description: Payer Loan reference
|
|
1644
|
+
type: string
|
|
1395
1645
|
amountType:
|
|
1396
1646
|
$ref: '#/components/schemas/AmountType'
|
|
1397
1647
|
currency:
|
|
1398
1648
|
$ref: '#/components/schemas/Currency'
|
|
1399
1649
|
amount:
|
|
1400
1650
|
$ref: '#/components/schemas/Amount'
|
|
1401
|
-
transactionType:
|
|
1402
|
-
|
|
1651
|
+
# transactionType:
|
|
1652
|
+
# $ref: '#/components/schemas/transactionType'
|
|
1653
|
+
# transferValidStatus:
|
|
1654
|
+
# description: >-
|
|
1655
|
+
# Set to true when the transfer request is valid
|
|
1656
|
+
# type: boolean
|
|
1403
1657
|
note:
|
|
1404
1658
|
$ref: '#/components/schemas/Note'
|
|
1405
|
-
|
|
1659
|
+
quoteRequestExtensions:
|
|
1406
1660
|
$ref: '#/components/schemas/ExtensionList'
|
|
1661
|
+
transferRequestExtensions:
|
|
1662
|
+
$ref: '#/components/schemas/ExtensionList'
|
|
1663
|
+
lastError:
|
|
1664
|
+
description: >
|
|
1665
|
+
Object representing the error occured during initial validation.
|
|
1666
|
+
$ref: '#/components/schemas/validationError'
|
|
1407
1667
|
required:
|
|
1408
|
-
-
|
|
1668
|
+
- homeTransactionId
|
|
1409
1669
|
- to
|
|
1410
1670
|
- amountType
|
|
1411
1671
|
- currency
|
|
1412
|
-
-
|
|
1413
|
-
|
|
1672
|
+
- amount
|
|
1673
|
+
# - transactionType
|
|
1674
|
+
# - transferValidStatus
|
|
1675
|
+
individualTransferAccept:
|
|
1676
|
+
title: IndividualTransfer
|
|
1414
1677
|
type: object
|
|
1678
|
+
description: Data model for the 'individualTransfer' while accepting party or quote.
|
|
1679
|
+
properties:
|
|
1680
|
+
homeTransactionId:
|
|
1681
|
+
$ref: '#/components/schemas/CorrelationId'
|
|
1682
|
+
transactionId:
|
|
1683
|
+
$ref: '#/components/schemas/CorrelationId'
|
|
1415
1684
|
required:
|
|
1416
1685
|
- homeTransactionId
|
|
1686
|
+
- transactionId
|
|
1687
|
+
|
|
1688
|
+
bulkTransferRequest:
|
|
1689
|
+
type: object
|
|
1690
|
+
required:
|
|
1691
|
+
- bulkHomeTransactionID
|
|
1692
|
+
- options
|
|
1417
1693
|
- from
|
|
1418
1694
|
- individualTransfers
|
|
1419
1695
|
properties:
|
|
1420
|
-
|
|
1696
|
+
bulkHomeTransactionID:
|
|
1421
1697
|
type: string
|
|
1422
1698
|
description: >-
|
|
1423
1699
|
Transaction ID from the DFSP backend, used to reconcile transactions
|
|
1424
1700
|
between the Switch and DFSP backend systems.
|
|
1425
|
-
|
|
1426
|
-
$ref: '#/components/schemas/
|
|
1701
|
+
options:
|
|
1702
|
+
$ref: '#/components/schemas/bulkTransferOptions'
|
|
1427
1703
|
from:
|
|
1428
|
-
$ref: '#/components/schemas/
|
|
1704
|
+
$ref: '#/components/schemas/Party'
|
|
1429
1705
|
individualTransfers:
|
|
1430
1706
|
description: List of individual transfers in a bulk transfer.
|
|
1431
1707
|
type: array
|
|
@@ -1440,8 +1716,12 @@ components:
|
|
|
1440
1716
|
properties:
|
|
1441
1717
|
transferId:
|
|
1442
1718
|
$ref: '#/components/schemas/CorrelationId'
|
|
1719
|
+
homeTransactionId:
|
|
1720
|
+
$ref: '#/components/schemas/CorrelationId'
|
|
1721
|
+
transactionId:
|
|
1722
|
+
$ref: '#/components/schemas/CorrelationId'
|
|
1443
1723
|
to:
|
|
1444
|
-
$ref: '#/components/schemas/
|
|
1724
|
+
$ref: '#/components/schemas/Party'
|
|
1445
1725
|
amountType:
|
|
1446
1726
|
$ref: '#/components/schemas/AmountType'
|
|
1447
1727
|
currency:
|
|
@@ -1456,15 +1736,12 @@ components:
|
|
|
1456
1736
|
$ref: '#/components/schemas/CorrelationId'
|
|
1457
1737
|
quoteResponse:
|
|
1458
1738
|
$ref: '#/components/schemas/QuotesIDPutResponse'
|
|
1459
|
-
quoteResponseSource:
|
|
1460
|
-
type: string
|
|
1461
|
-
description: >
|
|
1462
|
-
FSPID of the entity that supplied the quote response. This may not
|
|
1463
|
-
be the same as the FSPID of the entity which owns the end user
|
|
1464
|
-
account in the case of a FOREX transfer. i.e. it may be a FOREX
|
|
1465
|
-
gateway.
|
|
1466
1739
|
fulfil:
|
|
1467
1740
|
$ref: '#/components/schemas/TransfersIDPutResponse'
|
|
1741
|
+
quoteRequestExtensions:
|
|
1742
|
+
$ref: '#/components/schemas/ExtensionList'
|
|
1743
|
+
transferRequestExtensions:
|
|
1744
|
+
$ref: '#/components/schemas/ExtensionList'
|
|
1468
1745
|
lastError:
|
|
1469
1746
|
description: >
|
|
1470
1747
|
Object representing the last error to occur during a transfer
|
|
@@ -1475,19 +1752,50 @@ components:
|
|
|
1475
1752
|
bulkTransferResponse:
|
|
1476
1753
|
type: object
|
|
1477
1754
|
required:
|
|
1755
|
+
- bulkHomeTransactionID
|
|
1478
1756
|
- from
|
|
1757
|
+
- bulkExpiration
|
|
1479
1758
|
- individualTransferResults
|
|
1480
1759
|
properties:
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1760
|
+
bulkHomeTransactionID:
|
|
1761
|
+
type: string
|
|
1762
|
+
description: >-
|
|
1763
|
+
Transaction ID from the DFSP backend, used to reconcile transactions
|
|
1764
|
+
between the Switch and DFSP backend systems.
|
|
1765
|
+
bulkExpiration:
|
|
1766
|
+
$ref: '#/components/schemas/DateTime'
|
|
1767
|
+
currentState:
|
|
1768
|
+
$ref: '#/components/schemas/bulkTransferStatus'
|
|
1485
1769
|
individualTransferResults:
|
|
1486
1770
|
type: array
|
|
1487
1771
|
maxItems: 1000
|
|
1488
1772
|
items:
|
|
1489
1773
|
$ref: '#/components/schemas/individualTransferResult'
|
|
1490
1774
|
description: List of individual transfer result in a bulk transfer response.
|
|
1775
|
+
extensions:
|
|
1776
|
+
$ref: '#/components/schemas/ExtensionList'
|
|
1777
|
+
bulkAcceptPartyErrorResponse:
|
|
1778
|
+
allOf:
|
|
1779
|
+
- $ref: '#/components/schemas/errorResponse'
|
|
1780
|
+
- type: object
|
|
1781
|
+
required:
|
|
1782
|
+
- bulkTansferState
|
|
1783
|
+
properties:
|
|
1784
|
+
bulkTransferState:
|
|
1785
|
+
allOf:
|
|
1786
|
+
- $ref: '#/components/schemas/bulkTransferContinuationAcceptParty'
|
|
1787
|
+
- $ref: '#/components/schemas/partyError'
|
|
1788
|
+
bulkAcceptQuoteErrorResponse:
|
|
1789
|
+
allOf:
|
|
1790
|
+
- $ref: '#/components/schemas/errorResponse'
|
|
1791
|
+
- type: object
|
|
1792
|
+
required:
|
|
1793
|
+
- bulkTansferState
|
|
1794
|
+
properties:
|
|
1795
|
+
bulkTransferState:
|
|
1796
|
+
allOf:
|
|
1797
|
+
- $ref: '#/components/schemas/bulkTransferContinuationAcceptQuote'
|
|
1798
|
+
- $ref: '#/components/schemas/quoteError'
|
|
1491
1799
|
bulkTransferErrorResponse:
|
|
1492
1800
|
allOf:
|
|
1493
1801
|
- $ref: '#/components/schemas/errorResponse'
|
|
@@ -1501,6 +1809,8 @@ components:
|
|
|
1501
1809
|
type: string
|
|
1502
1810
|
enum:
|
|
1503
1811
|
- ERROR_OCCURRED
|
|
1812
|
+
- WAITING_FOR_PARTY_ACCEPTANCE
|
|
1813
|
+
- WAITING_FOR_QUOTE_ACCEPTANCE
|
|
1504
1814
|
- COMPLETED
|
|
1505
1815
|
individualTransferFulfilment:
|
|
1506
1816
|
type: object
|
|
@@ -2379,6 +2689,22 @@ components:
|
|
|
2379
2689
|
application/json:
|
|
2380
2690
|
schema:
|
|
2381
2691
|
$ref: '#/components/schemas/bulkTransferResponse'
|
|
2692
|
+
bulkTransferAccepted:
|
|
2693
|
+
description: Bulk transfer accepted successfully
|
|
2694
|
+
bulkPartyLookupResponse:
|
|
2695
|
+
description: Bulk party lookup completed successfully
|
|
2696
|
+
content:
|
|
2697
|
+
application/json:
|
|
2698
|
+
schema:
|
|
2699
|
+
$ref: '#/components/schemas/bulkPartyLookupResponse'
|
|
2700
|
+
bulkTransferPutBadRequest:
|
|
2701
|
+
description: 'Malformed or missing required body, headers or parameters'
|
|
2702
|
+
content:
|
|
2703
|
+
application/json:
|
|
2704
|
+
schema:
|
|
2705
|
+
oneOf:
|
|
2706
|
+
- $ref: '#/components/schemas/bulkAcceptPartyErrorResponse'
|
|
2707
|
+
- $ref: '#/components/schemas/bulkAcceptQuoteErrorResponse'
|
|
2382
2708
|
bulkTransferBadRequest:
|
|
2383
2709
|
description: 'Malformed or missing required body, headers or parameters'
|
|
2384
2710
|
content:
|
|
@@ -162,8 +162,8 @@ class OutboundBulkQuotesModel {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
} else if (message.type === 'bulkQuoteResponseError') {
|
|
165
|
-
error = new BackendError(`Got an error response requesting bulk quote: ${util.inspect(message.data, { depth: Infinity })}`, 500);
|
|
166
|
-
error.mojaloopError = message.data;
|
|
165
|
+
error = new BackendError(`Got an error response requesting bulk quote: ${util.inspect(message.data.body, { depth: Infinity })}`, 500);
|
|
166
|
+
error.mojaloopError = message.data.body;
|
|
167
167
|
}
|
|
168
168
|
else {
|
|
169
169
|
this._logger.push({ message }).log(`Ignoring cache notification for bulk quote ${bulkQuoteKey}. Unknown message type ${message.type}.`);
|
|
@@ -297,8 +297,8 @@ class OutboundBulkQuotesModel {
|
|
|
297
297
|
let message = JSON.parse(msg);
|
|
298
298
|
|
|
299
299
|
if (message.type === 'bulkQuoteError') {
|
|
300
|
-
error = new BackendError(`Got an error response retrieving bulk quote: ${util.inspect(message.data, { depth: Infinity })}`, 500);
|
|
301
|
-
error.mojaloopError = message.data;
|
|
300
|
+
error = new BackendError(`Got an error response retrieving bulk quote: ${util.inspect(message.data.body, { depth: Infinity })}`, 500);
|
|
301
|
+
error.mojaloopError = message.data.body;
|
|
302
302
|
} else if (message.type !== 'bulkQuoteResponse') {
|
|
303
303
|
this._logger.push({ message }).log(`Ignoring cache notification for bulk quote ${bulkQuoteKey}. Uknokwn message type ${message.type}.`);
|
|
304
304
|
return;
|
|
@@ -161,8 +161,8 @@ class OutboundBulkTransfersModel {
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
} else if (message.type === 'bulkTransferError') {
|
|
164
|
-
error = new BackendError(`Got an error response preparing bulk transfer: ${util.inspect(message.data, { depth: Infinity })}`, 500);
|
|
165
|
-
error.mojaloopError = message.data;
|
|
164
|
+
error = new BackendError(`Got an error response preparing bulk transfer: ${util.inspect(message.data.body, { depth: Infinity })}`, 500);
|
|
165
|
+
error.mojaloopError = message.data.body;
|
|
166
166
|
}
|
|
167
167
|
else {
|
|
168
168
|
this._logger.push({ message }).log(`Ignoring cache notification for bulk transfer ${bulkTransferKey}. Unknown message type ${message.type}.`);
|
|
@@ -289,8 +289,8 @@ class OutboundBulkTransfersModel {
|
|
|
289
289
|
let message = JSON.parse(msg);
|
|
290
290
|
|
|
291
291
|
if (message.type === 'bulkTransferError') {
|
|
292
|
-
error = new BackendError(`Got an error response retrieving bulk transfer: ${util.inspect(message.data, { depth: Infinity })}`, 500);
|
|
293
|
-
error.mojaloopError = message.data;
|
|
292
|
+
error = new BackendError(`Got an error response retrieving bulk transfer: ${util.inspect(message.data.body, { depth: Infinity })}`, 500);
|
|
293
|
+
error.mojaloopError = message.data.body;
|
|
294
294
|
} else if (message.type !== 'bulkTransferFulfil') {
|
|
295
295
|
this._logger.push({ message }).log(`Ignoring cache notification for bulk transfer ${bulkTransferKey}. Uknokwn message type ${message.type}.`);
|
|
296
296
|
return;
|
|
@@ -267,11 +267,10 @@ class OutboundRequestToPayTransferModel {
|
|
|
267
267
|
const subId = await this._cache.subscribe(payeeKey, (cn, msg, subId) => {
|
|
268
268
|
try {
|
|
269
269
|
let payee = JSON.parse(msg);
|
|
270
|
-
|
|
271
|
-
if(payee.errorInformation) {
|
|
270
|
+
if(payee.body && payee.body.errorInformation) {
|
|
272
271
|
// this is an error response to our GET /parties request
|
|
273
|
-
const err = new BackendError(`Got an error response resolving party: ${util.inspect(payee)}`, 500);
|
|
274
|
-
err.mojaloopError = payee;
|
|
272
|
+
const err = new BackendError(`Got an error response resolving party: ${util.inspect(payee.body)}`, 500);
|
|
273
|
+
err.mojaloopError = payee.body;
|
|
275
274
|
|
|
276
275
|
// cancel the timeout handler
|
|
277
276
|
clearTimeout(timeout);
|
|
@@ -405,8 +404,8 @@ class OutboundRequestToPayTransferModel {
|
|
|
405
404
|
}
|
|
406
405
|
}
|
|
407
406
|
} else if (message.type === 'quoteResponseError') {
|
|
408
|
-
error = new BackendError(`Got an error response requesting quote: ${util.inspect(message.data)}`, 500);
|
|
409
|
-
error.mojaloopError = message.data;
|
|
407
|
+
error = new BackendError(`Got an error response requesting quote: ${util.inspect(message.data.body)}`, 500);
|
|
408
|
+
error.mojaloopError = message.data.body;
|
|
410
409
|
}
|
|
411
410
|
else {
|
|
412
411
|
this._logger.push({ message }).log(`Ignoring cache notification for quote ${quoteKey}. Unknown message type ${message.type}.`);
|
|
@@ -620,8 +619,8 @@ class OutboundRequestToPayTransferModel {
|
|
|
620
619
|
}
|
|
621
620
|
}
|
|
622
621
|
} else if (message.type === 'transferError') {
|
|
623
|
-
error = new BackendError(`Got an error response preparing transfer: ${util.inspect(message.data)}`, 500);
|
|
624
|
-
error.mojaloopError = message.data;
|
|
622
|
+
error = new BackendError(`Got an error response preparing transfer: ${util.inspect(message.data.body)}`, 500);
|
|
623
|
+
error.mojaloopError = message.data.body;
|
|
625
624
|
} else {
|
|
626
625
|
this._logger.push({ message }).log(`Ignoring cache notification for transfer ${transferKey}. Uknokwn message type ${message.type}.`);
|
|
627
626
|
return;
|
|
@@ -701,8 +700,8 @@ class OutboundRequestToPayTransferModel {
|
|
|
701
700
|
let message = JSON.parse(msg);
|
|
702
701
|
|
|
703
702
|
if (message.type === 'transferError') {
|
|
704
|
-
error = new BackendError(`Got an error response retrieving transfer: ${util.inspect(message.data)}`, 500);
|
|
705
|
-
error.mojaloopError = message.data;
|
|
703
|
+
error = new BackendError(`Got an error response retrieving transfer: ${util.inspect(message.data.body)}`, 500);
|
|
704
|
+
error.mojaloopError = message.data.body;
|
|
706
705
|
} else if (message.type !== 'transferFulfil') {
|
|
707
706
|
this._logger.push({ message }).log(`Ignoring cache notification for transfer ${transferKey}. Uknokwn message type ${message.type}.`);
|
|
708
707
|
return;
|
|
@@ -497,8 +497,8 @@ class OutboundTransfersModel {
|
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
} else if (message.type === 'quoteResponseError') {
|
|
500
|
-
error = new BackendError(`Got an error response requesting quote: ${util.inspect(message.data, { depth: Infinity })}`, 500);
|
|
501
|
-
error.mojaloopError = message.data;
|
|
500
|
+
error = new BackendError(`Got an error response requesting quote: ${util.inspect(message.data.body, { depth: Infinity })}`, 500);
|
|
501
|
+
error.mojaloopError = message.data.body;
|
|
502
502
|
}
|
|
503
503
|
else {
|
|
504
504
|
this._logger.push({ message }).log(`Ignoring cache notification for quote ${quoteKey}. Unknown message type ${message.type}.`);
|
|
@@ -207,10 +207,13 @@ describe('OutboundBulkQuotesModel', () => {
|
|
|
207
207
|
const expectError = {
|
|
208
208
|
type: 'bulkQuoteResponseError',
|
|
209
209
|
data: {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
body: {
|
|
211
|
+
errorInformation: {
|
|
212
|
+
errorCode: '3205',
|
|
213
|
+
errorDescription: 'Bulk quote ID not found'
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
headers: {}
|
|
214
217
|
}
|
|
215
218
|
};
|
|
216
219
|
|
|
@@ -239,7 +242,7 @@ describe('OutboundBulkQuotesModel', () => {
|
|
|
239
242
|
expect(err.message.replace(/[ \n]/g,'')).toEqual(errMsg.replace(/[ \n]/g,''));
|
|
240
243
|
expect(err.bulkQuoteState).toBeTruthy();
|
|
241
244
|
expect(err.bulkQuoteState.lastError).toBeTruthy();
|
|
242
|
-
expect(err.bulkQuoteState.lastError.mojaloopError).toEqual(expectError.data);
|
|
245
|
+
expect(err.bulkQuoteState.lastError.mojaloopError).toEqual(expectError.data.body);
|
|
243
246
|
expect(err.bulkQuoteState.lastError.bulkQuoteState).toBe(undefined);
|
|
244
247
|
return;
|
|
245
248
|
}
|
|
@@ -202,10 +202,13 @@ describe('outboundBulkTransferModel', () => {
|
|
|
202
202
|
const expectError = {
|
|
203
203
|
type: 'bulkTransferError',
|
|
204
204
|
data: {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
205
|
+
body: {
|
|
206
|
+
errorInformation: {
|
|
207
|
+
errorCode: '4001',
|
|
208
|
+
errorDescription: 'Payer FSP insufficient liquidity'
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
headers: {}
|
|
209
212
|
}
|
|
210
213
|
};
|
|
211
214
|
|
|
@@ -234,7 +237,7 @@ describe('outboundBulkTransferModel', () => {
|
|
|
234
237
|
expect(err.message.replace(/[ \n]/g,'')).toEqual(errMsg.replace(/[ \n]/g,''));
|
|
235
238
|
expect(err.bulkTransferState).toBeTruthy();
|
|
236
239
|
expect(err.bulkTransferState.lastError).toBeTruthy();
|
|
237
|
-
expect(err.bulkTransferState.lastError.mojaloopError).toEqual(expectError.data);
|
|
240
|
+
expect(err.bulkTransferState.lastError.mojaloopError).toEqual(expectError.data.body);
|
|
238
241
|
expect(err.bulkTransferState.lastError.bulkTransferState).toBe(undefined);
|
|
239
242
|
return;
|
|
240
243
|
}
|
|
@@ -1390,10 +1390,13 @@ describe('outboundModel', () => {
|
|
|
1390
1390
|
const expectError = {
|
|
1391
1391
|
type: 'quoteResponseError',
|
|
1392
1392
|
data: {
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1393
|
+
body: {
|
|
1394
|
+
errorInformation: {
|
|
1395
|
+
errorCode: '3205',
|
|
1396
|
+
errorDescription: 'Quote ID not found'
|
|
1397
|
+
}
|
|
1398
|
+
},
|
|
1399
|
+
headers: {}
|
|
1397
1400
|
}
|
|
1398
1401
|
};
|
|
1399
1402
|
|
|
@@ -1430,7 +1433,7 @@ describe('outboundModel', () => {
|
|
|
1430
1433
|
expect(err.message.replace(/[ \n]/g,'')).toEqual(errMsg.replace(/[ \n]/g,''));
|
|
1431
1434
|
expect(err.transferState).toBeTruthy();
|
|
1432
1435
|
expect(err.transferState.lastError).toBeTruthy();
|
|
1433
|
-
expect(err.transferState.lastError.mojaloopError).toEqual(expectError.data);
|
|
1436
|
+
expect(err.transferState.lastError.mojaloopError).toEqual(expectError.data.body);
|
|
1434
1437
|
expect(err.transferState.lastError.transferState).toBe(undefined);
|
|
1435
1438
|
return;
|
|
1436
1439
|
}
|