Skip to content
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

Add payment validation before initiating pay session #334

Open
marsella opened this issue Nov 24, 2021 · 0 comments
Open

Add payment validation before initiating pay session #334

marsella opened this issue Nov 24, 2021 · 0 comments

Comments

@marsella
Copy link
Contributor

Right now, a payment isn't rejected for not-enough-balance until the customer tries to form a pay proof. This is very late and puts the customer into a difficult-to-recover state.
Also, there's a weird situation where a payment is initiated (the non-zkabacus bits) but the customer status doesn't change until it gets to zkabacus parts. This could result in a "race" where both payments get approved but only one gets executed.

Instead, the pay session should do the following

  1. Set status to pending payment
  2. Check whether there's enough balance. If not, return status to Ready
  3. If so, continue.
  4. When zkabacus starts, update state from PendingPay, not from Ready.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant