summaryrefslogtreecommitdiff
path: root/src/include/taler_merchant_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-05-28 23:00:37 +0200
committerChristian Grothoff <christian@grothoff.org>2023-05-28 23:00:37 +0200
commit0eb10b52c3a65770617d391ebdf0596e845718ce (patch)
tree2c7b96a69fbed0786822b3851b6f057414f17624 /src/include/taler_merchant_service.h
parent62220c02979c1a7e81d8ac261d2f624680bdedc1 (diff)
downloadmerchant-0eb10b52c3a65770617d391ebdf0596e845718ce.tar.gz
merchant-0eb10b52c3a65770617d391ebdf0596e845718ce.tar.bz2
merchant-0eb10b52c3a65770617d391ebdf0596e845718ce.zip
implement new account api in libtalermerchant (for #7824)
Diffstat (limited to 'src/include/taler_merchant_service.h')
-rw-r--r--src/include/taler_merchant_service.h124
1 files changed, 123 insertions, 1 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 33ef033f..114811be 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -480,7 +480,7 @@ struct TALER_MERCHANT_InstancesPostHandle;
/**
- * Function called with the result of the GET /instances/$ID operation.
+ * Function called with the result of the POST /instances/$ID operation.
*
* @param cls closure
* @param hr HTTP response data
@@ -571,6 +571,128 @@ TALER_MERCHANT_instances_post_cancel (
/**
+ * Handle for a POST /instances/$ID/account operation.
+ */
+struct TALER_MERCHANT_AccountPostHandle;
+
+
+/**
+ * Response for a POST /instances/$ID/account operation.
+ */
+struct TALER_MERCHANT_AccountPostResponse
+{
+ /**
+ * HTTP response data
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+};
+
+
+/**
+ * Function called with the result of the POST /instances/$ID/account operation.
+ *
+ * @param cls closure
+ * @param par response data
+ */
+typedef void
+(*TALER_MERCHANT_AccountPostCallback)(
+ void *cls,
+ const struct TALER_MERCHANT_AccountPostResponse *par);
+
+
+/**
+ * Setup an new account for an instance in the backend.
+ *
+ * @param ctx the context
+ * @param backend_url HTTP base URL for the backend
+ * @param account the bank accounts to add to the merchant instance
+ * @param auth_token authentication token to use for access control, NULL for external auth; MUST follow RFC 8959
+ * @param cb function to call with the response
+ * @param cb_cls closure for @a config_cb
+ * @return the instances handle; NULL upon error
+ */
+struct TALER_MERCHANT_AccountPostHandle *
+TALER_MERCHANT_account_post (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const struct TALER_MERCHANT_AccountConfig *account,
+ TALER_MERCHANT_AccountPostCallback cb,
+ void *cb_cls);
+
+
+/**
+ * Cancel /account request. Must not be called by clients after
+ * the callback was invoked.
+ *
+ * @param pah request to cancel.
+ */
+void
+TALER_MERCHANT_account_post_cancel (
+ struct TALER_MERCHANT_AccountPostHandle *pah);
+
+
+/**
+ * Handle for a DELETE /instances/$ID/account/$H_WIRE operation.
+ */
+struct TALER_MERCHANT_AccountDeleteHandle;
+
+
+/**
+ * Response for a DELETE /instances/$ID/account operation.
+ */
+struct TALER_MERCHANT_AccountDeleteResponse
+{
+ /**
+ * HTTP response data
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+};
+
+
+/**
+ * Function called with the result of the DELETE /instances/$ID/account/$H_WIRE operation.
+ *
+ * @param cls closure
+ * @param par response data
+ */
+typedef void
+(*TALER_MERCHANT_AccountDeleteCallback)(
+ void *cls,
+ const struct TALER_MERCHANT_AccountDeleteResponse *par);
+
+
+/**
+ * Remove bank account from an instance in the backend.
+ *
+ * @param ctx the context
+ * @param backend_url HTTP base URL for the backend
+ * @param h_wire wire hash of the bank accounts to delete
+ * @param auth_token authentication token to use for access control, NULL for external auth; MUST follow RFC 8959
+ * @param cb function to call with the response
+ * @param cb_cls closure for @a config_cb
+ * @return the instances handle; NULL upon error
+ */
+struct TALER_MERCHANT_AccountDeleteHandle *
+TALER_MERCHANT_account_delete (
+ struct GNUNET_CURL_Context *ctx,
+ const char *backend_url,
+ const struct TALER_MerchantWireHashP *h_wire,
+ TALER_MERCHANT_AccountDeleteCallback cb,
+ void *cb_cls);
+
+
+/**
+ * Cancel /account request. Must not be called by clients after
+ * the callback was invoked.
+ *
+ * @param pah request to cancel.
+ */
+void
+TALER_MERCHANT_account_delete_cancel (
+ struct TALER_MERCHANT_AccountDeleteHandle *pah);
+
+
+/**
* Handle for a PATCH /instances/$ID operation.
*/
struct TALER_MERCHANT_InstancePatchHandle;