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

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
NameDescription
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
TypeDescription
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
NameDescription
var float
Returns
TypeDescription
$this

getCurrency

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

Returns
TypeDescription
string

setCurrency

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

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getTransactionId

The transaction ID with a length limit of 128 characters.

Returns
TypeDescription
string

setTransactionId

The transaction ID with a length limit of 128 characters.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getTax

All the taxes associated with the transaction.

Returns
TypeDescription
float

hasTax

clearTax

setTax

All the taxes associated with the transaction.

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:

  • Profit = value - tax - cost
Returns
TypeDescription
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:

  • Profit = value - tax - cost
Parameter
NameDescription
var float
Returns
TypeDescription
$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:

  • Profit = value - tax - cost
Returns
TypeDescription
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:

  • Profit = value - tax - cost
Parameter
NameDescription
var float
Returns
TypeDescription
$this