summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-12-13 22:18:47 +0100
committerChristian Grothoff <christian@grothoff.org>2017-12-13 22:18:47 +0100
commit015dd3aebfdea6d090cc07bb3c7586aadff83465 (patch)
tree0ecf62480a628dc8cdc567fbce695f8294ecb28b
parent9d79c8c2c819a823ad7f75824c4fbd885543c48a (diff)
downloadmerchant-015dd3aebfdea6d090cc07bb3c7586aadff83465.tar.gz
merchant-015dd3aebfdea6d090cc07bb3c7586aadff83465.tar.bz2
merchant-015dd3aebfdea6d090cc07bb3c7586aadff83465.zip
fix bug in testcase (and API) introduced when next_url and pickup_url were added to the spec
-rw-r--r--src/include/taler_merchant_service.h8
-rw-r--r--src/lib/merchant_api_tip_authorize.c14
-rw-r--r--src/lib/test_merchant_api.c2
3 files changed, 18 insertions, 6 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 0b739d6b..a1ee0ddb 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -808,7 +808,9 @@ typedef void
* that a tip should be created.
*
* @param ctx execution context
- * @param backend_uri base URL of the merchant backend
+ * @param backend_url base URL of the merchant backend
+ * @param pickup_url frontend URL for where the tip can be picked up
+ * @param next_url where the browser should proceed after picking up the tip
* @param amount amount to be handed out as a tip
* @param instance which backend instance should create the tip (identifies the reserve and exchange)
* @param justification which justification should be stored (human-readable reason for the tip)
@@ -818,7 +820,9 @@ typedef void
*/
struct TALER_MERCHANT_TipAuthorizeOperation *
TALER_MERCHANT_tip_authorize (struct GNUNET_CURL_Context *ctx,
- const char *backend_uri,
+ const char *backend_url,
+ const char *pickup_url,
+ const char *next_url,
const struct TALER_Amount *amount,
const char *instance,
const char *justification,
diff --git a/src/lib/merchant_api_tip_authorize.c b/src/lib/merchant_api_tip_authorize.c
index 3c7899df..a7aa4f5a 100644
--- a/src/lib/merchant_api_tip_authorize.c
+++ b/src/lib/merchant_api_tip_authorize.c
@@ -174,7 +174,9 @@ handle_tip_authorize_finished (void *cls,
* that a tip should be created.
*
* @param ctx execution context
- * @param backend_uri base URL of the merchant backend
+ * @param backend_url base URL of the merchant backend
+ * @param pickup_url frontend URL for where the tip can be picked up
+ * @param next_url where the browser should proceed after picking up the tip
* @param amount amount to be handed out as a tip
* @param instance which backend instance should create the tip (identifies the reserve and exchange)
* @param justification which justification should be stored (human-readable reason for the tip)
@@ -184,7 +186,9 @@ handle_tip_authorize_finished (void *cls,
*/
struct TALER_MERCHANT_TipAuthorizeOperation *
TALER_MERCHANT_tip_authorize (struct GNUNET_CURL_Context *ctx,
- const char *backend_uri,
+ const char *backend_url,
+ const char *pickup_url,
+ const char *next_url,
const struct TALER_Amount *amount,
const char *instance,
const char *justification,
@@ -199,18 +203,20 @@ TALER_MERCHANT_tip_authorize (struct GNUNET_CURL_Context *ctx,
tao->ctx = ctx;
tao->cb = authorize_cb;
tao->cb_cls = authorize_cb_cls;
- tao->url = MAH_path_to_url_ (backend_uri,
+ tao->url = MAH_path_to_url_ (backend_url,
"/tip-authorize");
te_obj = json_pack ("{"
" s:o," /* amount */
" s:s," /* instance */
" s:s," /* justification */
" s:s," /* pickup_url */
+ " s:s," /* next_url */
"}",
"amount", TALER_JSON_from_amount (amount),
"instance", instance,
"justification", justification,
- "pickup_url", "https://example.com");
+ "pickup_url", pickup_url,
+ "next_url", next_url);
if (NULL == te_obj)
{
GNUNET_break (0);
diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index 9bbcb00b..769421b5 100644
--- a/src/lib/test_merchant_api.c
+++ b/src/lib/test_merchant_api.c
@@ -3033,6 +3033,8 @@ interpreter_run (void *cls)
= TALER_MERCHANT_tip_authorize
(ctx,
MERCHANT_URL,
+ "http://merchant.com/pickup",
+ "http://merchant.com/continue",
&amount,
cmd->details.tip_authorize.instance,
cmd->details.tip_authorize.justification,