Skip to content

Commit 77a0c2a

Browse files
mkurapovoana-loleanjlielengyel-arpad85beniaminmunteanu
authored
feat: adding card-service and point-of-sale (#3715)
* feat: created the backbone for the card service (#3508) * Created the backbone for the card service * Format fix * feat: add card service to docker compose --------- Co-authored-by: Nathan Lie <[email protected]> * feat: initialize POS service (#3509) * feat(wip): pos service * Completed POS service init * Added docker files and missing scripts * Removed editor code after handling conflicts * Updated docker-compose for cloud 9 localenv and removed unnecessary telemetry command from dockerfile * Updated docker compose files for c9 and hlb * Updated ports and env var names from config * fix: install ts-node-dev, add main script to index.ts --------- Co-authored-by: Nathan Lie <[email protected]> * feat(card-service): card payments table (#3514) * migration & model for card payments * feat(pos): create merchants table (#3519) * merchants table migrations and model * typo * Docker compose fix (for slower PCs) on localenv (#3522) * fix(cards-service): add dependencies to package.json (#3530) * fix(cards-service): add dependencies to package.json * chore(cards-service): lockfile * feat: Added CardService client in rafiki backend (#3510) * feat(pos): pos card services table (#3526) * merchants table migrations and model * feat(card-service): introduce testcontainers for database and redis (#3533) * feat(card-service): add testcontainers setup * chore(cards-service): lockfile * feat(cards-service): fix test containers setup * fix(cards-service): fix type issue * feat(pos): merchants services (#3528) * merchant service * jest setup * tests * feat: Integrate Redis client in Card Service for (requestId, posServiceHost) mapping (#3524) * Integrate Redis client in Card Service for (requestId, posServiceHost) mapping * remove unused dep * prettier fix * Separate logging params from the message itself * ttl * prettier fix * Rewrite redis service tests to use testcontainers instead of mocks --------- Co-authored-by: Antoniu Neacsu <[email protected]> * feat(pos): create merchant route (#3538) * post merchants route --------- Co-authored-by: Nathan Lie <[email protected]> * feat(card-service): introduce AuditLogService (#3525) * feat(card-service): introduce AuditLogService * feat(card-service): add testcontainers setup * chore(cards-service): lockfile * fix service update method and add tests. card_payemnts migration index added * chore(cards-service): remove unnecessary app container start in tests * chore(cards-service): add uuid as a placeholder for open payments tennantId for clarity * chore(cards-service): format imports * fix(localenv): add required env vars to docker-compose (#3550) * feat(point-of-sale): POS Device service (#3548) * pos device service * Added algorithm as param on registering device, updated tests so that we check the device obj * feat(pos): RAF-1121-revoke merchant route (#3553) * feat(ci/cd): add ci jobs for testing point of sale and card-service (#3554) [CLOSES RAF-1109](https://linear.app/interledger/issue/RAF-1109/devops-cicd-github-actions-to-test-card-and-pos-service) * fix: (rafiki backend) Augment Wallet Address response with cardService field (#3552) * feat: add cardServiceUrl configuration and update related routes * feat: rename CARD_SERVICE_HOST to CARD_SERVICE_URL for consistency * fix format --------- Co-authored-by: HRadry <[email protected]> * fix(localenv): rename CARD_SERVICE_HOST to CARD_SERVICE_URL * feat(point-of-sale): added route for registering a POS device (#3555) * Route for registering a POS device * Fixed issue addressed in comments, tried to fix the port issue of jest * Changed test container port to 0, format fix * fix: typo in route * feat: bruno calls for creating merchant and registering POS device (#3558) * feat: [RAF-1083][POS Service]: Add GQL Client for Rafiki BE calls for incoming payment operations (#3546) * feat(pos): device revoke (#3560) * feat(pos): nested routing for devices, device revoke route & error handling * feat(pos-service): pos devices router and service specific error handling * feat(pos): test app now uses dynamic ports to avoid jest worker conflicts * fix(pos): fix tests * chore(pos-service): PR suggestions * fix(pos): extend error handling approach to register route in pos devices * chore(pos): remove unused knex in routes * chore(pos): rename DeviceRoutes * chore(pos): pnpm-lock * chore(pos): format * feat: added card service client to initiate a payment from pos service (#3535) * Added card service client to initiate a payment * feat(backend): Raul/raf 1095 augment outgoing payments for card (#3539) * feat(backend): add card information to outgoing payment graph ql * fix(backend): save expiry as string MM/YY * feature(backend): add mm/yy validation * fix(backend): run prittier * fix(backend): comments and set type to table name and relation * fix(backend): remove unused deps * feat(backend): add tests for outgoing payments with card details * fix(backend): fix pr comments --------- Co-authored-by: Raul Ranete <[email protected]> * feat(point-of-sale): service for obtaining walletAddress by its url from Rafiki Backend (#3578) * Added axios call to rafiki backend for getting wallet address by its url * Handled the case when cardServiceUrl may not be set on wallet address * feat(card-service): add endpoints to initiate payment and receive payment result (#3547) * feat(card-service): add endpoints to initiate payment and recieve payment result * fix: improve open api spec validation * fix: rename paymetn timeout var and comment terminal cert prop * fix: add PaymentRouteError * fix: rename env var and remove deleted prop * fix(backend): made CARD_SERVICE_URL optional (#3600) * Made CARD_SERVICE_URL optional * Created cardService container only if cardServiceUrl is set in config * Added noop card service when cardServiceUrl is not provided * Regenerated graphql * Added warning when CARD_SERVICE_URL is not set * feat(point-of-sale): POST payment route (#3597) * Payment route structure * Added routes test file * Removed some comments * Added test for unknown error * Updated graphql generated files * feat(backend): publish webhooks to POS service if applicable (#3596) * feat: created the backbone for the card service (#3508) * Created the backbone for the card service * Format fix * feat: add card service to docker compose --------- Co-authored-by: Nathan Lie <[email protected]> * feat: Integrate Redis client in Card Service for (requestId, posServiceHost) mapping (#3524) * Integrate Redis client in Card Service for (requestId, posServiceHost) mapping * remove unused dep * prettier fix * Separate logging params from the message itself * ttl * prettier fix * Rewrite redis service tests to use testcontainers instead of mocks --------- Co-authored-by: Antoniu Neacsu <[email protected]> * feat(point-of-sale): added route for registering a POS device (#3555) * Route for registering a POS device * Fixed issue addressed in comments, tried to fix the port issue of jest * Changed test container port to 0, format fix * feat(backend): publish webhooks to POS service if applicable * feat: add column to incoming payment * fix: tests * feat: add warn log * fix: better logger requirements for finalizing webhook recipients * fix: make open payments default reason for incoming payment initialization * fix: improve optional env var function * fix: warn log, better optional env, backfill migration, tests * fix: rebase bugs * chore: regenerate lockfile * chore: regenerate gql * fix: tests * fix: remove metadata; better tests * fix: build errors * fix: tests, add type file --------- Co-authored-by: oana-lolea <[email protected]> Co-authored-by: zeppelin44 <[email protected]> Co-authored-by: Antoniu Neacsu <[email protected]> * feat(point-of-sale): handle incoming payment completed webhooks from backend (#3613) * feat: created the backbone for the card service (#3508) * Created the backbone for the card service * Format fix * feat: add card service to docker compose --------- Co-authored-by: Nathan Lie <[email protected]> * feat: initialize POS service (#3509) * feat(wip): pos service * Completed POS service init * Added docker files and missing scripts * Removed editor code after handling conflicts * Updated docker-compose for cloud 9 localenv and removed unnecessary telemetry command from dockerfile * Updated docker compose files for c9 and hlb * Updated ports and env var names from config * fix: install ts-node-dev, add main script to index.ts --------- Co-authored-by: Nathan Lie <[email protected]> * feat: Integrate Redis client in Card Service for (requestId, posServiceHost) mapping (#3524) * Integrate Redis client in Card Service for (requestId, posServiceHost) mapping * remove unused dep * prettier fix * Separate logging params from the message itself * ttl * prettier fix * Rewrite redis service tests to use testcontainers instead of mocks --------- Co-authored-by: Antoniu Neacsu <[email protected]> * feat(point-of-sale): added route for registering a POS device (#3555) * Route for registering a POS device * Fixed issue addressed in comments, tried to fix the port issue of jest * Changed test container port to 0, format fix * feat(wip): merge pos-card-services * feat(point-of-sale): handle incoming payment completed webhooks from backend * fix: typo, expose incoming payment url in gql * fix: typo & unintended changes * chore: regenerate gql * feat: clean up request map if wehbook times out --------- Co-authored-by: oana-lolea <[email protected]> Co-authored-by: zeppelin44 <[email protected]> Co-authored-by: Antoniu Neacsu <[email protected]> * fix: test * feat(card-service): call outgoing payment creation during payment route (#3614) * feat(card-service): call outgoing payment creation during payment route * chore: regenerate graphql * chore: regenerate gql * chore(backend): remove tenant id from card service path in WA response (#3627) * chore(point-of-sale): add expiry for incoming payments created by pos service (#3623) * chore(point-of-sale): add expiry for incoming payments created by pos service * chore(point-of-sale): use jest timers for incoming payment expiry in tests * feat(card-service): remove `debitAmount` from outgoing payment creation admin API request (#3632) * chore(pos, card-service): update generated graphql types * feat(card-service): remove debitAmount from outgoing payment creation mutation * feat(backend): add custom webhook URL for POS (#3628) * feat(backend): add custom webhook URL for POS * fix(backend): remove fallback webhook URL for POS * fix(point-of-sale): added bruno script + added missing env variables to local docker compose file (#3629) * Added bruno script + added missing env variables to local docker containers * Added missing env variables for card-service * Sent tenant id to backend for now, updated bruno req, fixed createIncPayment mutation * Removed unnecessary header * Fixed a test after mutation update * Updated generated graphql files * Fixed connection between payment service calls * Fixed env variables and mutation type for creating inc payment * fix: match payment bodies for pos and card service (#3653) * Matched bodies between pos and card services /payment * Forgot to stage this * Fixed test * Updated graphql types * feat(card-service, pos-service): updating payment routes with new payload (#3655) * chore: update docker compose file to make webhook signatures work * feat(pos): update /payment request payload * feat(card-service): updating payment handler with new payload * chore(bruno): update initiate Payment request * chore: lint OpenAPI * feat(backend): additional webhook events for outgoing payments (#3651) * feat(backend): add additional webhook events for outgoing payments * feat(backend): update webhook recipients logic * chore(backend): extract funded and cancelled events into a new type * chore(backend): move IncomingPaymentInitiationReason to separate file * chore(backend): simplify webhook recipients logic * feat(backend): Update handling of `OutgoingPaymentCardDetails` (#3658) * feat(backend): update CardDetailsInput GraphQL type * feat(backend): update OutgoingPaymentCardDetails model * feat(backend): start publishing cardDetails in outgoing_payment.created webhook * chore(backend): remove old expiry check * test(backend): update outgoing payment resolver test * chore(backend): remove unused cardDetails from GraphQL API * test(backend): update outgoing payment resolver test * chore(backend): update migration to not add already included requestId * chore(backend): update outgoing payment test * feat(card-service): update outgoing payment creation with new payload * test(backend): update outgoing payment test * fix(backend): fix webhook resolver filter for OP funded and cancelled events (#3662) * chore: add sha.js override to fix security vulnerability * feat(card-service): handle payment cancelled & funded events (#3667) * feat(card-service): handle payment cancelled & funded events * feat(card-service): fix tests * fix: updates to make e2e payment flow work (#3668) * chore(localenv): add CARD_WEBHOOK_SERVICE_URL to cloud nine wallet backend * feat(backend): fetch cardDetails during outgoing payment funded and cancelled * chore(pos): correctly handle response from card service * test(pos): update card service client test * chore(card-service): add paymentRoutes to AppServices * chore(backend): fix withGraphFetched query * test(pos): remove unused test * fix(card-service): update payment result type * chore(card-service): format --------- Co-authored-by: Max Kurapov <[email protected]> * chore: add card-service and pos-service image build steps in CI (#3657) * Added card-service and point-of-sale images when pushing to registry * Added dockerfile.prod for card-service * Added spectral to validate card-service open api specs * Fix on building the packages * Fixed dockerfile * Added token-introspection * trying to fix crypto issue * Another try to fix card-service pipeline * Still trying * Testing if crypto is actually the issue here * Trying to debug * Added @types/node so it can see the crypto package * Updated yaml for card-service, removed unnecessary changes * Fix format * Updated axios version of pos * Added tags to card-service.yaml * Removed token-introspection from pos and card services * Added command to run pos and card services in docker file * chore(point-of-sale): update pos service response structure (#3675) * chore(point-of-sale): update pos service response structure * fix: map cleanup in finally block * feat: add integration test for pos-card flow (#3678) * added integration test for pos flow * updated pnpm lock * Added webhook urls and signature secrets to c9 and hlf env * Set up hosts for card service and pos for IT * Added test env to performance test job * Updated IT structure and test name, removed unnecessary formatting * Forgot to remove 'card_expired' from result * Updated result model after merging pos-cards branch * Used prod docker files for pos and card services, added open api files to card-service build, fixed axios dependency issue * feat: added sender wallet address to incoming payment (#3705) * Added sender wallet address to incoming payment * chore(card,pos-service): update alpine image * chore(card-service, pos-service): cleanup unused code (#3718) * chore(point-of-sale): remove merchant service, knex, db connections * chore(card-service): remove knex, objection, db connection * chore(localenv): remove db connections for pos and card service * chore(pos): remove migration folder from dockerfile * chore(bruno): remove unused POS service APIs * chore(testenv): remove db connection for card and pos services * chore(pos, card-service): use core imports from apollo client * chore(point-of-sale, card-service): update webhook handling (#3725) * chore(card-service): rename `/payment-event` route to `/webhook` * chore(point-of-sale): make webhook signature signing optional * chore(testenv): update CARD_WEBHOOK_SERVICE_URL * test(point-of-sale): allow optional webhook signature * feat(point-of-sale): pos service API for getting incoming payments (#3708) * feat(point-of-sale): API for getting pos service's incoming payments * fix: tests * feat: filter out unnecessary fields in response * chore: bruno collection urls * feat: include senderWalletAddress in query * fix: bruno urls * fix: serialize query params properly for gql requests * fix: expose tenant id in payment gql requests * feat: use open payments-esque response format * feat: include metadata * feat: remove unnecessary fields * fix: regenerate gql * fix: imports * fix: proper object assign use and pr comments * feat(backend): add filtering incoming payments by initiatedBy (#3714) * add filtering incoming payments by initiatedBy * Added filter to walletAddress.incomingPayments resolver * added filtering by initiatedBy to also work with notIn * Added filter to getPage functions * feat(point-of-sale): filter incoming payments by those initiated by card payemnt (#3734) * chore(card-service): remove unused components (#3736) * chore(card-service): remove pos-store * chore(backend): remove redis from instantiation * chore: remove unused pos & card service components (#3737) * chore(testenv): remove port * chore(localenv): removed card & pos volumes, ports, seed * chore(card-service): remove init script * chore(backend): remove unused card service * chore(backend): remove card expiry from outgoing payment errors * feat(point-of-sale): add `senderWalletAddress` to incoming payment creation (#3738) * feat(point-of-sale): add USE_HTTP flag * feat(point-of-sale): pass in senderWalletAddress into incoming payment creation * chore(testenv): add USE_HTTP to point-of-sale service * chore(point-of-sale): update card service client log service name * test(point-of-sale): update payment route & service tests --------- Co-authored-by: oana-lolea <[email protected]> Co-authored-by: Nathan Lie <[email protected]> Co-authored-by: Arpi Lengyel <[email protected]> Co-authored-by: Arpi Lengyel <[email protected]> Co-authored-by: xplicit <[email protected]> Co-authored-by: zeppelin44 <[email protected]> Co-authored-by: Antoniu Neacsu <[email protected]> Co-authored-by: MiguelLescasJorgeSebastian <[email protected]> Co-authored-by: HRadry <[email protected]> Co-authored-by: Raul <[email protected]> Co-authored-by: Raul Ranete <[email protected]> Co-authored-by: dragosp1011 <[email protected]> Co-authored-by: Bogdan S <[email protected]>
1 parent 8b1ec9c commit 77a0c2a

File tree

146 files changed

+14791
-682
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+14791
-682
lines changed

.eslintrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ parserOptions:
1818
plugins:
1919
- '@typescript-eslint'
2020
rules:
21-
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }]
21+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }]
2222
overrides:
2323
- files: ["*.js"]
2424
rules:

.github/workflows/node-build.yml

Lines changed: 71 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Node Build
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '0 21 * * *'
6+
- cron: "0 21 * * *"
77
pull_request:
88
branches:
9-
- '**'
9+
- "**"
1010
push:
1111
branches:
1212
- main
@@ -17,9 +17,9 @@ jobs:
1717
runs-on: ubuntu-latest
1818
timeout-minutes: 5
1919
steps:
20-
- uses: actions/checkout@v4
21-
- uses: ./.github/workflows/rafiki/env-setup
22-
- run: pnpm checks
20+
- uses: actions/checkout@v4
21+
- uses: ./.github/workflows/rafiki/env-setup
22+
- run: pnpm checks
2323

2424
backend:
2525
runs-on: ubuntu-latest
@@ -84,6 +84,32 @@ jobs:
8484
run: |
8585
npx @stoplight/spectral-cli lint ./packages/token-introspection/src/openapi/specs/*.yaml
8686
87+
card-service:
88+
runs-on: ubuntu-latest
89+
needs: prerequisite
90+
timeout-minutes: 10
91+
steps:
92+
- uses: actions/checkout@v4
93+
- uses: ./.github/workflows/rafiki/env-setup
94+
- run: pnpm --filter card-service test:ci
95+
- run: pnpm --filter card-service build
96+
- name: AsyncAPI extension
97+
run: |
98+
echo "{\"extends\":[\"spectral:oas\",\"spectral:asyncapi\"]}" >> .spectral.json
99+
- name: Validate Open API specs
100+
run: |
101+
npx @stoplight/spectral-cli lint ./packages/card-service/src/openapi/specs/*.yaml
102+
103+
point-of-sale:
104+
runs-on: ubuntu-latest
105+
needs: prerequisite
106+
timeout-minutes: 10
107+
steps:
108+
- uses: actions/checkout@v4
109+
- uses: ./.github/workflows/rafiki/env-setup
110+
- run: pnpm --filter point-of-sale build
111+
- run: pnpm --filter point-of-sale test:ci
112+
87113
mock-account-servicing-entity:
88114
runs-on: ubuntu-latest
89115
needs: prerequisite
@@ -127,20 +153,20 @@ jobs:
127153
strategy:
128154
fail-fast: false
129155
matrix:
130-
language: [ 'javascript' ]
156+
language: ["javascript"]
131157
config:
132-
- './.github/codeql/source.yml'
133-
- './.github/codeql/tests.yml'
158+
- "./.github/codeql/source.yml"
159+
- "./.github/codeql/tests.yml"
134160
steps:
135-
- uses: actions/checkout@v4
136-
- uses: ./.github/workflows/rafiki/env-setup
137-
- name: Initialize CodeQL
138-
uses: github/codeql-action/init@v3
139-
with:
140-
languages: ${{ matrix.language }}
141-
config-file: ${{ matrix.config }}
142-
- name: Perform CodeQL Analysis
143-
uses: github/codeql-action/analyze@v3
161+
- uses: actions/checkout@v4
162+
- uses: ./.github/workflows/rafiki/env-setup
163+
- name: Initialize CodeQL
164+
uses: github/codeql-action/init@v3
165+
with:
166+
languages: ${{ matrix.language }}
167+
config-file: ${{ matrix.config }}
168+
- name: Perform CodeQL Analysis
169+
uses: github/codeql-action/analyze@v3
144170

145171
integration-test:
146172
runs-on: ubuntu-22.04
@@ -160,8 +186,10 @@ jobs:
160186
run: |
161187
echo "127.0.0.1 cloud-nine-wallet-test-backend" | sudo tee -a /etc/hosts
162188
echo "127.0.0.1 cloud-nine-wallet-test-auth" | sudo tee -a /etc/hosts
189+
echo "127.0.0.1 cloud-nine-wallet-test-card-service" | sudo tee -a /etc/hosts
163190
echo "127.0.0.1 happy-life-bank-test-backend" | sudo tee -a /etc/hosts
164191
echo "127.0.0.1 happy-life-bank-test-auth" | sudo tee -a /etc/hosts
192+
echo "127.0.0.1 happy-life-bank-test-point-of-sale" | sudo tee -a /etc/hosts
165193
- name: Build dependencies
166194
run: pnpm --filter integration build:deps
167195

@@ -188,9 +216,11 @@ jobs:
188216
- name: Setup hosts
189217
run: |
190218
echo "127.0.0.1 cloud-nine-wallet-test-backend" | sudo tee -a /etc/hosts
219+
echo "127.0.0.1 cloud-nine-wallet-test-card-service" | sudo tee -a /etc/hosts
191220
echo "127.0.0.1 cloud-nine-wallet-test-auth" | sudo tee -a /etc/hosts
192221
echo "127.0.0.1 happy-life-bank-test-backend" | sudo tee -a /etc/hosts
193222
echo "127.0.0.1 happy-life-bank-test-auth" | sudo tee -a /etc/hosts
223+
echo "127.0.0.1 happy-life-bank-test-point-of-sale" | sudo tee -a /etc/hosts
194224
195225
- name: Build dependencies
196226
run: pnpm --filter performance build:deps
@@ -312,7 +342,19 @@ jobs:
312342
node-build:
313343
runs-on: ubuntu-latest
314344
timeout-minutes: 5
315-
needs: [auth, backend, frontend, token-introspection, mock-account-servicing-entity, graphql, codeql-analyze, integration-test]
345+
needs:
346+
[
347+
auth,
348+
backend,
349+
frontend,
350+
token-introspection,
351+
card-service,
352+
point-of-sale,
353+
mock-account-servicing-entity,
354+
graphql,
355+
codeql-analyze,
356+
integration-test
357+
]
316358
steps:
317359
- uses: actions/checkout@v4
318360
- uses: ./.github/workflows/rafiki/env-setup
@@ -410,6 +452,8 @@ jobs:
410452
- auth
411453
- backend
412454
- frontend
455+
- card-service
456+
- point-of-sale
413457
steps:
414458
- name: Checkout code
415459
uses: actions/checkout@v4
@@ -447,6 +491,8 @@ jobs:
447491
- auth
448492
- backend
449493
- frontend
494+
- card-service
495+
- point-of-sale
450496
steps:
451497
- uses: actions/checkout@v4
452498
- name: Fetch docker image from cache
@@ -483,6 +529,8 @@ jobs:
483529
- auth
484530
- backend
485531
- frontend
532+
- card-service
533+
- point-of-sale
486534
steps:
487535
- uses: actions/checkout@v4
488536
- name: Fetch docker image from cache
@@ -515,6 +563,8 @@ jobs:
515563
- auth
516564
- backend
517565
- frontend
566+
- card-service
567+
- point-of-sale
518568
steps:
519569
- uses: actions/checkout@v4
520570
- uses: ./.github/actions/image-push
@@ -527,7 +577,7 @@ jobs:
527577

528578
push-manifest:
529579
name: Push multi-arch manifest list
530-
needs: [version-generator,push]
580+
needs: [version-generator, push]
531581
runs-on: ubuntu-latest
532582
if: needs.version-generator.outputs.dockerPush == 'true'
533583
strategy:
@@ -536,6 +586,8 @@ jobs:
536586
- auth
537587
- backend
538588
- frontend
589+
- card-service
590+
- point-of-sale
539591
steps:
540592
- uses: actions/checkout@v4
541593
- name: Push manifest list
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
meta {
2+
name: Get Incoming Payments
3+
type: http
4+
seq: 4
5+
}
6+
7+
get {
8+
url: http://localhost:4008/payments?receiverWalletAddress=https://happy-life-bank-backend/accounts/pfry
9+
body: none
10+
auth: inherit
11+
}
12+
13+
params:query {
14+
receiverWalletAddress: https://happy-life-bank-backend/accounts/pfry
15+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
meta {
2+
name: Initiate Payment
3+
type: http
4+
seq: 3
5+
}
6+
7+
post {
8+
url: http://localhost:4008/payment
9+
body: json
10+
auth: inherit
11+
}
12+
13+
body:json {
14+
{
15+
"signature": "signature",
16+
"payload": "payload",
17+
"amount": {
18+
"value": "1000",
19+
"assetScale": 2,
20+
"assetCode": "USD"
21+
},
22+
"senderWalletAddress": "https://cloud-nine-wallet-backend/accounts/gfranklin",
23+
"receiverWalletAddress": "https://happy-life-bank-backend/accounts/pfry",
24+
"timestamp": 1758105181325
25+
}
26+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
meta {
2+
name: POS Service APIs
3+
seq: 8
4+
}
5+
6+
auth {
7+
mode: inherit
8+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
meta {
2+
name: Get Incoming Payments
3+
type: graphql
4+
seq: 60
5+
}
6+
7+
post {
8+
url: {{RafikiGraphqlHost}}/graphql
9+
body: graphql
10+
auth: none
11+
}
12+
13+
body:graphql {
14+
query IncomingPayments($filter: IncomingPaymentFilter) {
15+
incomingPayments(filter: $filter) {
16+
edges {
17+
node {
18+
id
19+
walletAddressId
20+
client
21+
state
22+
expiresAt
23+
incomingAmount {
24+
value
25+
assetCode
26+
assetScale
27+
}
28+
receivedAmount {
29+
value
30+
assetCode
31+
assetScale
32+
}
33+
metadata
34+
createdAt
35+
}
36+
cursor
37+
}
38+
}
39+
}
40+
}
41+
42+
script:pre-request {
43+
const scripts = require('./scripts');
44+
45+
scripts.addApiSignatureHeader();
46+
}

localenv/cloud-nine-wallet/docker-compose.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
name: c9
22
services:
3+
cloud-nine-wallet-card-service:
4+
hostname: cloud-nine-wallet-card-service
5+
image: rafiki-card-service
6+
build:
7+
context: ../..
8+
dockerfile: ./packages/card-service/Dockerfile.dev
9+
restart: always
10+
networks:
11+
- rafiki
12+
ports:
13+
- '9234:9229'
14+
environment:
15+
NODE_ENV: ${NODE_ENV:-development}
16+
INSTANCE_NAME: CLOUD-NINE
17+
TRUST_PROXY: ${TRUST_PROXY}
18+
LOG_LEVEL: debug
19+
CARD_SERVICE_PORT: 3007
20+
GRAPHQL_URL: http://cloud-nine-wallet-backend:3001/graphql
21+
TENANT_ID: 438fa74a-fa7d-4317-9ced-dde32ece1787
22+
TENANT_SECRET: iyIgCprjb9uL8wFckR+pLEkJWMB7FJhgkvqhTQR/964=
23+
TENANT_SIGNATURE_VERSION: 1
24+
depends_on:
25+
- shared-database
26+
healthcheck:
27+
test: ["CMD", "wget", "--spider", "http://localhost:3007/healthz"]
28+
start_period: 60s
29+
start_interval: 5s
30+
interval: 30s
31+
retries: 1
32+
timeout: 3s
333
cloud-nine-mock-ase:
434
hostname: cloud-nine-wallet
535
image: rafiki-mock-ase
@@ -80,6 +110,8 @@ services:
80110
ENABLE_TELEMETRY: true
81111
KEY_ID: 7097F83B-CB84-469E-96C6-2141C72E22C0
82112
OPERATOR_TENANT_ID: 438fa74a-fa7d-4317-9ced-dde32ece1787
113+
CARD_SERVICE_URL: 'http://cloud-nine-wallet-card-service:3007'
114+
CARD_WEBHOOK_SERVICE_URL: 'http://cloud-nine-wallet-card-service:3007/webhook'
83115
depends_on:
84116
- shared-database
85117
- shared-redis

localenv/happy-life-bank/docker-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
name: hl
22
services:
3+
happy-life-bank-point-of-sale:
4+
hostname: happy-life-bank-point-of-sale
5+
image: rafiki-point-of-sale
6+
build:
7+
context: ../..
8+
dockerfile: ./packages/point-of-sale/Dockerfile.dev
9+
restart: always
10+
networks:
11+
- rafiki
12+
ports:
13+
- '4008:4008'
14+
- '9233:9229'
15+
environment:
16+
NODE_ENV: ${NODE_ENV:-development}
17+
INSTANCE_NAME: HAPPY-LIFE
18+
TRUST_PROXY: ${TRUST_PROXY}
19+
LOG_LEVEL: debug
20+
PORT: 4008
21+
TENANT_ID: cf5fd7d3-1eb1-4041-8e43-ba45747e9e5d
22+
TENANT_SECRET: iyIgCprjb9uL8wFckR+pLEkJWMB7FJhgkvqhTQR/964=
23+
GRAPHQL_URL: http://happy-life-bank-backend:3001/graphql
24+
WEBHOOK_SIGNATURE_SECRET: iyIgCprjb9uL8wFckR+pLEkJWMB7FJhgkvqhTQR/964=
25+
WEBHOOK_SIGNATURE_VERSION: 1
26+
USE_HTTP: true
27+
depends_on:
28+
- shared-database
29+
healthcheck:
30+
test: ["CMD", "wget", "--spider", "http://localhost:4008/healthz"]
31+
start_period: 60s
32+
start_interval: 5s
33+
interval: 30s
34+
retries: 1
35+
timeout: 3s
336
happy-life-mock-ase:
437
hostname: happy-life-bank
538
image: rafiki-mock-ase
@@ -67,6 +100,8 @@ services:
67100
ILP_ADDRESS: test.happy-life-bank
68101
ILP_CONNECTOR_URL: http://happy-life-bank-backend:4002
69102
STREAM_SECRET: BjPXtnd00G2mRQwP/8ZpwyZASOch5sUXT5o0iR5b5wU=
103+
SIGNATURE_SECRET: iyIgCprjb9uL8wFckR+pLEkJWMB7FJhgkvqhTQR/964= # webhook signature
104+
SIGNATURE_VERSION: 1
70105
ADMIN_API_SECRET: iyIgCprjb9uL8wFckR+pLEkJWMB7FJhgkvqhTQR/964=
71106
WEBHOOK_URL: http://happy-life-bank/webhooks
72107
EXCHANGE_RATES_URL: http://happy-life-bank/rates
@@ -76,6 +111,8 @@ services:
76111
ENABLE_TELEMETRY: true
77112
KEY_ID: 53f2d913-e98a-40b9-b270-372d0547f23d
78113
OPERATOR_TENANT_ID: cf5fd7d3-1eb1-4041-8e43-ba45747e9e5d
114+
CARD_SERVICE_URL: 'http://happy-life-bank-card-service:4007'
115+
POS_WEBHOOK_SERVICE_URL: 'http://happy-life-bank-point-of-sale:4008/webhook'
79116
WALLET_ADDRESS_NOT_FOUND_POLLING_ENABLED: true
80117
depends_on:
81118
- cloud-nine-backend

0 commit comments

Comments
 (0)