From 55605272856e9acefaa3cebcb81acef4806752fe Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Thu, 6 Aug 2020 21:28:14 -0400 Subject: spec for uri parsing methods --- src/include/taler_merchant_service.h | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'src/include/taler_merchant_service.h') diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index ca391e10..19438f97 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -136,6 +136,50 @@ TALER_MERCHANT_baseurl_add_instance (const char *base_url, const char *instance_id); +/** + * Extracts information from a taler://pay URI. + * + * @param pay_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] session_id the session id to use for payment + * (NULL if not present). + * @param[out] claim_token the claim token needed to claim the order + * (zeroed if not present). + * @param[out] ssid the ssid for internet connectivity (NULL if not present). + * @return GNUNET_OK on success, GNUNET_SYSERR otherwise. + */ +int +TALER_MERCHANT_parse_pay_uri (const char *pay_uri, + const char **merchant_host, + const char **merchant_prefix_path, + const char **order_id, + const char **session_id, + struct GNUNET_HashCode *claim_token, + const 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. + */ +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); + + /* ********************* /public/config ****************** */ -- cgit v1.2.3