# Google Cloud Discovery Engine V1 Client - Class TransactionInfo (1.11.1)

1.11.1 (latest) 1.11.0 1.10.1 1.9.1 1.8.0 1.7.0 1.6.1 1.5.1 1.4.0 1.3.3 1.2.0 1.1.0 1.0.0 0.11.3 0.8.0 0.7.1 0.6.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 Reference documentation and code samples for the Google Cloud Discovery Engine V1 Client class TransactionInfo.

A transaction represents the entire purchase transaction.

Generated from protobuf message `google.cloud.discoveryengine.v1.TransactionInfo`

## Namespace

Google \\ Cloud \\ DiscoveryEngine \\ V1

## 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](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__) |
| `↳ discount_value` | `float` The total discount(s) value applied to this transaction. This figure should be excluded from [TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) For example, if a user paid [TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) amount, then nominal (pre-discount) value of the transaction is the sum of [TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) and [TransactionInfo.discount_value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__) This means that profit is calculated the same way, regardless of the discount value, and that [TransactionInfo.discount_value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__) can be larger than [TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__): \* \* Profit = [value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__) |

### 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:

- Profit = [value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__)

| **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:

- Profit = [value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__)

| **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](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)
For example, if a user paid
[TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)
amount, then nominal (pre-discount) value of the transaction is the sum of
[TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)
and
[TransactionInfo.discount_value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__)
This means that profit is calculated the same way, regardless of the
discount value, and that
[TransactionInfo.discount_value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__)
can be larger than
[TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__):

- Profit = [value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__)

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `float` |   |

### hasDiscountValue

### clearDiscountValue

### setDiscountValue

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

This figure should be excluded from
[TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)
For example, if a user paid
[TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)
amount, then nominal (pre-discount) value of the transaction is the sum of
[TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__)
and
[TransactionInfo.discount_value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__)
This means that profit is calculated the same way, regardless of the
discount value, and that
[TransactionInfo.discount_value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getDiscountValue__)
can be larger than
[TransactionInfo.value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__):

- Profit = [value](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getValue__) - [tax](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getTax__) - [cost](https://docs.cloud.google.com/php/docs/reference/cloud-discoveryengine/latest/V1.TransactionInfo#_Google_Cloud_DiscoveryEngine_V1_TransactionInfo__getCost__)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `float` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |