summaryrefslogtreecommitdiff
path: root/src/include/taler_merchant_service.h
diff options
context:
space:
mode:
authorJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-08-10 16:10:52 -0400
committerJonathan Buchanan <jonathan.russ.buchanan@gmail.com>2020-08-10 16:10:52 -0400
commit280bbb526c245ac69762e989816cb4c4848cd22c (patch)
tree0b9f6a19629ab04597ae52186d0d38769f9f6c6b /src/include/taler_merchant_service.h
parent119de8db9e317e46ebe800524b806809d2b435b0 (diff)
downloadmerchant-280bbb526c245ac69762e989816cb4c4848cd22c.tar.gz
merchant-280bbb526c245ac69762e989816cb4c4848cd22c.tar.bz2
merchant-280bbb526c245ac69762e989816cb4c4848cd22c.zip
implement parse refund uri (untested) & add more tests for pay uri
Diffstat (limited to 'src/include/taler_merchant_service.h')
-rw-r--r--src/include/taler_merchant_service.h54
1 files changed, 43 insertions, 11 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h
index b33941aa..17d0f16f 100644
--- a/src/include/taler_merchant_service.h
+++ b/src/include/taler_merchant_service.h
@@ -197,22 +197,54 @@ TALER_MERCHANT_parse_pay_uri_free (
/**
+ * Contains information gathered from parsing a taler://refund URI.
+ */
+struct TALER_MERCHANT_RefundUriData
+{
+ /**
+ * Hostname (and possibly port) of the merchant.
+ */
+ char *merchant_host;
+
+ /**
+ * Prefix to the base url of the merchant backend. May be NULL.
+ */
+ char *merchant_prefix_path;
+
+ /**
+ * The id of the order to pay.
+ */
+ char *order_id;
+
+ /**
+ * A WLAN SSID that the wallet can use to connect to the internet in order to
+ * to pay. May be NULL.
+ */
+ char *ssid;
+};
+
+
+/**
* Extracts information from a taler://refund URI.
*
* @param refund_uri the URI to parse.
- * @param[out] merchant_host the hostname of the merchant.
- * @param[out] merchant_prefix_path prefix of the base URL
- * (NULL if not present).
- * @param[out] order_id the id of the order to pay.
- * @param[out] ssid the ssid for internet connectivity (NULL if not present).
- * @return GNUNET_OK on success, GNUNET_SYSERR otherwise.
+ * @param[out] parse_data data extracted from the URI. Must be free'd.
+ * @return GNUNET_SYSERR if @e refund_uri is malformed, GNUNET_OK otherwise.
*/
int
-TALER_MERCHANT_parse_refund_uri (const char *refund_uri,
- const char **merchant_host,
- const char **merchant_prefix_path,
- const char **order_id,
- const char **ssid);
+TALER_MERCHANT_parse_refund_uri (
+ const char *refund_uri,
+ struct TALER_MERCHANT_RefundUriData *parse_data);
+
+
+/**
+ * Frees data contained in the result of parsing a taler://refund URI.
+ *
+ * @param parse_data the data to free.
+ */
+void
+TALER_MERCHANT_parse_refund_uri_free (
+ struct TALER_MERCHANT_RefundUriData *parse_data);
/* ********************* /public/config ****************** */