summaryrefslogtreecommitdiff
path: root/src/include/taler_merchant_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-05-01 00:09:55 +0200
committerChristian Grothoff <christian@grothoff.org>2023-05-01 00:09:55 +0200
commit583c01c6224dd317f9665e623b02a32b74fdf74a (patch)
tree0b12e40c9dafde2b235c3c405a1ee032ff0e70d4 /src/include/taler_merchant_service.h
parenta7fe1d1b77ce1d7959522262f85788807d56316b (diff)
downloadmerchant-583c01c6224dd317f9665e623b02a32b74fdf74a.tar.gz
merchant-583c01c6224dd317f9665e623b02a32b74fdf74a.tar.bz2
merchant-583c01c6224dd317f9665e623b02a32b74fdf74a.zip
first rough cut at merchant update for #7810 (still with known bugs)
Diffstat (limited to 'src/include/taler_merchant_service.h')
-rw-r--r--src/include/taler_merchant_service.h133
1 files changed, 111 insertions, 22 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 30f65a0f..1135cb38 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -3268,22 +3268,58 @@ TALER_MERCHANT_transfers_get_cancel (
struct TALER_MERCHANT_PostReservesHandle;
-// FIXME: change signature!
+/**
+ * Response to a POST /reserves request.
+ */
+struct TALER_MERCHANT_PostReservesResponse
+{
+ /**
+ * HTTP response details.
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+
+ /**
+ * Details depending on HTTP status.
+ */
+ union
+ {
+ /**
+ * Response on #MHD_HTTP_OK.
+ */
+ struct
+ {
+ /**
+ * Public key of the created reserve.
+ */
+ struct TALER_ReservePublicKeyP reserve_pub;
+
+ /**
+ * Accounts to credit to for filling the reserve.
+ * Array of accounts of the exchange.
+ */
+ const struct TALER_EXCHANGE_WireAccount *accounts;
+
+ /**
+ * Length of @e accounts array.
+ */
+ unsigned int accounts_len;
+
+ } ok;
+ } details;
+};
+
+
/**
* Callbacks of this type are used to work the result of submitting a
* POST /reserves request to a merchant
*
* @param cls closure
- * @param hr HTTP response details
- * @param reserve_pub public key of the created reserve, NULL on error
- * @param payto_uri where to make the payment to for filling the reserve, NULL on error
+ * @param prr response details
*/
typedef void
(*TALER_MERCHANT_PostReservesCallback) (
void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- const struct TALER_ReservePublicKeyP *reserve_pub,
- const char *payto_uri);
+ const struct TALER_MERCHANT_PostReservesResponse *prr);
/**
@@ -3455,29 +3491,82 @@ struct TALER_MERCHANT_TipDetails
};
-// FIXME: change signature!
+/**
+ * Response to a GET /reserves/$ID request.
+ */
+struct TALER_MERCHANT_ReserveGetResponse
+{
+ /**
+ * HTTP response.
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+
+ /**
+ * Details depending on HTTP status.
+ */
+ union
+ {
+
+ /**
+ * Details on #MHD_HTTP_OK.
+ */
+ struct
+ {
+
+ /**
+ * reserve summary for the reserve
+ */
+ struct TALER_MERCHANT_ReserveSummary rs;
+
+ /**
+ * URL of the exchange hosting the reserve, NULL if not @a active
+ */
+ const char *exchange_url;
+
+ /**
+ * Accounts to credit to for filling the reserve.
+ * Array of accounts of the exchange. Empty if
+ * already filled.
+ */
+ const struct TALER_EXCHANGE_WireAccount *accounts;
+
+ /**
+ * Length of @e accounts array.
+ */
+ unsigned int accounts_len;
+
+ /**
+ * Array with details about the tips granted.
+ */
+ const struct TALER_MERCHANT_TipDetails *tips;
+
+ /**
+ * Length of the @e tips array
+ */
+ unsigned int tips_length;
+
+ /**
+ * Is this reserve active (false if it was deleted but not purged)
+ */
+ bool active;
+
+ } ok;
+
+ } details;
+
+};
+
+
/**
* Callback to process a GET /reserve/$RESERVE_PUB request
*
* @param cls closure
- * @param hr HTTP response details
- * @param rs reserve summary for the reserve, NULL on error
- * @param active is this reserve active (false if it was deleted but not purged)
- * @param exchange_url URL of the exchange hosting the reserve, NULL if not @a active
- * @param payto_uri URI to fill the reserve, NULL if not @a active or already filled
- * @param tips_length length of the @a reserves array
- * @param tips array with details about the tips granted, NULL on error
+ * @param rgr response details
*/
typedef void
(*TALER_MERCHANT_ReserveGetCallback) (
void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- const struct TALER_MERCHANT_ReserveSummary *rs,
- bool active,
- const char *exchange_url,
- const char *payto_uri,
- unsigned int tips_length,
- const struct TALER_MERCHANT_TipDetails tips[]);
+ const struct TALER_MERCHANT_ReserveGetResponse *rgr);
/**