JSMA orders
Overview
The JSMA orders provides access to the orders (JSMA order) in the instance.
What can JSMA orders do for me?
You can use the JSMA orders to access and manipulate orders in the database
Index
Usage
writing data
Here is an example on how to write data to a JSMA orders:
... orders.createFromCart(cart, [uuid]) ...
reading data
Here is an example on how to read data from a JSMA orders:
... orders.findOrderItemByUuid(uuid) ...
Methods
The JSMA orders provides the following methods:
orders.create(portal)
Creates an order in a given portal
Example
... orders.create(portal) ...
Parameter portal (required)
orders.createFromCart(cart, [uuid])
Creates an order in a given cart
Example
... orders.createFromCart(cart, [uuid]) ...
Parameter cart (required)
Parameter uuid (optional)
orders.createFromCartWithPaypal(cart, token, payerId)
Creates an order in a given cart with paypal
Example
... orders.createFromCartWithPaypal(cart, token, payerId) ...
Parameter cart (required)
Parameter token (required)
Parameter payerId (required)
orders.current
Returns the current order
Example
... orders.current ...
orders.find(query, [options={}])
The function signature orders.find(query, [limit]) is deprecated and will produce a warning in log files.
Finding an order matching the given parameter in query
Example
... orders.find(query, { limit: 1000, page: 2 }) orders.find(query, [limit]) // deprecated ...
Parameter query (required)
Parameter options:object (optional)
orders.findById(id)
Finds an order by the given id
Avoid usage of findById
Ids change whenever a package is reimported. So please avoid using ids whenever possible. Also delivering contents to users by id might make it possible for users to flip through the files (and by that see contents of others possibly) by changing the ids in requests.
Example
... orders.findById(id) ...
Parameter id (required)
orders.findByUuid(uuid)
Finds an order by the given uuid
Example
... orders.findByUuid(uuid) ...
Parameter uuid (required)
orders.findOrderItemByUuid(uuid)
Findes an order that contains an orderItem with the given uuid
Example
... orders.findOrderItemByUuid(uuid) ...
Parameter uuid (required)
orders.findOrderItems(query, [limit])
Finds orderItems matching the given paramenters in query
Example
... orders.findOrderItems(query, [limit]) ...