whb07 / payments_engine

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

payments_engine

A simple implementation of a payment engine, where an account has the following states:

  • valid
  • frozen
  • disputed

The transition from each stage can only happen in a specified manner:

  • valid -> disputed
  • disputed -> frozen OR valid

The following actions can be done in each stage:

  • valid - withdraw, deposit
  • disputed - resolve, chargeback, withdraw, deposit
  • frozen: NOTHING

How it works:

It doesn't...yet. Went down the wrong abstraction rabbit hole and down a weird implementation c'est la vie.

About


Languages

Language:Rust 100.0%