diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-09-05 13:13:19 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-09-05 13:13:19 +0200 |
commit | 6f8c2241fcd836bad836861c4b3eb7d43504a780 (patch) | |
tree | ce75d371761d655a8eb040b4e620267a8c116c45 /src/backenddb/merchant-0001.sql | |
parent | c0f992290a61e67f08e720649673951ef86638b5 (diff) | |
download | merchant-6f8c2241fcd836bad836861c4b3eb7d43504a780.tar.gz merchant-6f8c2241fcd836bad836861c4b3eb7d43504a780.tar.bz2 merchant-6f8c2241fcd836bad836861c4b3eb7d43504a780.zip |
fix idempotency issue for POST /private/orders (#6445)
Diffstat (limited to 'src/backenddb/merchant-0001.sql')
-rw-r--r-- | src/backenddb/merchant-0001.sql | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backenddb/merchant-0001.sql b/src/backenddb/merchant-0001.sql index 0adc495b..f75cbb28 100644 --- a/src/backenddb/merchant-0001.sql +++ b/src/backenddb/merchant-0001.sql @@ -190,6 +190,7 @@ CREATE TABLE IF NOT EXISTS merchant_orders REFERENCES merchant_instances (merchant_serial) ON DELETE CASCADE ,order_id VARCHAR NOT NULL ,claim_token BYTEA NOT NULL CHECK (LENGTH(claim_token)=16) + ,h_post_data BYTEA NOT NULL CHECK (LENGTH(h_post_data)=64) ,pay_deadline INT8 NOT NULL ,creation_time INT8 NOT NULL ,contract_terms BYTEA NOT NULL @@ -199,6 +200,8 @@ COMMENT ON TABLE merchant_orders IS 'Orders we offered to a customer, but that have not yet been claimed'; COMMENT ON COLUMN merchant_orders.contract_terms IS 'Claiming changes the contract_terms, hence we have no hash of the terms in this table'; +COMMENT ON COLUMN merchant_orders.h_post_data + IS 'Hash of the POST request that created this order, for idempotency checks'; COMMENT ON COLUMN merchant_orders.claim_token IS 'Token optionally used to authorize the wallet to claim the order. All zeros (not NULL) if not used'; COMMENT ON COLUMN merchant_orders.merchant_serial |