libinterchange
Data Structures | Macros | Functions
ord.h File Reference
#include "interchange/typedefs.h"

Go to the source code of this file.

Data Structures

struct  interchange_ord_item
 
struct  interchange_ord_order
 
struct  interchange_ord_transaction
 

Macros

#define interchange_ord_remove(a, b, c, d)   interchange_ord_update(a, 0, b, c, d)
 For removing an item from a cart.
 

Functions

void interchange_ord_order (const char *sku, const char *item, const unsigned int quantity, const char *options[][2], void(*parser)(interchange_response *))
 For putting an item to a cart.
 
void interchange_ord_update (const char *name, const unsigned int quantity, const char *orderpage, const char *nextpage, void(*parser)(interchange_response *))
 For updating the quantity of an item in a cart.
 
void interchange_ord_checkout (const char *order_profile, struct interchange_member member, void(*handler)(interchange_response *))
 For checking out items in the cart.
 
void interchange_ord_free_order (struct interchange_ord_order *order)
 
void interchange_ord_clear_transaction (struct interchange_ord_transaction *transaction)
 

Macro Definition Documentation

◆ interchange_ord_remove

#define interchange_ord_remove (   a,
  b,
  c,
 
)    interchange_ord_update(a, 0, b, c, d)

For removing an item from a cart.

Parameters
nameThe name given, in the cart, to the item.
orderpageThe order page, by default it's ord/basket.
nextpageThe page to expect response from, whatever the result is.
parserFunction for parsing the formatted response.

Function Documentation

◆ interchange_ord_checkout()

void interchange_ord_checkout ( const char *  order_profile,
struct interchange_member  member,
void(*)(interchange_response *)  handler 
)

For checking out items in the cart.

Parameters
order_profileThe order profile/method.
memberThe member checking out.
handlerA pointer to the function when a custom handler is needed to arrange the data into the product.

◆ interchange_ord_clear_transaction()

void interchange_ord_clear_transaction ( struct interchange_ord_transaction transaction)

◆ interchange_ord_free_order()

void interchange_ord_free_order ( struct interchange_ord_order order)

◆ interchange_ord_order()

void interchange_ord_order ( const char *  sku,
const char *  item,
const unsigned int  quantity,
const char *  options[][2],
void(*)(interchange_response *)  parser 
)

For putting an item to a cart.

Parameters
skuThe product or variant SKU of the item to order.
itemThe product SKU of the item to order.
quantityThe quantity of the item to order.
optionsAny additional pairs of custom options.
parserFunction for parsing the formatted response.

◆ interchange_ord_update()

void interchange_ord_update ( const char *  name,
const unsigned int  quantity,
const char *  orderpage,
const char *  nextpage,
void(*)(interchange_response *)  parser 
)

For updating the quantity of an item in a cart.

Parameters
nameThe name given, in the cart, to the item.
quantityThe desired quantity.
orderpageThe order page, by default it's ord/basket.
nextpageThe page to expect response from, whatever the result is.
parserFunction for parsing the formatted response.