summaryrefslogtreecommitdiff
path: root/src/lib/merchant_api_post_orders.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/merchant_api_post_orders.c')
-rw-r--r--src/lib/merchant_api_post_orders.c48
1 files changed, 43 insertions, 5 deletions
diff --git a/src/lib/merchant_api_post_orders.c b/src/lib/merchant_api_post_orders.c
index c0fd5fcb..56881133 100644
--- a/src/lib/merchant_api_post_orders.c
+++ b/src/lib/merchant_api_post_orders.c
@@ -92,9 +92,9 @@ handle_post_order_finished (void *cls,
po->job = NULL;
TALER_MERCHANT_handle_order_creation_response_ (po->cb,
- po->cb_cls,
- response_code,
- json);
+ po->cb_cls,
+ response_code,
+ json);
TALER_MERCHANT_orders_post_cancel (po);
}
@@ -107,6 +107,8 @@ TALER_MERCHANT_orders_post (struct GNUNET_CURL_Context *ctx,
TALER_MERCHANT_PostOrdersCallback cb,
void *cb_cls)
{
+ static const char *no_uuids[GNUNET_NZL (0)];
+
return TALER_MERCHANT_orders_post2 (ctx,
backend_url,
order,
@@ -115,7 +117,7 @@ TALER_MERCHANT_orders_post (struct GNUNET_CURL_Context *ctx,
0,
NULL,
0,
- NULL,
+ no_uuids,
true,
cb,
cb_cls);
@@ -132,7 +134,40 @@ TALER_MERCHANT_orders_post2 (
unsigned int inventory_products_length,
const struct TALER_MERCHANT_InventoryProduct inventory_products[],
unsigned int uuids_length,
- const char *uuids[],
+ const char *uuids[static uuids_length],
+ bool create_token,
+ TALER_MERCHANT_PostOrdersCallback cb,
+ void *cb_cls)
+{
+ return TALER_MERCHANT_orders_post3 (
+ ctx,
+ backend_url,
+ order,
+ NULL, /* session ID */
+ refund_delay,
+ payment_target,
+ inventory_products_length,
+ inventory_products,
+ uuids_length,
+ uuids,
+ create_token,
+ cb,
+ cb_cls);
+}
+
+
+struct TALER_MERCHANT_PostOrdersHandle *
+TALER_MERCHANT_orders_post3 (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const json_t *order,
+ const char *session_id,
+ struct GNUNET_TIME_Relative refund_delay,
+ const char *payment_target,
+ unsigned int inventory_products_length,
+ const struct TALER_MERCHANT_InventoryProduct inventory_products[],
+ unsigned int uuids_length,
+ const char *uuids[static uuids_length],
bool create_token,
TALER_MERCHANT_PostOrdersCallback cb,
void *cb_cls)
@@ -152,6 +187,9 @@ TALER_MERCHANT_orders_post2 (
GNUNET_JSON_pack_object_incref ("order",
(json_t *) order),
GNUNET_JSON_pack_allow_null (
+ GNUNET_JSON_pack_string ("session_id",
+ session_id)),
+ GNUNET_JSON_pack_allow_null (
GNUNET_JSON_pack_string ("payment_target",
payment_target)));
if (0 != refund_delay.rel_value_us)