merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

patch-private-templates-TEMPLATE_ID.h (2544B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2014-2026 Taler Systems SA
      4 
      5   TALER is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU Lesser General Public License as published by the Free Software
      7   Foundation; either version 2.1, or (at your option) any later version.
      8 
      9   TALER is distributed in the hope that it will be useful, but WITHOUT ANY
     10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11   A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
     12 
     13   You should have received a copy of the GNU Lesser General Public License along with
     14   TALER; see the file COPYING.LGPL.  If not, see
     15   <http://www.gnu.org/licenses/>
     16 */
     17 /**
     18  * @file include/taler/taler-merchant/patch-private-templates-TEMPLATE_ID.h
     19  * @brief C interface for PATCH /private/templates/$TEMPLATE_ID of the merchant backend
     20  * @author Christian Grothoff
     21  */
     22 #ifndef _TALER_MERCHANT__PATCH_PRIVATE_TEMPLATES_TEMPLATE_ID_H
     23 #define _TALER_MERCHANT__PATCH_PRIVATE_TEMPLATES_TEMPLATE_ID_H
     24 
     25 #include <taler/taler-merchant/common.h>
     26 
     27 
     28 /**
     29  * Handle for a PATCH /private/templates/$TEMPLATE_ID request.
     30  */
     31 struct TALER_MERCHANT_TemplatePatchHandle;
     32 
     33 
     34 /**
     35  * Callback for a PATCH /private/templates/$TEMPLATE_ID request.
     36  *
     37  * @param cls closure
     38  * @param hr HTTP response details
     39  */
     40 typedef void
     41 (*TALER_MERCHANT_TemplatePatchCallback)(
     42   void *cls,
     43   const struct TALER_MERCHANT_HttpResponse *hr);
     44 
     45 
     46 /**
     47  * Issue a PATCH /private/templates/$TEMPLATE_ID request to update a template.
     48  *
     49  * @param ctx CURL context to use
     50  * @param backend_url base URL of the merchant backend
     51  * @param template_id identifier of the template to update
     52  * @param template_description new human-readable description
     53  * @param otp_id new OTP device ID, or NULL to remove association
     54  * @param template_contract new template contract (JSON)
     55  * @param cb callback to invoke with the result
     56  * @param cb_cls closure for @a cb
     57  * @return handle for the request, NULL on hard error
     58  */
     59 struct TALER_MERCHANT_TemplatePatchHandle *
     60 TALER_MERCHANT_template_patch (
     61   struct GNUNET_CURL_Context *ctx,
     62   const char *backend_url,
     63   const char *template_id,
     64   const char *template_description,
     65   const char *otp_id,
     66   json_t *template_contract,
     67   TALER_MERCHANT_TemplatePatchCallback cb,
     68   void *cb_cls);
     69 
     70 
     71 /**
     72  * Cancel a PATCH /private/templates/$TEMPLATE_ID request.
     73  *
     74  * @param[in] tph handle to cancel
     75  */
     76 void
     77 TALER_MERCHANT_template_patch_cancel (
     78   struct TALER_MERCHANT_TemplatePatchHandle *tph);
     79 
     80 
     81 #endif