diff options
Diffstat (limited to 'src/backend/melted/merchant.h')
-rw-r--r-- | src/backend/melted/merchant.h | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/src/backend/melted/merchant.h b/src/backend/melted/merchant.h new file mode 100644 index 00000000..c66131ed --- /dev/null +++ b/src/backend/melted/merchant.h | |||
@@ -0,0 +1,110 @@ | |||
1 | /* | ||
2 | This file is part of TALER | ||
3 | (C) 2014 Christian Grothoff (and other contributing authors) | ||
4 | |||
5 | TALER is free software; you can redistribute it and/or modify it under the | ||
6 | terms of the GNU 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. If not, If not, see <http://www.gnu.org/licenses/> | ||
15 | */ | ||
16 | |||
17 | /** | ||
18 | * @file merchant/merchant.c | ||
19 | * @brief Common utility functions for merchant | ||
20 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | ||
21 | */ | ||
22 | |||
23 | #ifndef MERCHANT_H | ||
24 | #define MERCHANT_H | ||
25 | |||
26 | #include <gnunet/gnunet_common.h> | ||
27 | #include <gnunet/gnunet_crypto_lib.h> | ||
28 | |||
29 | /** | ||
30 | * A mint | ||
31 | */ | ||
32 | struct MERCHANT_MintInfo { | ||
33 | /** | ||
34 | * Hostname | ||
35 | */ | ||
36 | char *hostname; | ||
37 | |||
38 | /** | ||
39 | * The public key of the mint | ||
40 | */ | ||
41 | struct GNUNET_CRYPTO_EddsaPublicKey pubkey; | ||
42 | |||
43 | /** | ||
44 | * The port where the mint's service is running | ||
45 | */ | ||
46 | uint16_t port; | ||
47 | |||
48 | }; | ||
49 | |||
50 | |||
51 | /** | ||
52 | * Parses mints from the configuration. | ||
53 | * | ||
54 | * @param cfg the configuration | ||
55 | * @param mints the array of mints upon successful parsing. Will be NULL upon | ||
56 | * error. | ||
57 | * @return the number of mints in the above array; GNUNET_SYSERR upon error in | ||
58 | * parsing. | ||
59 | */ | ||
60 | int | ||
61 | TALER_MERCHANT_parse_mints (const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
62 | struct MERCHANT_MintInfo **mints); | ||
63 | |||
64 | |||
65 | GNUNET_NETWORK_STRUCT_BEGIN | ||
66 | struct MERCHANT_WIREFORMAT_Sepa | ||
67 | { | ||
68 | /** | ||
69 | * The international bank account number | ||
70 | */ | ||
71 | char *iban; | ||
72 | |||
73 | /** | ||
74 | * Name of the bank account holder | ||
75 | */ | ||
76 | char *name; | ||
77 | |||
78 | /** | ||
79 | *The bank identification code | ||
80 | */ | ||
81 | char *bic; | ||
82 | |||
83 | /** | ||
84 | * The latest payout date when the payment corresponding to this account has | ||
85 | * to take place. A value of 0 indicates a transfer as soon as possible. | ||
86 | */ | ||
87 | struct GNUNET_TIME_AbsoluteNBO payout; | ||
88 | }; | ||
89 | GNUNET_NETWORK_STRUCT_END | ||
90 | |||
91 | /** | ||
92 | * Parse the SEPA information from the configuration. If any of the required | ||
93 | * fileds is missing return NULL. | ||
94 | * | ||
95 | * @param cfg the configuration | ||
96 | * @return Sepa details as a structure; NULL upon error | ||
97 | */ | ||
98 | struct MERCHANT_WIREFORMAT_Sepa * | ||
99 | TALER_MERCHANT_parse_wireformat_sepa (const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
100 | |||
101 | |||
102 | /** | ||
103 | * Destroy and free resouces occupied by the wireformat structure | ||
104 | * | ||
105 | * @param wf the wireformat structure | ||
106 | */ | ||
107 | void | ||
108 | TALER_MERCHANT_destroy_wireformat_sepa (struct MERCHANT_WIREFORMAT_Sepa *wf); | ||
109 | |||
110 | #endif /* MERCHANT_H */ | ||