diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-08-09 23:28:56 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-08-09 23:28:56 -0400 |
commit | 119de8db9e317e46ebe800524b806809d2b435b0 (patch) | |
tree | 737423707c1004bf86bcbb801c97cda1b256e8e3 /src/include/taler_merchant_service.h | |
parent | ef6fed10b06bef0ba7d9003b594c8e994665229f (diff) | |
download | merchant-119de8db9e317e46ebe800524b806809d2b435b0.tar.gz merchant-119de8db9e317e46ebe800524b806809d2b435b0.tar.bz2 merchant-119de8db9e317e46ebe800524b806809d2b435b0.zip |
implement parser for taler_pay_uri
Diffstat (limited to 'src/include/taler_merchant_service.h')
-rw-r--r-- | src/include/taler_merchant_service.h | 67 |
1 files changed, 51 insertions, 16 deletions
diff --git a/src/include/taler_merchant_service.h b/src/include/taler_merchant_service.h index 19438f97..b33941aa 100644 --- a/src/include/taler_merchant_service.h +++ b/src/include/taler_merchant_service.h @@ -137,28 +137,63 @@ TALER_MERCHANT_baseurl_add_instance (const char *base_url, /** + * Contains information gathered from parsing a taler://pay URI. + */ +struct TALER_MERCHANT_PayUriData +{ + /** + * 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; + + /** + * Session id to use when paying the order. May be NULL. + */ + char *session_id; + + /** + * Claim token to use when claiming the order. May be NULL. + */ + struct TALER_ClaimTokenP *claim_token; + + /** + * 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://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. + * @param[out] parse_data data extracted from the URI. Must be free'd. + * @return GNUNET_SYSERR if @e pay_uri is malformed, GNUNET_OK 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); + struct TALER_MERCHANT_PayUriData *parse_data); + + +/** + * Frees data contained in the result of parsing a taler://pay URI. + * + * @param parse_data the data to free. + */ +void +TALER_MERCHANT_parse_pay_uri_free ( + struct TALER_MERCHANT_PayUriData *parse_data); /** |