2021-08-23 17:39:03 +00:00
|
|
|
const { customerBilling, customerShipping } = require('./shared');
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A basic order.
|
|
|
|
*
|
|
|
|
* For more details on the order properties, see:
|
|
|
|
*
|
|
|
|
* https://woocommerce.github.io/woocommerce-rest-api-docs/#order-properties
|
|
|
|
*/
|
2021-09-07 22:20:44 +00:00
|
|
|
const order = {
|
|
|
|
payment_method: '',
|
|
|
|
payment_method_title: '',
|
|
|
|
status: 'pending',
|
|
|
|
set_paid: false,
|
|
|
|
currency: 'USD',
|
|
|
|
customer_note: '',
|
|
|
|
customer_id: 0,
|
|
|
|
billing: customerBilling,
|
|
|
|
shipping: customerShipping,
|
|
|
|
line_items: [],
|
|
|
|
shipping_lines: [],
|
|
|
|
fee_lines: [],
|
|
|
|
coupon_lines: [],
|
|
|
|
};
|
2021-08-23 17:39:03 +00:00
|
|
|
|
|
|
|
const productLineItems = {
|
2021-08-24 01:25:07 +00:00
|
|
|
name: '',
|
|
|
|
product_id: '',
|
2021-08-23 17:39:03 +00:00
|
|
|
variation_id: 0,
|
|
|
|
quantity: 0,
|
2021-08-24 01:25:07 +00:00
|
|
|
tax_class: '',
|
|
|
|
subtotal: '',
|
|
|
|
total: '',
|
2021-09-07 22:20:44 +00:00
|
|
|
};
|
2021-08-23 17:39:03 +00:00
|
|
|
|
|
|
|
const shippingLines = {
|
2021-08-24 01:25:07 +00:00
|
|
|
method_title: '',
|
2021-09-07 22:20:44 +00:00
|
|
|
method_id: 'flat_rate',
|
2021-08-24 01:25:07 +00:00
|
|
|
total: '',
|
2021-09-07 22:20:44 +00:00
|
|
|
};
|
2021-08-23 17:39:03 +00:00
|
|
|
|
|
|
|
const feeLines = {
|
2021-09-07 22:20:44 +00:00
|
|
|
name: 'Fee',
|
2021-08-24 01:25:07 +00:00
|
|
|
tax_class: '',
|
2021-09-07 22:20:44 +00:00
|
|
|
tax_status: 'none',
|
2021-08-24 01:25:07 +00:00
|
|
|
total: '',
|
2021-09-07 22:20:44 +00:00
|
|
|
};
|
2021-08-23 17:39:03 +00:00
|
|
|
|
|
|
|
const couponLines = {
|
2021-09-07 22:20:44 +00:00
|
|
|
code: '10off',
|
|
|
|
};
|
2021-08-23 17:39:03 +00:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
order,
|
|
|
|
productLineItems,
|
|
|
|
shippingLines,
|
|
|
|
feeLines,
|
|
|
|
couponLines,
|
2021-09-07 22:20:44 +00:00
|
|
|
};
|