Google Cloud Retail V2 Client - Class PurchaseTransaction (1.0.1)

Reference documentation and code samples for the Google Cloud Retail V2 Client class PurchaseTransaction.

A transaction represents the entire purchase transaction.

Generated from protobuf message google.cloud.retail.v2.PurchaseTransaction

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ id string

The transaction ID with a length limit of 128 characters.

↳ revenue float

Required. Total non-zero revenue or grand total associated with the transaction. This value include shipping, tax, or other adjustments to total revenue that you want to include as part of your revenue calculations.

↳ tax float

All the taxes associated with the transaction.

↳ cost float

All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that: * Profit = revenue - tax - cost

↳ currency_code string

Required. Currency code. Use three-character ISO-4217 code.

getId

The transaction ID with a length limit of 128 characters.

Generated from protobuf field string id = 1;

Returns
TypeDescription
string

setId

The transaction ID with a length limit of 128 characters.

Generated from protobuf field string id = 1;

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRevenue

Required. Total non-zero revenue or grand total associated with the transaction. This value include shipping, tax, or other adjustments to total revenue that you want to include as part of your revenue calculations.

Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
float

setRevenue

Required. Total non-zero revenue or grand total associated with the transaction. This value include shipping, tax, or other adjustments to total revenue that you want to include as part of your revenue calculations.

Generated from protobuf field float revenue = 2 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getTax

All the taxes associated with the transaction.

Generated from protobuf field float tax = 3;

Returns
TypeDescription
float

setTax

All the taxes associated with the transaction.

Generated from protobuf field float tax = 3;

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getCost

All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that:

Generated from protobuf field float cost = 4;

Returns
TypeDescription
float

setCost

All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that:

Generated from protobuf field float cost = 4;

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getCurrencyCode

Required. Currency code. Use three-character ISO-4217 code.

Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
string

setCurrencyCode

Required. Currency code. Use three-character ISO-4217 code.

Generated from protobuf field string currency_code = 5 [(.google.api.field_behavior) = REQUIRED];

Parameter
NameDescription
var string
Returns
TypeDescription
$this