Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Set up Redis/Postgres to track async payments #15

Open
nkramer44 opened this issue Feb 11, 2020 · 1 comment
Open

Set up Redis/Postgres to track async payments #15

nkramer44 opened this issue Feb 11, 2020 · 1 comment
Labels
enhancement New feature or request send money async

Comments

@nkramer44
Copy link
Contributor

nkramer44 commented Feb 11, 2020

In order to provide idempotent/async sendMoney functionality, we will need a data store that is able to keep track of pending/complete payments. We should decide on a data store, either Redis or Postgres. Since this will likely change with any more sophisticated balance tracking/resiliency measures, we should probably just go with what's easiest.

This should just be one table with the following fields (essentially storing a SendMoneyResult plus or minus some fields):

  • paymentId : Some unique identifier which will be passed by the client. Assume UUID for now
  • originalAmount : Amount requested to send
  • amountDelivered : Amount that was actually delivered
  • amountSent : Amount that was sent
  • amountLeftToSend : Difference between originalAmount and amountDelivered
  • Maybe some packet info for debugging purposes, but not necessary
  • destination : Payment pointer of the receiver
  • status : either PENDING, COMPLETE, or FAILED

Note that this will partially solve the resiliency issue between client and Hermes, but will NOT solve the case of Hermes disconnecting from the connector.

@nkramer44 nkramer44 added enhancement New feature or request send money async labels Feb 11, 2020
This was referenced Feb 11, 2020
@sappenin
Copy link
Contributor

For the future - let's do this in Postgres first.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request send money async
Projects
None yet
Development

No branches or pull requests

2 participants