Skip to content

Conversation

@sanducb
Copy link
Contributor

@sanducb sanducb commented Oct 16, 2025

Changes proposed in this pull request

  • WIP

Context

Closes #RAF-1185

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

netlify bot commented Oct 16, 2025

Deploy Preview for brilliant-pasca-3e80ec ready!

Name Link
🔨 Latest commit bad9469
🔍 Latest deploy log https://app.netlify.com/projects/brilliant-pasca-3e80ec/deploys/697b2be31b7f5c000737d272
😎 Deploy Preview https://deploy-preview-3706--brilliant-pasca-3e80ec.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added pkg: backend Changes in the backend package. type: source Changes business logic labels Oct 16, 2025
Copy link
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.

Only focused on the kyc decision middleware here


const readDecision = async (): Promise<string | undefined> => {
try {
const value = await redis.get(cacheKey)
Copy link
Contributor

Choose a reason for hiding this comment

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

We have a poll utility function for this in utils.ts


const incomingPaymentId = ctx.state.streamDestination
const connectionId = ctx.state.connectionId ?? 'unknown'
const cacheKey = `kyc_decision:${incomingPaymentId}:${connectionId}`
Copy link
Contributor

@mkurapov mkurapov Jan 19, 2026

Choose a reason for hiding this comment

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

I think we should incorporate the polling inside the existing incoming payment service that will handle the logic for this. That is where we can also put the code to actually confirm or reject the partial incoming payment.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the incoming payment service is fine for this one.

}

const incomingPaymentId = ctx.state.streamDestination
const connectionId = ctx.state.connectionId ?? 'unknown'
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's generate our own UUID partialIncomingPaymentId

import { ILPContext, ILPMiddleware } from '../rafiki'
import { StreamState } from './stream-address'

export function createKycDecisionMiddleware(): ILPMiddleware {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should not have any references to "kyc" in this code change, but simply partialPaymentDecisionMiddleware or something

@github-actions github-actions bot added the type: tests Testing related label Jan 26, 2026
@sanducb sanducb requested a review from mkurapov January 26, 2026 10:56
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. type: source Changes business logic type: tests Testing related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants