From 7f934ce683df5252fa6350dcc15e187b1c7623cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 25 Sep 2022 10:20:12 +0800 Subject: Rename remaining icclient to interchange --- interchange/ord.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 interchange/ord.h (limited to 'interchange/ord.h') diff --git a/interchange/ord.h b/interchange/ord.h new file mode 100644 index 0000000..c62bcf0 --- /dev/null +++ b/interchange/ord.h @@ -0,0 +1,37 @@ +#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); +void interchange_ord_checkout(const struct interchange_ord_order *order, const struct interchange_member *member); +void interchange_ord_free(struct interchange_ord_order *order); + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3