# Class PaymentTransaction

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [dw.object.PersistentObject](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.PersistentObject.md)
    - [dw.object.ExtensibleObject](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.ExtensibleObject.md)
      - [dw.order.PaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md)

The PaymentTransaction class represents a payment transaction.

## Constant Summary

| Constant                                                                                                                                        | Description                                                                   |
| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| [TYPE_AUTH](#type_auth): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "AUTH"                            | Constant representing the authorization type of payment transaction.          |
| [TYPE_AUTH_REVERSAL](#type_auth_reversal): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "AUTH_REVERSAL" | Constant representing the authorization reversal type of payment transaction. |
| [TYPE_CAPTURE](#type_capture): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "CAPTURE"                   | Constant representing the capture type of payment transaction.                |
| [TYPE_CREDIT](#type_credit): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "CREDIT"                      | Constant representing the credit type of payment transaction.                 |

## Property Summary

| Property                                                                                                                                                                  | Description                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [accountID](#accountid): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)                                                               | Returns the payment service-specific account id.                                                                                  |
| [accountType](#accounttype): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)                                                           | Returns the payment service-specific account type.                                                                                |
| [amount](#amount): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)                                                                       | Returns the amount of the transaction.                                                                                            |
| [paymentInstrument](#paymentinstrument): [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md) `(read-only)` | Returns the payment instrument related to this payment transaction.                                                               |
| [paymentProcessor](#paymentprocessor): [PaymentProcessor](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentProcessor.md)                             | Returns the payment processor related to this payment transaction.                                                                |
| [transactionID](#transactionid): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)                                                       | Returns the payment service-specific transaction id.                                                                              |
| [type](#type): [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)                                                                   | Returns the value of the transaction type where the  value is one of TYPE_AUTH, TYPE_AUTH_REVERSAL, TYPE_CAPTURE  or TYPE_CREDIT. |

## Constructor Summary

This class does not have a constructor, so you cannot create it directly.

## Method Summary

| Method                                                                                                                                                                                                                                                  | Description                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [getAccountID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#getaccountid)()                                                                                                                                     | Returns the payment service-specific account id.                                                                                  |
| [getAccountType](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#getaccounttype)()                                                                                                                                 | Returns the payment service-specific account type.                                                                                |
| [getAmount](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#getamount)()                                                                                                                                           | Returns the amount of the transaction.                                                                                            |
| [getPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#getpaymentinstrument)()                                                                                                                     | Returns the payment instrument related to this payment transaction.                                                               |
| [getPaymentProcessor](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#getpaymentprocessor)()                                                                                                                       | Returns the payment processor related to this payment transaction.                                                                |
| [getTransactionID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#gettransactionid)()                                                                                                                             | Returns the payment service-specific transaction id.                                                                              |
| [getType](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#gettype)()                                                                                                                                               | Returns the value of the transaction type where the  value is one of TYPE_AUTH, TYPE_AUTH_REVERSAL, TYPE_CAPTURE  or TYPE_CREDIT. |
| [setAccountID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#setaccountidstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                             | Sets the payment service-specific account id.                                                                                     |
| [setAccountType](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#setaccounttypestring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                         | Sets the payment service-specific account type.                                                                                   |
| [setAmount](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#setamountmoney)([Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md))                                                      | Sets the amount of the transaction.                                                                                               |
| [setPaymentProcessor](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#setpaymentprocessorpaymentprocessor)([PaymentProcessor](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentProcessor.md)) | Sets the payment processor related to this payment transaction.                                                                   |
| [setTransactionID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#settransactionidstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                     | Sets the payment service-specific transaction id.                                                                                 |
| [setType](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md#settypestring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                       | Sets the value of the transaction type where permissible  values are TYPE_AUTH, TYPE_AUTH_REVERSAL, TYPE_CAPTURE or TYPE_CREDIT.  |

### Methods inherited from class ExtensibleObject

[describe](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.ExtensibleObject.md#describe), [getCustom](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.ExtensibleObject.md#getcustom)

### Methods inherited from class PersistentObject

[getCreationDate](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.PersistentObject.md#getcreationdate), [getLastModified](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.PersistentObject.md#getlastmodified), [getUUID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.object.PersistentObject.md#getuuid)

### Methods inherited from class Object

[assign](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#assignobject-object), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject), [create](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#createobject-object), [defineProperties](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertiesobject-object), [defineProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#definepropertyobject-object-object), [entries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#entriesobject), [freeze](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#freezeobject), [fromEntries](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#fromentriesiterable), [getOwnPropertyDescriptor](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertydescriptorobject-object), [getOwnPropertyNames](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertynamesobject), [getOwnPropertySymbols](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getownpropertysymbolsobject), [getPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#getprototypeofobject), [hasOwnProperty](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#hasownpropertystring), [is](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isobject-object), [isExtensible](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isextensibleobject), [isFrozen](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isfrozenobject), [isPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#isprototypeofobject), [isSealed](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#issealedobject), [keys](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#keysobject), [preventExtensions](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#preventextensionsobject), [propertyIsEnumerable](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#propertyisenumerablestring), [seal](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#sealobject), [setPrototypeOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#setprototypeofobject-object), [toLocaleString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tolocalestring), [toString](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#tostring), [valueOf](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valueof), [values](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md#valuesobject)

## Constant Details

### TYPE_AUTH

- TYPE_AUTH: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "AUTH"
  - : Constant representing the authorization type of payment transaction.

***

### TYPE_AUTH_REVERSAL

- TYPE_AUTH_REVERSAL: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "AUTH_REVERSAL"
  - : Constant representing the authorization reversal type of payment transaction.

***

### TYPE_CAPTURE

- TYPE_CAPTURE: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "CAPTURE"
  - : Constant representing the capture type of payment transaction.

***

### TYPE_CREDIT

- TYPE_CREDIT: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) = "CREDIT"
  - : Constant representing the credit type of payment transaction.

***

## Property Details

### accountID

- accountID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the payment service-specific account id.

***

### accountType

- accountType: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the payment service-specific account type.

***

### amount

- amount: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)
  - : Returns the amount of the transaction.

***

### paymentInstrument

- paymentInstrument: [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md) `(read-only)`
  - : Returns the payment instrument related to this payment transaction.

***

### paymentProcessor

- paymentProcessor: [PaymentProcessor](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentProcessor.md)
  - : Returns the payment processor related to this payment transaction.

***

### transactionID

- transactionID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the payment service-specific transaction id.

***

### type

- type: [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)
  - : Returns the value of the transaction type where the
    value is one of TYPE_AUTH, TYPE_AUTH_REVERSAL, TYPE_CAPTURE
    or TYPE_CREDIT.

***

## Method Details

### getAccountID()

- getAccountID(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the payment service-specific account id.

    **Returns:**

    - the payment service-specific account id.

***

### getAccountType()

- getAccountType(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the payment service-specific account type.

    **Returns:**

    - the payment service-specific account type.

***

### getAmount()

- getAmount(): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)
  - : Returns the amount of the transaction.

    **Returns:**

    - the amount of the transaction.

***

### getPaymentInstrument()

- getPaymentInstrument(): [OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md)
  - : Returns the payment instrument related to this payment transaction.

    **Returns:**

    - the order payment instrument related to this payment transaction.

***

### getPaymentProcessor()

- getPaymentProcessor(): [PaymentProcessor](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentProcessor.md)
  - : Returns the payment processor related to this payment transaction.

    **Returns:**

    - the payment processor related to this payment transaction.

***

### getTransactionID()

- getTransactionID(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the payment service-specific transaction id.

    **Returns:**

    - the payment service-specific transaction id.

***

### getType()

- getType(): [EnumValue](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.EnumValue.md)
  - : Returns the value of the transaction type where the
    value is one of TYPE_AUTH, TYPE_AUTH_REVERSAL, TYPE_CAPTURE
    or TYPE_CREDIT.

    **Returns:**

    - the value of the transaction type where the
      value is one of TYPE_AUTH, TYPE_AUTH_REVERSAL, TYPE_CAPTURE
      or TYPE_CREDIT.

***

### setAccountID(String)

- setAccountID(accountID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets the payment service-specific account id.

    **Parameters:**

    - accountID - the payment service-specific account id.

***

### setAccountType(String)

- setAccountType(accountType: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets the payment service-specific account type.

    **Parameters:**

    - accountType - the payment service-specific account type.

***

### setAmount(Money)

- setAmount(amount: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)): void
  - : Sets the amount of the transaction.

    **Parameters:**

    - amount - the amount of the transaction.

***

### setPaymentProcessor(PaymentProcessor)

- setPaymentProcessor(paymentProcessor: [PaymentProcessor](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentProcessor.md)): void
  - : Sets the payment processor related to this payment transaction.

    **Parameters:**

    - paymentProcessor - the payment processor related to this payment transaction.

***

### setTransactionID(String)

- setTransactionID(transactionID: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets the payment service-specific transaction id.

    **Parameters:**

    - transactionID - the payment service-specific transaction id.

***

### setType(String)

- setType(type: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): void
  - : Sets the value of the transaction type where permissible
    values are TYPE_AUTH, TYPE_AUTH_REVERSAL, TYPE_CAPTURE or TYPE_CREDIT.

    **Parameters:**

    - type - the value of the transaction type where the  value is one of TYPE_AUTH, TYPE_AUTH_REVERSAL, TYPE_CAPTURE or TYPE_CREDIT.

***
