AfRApay.Web: Make transactions idempotent #12

Merged
zotan merged 3 commits from feature/idempotency into dev 2023-02-09 01:36:35 +01:00
Member

First rule of networking is the network is unreliable. Sometimes things get
lost, sometimes it gets found multiple times for TCP reasons or because a
browser tries to be clever.

And when you're dealing with money, even if it's monopoly money, you don't
want a duplicated request to mean a double-debit. The easiest way to do this
is to simply include an idempotency key with each request - if that key is
repeated, the request is ignored.

This changes the database schema, and I can't be arsed adding a migration at this point, so you gotta reset your databases. @zotan @enbyfoxen

First rule of networking is the network is unreliable. Sometimes things get lost, sometimes it gets found multiple times for TCP reasons or because a browser tries to be clever. And when you're dealing with money, even if it's monopoly money, you don't want a duplicated request to mean a double-debit. The easiest way to do this is to simply include an idempotency key with each request - if that key is repeated, the request is ignored. _This changes the database schema, and I can't be arsed adding a migration at this point, so you gotta reset your databases. @zotan @enbyfoxen_
embr force-pushed feature/idempotency from 0862f8e0da to 211107f0c6 2023-02-08 23:44:42 +01:00 Compare
embr force-pushed feature/idempotency from 5f7125c783 to 63669c6188 2023-02-09 00:24:14 +01:00 Compare
zotan added 1 commit 2023-02-09 01:34:44 +01:00
zotan merged commit 3644730b5f into dev 2023-02-09 01:36:35 +01:00
zotan deleted branch feature/idempotency 2023-02-09 01:36:50 +01:00
Sign in to join this conversation.
No description provided.