aboutsummaryrefslogtreecommitdiff
path: root/src/product.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/product.h')
-rw-r--r--src/product.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/product.h b/src/product.h
new file mode 100644
index 0000000..8b8fd61
--- /dev/null
+++ b/src/product.h
@@ -0,0 +1,67 @@
+/*
+ This file is part of TALER
+ Copyright (C) 2019 GNUnet e.V.
+
+ TALER is free software; you can redistribute it and/or modify it under the
+ terms of the GNU General Public License as published by the Free Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ TALER is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more
+details.
+
+ You should have received a copy of the GNU General Public License
+along with
+ TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
+*/
+
+/**
+* @file product.h
+* @brief defined a product order with the attributes of the product and
+the links used to communicate with taler. Provides setter methods to set
+the attributes.
+* @author BOSS Marco
+*/
+
+#ifndef PRODUCT_H
+#define PRODUCT_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+typedef struct TalerResponse{
+ char *string;
+ size_t size;
+} TalerResponse;
+
+typedef struct ProductOrder{
+ char *product;
+ char *currency;
+ char *amount;
+ char *orderRequest;
+ char *orderID;
+ char *checkUrl;
+ char *payUrl;
+ bool paid;
+ TalerResponse *response;
+} ProductOrder;
+
+
+int product_init( ProductOrder *product, const char* currency );
+
+void product_exit( ProductOrder *product );
+
+void product_reset( ProductOrder *product );
+
+int product_set_check_url( ProductOrder *product );
+
+int product_set_order_id( ProductOrder *product );
+
+int product_set_pay_url( ProductOrder *product );
+
+int product_set_paid_status( ProductOrder *product );
+
+#endif // PRODUCT_H