Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fbdbdd8
Updated library to adapt dfsp party accounts.
kleyow May 29, 2020
7bd46f6
Updated adapter.
kleyow May 30, 2020
6be7d66
Fixed test data.
kleyow Jun 1, 2020
ed5bc9d
Fixed data structure.
kleyow Jun 1, 2020
d66b26f
Edited CI to build PISP docker image.
kleyow Jun 1, 2020
e785eda
Updated CI. (#167)
kleyow Jun 10, 2020
ec0a5ca
Merge branch 'master' into pisp/update/merge_master
eoln Jun 11, 2020
2b2e685
Merge pull request #171 from eoln/pisp/update/merge_master
eoln Jun 11, 2020
456fedc
implement POST /authorization on OutbondService (#170)
eoln Jul 1, 2020
3085167
#321 Handle transfer calls (Switch --> PISP) (#175)
sridharvoruganti Jul 9, 2020
e21bb87
test: fix broken test (#177)
eoln Jul 9, 2020
5e80415
Merge mojaloop sdk-scheme-adapter 'master' into pisp/master (#178)
sridharvoruganti Jul 10, 2020
4bad03c
chore(package): latest sdk-standard-components (#180)
eoln Jul 15, 2020
e8f4ed8
ci: checkout after installing default dependenices
eoln Jul 16, 2020
03b7a77
fix: use anyOf instead of oneOf for PUT /authorizations/{id} at Inbou…
eoln Jul 22, 2020
99a4b98
chore: bump version
eoln Jul 22, 2020
c4a0306
fix: the way how errors are handled at InboundServer (#188)
eoln Jul 23, 2020
68e8de5
Added outbound GET/POST thirdparty requests transaction call. (#190)
kleyow Jul 31, 2020
ce5af89
fix(thirdparty): rename thirdParty to thirdparty (#192)
kleyow Aug 7, 2020
58fc8b3
feat: 1671 kick off post authorization (#219)
eoln Oct 8, 2020
472f328
enforce
eoln Oct 8, 2020
e595825
feat: PartiesModel (#221)
eoln Oct 21, 2020
876699f
feat: 1771 parties - handlers (#222)
eoln Oct 21, 2020
cbd9509
fix(parties-model): 1771 proper invocation of onRequestPartiesInforma…
eoln Oct 22, 2020
e9fc7af
remove package-lock
eoln Oct 23, 2020
a68b628
enforce
eoln Oct 23, 2020
ea4582b
chore: sync pisp/master to v11.0.0 (#236)
kleyow Dec 30, 2020
8d1baab
chore: sync pisp/master to v11.10.1 (#237)
kleyow Jan 4, 2021
28704e2
chore: update config in models (#238)
kleyow Jan 4, 2021
74b0aff
fix: edit some faulty tests (#239)
kleyow Jan 5, 2021
0710da7
chore: add new type enums (#242)
kleyow Jan 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ orbs:
# defaults
#
# YAML defaults templates, in alphabetical order
##
##
defaults_Dependencies: &defaults_Dependencies |
apk --no-cache add git
apk --no-cache add ca-certificates
Expand Down Expand Up @@ -50,7 +50,7 @@ defaults_license_scanner: &defaults_license_scanner
executors:
default-docker:
working_directory: /home/circleci/project
docker:
docker:
- image: node:12.16.1-alpine

default-machine:
Expand All @@ -66,10 +66,10 @@ jobs:
setup:
executor: default-docker
steps:
- checkout
- run:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- run:
name: Access npm folder as root
command: cd $(npm root -g)/npm
Expand All @@ -87,10 +87,10 @@ jobs:
test-unit:
executor: default-docker
steps:
- checkout
- run:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- restore_cache:
keys:
- dependency-cache-5-{{ checksum "src/package.json" }}
Expand Down Expand Up @@ -129,10 +129,10 @@ jobs:
lint:
executor: default-docker
steps:
- checkout
- run:
name: Install general dependencies
command: *defaults_Dependencies
- checkout
- restore_cache:
keys:
- dependency-cache-5-{{ checksum "src/package.json" }}
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
root: /tmp
paths:
- ./docker-image.tar

license-scan:
executor: default-machine
steps:
Expand Down Expand Up @@ -249,7 +249,7 @@ jobs:
# failure_message: 'Anchore Image Scan failed for: \`"${DOCKER_ORG}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_TAG}"\`'
# - store_artifacts:
# path: anchore-reports

publish:
executor: default-machine
steps:
Expand All @@ -271,8 +271,17 @@ jobs:
command: |
echo "Publishing $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$CIRCLE_TAG"
docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$CIRCLE_TAG
echo "Publishing $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG"
docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG
case "$CIRCLE_TAG" in
*-pisp*)
# Don't update `late5t` for an image that has a `-pisp`
echo 'skipping late5t tag'
exit 0
;;
*)
echo "Publishing $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG"
docker push $DOCKER_ORG/$CIRCLE_PROJECT_REPONAME:$RELEASE_TAG
;;
esac
- slack/status:
webhook: "$SLACK_WEBHOOK_ANNOUNCEMENT"
success_message: '*"${CIRCLE_PROJECT_REPONAME}"* - Release \`"${CIRCLE_TAG}"\` \nhttps://github.com/mojaloop/"${CIRCLE_PROJECT_REPONAME}"/releases/tag/"${CIRCLE_TAG}"'
Expand Down Expand Up @@ -344,7 +353,7 @@ workflows:
- audit-licenses
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?/
only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?(\-pisp)?/
branches:
ignore:
- /.*/
Expand All @@ -354,7 +363,7 @@ workflows:
- build
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?/
only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?(\-pisp)?/
branches:
ignore:
- /.*/
Expand All @@ -375,7 +384,7 @@ workflows:
- license-scan
filters:
tags:
only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?/
only: /v[0-9]+(\.[0-9]+)*(\-snapshot)?(\-hotfix(\.[0-9]+))?(\-pisp)?/
branches:
ignore:
- /.*/
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
node_modules/
.swp
src/junit.xml
.DS_Store
.vscode
secrets/*.pem
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:12.16.1-alpine as builder
FROM node:12.18.3-alpine as builder

RUN apk add --no-cache git python build-base

Expand All @@ -10,17 +10,18 @@ WORKDIR /src/
# files change- only when any dependencies change- which is a superior developer experience when
# relying on docker-compose.
COPY ./src/package.json ./package.json
COPY ./src/package-lock.json ./package-lock.json
COPY ./src/lib/cache/package.json ./lib/cache/package.json
COPY ./src/lib/log/package.json ./lib/log/package.json
COPY ./src/lib/check/package.json ./lib/check/package.json
COPY ./src/lib/model/lib/requests/package.json ./lib/model/lib/requests/package.json
COPY ./src/lib/model/lib/shared/package.json ./lib/model/lib/shared/package.json
COPY ./src/lib/model/package.json ./lib/model/package.json
COPY ./src/lib/randomphrase/package.json ./lib/randomphrase/package.json
COPY ./src/lib/router/package.json ./lib/router/package.json
COPY ./src/lib/validate/package.json ./lib/validate/package.json
RUN npm install
RUN npm ci --only=production

FROM node:12.16.1-alpine
FROM node:12.18.3-alpine

ARG BUILD_DATE
ARG VCS_URL
Expand All @@ -37,7 +38,6 @@ LABEL org.label-schema.url="https://mojaloop.io/"
LABEL org.label-schema.version=$VERSION

COPY --from=builder /src/ /src
RUN npm prune --production
COPY ./src ./src
COPY ./secrets /

Expand Down
44 changes: 44 additions & 0 deletions Dockerfile-integration
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM node:12.18.3-alpine as builder

RUN apk add --no-cache git python build-base

EXPOSE 3000

WORKDIR /src/

# This is super-ugly, but it means we don't have to re-run npm install every time any of the source
# files change- only when any dependencies change- which is a superior developer experience when
# relying on docker-compose.
COPY ./src/package.json ./package.json
COPY ./src/package-lock.json ./package-lock.json
COPY ./src/lib/cache/package.json ./lib/cache/package.json
COPY ./src/lib/check/package.json ./lib/check/package.json
COPY ./src/lib/model/lib/requests/package.json ./lib/model/lib/requests/package.json
COPY ./src/lib/model/lib/shared/package.json ./lib/model/lib/shared/package.json
COPY ./src/lib/model/package.json ./lib/model/package.json
COPY ./src/lib/randomphrase/package.json ./lib/randomphrase/package.json
COPY ./src/lib/router/package.json ./lib/router/package.json
COPY ./src/lib/validate/package.json ./lib/validate/package.json
RUN npm ci

FROM node:12.18.3-alpine

ARG BUILD_DATE
ARG VCS_URL
ARG VCS_REF
ARG VERSION

# See http://label-schema.org/rc1/ for label schema info
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="sdk-scheme-adapter"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.vcs-url=$VCS_URL
LABEL org.label-schema.vcs-ref=$VCS_REF
LABEL org.label-schema.url="https://mojaloop.io/"
LABEL org.label-schema.version=$VERSION

COPY --from=builder /src/ /src
COPY ./src ./src
COPY ./secrets /

CMD ["node", "src/index.js"]
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,19 @@ docker exec -it scheme-adapter-int sh -c 'npm run test:int'

# copy results out
docker cp scheme-adapter-int:/src/junit.xml .
```
```

### Get status of quote request
The status of a previously sent quotation request can be get by executing `GET /quotes/{ID}`.
When the response to the original quote request is sent, the response is cached in the redis store. When a `GET /quotes/{ID}` is received,
the cached response is retrieved from the redis store and returned to the caller as a body with `PUT /quotes/{ID}` request.
When the redis is setup as a persistent store then it will return the response for all the quote requests sent with `POST /quotes`. If the the redis is setup as cache with expiry time then it will not return response for the expired quotes when the cache expires. Also only the payer dfsp is supposed to make the `GET /quotes/{ID}` request.
If the quote response is not found in the redis store `PUT /quotes/{ID}` will be made with the following body
```
{
"errorInformation":{
"errorCode":"3205",
"errorDescription":"Quote ID not found"
}
}
```
1 change: 1 addition & 0 deletions docker-compose.integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
container_name: scheme-adapter-int
build:
context: .
dockerfile: Dockerfile-integration
target: builder
env_file: ./src/test/config/integration.env
volumes:
Expand Down
70 changes: 67 additions & 3 deletions docs/dfspInboundApi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ info:
license:
name: Apache License Version 2.0, January 2004
url: http://www.apache.org/licenses/
version: 1.0.0
version: 1.1.0

paths:
/participants/{idType}/{idValue}:
Expand Down Expand Up @@ -171,6 +171,24 @@ paths:
$ref: '#/components/schemas/transferDetailsResponse'
500:
$ref: '#/components/responses/500'
put:
summary: Receive notification for a specific transfer
description: The HTTP request `PUT /transfers/{transferId}` is used to receive notification for transfer being fulfiled when the FSP is a Payee
tags:
- Transfers
parameters:
- $ref: '#/components/schemas/transferId'
requestBody:
description: An incoming notification for fulfiled transfer
content:
application/json:
schema:
$ref: '#/components/schemas/fulfilNotification'
responses:
200:
description: The notification was accepted
500:
$ref: '#/components/responses/500'

components:
schemas:
Expand Down Expand Up @@ -345,6 +363,8 @@ components:
- XDR
- XOF
- XPF
- XTS
- XXX
- YER
- ZAR
- ZMW
Expand Down Expand Up @@ -380,6 +400,13 @@ components:
minItems: 0
maxItems: 16

accountList:
type: array
items:
$ref: '#/components/schemas/account'
minItems: 1
maxItems: 32

geoCode:
type: object
description: Indicates the geographic location from where the transaction was initiated.
Expand Down Expand Up @@ -478,6 +505,23 @@ components:
minLength: 1
maxLength: 128


account:
type: object
properties:
address:
type: string
minLength: 1
maxLength: 1023
currency:
type: string
minLength: 3
maxLength: 3
description:
type: string
minLength: 1
maxLength: 128

initiatorType:
type: string
enum:
Expand Down Expand Up @@ -680,6 +724,8 @@ components:
description: Up to 4 digits specifying the sender's merchant classification, if known and applicable.
extensionList:
$ref: '#/components/schemas/extensionList'
accounts:
$ref: '#/components/schemas/accountList'

transferState:
type: string
Expand Down Expand Up @@ -774,14 +820,33 @@ components:
extensions:
$ref: '#/components/schemas/extensionList'


transferStatus:
type: string
enum:
- ERROR_OCCURRED
- WAITING_FOR_QUOTE_ACCEPTANCE
- COMPLETED

fulfilNotification:
title: TransfersIDPatchResponse
type: object
description: PUT /transfers/{transferId} object
properties:
completedTimestamp:
$ref: '#/components/schemas/timestamp'
description: Time and date when the transaction was completed.
example: "2020-05-19T08:38:08.699-04:00"
transferState:
$ref: '#/components/schemas/transferState'
description: State of the transfer.
example: COMMITTED
extensionList:
$ref: '#/components/schemas/ExtensionList'
description: Optional extension, specific to deployment.
required:
- completedTimestamp
- transferState

responses:
'400':
description: Malformed or missing required headers or parameters
Expand Down Expand Up @@ -833,4 +898,3 @@ components:
minLength: 1
maxLength: 128
description: Either a sub-identifier of a `{idValue}`, or a sub-type of the `{idType}`, normally a `{personalIdType}`

Loading