blob: 22bf81eb8bc287e299258ba0228afcf88ff3a10f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
#ifndef INTERCHANGE_ORD_H
#define INTERCHANGE_ORD_H
struct interchange_ord_item {
struct interchange_product *product;
unsigned int quantity;
};
struct interchange_ord_order {
double subtotal;
double shipping;
double total_cost;
char *profile;
size_t nitems;
struct interchange_ord_item *items[];
};
#ifdef __cplusplus
extern "C" {
#endif
/*!
* \brief For putting an item to a cart.
* \param sku The SKU of the item to order.
* \param catalog The catalog from which the item is.
* \param order The address of an order instance.
*/
void interchange_ord_order(const char *sku, const struct interchange_catalog *catalog,
struct interchange_ord_order **order);
/*!
* \brief For checking out items in the cart.
* \param order The order to be checked out.
* \param member The member checking out.
* \param handler A pointer to the function when a custom handler is needed to
* arrange the data into the product.
*/
void interchange_ord_checkout(const struct interchange_ord_order *order,
const struct interchange_member *member,
void (*handler)(interchange_response *));
void interchange_ord_free(struct interchange_ord_order *order);
#ifdef __cplusplus
}
#endif
#endif
|