woocommerce/tests/e2e/api-core-tests/data/order.js

69 lines
993 B
JavaScript
Raw Normal View History

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
*/
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-08-23 17:39:03 +00:00
}
const shippingLines = {
2021-08-24 01:25:07 +00:00
method_title: '',
method_id: '',
total: '',
2021-08-23 17:39:03 +00:00
}
const feeLines = {
2021-08-24 01:25:07 +00:00
name: '',
tax_class: '',
tax_status: '',
total: '',
2021-08-23 17:39:03 +00:00
}
const couponLines = {
2021-08-24 01:25:07 +00:00
code: ''
2021-08-23 17:39:03 +00:00
}
const order = {
2021-08-24 01:25:07 +00:00
payment_method: '',
payment_method_title: '',
status: 'pending',
2021-08-23 17:39:03 +00:00
set_paid: false,
2021-08-24 01:25:07 +00:00
currency: 'USD',
customer_note: '',
2021-08-23 17:39:03 +00:00
customer_id: 0,
billing: customerBilling,
shipping: customerShipping,
line_items: [
productLineItems
],
shipping_lines: [
shippingLines
],
fee_lines: [
feeLines
],
coupon_lines: [
couponLines
]
}
module.exports = {
order,
productLineItems,
shippingLines,
feeLines,
couponLines,
}