Skip to content

feat(backend): complete incoming payment#3748

Merged
oana-lolea merged 10 commits intomainfrom
oana/raf-1127
Nov 24, 2025
Merged

feat(backend): complete incoming payment#3748
oana-lolea merged 10 commits intomainfrom
oana/raf-1127

Conversation

@oana-lolea
Copy link
Copy Markdown
Contributor

@oana-lolea oana-lolea commented Nov 14, 2025

Changes proposed in this pull request

  • Added completeReceiver resolver that completes both local and remote incoming payments

Context

Fixes RAF-1127

Checklist

  • Related issues linked using fixes #number
  • Tests added/updated
  • Make sure that all checks pass
  • Bruno collection updated (if necessary)
  • Documentation issue created with user-docs label (if necessary)
  • OpenAPI specs updated (if necessary)

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 14, 2025

Deploy Preview for brilliant-pasca-3e80ec canceled.

Name Link
🔨 Latest commit 99c026f
🔍 Latest deploy log https://app.netlify.com/projects/brilliant-pasca-3e80ec/deploys/69205de5901dc9000894c99d

@github-actions github-actions Bot added type: tests Testing related pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. type: source Changes business logic pkg: mock-ase pkg: mock-account-service-lib labels Nov 14, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 14, 2025

🚀 Performance Test Results

Test Configuration:

  • VUs: 4
  • Duration: 1m0s

Test Metrics:

  • Requests/s: 45.39
  • Iterations/s: 15.15
  • Failed Requests: 0.00% (0 of 2727)
📜 Logs

> performance@1.0.0 run-tests:testenv /home/runner/work/rafiki/rafiki/test/performance
> ./scripts/run-tests.sh -e test "-k" "-q" "--vus" "4" "--duration" "1m"

Cloud Nine GraphQL API is up: http://localhost:3101/graphql
Cloud Nine Wallet Address is up: http://localhost:3100/
Happy Life Bank Address is up: http://localhost:4100/
cloud-nine-wallet-test-backend already set
cloud-nine-wallet-test-auth already set
happy-life-bank-test-backend already set
happy-life-bank-test-auth already set
     data_received..................: 984 kB 16 kB/s
     data_sent......................: 2.1 MB 35 kB/s
     http_req_blocked...............: avg=7.54µs   min=2.15µs   med=5.33µs   max=1.39ms   p(90)=6.75µs   p(95)=7.38µs  
     http_req_connecting............: avg=1.52µs   min=0s       med=0s       max=1.23ms   p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=87.52ms  min=6.86ms   med=71.73ms  max=421.11ms p(90)=152.59ms p(95)=176.57ms
       { expected_response:true }...: avg=87.52ms  min=6.86ms   med=71.73ms  max=421.11ms p(90)=152.59ms p(95)=176.57ms
     http_req_failed................: 0.00%  ✓ 0         ✗ 2727
     http_req_receiving.............: avg=77.96µs  min=29.61µs  med=64.82µs  max=2.75ms   p(90)=92.38µs  p(95)=108.68µs
     http_req_sending...............: avg=34.15µs  min=10.12µs  med=25.91µs  max=4.67ms   p(90)=36.92µs  p(95)=45.77µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=87.41ms  min=6.72ms   med=71.62ms  max=421.01ms p(90)=152.51ms p(95)=176.48ms
     http_reqs......................: 2727   45.39155/s
     iteration_duration.............: avg=263.91ms min=175.06ms med=251.86ms max=910.48ms p(90)=323.81ms p(95)=353.44ms
     iterations.....................: 910    15.147162/s
     vus............................: 4      min=4       max=4 
     vus_max........................: 4      min=4       max=4 

@oana-lolea oana-lolea marked this pull request as ready for review November 14, 2025 12:40
@oana-lolea oana-lolea requested a review from mkurapov November 14, 2025 12:40
Copy link
Copy Markdown
Contributor

@mkurapov mkurapov left a comment

Choose a reason for hiding this comment

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

Logic looks good - mostly test related comments

Comment thread packages/backend/src/open_payments/receiver/service.ts
context: { incomingPaymentId: incomingPayment.id },
message: errorMessage
})
throw new Error(errorMessage)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we can use IncomingPaymentError.UnknownWalletAddress here

return deps.knex.transaction(async (trx) => {
const payment = await IncomingPayment.query(trx)
.findOne({ id, tenantId })
.findOne({ id, ...(tenantId && { tenantId }) })
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

let's add a test for this that handles the case where tenantId is provided, and one where it is not

Comment thread packages/backend/src/open_payments/payment/incoming_remote/service.test.ts Outdated
Comment thread packages/backend/src/open_payments/payment/incoming_remote/service.test.ts Outdated
Comment thread packages/backend/src/open_payments/payment/incoming_remote/service.test.ts Outdated
Comment thread packages/backend/src/open_payments/payment/incoming_remote/service.test.ts Outdated
Comment thread packages/backend/src/open_payments/payment/incoming_remote/service.ts Outdated
@oana-lolea oana-lolea requested a review from mkurapov November 19, 2025 07:44
context: { incomingPaymentId: incomingPayment.id },
message: errorMessage
})
return IncomingPaymentError.UnknownWalletAddress
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's add a test for this branch

@oana-lolea oana-lolea requested a review from mkurapov November 21, 2025 13:03
Copy link
Copy Markdown
Contributor

@mkurapov mkurapov left a comment

Choose a reason for hiding this comment

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

Try to rerun the failed docker check to see if it works

@oana-lolea oana-lolea merged commit d1ce166 into main Nov 24, 2025
54 of 71 checks passed
@oana-lolea oana-lolea deleted the oana/raf-1127 branch November 24, 2025 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: backend Changes in the backend package. pkg: frontend Changes in the frontend package. pkg: mock-account-service-lib pkg: mock-ase type: source Changes business logic type: tests Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants