merchant

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

taler_merchantdb_lib.h (2993B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2014, 2015, 2016, 2020 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 3, 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 General Public License for more details.
     12 
     13   You should have received a copy of the GNU General Public License along with
     14   TALER; see the file COPYING.GPL.  If not, see <http://www.gnu.org/licenses/>
     15 */
     16 
     17 /**
     18  * @file taler_merchantdb_lib.h
     19  * @brief database helper functions used by the merchant backend
     20  * @author Sree Harsha Totakura <sreeharsha@totakura.in>
     21  */
     22 #ifndef TALER_MERCHANTDB_LIB_H
     23 #define TALER_MERCHANTDB_LIB_H
     24 
     25 #include <taler/taler_util.h>
     26 #include "taler_merchantdb_plugin.h"
     27 
     28 /**
     29  * Handle to interact with the database.
     30  */
     31 struct TALER_MERCHANTDB_Plugin;
     32 
     33 /**
     34  * Connect to postgresql database
     35  *
     36  * @param cfg the configuration handle
     37  * @return connection to the database; NULL upon error
     38  */
     39 struct TALER_MERCHANTDB_Plugin *
     40 TALER_MERCHANTDB_plugin_load (const struct GNUNET_CONFIGURATION_Handle *cfg);
     41 
     42 
     43 /**
     44  * Disconnect from the database
     45  *
     46  * @param dbh database handle to close
     47  */
     48 void
     49 TALER_MERCHANTDB_plugin_unload (struct TALER_MERCHANTDB_Plugin *dbh);
     50 
     51 
     52 /**
     53  * Free members of @a pd, but not @a pd itself.
     54  *
     55  * @param[in] pd product details to clean up
     56  */
     57 void
     58 TALER_MERCHANTDB_product_details_free (
     59   struct TALER_MERCHANTDB_ProductDetails *pd);
     60 
     61 
     62 /**
     63  * Free members of @a tp, but not @a tp itself.
     64  *
     65  * @param[in] tp template details to clean up
     66  */
     67 void
     68 TALER_MERCHANTDB_template_details_free (
     69   struct TALER_MERCHANTDB_TemplateDetails *tp);
     70 
     71 
     72 /**
     73  * Free members of @a wb, but not @a wb itself.
     74  *
     75  * @param[in] wb webhook details to clean up
     76  */
     77 void
     78 TALER_MERCHANTDB_webhook_details_free (
     79   struct TALER_MERCHANTDB_WebhookDetails *wb);
     80 
     81 /**
     82  * Free members of @a pwb, but not @a pwb itself.
     83  *
     84  * @param[in] pwb pending webhook details to clean up
     85  */
     86 void
     87 TALER_MERCHANTDB_pending_webhook_details_free (
     88   struct TALER_MERCHANTDB_PendingWebhookDetails *pwb);
     89 
     90 
     91 /**
     92  * Free members of @a tf, but not @a tf itself.
     93  *
     94  * @param[in] tf token family details to clean up
     95  */
     96 void
     97 TALER_MERCHANTDB_token_family_details_free (
     98   struct TALER_MERCHANTDB_TokenFamilyDetails *tf);
     99 
    100 
    101 /**
    102  * Free members of @a cd, but not @a cd itself.
    103  *
    104  * @param[in] cd token family details to clean up
    105  */
    106 void
    107 TALER_MERCHANTDB_category_details_free (
    108   struct TALER_MERCHANTDB_CategoryDetails *cd);
    109 
    110 /**
    111  * Free members of @a ud, but not @a ud itself.
    112  *
    113  * @param[in] ud unit details to clean up
    114  */
    115 void
    116 TALER_MERCHANTDB_unit_details_free (
    117   struct TALER_MERCHANTDB_UnitDetails *ud);
    118 
    119 #endif  /* MERCHANT_DB_H */
    120 
    121 /* end of taler_merchantdb_lib.h */