# Discovery Engine V1BETA API - Class Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo (v0.28.0)

0.28.0 (latest) 0.27.0 0.26.0 0.25.0 0.24.0 0.23.1 0.22.0 0.21.0 0.20.1 0.19.1 0.18.0 0.17.0 0.16.0 0.15.0 0.14.2 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.2 0.6.0 0.5.0 0.4.0 0.3.0 0.2.1 0.1.0 Reference documentation and code samples for the Discovery Engine V1BETA API class Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo.

A transaction represents the entire purchase transaction.

## Inherits

- Object

## Extended By

- Google::Protobuf::MessageExts::ClassMethods

## Includes

- Google::Protobuf::MessageExts

## Methods

### #cost

    def cost() -> ::Float

**Returns**

- (::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/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)") - [tax](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_tax_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#tax (method)") - [cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_cost_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#cost (method)")

### #cost=

    def cost=(value) -> ::Float

**Parameter**

- **value** (::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/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)") - [tax](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_tax_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#tax (method)") - [cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_cost_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#cost (method)")
**Returns**

- (::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/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)") - [tax](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_tax_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#tax (method)") - [cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_cost_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#cost (method)")

### #currency

    def currency() -> ::String

**Returns**

- (::String) --- Required. Currency code. Use three-character ISO-4217 code.

### #currency=

    def currency=(value) -> ::String

**Parameter**

- **value** (::String) --- Required. Currency code. Use three-character ISO-4217 code.
**Returns**

- (::String) --- Required. Currency code. Use three-character ISO-4217 code.

### #discount_value

    def discount_value() -> ::Float

**Returns**

- (::Float) --- The total discount(s) value applied to this transaction.
  This figure should be excluded from
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")

  For example, if a user paid
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")
  amount, then nominal (pre-discount) value of the transaction is the sum of
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")
  and
  [TransactionInfo.discount_value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_discount_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#discount_value (method)")

  This means that profit is calculated the same way, regardless of the
  discount value, and that
  [TransactionInfo.discount_value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_discount_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#discount_value (method)")
  can be larger than
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)"):
  - Profit = [value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)") - [tax](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_tax_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#tax (method)") - [cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_cost_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#cost (method)")

### #discount_value=

    def discount_value=(value) -> ::Float

**Parameter**

- **value** (::Float) ---

  The total discount(s) value applied to this transaction.
  This figure should be excluded from
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")

  For example, if a user paid
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")
  amount, then nominal (pre-discount) value of the transaction is the sum of
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")
  and
  [TransactionInfo.discount_value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_discount_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#discount_value (method)")

  This means that profit is calculated the same way, regardless of the
  discount value, and that
  [TransactionInfo.discount_value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_discount_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#discount_value (method)")
  can be larger than
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)"):
  - Profit = [value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)") - [tax](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_tax_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#tax (method)") - [cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_cost_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#cost (method)")
**Returns**

- (::Float) --- The total discount(s) value applied to this transaction.
  This figure should be excluded from
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")

  For example, if a user paid
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")
  amount, then nominal (pre-discount) value of the transaction is the sum of
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)")
  and
  [TransactionInfo.discount_value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_discount_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#discount_value (method)")

  This means that profit is calculated the same way, regardless of the
  discount value, and that
  [TransactionInfo.discount_value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_discount_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#discount_value (method)")
  can be larger than
  [TransactionInfo.value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)"):
  - Profit = [value](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_value_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#value (method)") - [tax](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_tax_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#tax (method)") - [cost](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-discovery_engine-v1beta/latest/Google-Cloud-DiscoveryEngine-V1beta-TransactionInfo#Google__Cloud__DiscoveryEngine__V1beta__TransactionInfo_cost_instance_ "Google::Cloud::DiscoveryEngine::V1beta::TransactionInfo#cost (method)")

### #tax

    def tax() -> ::Float

**Returns**

- (::Float) --- All the taxes associated with the transaction.

### #tax=

    def tax=(value) -> ::Float

**Parameter**

- **value** (::Float) --- All the taxes associated with the transaction.
**Returns**

- (::Float) --- All the taxes associated with the transaction.

### #transaction_id

    def transaction_id() -> ::String

**Returns**

- (::String) --- The transaction ID with a length limit of 128 characters.

### #transaction_id=

    def transaction_id=(value) -> ::String

**Parameter**

- **value** (::String) --- The transaction ID with a length limit of 128 characters.
**Returns**

- (::String) --- The transaction ID with a length limit of 128 characters.

### #value

    def value() -> ::Float

**Returns**

- (::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.

### #value=

    def value=(value) -> ::Float

**Parameter**

- **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.
**Returns**

- (::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.