Google Cloud Recommendation Engine V1beta1 Client - Class PurchaseTransaction (0.4.12)

Reference documentation and code samples for the Google Cloud Recommendation Engine V1beta1 Client class PurchaseTransaction.

A transaction represents the entire purchase transaction.

Generated from protobuf message google.cloud.recommendationengine.v1beta1.PurchaseTransaction

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ id string

Optional. The transaction ID with a length limit of 128 bytes.

↳ revenue float

Required. Total 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. This field is not required if the event type is refund.

↳ taxes array|Google\Protobuf\Internal\MapField

Optional. All the taxes associated with the transaction.

↳ costs array|Google\Protobuf\Internal\MapField

Optional. All the costs associated with the product. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs. Total product cost such that profit = revenue - (sum(taxes) + sum(costs)) If product_cost is not set, then profit = revenue - tax - shipping - sum(CatalogItem.costs). If CatalogItem.cost is not specified for one of the items, CatalogItem.cost based profit cannot be calculated for this Transaction.

↳ currency_code string

Required. Currency code. Use three-character ISO-4217 code. This field is not required if the event type is refund.

getId

Optional. The transaction ID with a length limit of 128 bytes.

Returns
TypeDescription
string

setId

Optional. The transaction ID with a length limit of 128 bytes.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getRevenue

Required. Total 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. This field is not required if the event type is refund.

Returns
TypeDescription
float

setRevenue

Required. Total 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. This field is not required if the event type is refund.

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getTaxes

Optional. All the taxes associated with the transaction.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setTaxes

Optional. All the taxes associated with the transaction.

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getCosts

Optional. All the costs associated with the product. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs.

Total product cost such that profit = revenue - (sum(taxes) + sum(costs)) If product_cost is not set, then profit = revenue - tax - shipping - sum(CatalogItem.costs). If CatalogItem.cost is not specified for one of the items, CatalogItem.cost based profit cannot be calculated for this Transaction.

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setCosts

Optional. All the costs associated with the product. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs.

Total product cost such that profit = revenue - (sum(taxes) + sum(costs)) If product_cost is not set, then profit = revenue - tax - shipping - sum(CatalogItem.costs). If CatalogItem.cost is not specified for one of the items, CatalogItem.cost based profit cannot be calculated for this Transaction.

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getCurrencyCode

Required. Currency code. Use three-character ISO-4217 code. This field is not required if the event type is refund.

Returns
TypeDescription
string

setCurrencyCode

Required. Currency code. Use three-character ISO-4217 code. This field is not required if the event type is refund.

Parameter
NameDescription
var string
Returns
TypeDescription
$this