Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
24 changes: 24 additions & 0 deletions bruno/collections/Rafiki/POS Service APIs/Initiate Payment.bru
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
meta {
name: Initiate Payment
type: http
seq: 3
}

post {
url: http://localhost:3008/payment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url: http://localhost:3008/payment
url: http://localhost:4008/payment

Let's do this, such that the incoming payment will be on the happy-life side of things, and cloud nine will pay into it.

body: json
auth: inherit
}

body:json {
{
"card": {
"walletAddress": "http://localhost:3000/accounts/gfranklin",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we should be passing in https://cloud-nine-wallet/... here, since the POS service will get it in the request and should find the wallet address using the shared rafiki network set up in the docker compose

"trasactionCounter": 1,
"expiry": "2025-09-13T13:00:00Z"
},
"signature": "signature",
"value": 1,
"merchantWalletAddress": "http://localhost:3000/accounts/gfranklin"
}
}
8 changes: 8 additions & 0 deletions localenv/cloud-nine-wallet/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ services:
LOG_LEVEL: debug
CARD_SERVICE_PORT: 3007
DATABASE_URL: postgresql://cloud_nine_wallet_card_service:cloud_nine_wallet_card_service@shared-database/cloud_nine_wallet_card_service
GRAPHQL_URL: http://cloud-nine-wallet-backend:3001/graphql
TENANT_ID: 438fa74a-fa7d-4317-9ced-dde32ece1787
TENANT_SECRET: tenant_secret
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TENANT_SECRET should match the API_SECRET from backend container

TENANT_SIGNATURE_VERSION: tenant_signature_version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TENANT_SIGNATURE_VERSION: tenant_signature_version
TENANT_SIGNATURE_VERSION: 1

depends_on:
- shared-database
healthcheck:
Expand Down Expand Up @@ -55,6 +59,10 @@ services:
LOG_LEVEL: debug
PORT: 3008
DATABASE_URL: postgresql://cloud_nine_wallet_point_of_sale:cloud_nine_wallet_point_of_sale@shared-database/cloud_nine_wallet_point_of_sale
TENANT_ID: 438fa74a-fa7d-4317-9ced-dde32ece1787
TENANT_SECRET: secret
GRAPHQL_URL: http://cloud-nine-wallet-backend:3001/graphql
WEBHOOK_SIGNATURE_SECRET: webhook_secret
depends_on:
- shared-database
healthcheck:
Expand Down
8 changes: 8 additions & 0 deletions localenv/happy-life-bank/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ services:
LOG_LEVEL: debug
CARD_SERVICE_PORT: 4007
DATABASE_URL: postgresql://happy_life_bank_card_service:happy_life_bank_card_service@shared-database/happy_life_bank_card_service
GRAPHQL_URL: http://happy-life-bank-backend:3001/graphql
TENANT_ID: cf5fd7d3-1eb1-4041-8e43-ba45747e9e5d
TENANT_SECRET: tenant_secret
TENANT_SIGNATURE_VERSION: tenant_signature_version
depends_on:
- shared-database
- cloud-nine-wallet-card-service
Expand Down Expand Up @@ -56,6 +60,10 @@ services:
LOG_LEVEL: debug
PORT: 4008
DATABASE_URL: postgresql://happy_life_bank_point_of_sale:happy_life_bank_point_of_sale@shared-database/happy_life_bank_point_of_sale
TENANT_ID: cf5fd7d3-1eb1-4041-8e43-ba45747e9e5d
TENANT_SECRET: secret
GRAPHQL_URL: http://happy-life-bank-backend:3001/graphql
WEBHOOK_SIGNATURE_SECRET: webhook_secret
depends_on:
- shared-database
- cloud-nine-wallet-point-of-sale
Expand Down
1 change: 1 addition & 0 deletions packages/point-of-sale/src/payments/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ async function payment(
ctx.body = result
ctx.status = 200
} catch (err) {
deps.logger.debug(err)
if (err instanceof IncomingPaymentEventTimeoutError)
webhookWaitMap.delete(err.incomingPaymentId)
const { body, status } = handlePaymentError(err)
Expand Down
2 changes: 1 addition & 1 deletion packages/point-of-sale/src/payments/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function getWalletAddress(
): Promise<WalletAddress> {
const config: AxiosRequestConfig = {
headers: {
'Content-Type': 'application/json'
Accept: 'application/json'
}
}
const { data: walletAddress } = await deps.axios.get<
Expand Down
Loading