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

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

Namespace

Google \ Cloud \ RecommendationEngine \ V1beta1

Methods

__construct

Constructor.

Parameters
Name Description
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
Type Description
string

setId

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

Parameter
Name Description
var string
Returns
Type Description
$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
Type Description
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
Name Description
var float
Returns
Type Description
$this

getTaxes

Optional. All the taxes associated with the transaction.

Returns
Type Description
Google\Protobuf\Internal\MapField

setTaxes

Optional. All the taxes associated with the transaction.

Parameter
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$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
Type Description
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
Name Description
var array|Google\Protobuf\Internal\MapField
Returns
Type Description
$this

getCurrencyCode

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

Returns
Type Description
string

setCurrencyCode

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

Parameter
Name Description
var string
Returns
Type Description
$this