summaryrefslogtreecommitdiff
path: root/src/include/taler_merchant_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-04-11 19:44:51 +0200
committerChristian Grothoff <christian@grothoff.org>2023-04-11 19:44:51 +0200
commit5ed3b2cfe1aa0cb31c589b308cc70684a20dd368 (patch)
tree858e253a3393febe8207e5870e59e04946fa6958 /src/include/taler_merchant_service.h
parentfeaf7bae8baf8ec701d02374e18a6b978dcfb9f8 (diff)
downloadmerchant-5ed3b2cfe1aa0cb31c589b308cc70684a20dd368.tar.gz
merchant-5ed3b2cfe1aa0cb31c589b308cc70684a20dd368.tar.bz2
merchant-5ed3b2cfe1aa0cb31c589b308cc70684a20dd368.zip
store user-type with merchant settings
Diffstat (limited to 'src/include/taler_merchant_service.h')
-rw-r--r--src/include/taler_merchant_service.h173
1 files changed, 144 insertions, 29 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index 3d55e4b0..863f1676 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -1,6 +1,6 @@
/*
This file is part of TALER
- Copyright (C) 2014-2022 Taler Systems SA
+ Copyright (C) 2014-2023 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software
@@ -303,6 +303,7 @@ struct TALER_MERCHANT_ConfigInformation
};
+// FIXME: change signature!
/**
* Function called with information about the merchant.
*
@@ -384,6 +385,11 @@ struct TALER_MERCHANT_InstanceInformation
*/
json_t *payment_targets;
+ /**
+ * User type for the instance.
+ */
+ enum TALER_KYCLOGIC_KycUserType ut;
+
};
@@ -394,19 +400,47 @@ struct TALER_MERCHANT_InstancesGetHandle;
/**
+ * Response to a GET /instances request.
+ */
+struct TALER_MERCHANT_InstancesGetResponse
+{
+ /**
+ * HTTP response data
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+
+ union
+ {
+ /**
+ * Data returned on #MHD_HTTP_OK status.
+ */
+ struct
+ {
+ /**
+ * length of the @e iis array
+ */
+ unsigned int iis_length;
+
+ /**
+ * array with instance information of length @e iis_length
+ */
+ const struct TALER_MERCHANT_InstanceInformation *iis;
+ } success;
+ } details;
+
+};
+
+
+/**
* Function called with the result of the GET /instances operation.
*
* @param cls closure
- * @param hr HTTP response data
- * @param iis_length length of the @a iis array
- * @param iis array with instance information of length @a iis_length
+ * @param igr response data
*/
typedef void
(*TALER_MERCHANT_InstancesGetCallback)(
void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- unsigned int iis_length,
- const struct TALER_MERCHANT_InstanceInformation iis[]);
+ const struct TALER_MERCHANT_InstancesGetResponse *igr);
/**
@@ -466,6 +500,7 @@ typedef void
* @param accounts_length how many bank accounts this instance has
* @param payto_uris URIs of the bank accounts of the merchant instance
* @param name name of the merchant instance
+ * @param ut user type of the merchant instance
* @param address physical address of the merchant instance
* @param jurisdiction jurisdiction of the merchant instance
* @param default_max_wire_fee default maximum wire fee merchant is willing to fully pay
@@ -487,6 +522,7 @@ TALER_MERCHANT_instances_post (
unsigned int accounts_length,
const char *payto_uris[],
const char *name,
+ enum TALER_KYCLOGIC_KycUserType ut,
const json_t *address,
const json_t *jurisdiction,
const struct TALER_Amount *default_max_wire_fee,
@@ -539,6 +575,7 @@ typedef void
* @param accounts_length length of the @a accounts array
* @param payto_uris URIs of the bank accounts of the merchant instance
* @param name name of the merchant instance
+ * @param ut user type of the merchant instance
* @param address physical address of the merchant instance
* @param jurisdiction jurisdiction of the merchant instance
* @param default_max_wire_fee default maximum wire fee merchant is willing to fully pay
@@ -559,6 +596,7 @@ TALER_MERCHANT_instance_patch (
unsigned int accounts_length,
const char *payto_uris[],
const char *name,
+ enum TALER_KYCLOGIC_KycUserType ut,
const json_t *address,
const json_t *jurisdiction,
const struct TALER_Amount *default_max_wire_fee,
@@ -682,7 +720,7 @@ struct TALER_MERCHANT_InstanceDetails
/**
* public key of the merchant instance
*/
- const struct TALER_MerchantPublicKeyP *merchant_pub;
+ struct TALER_MerchantPublicKeyP merchant_pub;
/**
* physical address of the merchant instance
@@ -697,17 +735,12 @@ struct TALER_MERCHANT_InstanceDetails
/**
* default maximum wire fee merchant is willing to fully pay
*/
- const struct TALER_Amount *default_max_wire_fee;
-
- /**
- * default amortization factor for excess wire fees
- */
- uint32_t default_wire_fee_amortization;
+ struct TALER_Amount default_max_wire_fee;
/**
* default maximum deposit fee merchant is willing to pay
*/
- const struct TALER_Amount *default_max_deposit_fee;
+ struct TALER_Amount default_max_deposit_fee;
/**
* default wire transfer delay merchant will ask for
@@ -718,6 +751,52 @@ struct TALER_MERCHANT_InstanceDetails
* default validity period for offers merchant makes
*/
struct GNUNET_TIME_Relative default_pay_delay;
+
+ /**
+ * Default amortization factor for excess wire fees
+ */
+ uint32_t default_wire_fee_amortization;
+
+ /**
+ * User type for the instance.
+ */
+ enum TALER_KYCLOGIC_KycUserType ut;
+};
+
+
+struct TALER_MERCHANT_InstanceGetResponse
+{
+ /**
+ * HTTP response data
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+
+ union
+ {
+
+ /**
+ * Data returned on #MHD_HTTP_OK.
+ */
+ struct
+ {
+ /**
+ * Length of the @e accounts array.
+ */
+ unsigned int accounts_length;
+
+ /**
+ * bank accounts of the merchant instance
+ */
+ const struct TALER_MERCHANT_Account *accounts;
+
+ /**
+ * Details about the instance.
+ */
+ struct TALER_MERCHANT_InstanceDetails details;
+
+ } success;
+ }
+ details;
};
@@ -725,18 +804,12 @@ struct TALER_MERCHANT_InstanceDetails
* Function called with the result of the GET /instances/$ID operation.
*
* @param cls closure
- * @param hr HTTP response data
- * @param accounts_length length of the @a accounts array
- * @param accounts bank accounts of the merchant instance
- * @param details details about the instance configuration
+ * @param igr response details
*/
typedef void
(*TALER_MERCHANT_InstanceGetCallback)(
void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- unsigned int accounts_length,
- const struct TALER_MERCHANT_Account accounts[],
- const struct TALER_MERCHANT_InstanceDetails *details);
+ const struct TALER_MERCHANT_InstanceGetResponse *igr);
/**
@@ -878,19 +951,45 @@ struct TALER_MERCHANT_InventoryEntry
/**
+ * Response to a GET /products request.
+ */
+struct TALER_MERCHANT_GetProductsResponse
+{
+ /**
+ * HTTP response details
+ */
+ struct TALER_MERCHANT_HttpResponse hr;
+
+ union
+ {
+ struct
+ {
+
+ /**
+ * length of the @a products array
+ */
+ unsigned int products_length;
+
+ /**
+ * array of products the requested instance offers
+ */
+ const struct TALER_MERCHANT_InventoryEntry *products;
+ } success;
+
+ } details;
+};
+
+
+/**
* Function called with the result of the GET /products operation.
*
* @param cls closure
- * @param hr HTTP response details
- * @param products_length length of the @a products array
- * @param products array of products the requested instance offers
+ * @param gpr response details
*/
typedef void
(*TALER_MERCHANT_ProductsGetCallback)(
void *cls,
- const struct TALER_MERCHANT_HttpResponse *hr,
- unsigned int products_length,
- const struct TALER_MERCHANT_InventoryEntry products[]);
+ const struct TALER_MERCHANT_GetProductsResponse *gpr);
/**
@@ -929,6 +1028,7 @@ TALER_MERCHANT_products_get_cancel (
struct TALER_MERCHANT_ProductGetHandle;
+// FIXME: change signature!
/**
* Function called with the result of the GET /products operation.
*
@@ -1481,6 +1581,7 @@ struct TALER_MERCHANT_OrderEntry
};
+// FIXME: change signature!
/**
* Function called with the result of the GET /orders operation.
*
@@ -2088,6 +2189,7 @@ TALER_MERCHANT_order_delete_cancel (
struct TALER_MERCHANT_OrderClaimHandle;
+// FIXME: change signature!
/**
* Callback called to process a POST /orders/$ID/claim response.
*
@@ -2474,6 +2576,7 @@ struct TALER_MERCHANT_AbortedCoin
};
+// FIXME: change signature!
/**
* Callbacks of this type are used to serve the result of submitting a
* /orders/$ID/abort request to a merchant.
@@ -2617,6 +2720,7 @@ TALER_MERCHANT_order_forget_cancel (struct
struct TALER_MERCHANT_OrderRefundHandle;
+// FIXME: change signature!
/**
* Callback to process a POST /orders/ID/refund request
*
@@ -2712,6 +2816,7 @@ struct TALER_MERCHANT_RefundDetail
};
+// FIXME: change signature!
/**
* Callback to process a (public) POST /orders/ID/refund request
*
@@ -2969,6 +3074,8 @@ struct TALER_MERCHANT_TransferData
};
+
+// FIXME: change signature!
/**
* Callbacks of this type are used to work the result of submitting a
* GET /transfers request to a merchant
@@ -3047,6 +3154,7 @@ TALER_MERCHANT_transfers_get_cancel (
struct TALER_MERCHANT_PostReservesHandle;
+// FIXME: change signature!
/**
* Callbacks of this type are used to work the result of submitting a
* POST /reserves request to a merchant
@@ -3152,6 +3260,7 @@ struct TALER_MERCHANT_ReserveSummary
};
+// FIXME: change signature!
/**
* Callback to process a GET /reserves request
*
@@ -3232,6 +3341,7 @@ struct TALER_MERCHANT_TipDetails
};
+// FIXME: change signature!
/**
* Callback to process a GET /reserve/$RESERVE_PUB request
*
@@ -3293,6 +3403,7 @@ TALER_MERCHANT_reserve_get_cancel (
struct TALER_MERCHANT_TipAuthorizeHandle;
+// FIXME: change signature!
/**
* Callback for a /reserves/$RESERVE_PUB/tip-authorize request. Returns the result of
* the operation.
@@ -3703,6 +3814,7 @@ struct TALER_MERCHANT_TipEntry
};
+// FIXME: change signature!
/**
* Callback to process a GET /private/tips request.
*
@@ -3880,6 +3992,7 @@ TALER_MERCHANT_tip_pickup_cancel (struct TALER_MERCHANT_TipPickupHandle *tph);
struct TALER_MERCHANT_TipPickup2Handle;
+// FIXME: change signature!
/**
* Callback for a POST /tips/$TIP_ID/pickup request. Returns the result of
* the operation. Note that the client MUST still do the unblinding of the @a
@@ -4136,6 +4249,7 @@ struct TALER_MERCHANT_TemplateEntry
};
+// FIXME: change signature!
/**
* Function called with the result of the GET /templates operation.
*
@@ -4497,6 +4611,7 @@ struct TALER_MERCHANT_WebhookEntry
};
+// FIXME: change signature!
/**
* Function called with the result of the GET /webhooks operation.
*