Constructor

Order

new Order(orderId)

Constructor for Order.

Parameter

Name Description

orderId

string

Unique identifier for the order.

Methods

addOtherItems

addOtherItems(items) returns Order

Adds a single item or list of items to the non-cart items list.

Parameter

Name Description

items

(LineItem or Array of LineItem)

Line Items to add.

Returns

Order Returns current constructed Order.

setCart

setCart(cart) returns Order

Set the cart for this order.

Parameter

Name Description

cart

Cart

Cart for this order.

Returns

Order Returns current constructed Order.

setImage

setImage(url, accessibilityText, width, height) returns Order

Sets the image for this order.

Parameters

Name Description

url

string

Image source URL.

accessibilityText

string

Text to replace for image for accessibility.

width

Optional

number

Width of the image.

height

Optional

number

Height of the image.

Returns

Order Returns current constructed Order.

setTermsOfService

setTermsOfService(tos) returns Order

Set the TOS for this order.

Parameter

Name Description

tos

string

String URL of the TOS.

Returns

Order Returns current constructed Order.

setTotalPrice

setTotalPrice(priceType, currencyCode, units, nanos) returns Order

Sets the total price for this order.

Parameters

Name Description

priceType

string

One of TransactionValues.PriceType.

currencyCode

string

Currency code of price.

units

number

Unit count of price.

nanos

Optional

number

Partial unit count of price.

Returns

Order Returns current constructed Order.