# Class CustomerPaymentInstrument

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

Represents any payment instrument stored in the customers profile, 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 number of the bank 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 registered and authenticated, and the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS  </li>  </ul>  Otherwise, the method returns the masked driver's license number of the bank account. |
| [bankAccountNumber](#bankaccountnumber): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                 | Returns the bank 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,  the current customer is registered and authenticated, the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS  </li>  </ul>  Otherwise, the method returns the masked bank account number.                                                               |
| [creditCardNumber](#creditcardnumber): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md) `(read-only)`                   | Returns the decrypted credit card number if the calling context meets  the following criteria: <br/>  <ul>  <li>  If the method call happens in the context of a storefront request,  the current customer is registered and authenticated, the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS.                                                                                                                                  |

## 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.customer.CustomerPaymentInstrument.md#getbankaccountdriverslicense)() | Returns the driver's license number of the bank 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 registered and authenticated, and the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS  </li>  </ul>  Otherwise, the method returns the masked driver's license number of the bank account. |
| [getBankAccountNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.CustomerPaymentInstrument.md#getbankaccountnumber)()                 | Returns the bank 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,  the current customer is registered and authenticated, the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS  </li>  </ul>  Otherwise, the method returns the masked bank account number.                                                               |
| [getCreditCardNumber](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.CustomerPaymentInstrument.md#getcreditcardnumber)()                   | Returns the decrypted credit card number if the calling context meets  the following criteria: <br/>  <ul>  <li>  If the method call happens in the context of a storefront request,  the current customer is registered and authenticated, the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS.                                                                                                                                  |

### 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 number of the bank 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 registered and authenticated, and the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS

    Otherwise, the method returns the masked driver's license number of the bank account.

    **Note:** this method handles sensitive financial and card holder data.
    Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9.

***

### bankAccountNumber

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

    - If the method call happens in the context of a storefront request,  the current customer is registered and authenticated, the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS

    Otherwise, the method returns the masked bank account number.

    **Note:** this method handles sensitive financial and card holder data.
    Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9.

***

### creditCardNumber

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

    - If the method call happens in the context of a storefront request,  the current customer is registered and authenticated, the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS.

    Otherwise, the method returns the masked credit card number.

    **Note:** this method handles sensitive financial and card holder data.
    Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9.

***

## Method Details

### getBankAccountDriversLicense()

- getBankAccountDriversLicense(): [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)
  - : Returns the driver's license number of the bank 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 registered and authenticated, and the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS

    Otherwise, the method returns the masked driver's license number of the bank account.

    **Note:** this method handles sensitive financial and card holder data.
    Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9.

***

### getBankAccountNumber()

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

    - If the method call happens in the context of a storefront request,  the current customer is registered and authenticated, the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS

    Otherwise, the method returns the masked bank account number.

    **Note:** this method handles sensitive financial and card holder data.
    Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9.

***

### getCreditCardNumber()

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

    - If the method call happens in the context of a storefront request,  the current customer is registered and authenticated, the payment  instrument is associated to the profile of the current customer, and  the current protocol is HTTPS.

    Otherwise, the method returns the masked credit card number.

    **Note:** this method handles sensitive financial and card holder data.
    Pay special attention to PCI DSS v3. requirements 1, 3, 7, and 9.

***
