summaryrefslogtreecommitdiff
path: root/src/backend/taler-merchant-httpd_post-orders-ID-claim.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-27 15:58:32 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-27 15:58:32 +0200
commite3d91bf74804871c5d7438a0b04265b69feba34a (patch)
treee8f03f09afcca6b645202059a7aade532c09dd59 /src/backend/taler-merchant-httpd_post-orders-ID-claim.c
parent255f162ddb88e932d087574a52d959a7a1d5ba80 (diff)
downloadmerchant-e3d91bf74804871c5d7438a0b04265b69feba34a.tar.gz
merchant-e3d91bf74804871c5d7438a0b04265b69feba34a.tar.bz2
merchant-e3d91bf74804871c5d7438a0b04265b69feba34a.zip
db implementation of claiming
Diffstat (limited to 'src/backend/taler-merchant-httpd_post-orders-ID-claim.c')
-rw-r--r--src/backend/taler-merchant-httpd_post-orders-ID-claim.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c
index e58a73c5..6b3a9229 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-claim.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-claim.c
@@ -31,7 +31,7 @@
/**
- * How often do we retry the simple INSERT database transaction?
+ * How often do we retry the database transaction?
*/
#define MAX_RETRIES 3
@@ -103,7 +103,17 @@ claim_order (const char *instance_id,
*contract_terms = NULL;
return qs;
}
- // FIXME: should we remove the ORDER from the order table here?
+ qs = TMH_db->delete_order (TMH_db->cls,
+ instance_id,
+ order_id);
+ if (0 >= qs)
+ {
+ GNUNET_break (0);
+ TMH_db->rollback (TMH_db->cls);
+ json_decref (*contract_terms);
+ *contract_terms = NULL;
+ return qs;
+ }
qs = TMH_db->commit (TMH_db->cls);
if (0 > qs)
return qs;