summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcello Stanisci <marcello.stanisci@inria.fr>2017-06-07 11:49:03 +0200
committerMarcello Stanisci <marcello.stanisci@inria.fr>2017-06-07 11:49:23 +0200
commit190d229f43aa14adc6cd58336beb541b36b7f43f (patch)
tree884e0288b30c39a044d61b683ed1b0746a386e65
parent88d6efd15aa31cef256101f8eca7e6e2341191f6 (diff)
downloadmerchant-190d229f43aa14adc6cd58336beb541b36b7f43f.tar.gz
merchant-190d229f43aa14adc6cd58336beb541b36b7f43f.tar.bz2
merchant-190d229f43aa14adc6cd58336beb541b36b7f43f.zip
comments + passing refund reason to refund cb
-rw-r--r--src/backenddb/plugin_merchantdb_postgres.c1
-rw-r--r--src/include/taler_merchantdb_plugin.h11
2 files changed, 12 insertions, 0 deletions
diff --git a/src/backenddb/plugin_merchantdb_postgres.c b/src/backenddb/plugin_merchantdb_postgres.c
index 73fd3304..9e9ac4a6 100644
--- a/src/backenddb/plugin_merchantdb_postgres.c
+++ b/src/backenddb/plugin_merchantdb_postgres.c
@@ -157,6 +157,7 @@ postgres_initialize (void *cls)
" rtransaction_id SERIAL"
",h_contract_terms BYTEA NOT NULL"
",coin_pub BYTEA NOT NULL CHECK (LENGTH(coin_pub)=32)"
+ ",reason VARCHAR NOT NULL"
",refund_amount_val INT8 NOT NULL"
",refund_amount_frac INT8 NOT NULL"
",refund_amount_curr VARCHAR(" TALER_CURRENCY_LEN_STR ") NOT NULL"
diff --git a/src/include/taler_merchantdb_plugin.h b/src/include/taler_merchantdb_plugin.h
index 67b5c0cc..9e7ec88a 100644
--- a/src/include/taler_merchantdb_plugin.h
+++ b/src/include/taler_merchantdb_plugin.h
@@ -125,10 +125,21 @@ typedef void
const json_t *proof);
+/**
+ * Function called with information about a refund.
+ *
+ * @param cls closure
+ * @param coin_pub public coin from which the refund comes from
+ * @param rtransaction_id identificator of the refund
+ * @param reason human-readable explaination of the refund
+ * @param refund_amount refund amount which is being taken from coin_pub
+ * @param refund_fee cost of this refund operation
+ */
typedef void
(*TALER_MERCHANTDB_RefundCallback)(void *cls,
const struct TALER_CoinSpendPublicKeyP *coin_pub,
uint64_t rtransaction_id,
+ const char *reason,
const struct TALER_Amount *refund_amount,
const struct TALER_Amount *refund_fee);