-
Notifications
You must be signed in to change notification settings - Fork 96
fix(point-of-sale): added bruno script + added missing env variables to local docker compose file #3629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🚀 Performance Test ResultsTest Configuration:
Test Metrics:
📜 Logs
|
body:json { | ||
{ | ||
"card": { | ||
"walletAddress": "http://localhost:3000/accounts/gfranklin", |
There was a problem hiding this comment.
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
packages/backend/src/app.ts
Outdated
// we don't need to verify the signature nor prevent replay attacks | ||
koa.use( | ||
this.config.env !== 'test' | ||
this.config.env !== 'test' && this.config.env !== 'development' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this so that I can bypass the tenant signature check for now while testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if the TENANT_SECRET
matches the API_SECRET
from above, then this validation should work without having to bypass it
value: body.value | ||
} | ||
const incomingPayment = await deps.paymentService.createIncomingPayment( | ||
walletAddress.id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be the UUID of the wallet address, not the actual address. Will add a request to fetch that.
} | ||
|
||
post { | ||
url: http://localhost:3008/payment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
...(tenantId && { | ||
context: { | ||
headers: { | ||
'tenant-id': tenantId | ||
} | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are already passing in the tenantId
when we are setting up the apolloClient
(index.ts
), so I think we can leave this out
GRAPHQL_URL: http://cloud-nine-wallet-backend:3001/graphql | ||
TENANT_ID: 438fa74a-fa7d-4317-9ced-dde32ece1787 | ||
TENANT_SECRET: tenant_secret | ||
TENANT_SIGNATURE_VERSION: tenant_signature_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TENANT_SIGNATURE_VERSION: tenant_signature_version | |
TENANT_SIGNATURE_VERSION: 1 |
requestId: uuid() | ||
} | ||
const cardServiceUrl = options.card.walletAddress.cardService | ||
const response = await deps.axios.post<PaymentResponse>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will get BAD_REQUEST
because we are missing some data that cardService
is expecting.
- rafiki | ||
ports: | ||
- '3007:3007' | ||
- '9234:9229' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added for debugging
- rafiki | ||
ports: | ||
- '4008:4008' | ||
- '9233:9229' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added for debugging
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 |
There was a problem hiding this comment.
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
packages/backend/src/app.ts
Outdated
// we don't need to verify the signature nor prevent replay attacks | ||
koa.use( | ||
this.config.env !== 'test' | ||
this.config.env !== 'test' && this.config.env !== 'development' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if the TENANT_SECRET
matches the API_SECRET
from above, then this validation should work without having to bypass it
const { data } = await client.mutate< | ||
Mutation['createIncomingPayment'], | ||
CreateIncomingPaymentInput | ||
Mutation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutation, | |
CreateIncomingPayment, |
Importing this from '../graphql/generated/graphql'
should give you the correct type for the Mutation
Added bruno script to initiate a payment.
Fixes #3542
Linear #1120
Also fixed the flow in the payment route.
Linear #1151
Also added environment variables for POS and Cards services in local playground.
Fixes #3619
Linear #1150