# Class OrderPaymentInstrument

- [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.customer.EncryptedObject](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.EncryptedObject.md)
        - [dw.order.PaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md)
          - [dw.order.OrderPaymentInstrument](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md)

Represents any payment instrument used to pay orders, such as credit card
or bank transfer. The object defines standard methods for credit card
payment, and can be extended by attributes appropriate for other
payment methods.

## Property Summary

| Property                                                                                                                                                            | Description                                                                                                                                                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [bankAccountDriversLicense](#bankaccountdriverslicense): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`           | Returns the driver's license associated with a bank account if the calling  context meets the following criteria: <br/>  <ul>  <li>  If the method call happens in the context of a storefront request and  the current customer is identical to the customer related to the basket  or order, and the current protocol is HTTPS. |
| [bankAccountNumber](#bankaccountnumber): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                           | Returns the account number if the calling context meets  the following criteria: <br/>  <ul>  <li>  If the method call happens in the context of a storefront request and  the current customer is identical to the customer related to the basket  or order, and the current protocol is HTTPS.                                  |
| [capturedAmount](#capturedamount): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`                                   | Returns the sum of the captured amounts.                                                                                                                                                                                                                                                                                          |
| [creditCardNumber](#creditcardnumber): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                             | Returns the de-crypted creditcard number if the calling context meets  the following criteria: <br/>  <ul>  <li>  If the method call happens in the context of a storefront request and  the current authenticated customer is referenced by the basket or order, and the current protocol is HTTPS.                              |
| [paymentTransaction](#paymenttransaction): [PaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md) `(read-only)` | Returns the Payment Transaction for this Payment Instrument or null.                                                                                                                                                                                                                                                              |
| [refundedAmount](#refundedamount): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`                                   | Returns the sum of the refunded amounts.                                                                                                                                                                                                                                                                                          |

## Constructor Summary

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

## Method Summary

| Method                                                                                                                                                  | Description                                                                                                                                                                                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [getBankAccountDriversLicense](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md#getbankaccountdriverslicense)() | Returns the driver's license associated with a bank account if the calling  context meets the following criteria: <br/>  <ul>  <li>  If the method call happens in the context of a storefront request and  the current customer is identical to the customer related to the basket  or order, and the current protocol is HTTPS. |
| [getBankAccountNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md#getbankaccountnumber)()                 | Returns the account number if the calling context meets  the following criteria: <br/>  <ul>  <li>  If the method call happens in the context of a storefront request and  the current customer is identical to the customer related to the basket  or order, and the current protocol is HTTPS.                                  |
| [getCapturedAmount](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md#getcapturedamount)()                       | Returns the sum of the captured amounts.                                                                                                                                                                                                                                                                                          |
| [getCreditCardNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md#getcreditcardnumber)()                   | Returns the de-crypted creditcard number if the calling context meets  the following criteria: <br/>  <ul>  <li>  If the method call happens in the context of a storefront request and  the current authenticated customer is referenced by the basket or order, and the current protocol is HTTPS.                              |
| [getPaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md#getpaymenttransaction)()               | Returns the Payment Transaction for this Payment Instrument or null.                                                                                                                                                                                                                                                              |
| [getRefundedAmount](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.OrderPaymentInstrument.md#getrefundedamount)()                       | Returns the sum of the refunded amounts.                                                                                                                                                                                                                                                                                          |

### Methods inherited from class PaymentInstrument

[getBankAccountDriversLicense](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankaccountdriverslicense), [getBankAccountDriversLicenseLastDigits](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankaccountdriverslicenselastdigits), [getBankAccountDriversLicenseLastDigits](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankaccountdriverslicenselastdigitsnumber), [getBankAccountDriversLicenseStateCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankaccountdriverslicensestatecode), [getBankAccountHolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankaccountholder), [getBankAccountNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankaccountnumber), [getBankAccountNumberLastDigits](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankaccountnumberlastdigits), [getBankAccountNumberLastDigits](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankaccountnumberlastdigitsnumber), [getBankRoutingNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getbankroutingnumber), [getCreditCardExpirationMonth](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardexpirationmonth), [getCreditCardExpirationYear](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardexpirationyear), [getCreditCardHolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardholder), [getCreditCardIssueNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardissuenumber), [getCreditCardNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardnumber), [getCreditCardNumberLastDigits](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardnumberlastdigits), [getCreditCardNumberLastDigits](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardnumberlastdigitsnumber), [getCreditCardToken](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardtoken), [getCreditCardType](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardtype), [getCreditCardValidFromMonth](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardvalidfrommonth), [getCreditCardValidFromYear](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getcreditcardvalidfromyear), [getEncryptedBankAccountDriversLicense](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getencryptedbankaccountdriverslicensestring-string), [getEncryptedBankAccountNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getencryptedbankaccountnumberstring-string), [getEncryptedCreditCardNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getencryptedcreditcardnumberstring-certificateref), [getEncryptedCreditCardNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getencryptedcreditcardnumberstring-string), [getGiftCertificateCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getgiftcertificatecode), [getGiftCertificateID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getgiftcertificateid), [getMaskedBankAccountDriversLicense](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getmaskedbankaccountdriverslicense), [getMaskedBankAccountDriversLicense](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getmaskedbankaccountdriverslicensenumber), [getMaskedBankAccountNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getmaskedbankaccountnumber), [getMaskedBankAccountNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getmaskedbankaccountnumbernumber), [getMaskedCreditCardNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getmaskedcreditcardnumber), [getMaskedCreditCardNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getmaskedcreditcardnumbernumber), [getMaskedGiftCertificateCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getmaskedgiftcertificatecode), [getMaskedGiftCertificateCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getmaskedgiftcertificatecodenumber), [getPaymentMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#getpaymentmethod), [isCreditCardExpired](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#iscreditcardexpired), [isPermanentlyMasked](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#ispermanentlymasked), [setBankAccountDriversLicense](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setbankaccountdriverslicensestring), [setBankAccountDriversLicenseStateCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setbankaccountdriverslicensestatecodestring), [setBankAccountHolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setbankaccountholderstring), [setBankAccountNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setbankaccountnumberstring), [setBankRoutingNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setbankroutingnumberstring), [setCreditCardExpirationMonth](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardexpirationmonthnumber), [setCreditCardExpirationYear](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardexpirationyearnumber), [setCreditCardHolder](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardholderstring), [setCreditCardIssueNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardissuenumberstring), [setCreditCardNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardnumberstring), [setCreditCardToken](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardtokenstring), [setCreditCardType](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardtypestring), [setCreditCardValidFromMonth](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardvalidfrommonthnumber), [setCreditCardValidFromYear](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setcreditcardvalidfromyearnumber), [setGiftCertificateCode](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setgiftcertificatecodestring), [setGiftCertificateID](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentInstrument.md#setgiftcertificateidstring)

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

## Property Details

### bankAccountDriversLicense

- bankAccountDriversLicense: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the driver's license associated with a bank account if the calling
    context meets the following criteria:

    - If the method call happens in the context of a storefront request and  the current customer is identical to the customer related to the basket  or order, and the current protocol is HTTPS.
    - If the method call happens in the context of the business manager and the  current user has permission to the Orders module.

    Otherwise, the method throws an exception.

***

### bankAccountNumber

- bankAccountNumber: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the account number if the calling context meets
    the following criteria:

    - If the method call happens in the context of a storefront request and  the current customer is identical to the customer related to the basket  or order, and the current protocol is HTTPS.
    - If the method call happens in the context of the business manager and the  current user has permissions to the Orders module.

    Otherwise, the method throws an exception.

***

### capturedAmount

- capturedAmount: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`
  - : Returns the sum of the captured amounts. The captured amounts
    are calculated on the fly. Associate a payment capture for an Payment Instrument with an Invoice
    using Invoice method addCaptureTransaction.

***

### creditCardNumber

- creditCardNumber: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`
  - : Returns the de-crypted creditcard number if the calling context meets
    the following criteria:

    - If the method call happens in the context of a storefront request and  the current authenticated customer is referenced by the basket or order, and the current protocol is HTTPS.
    - If the customer is anonymous, and the order references this customer, and the protocol is secure and  the order status is CREATED.
    - If the method call happens in the context of the business manager and the  current user has the permission to manage orders.
    - If the payment information has not been masked as a result of the data retention security policy  for the site.

    Otherwise, the method returns the masked credit card number.

***

### paymentTransaction

- paymentTransaction: [PaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md) `(read-only)`
  - : Returns the Payment Transaction for this Payment Instrument or null.

***

### refundedAmount

- refundedAmount: [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md) `(read-only)`
  - : Returns the sum of the refunded amounts. The refunded amounts
    are calculated on the fly. Associate a payment refund for an Payment Instrument with an Invoice
    using Invoice method addRefundTransaction.

***

## Method Details

### getBankAccountDriversLicense()

- getBankAccountDriversLicense(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the driver's license associated with a bank account if the calling
    context meets the following criteria:

    - If the method call happens in the context of a storefront request and  the current customer is identical to the customer related to the basket  or order, and the current protocol is HTTPS.
    - If the method call happens in the context of the business manager and the  current user has permission to the Orders module.

    Otherwise, the method throws an exception.

    **Returns:**

    - the driver's license number if the calling context meets the
      necessary criteria.

***

### getBankAccountNumber()

- getBankAccountNumber(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the account number if the calling context meets
    the following criteria:

    - If the method call happens in the context of a storefront request and  the current customer is identical to the customer related to the basket  or order, and the current protocol is HTTPS.
    - If the method call happens in the context of the business manager and the  current user has permissions to the Orders module.

    Otherwise, the method throws an exception.

    **Returns:**

    - the account number if the calling context meets the
      necessary criteria.

***

### getCapturedAmount()

- getCapturedAmount(): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)
  - : Returns the sum of the captured amounts. The captured amounts
    are calculated on the fly. Associate a payment capture for an Payment Instrument with an Invoice
    using Invoice method addCaptureTransaction.

    **Returns:**

    - sum of captured amounts

***

### getCreditCardNumber()

- getCreditCardNumber(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the de-crypted creditcard number if the calling context meets
    the following criteria:

    - If the method call happens in the context of a storefront request and  the current authenticated customer is referenced by the basket or order, and the current protocol is HTTPS.
    - If the customer is anonymous, and the order references this customer, and the protocol is secure and  the order status is CREATED.
    - If the method call happens in the context of the business manager and the  current user has the permission to manage orders.
    - If the payment information has not been masked as a result of the data retention security policy  for the site.

    Otherwise, the method returns the masked credit card number.

    **Returns:**

    - the de-crypted creditcard number if the calling context meets the
      necessary criteria.

***

### getPaymentTransaction()

- getPaymentTransaction(): [PaymentTransaction](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentTransaction.md)
  - : Returns the Payment Transaction for this Payment Instrument or null.

    **Returns:**

    - the Payment Transaction for this Payment Instrument or null.

***

### getRefundedAmount()

- getRefundedAmount(): [Money](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.value.Money.md)
  - : Returns the sum of the refunded amounts. The refunded amounts
    are calculated on the fly. Associate a payment refund for an Payment Instrument with an Invoice
    using Invoice method addRefundTransaction.

    **Returns:**

    - sum of refunded amounts

***
