taler-mdb

GNU Taler Extensions and Integrations
Log | Files | Refs | Submodules | README | LICENSE

commit e2dccbdda2e085b011218f59a7f18aa0e792cf12
parent 5e31cfb05595597ade329c215cefef0ac10c131c
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 24 Aug 2020 14:15:48 +0200

implement #6522

Diffstat:
Msrc/main.c | 49++++++-------------------------------------------
1 file changed, 6 insertions(+), 43 deletions(-)

diff --git a/src/main.c b/src/main.c @@ -606,11 +606,6 @@ static char *currency; static char *backend_base_url; /** - * Taler fulfillment url read from configuration file - */ -static char *fulfillment_url; - -/** * Fulfillment message to display after successful payment, read from configuration file */ static char *fulfillment_msg; @@ -1539,26 +1534,7 @@ launch_payment (struct Product *product) { struct PaymentActivity *pa; json_t *orderReq; - char *fulflmntUrl; - struct GNUNET_ShortHashCode uuid; - char *uuid_s; - - /* We need to ensure that every fulfillment URL is unique; - most easily done by adding a random nonce, as we may - not have a reliable counter or clock on the machine */ - GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_NONCE, - &uuid, - sizeof (uuid)); - uuid_s = GNUNET_STRINGS_data_to_string_alloc (&uuid, - sizeof (uuid)); - /* create the fulfillment url, e.g. "taler://fulfillment-success/Enjoy+your+ice+cream!"; */ - GNUNET_asprintf (&fulflmntUrl, - "%s%s%s#%s", - fulfillment_url, - fulfillment_msg, - product->description, - uuid_s); - GNUNET_free (uuid_s); + /* create the json object for the order request */ if (NULL != product->preview) { @@ -1567,8 +1543,8 @@ launch_payment (struct Product *product) product->description, "preview", product->preview, "amount", TALER_JSON_from_amount (&product->price), - "fulfillment_url", fulflmntUrl - ,"auto_refund", GNUNET_JSON_from_time_rel ( + "fulfillment_message", fulfillment_msg, + "auto_refund", GNUNET_JSON_from_time_rel ( MAX_REFUND_DELAY) ); } @@ -1578,12 +1554,11 @@ launch_payment (struct Product *product) "summary", product->description, "amount", TALER_JSON_from_amount (&product->price), - "fulfillment_url", fulflmntUrl - ,"auto_refund", GNUNET_JSON_from_time_rel ( + "fulfillment_message", fulfillment_msg, + "auto_refund", GNUNET_JSON_from_time_rel ( MAX_REFUND_DELAY) ); } - GNUNET_free (fulflmntUrl); if (NULL == orderReq) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -2972,24 +2947,12 @@ run (void *cls, if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_string (cfg, "taler-mdb", - "fulfillment-url", - &fulfillment_url)) - { - GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "taler-mdb", - "fulfillment-url"); - global_ret = EXIT_FAILURE; - return; - } - if (GNUNET_OK != - GNUNET_CONFIGURATION_get_value_string (cfg, - "taler-mdb", "fulfillment-msg", &fulfillment_msg)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, "taler-mdb", - "fulfillment-msgcurrency"); + "fulfillment-msg"); global_ret = EXIT_FAILURE; return; }