Google Cloud Discovery Engine V1beta Client - Class TransactionInfo (0.11.3)

Reference documentation and code samples for the Google Cloud Discovery Engine V1beta Client class TransactionInfo.

A transaction represents the entire purchase transaction.

Generated from protobuf message google.cloud.discoveryengine.v1beta.TransactionInfo

Namespace

Google \ Cloud \ DiscoveryEngine \ V1beta

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ value float

Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.

↳ currency string

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

↳ transaction_id string

The transaction ID with a length limit of 128 characters.

↳ 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 = value - tax - cost

↳ discount_value float

The total discount(s) value applied to this transaction. This figure should be excluded from TransactionInfo.value For example, if a user paid TransactionInfo.value amount, then nominal (pre-discount) value of the transaction is the sum of TransactionInfo.value and TransactionInfo.discount_value This means that profit is calculated the same way, regardless of the discount value, and that TransactionInfo.discount_value can be larger than TransactionInfo.value: * Profit = value - tax - cost

getValue

Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.

Returns
Type Description
float

hasValue

clearValue

setValue

Required. Total non-zero value associated with the transaction. This value may include shipping, tax, or other adjustments to the total value that you want to include.

Parameter
Name Description
var float
Returns
Type Description
$this

getCurrency

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

Returns
Type Description
string

setCurrency

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

Parameter
Name Description
var string
Returns
Type Description
$this

getTransactionId

The transaction ID with a length limit of 128 characters.

Returns
Type Description
string

setTransactionId

The transaction ID with a length limit of 128 characters.

Parameter
Name Description
var string
Returns
Type Description
$this

getTax

All the taxes associated with the transaction.

Returns
Type Description
float

hasTax

clearTax

setTax

All the taxes associated with the transaction.

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

Returns
Type Description
float

hasCost

clearCost

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:

Parameter
Name Description
var float
Returns
Type Description
$this

getDiscountValue

The total discount(s) value applied to this transaction.

This figure should be excluded from TransactionInfo.value For example, if a user paid TransactionInfo.value amount, then nominal (pre-discount) value of the transaction is the sum of TransactionInfo.value and TransactionInfo.discount_value This means that profit is calculated the same way, regardless of the discount value, and that TransactionInfo.discount_value can be larger than TransactionInfo.value:

Returns
Type Description
float

hasDiscountValue

clearDiscountValue

setDiscountValue

The total discount(s) value applied to this transaction.

This figure should be excluded from TransactionInfo.value For example, if a user paid TransactionInfo.value amount, then nominal (pre-discount) value of the transaction is the sum of TransactionInfo.value and TransactionInfo.discount_value This means that profit is calculated the same way, regardless of the discount value, and that TransactionInfo.discount_value can be larger than TransactionInfo.value:

Parameter
Name Description
var float
Returns
Type Description
$this