# Class PaymentMgr

- [TopLevel.Object](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Object.md)
  - [dw.order.PaymentMgr](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md)

[PaymentMgr](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md) is used to access payment methods and payment
cards of the current site.

To access payment methods and payment cards explicitly, use methods
[getPaymentMethod(String)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md#getpaymentmethodstring) and [getPaymentCard(String)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md#getpaymentcardstring).

To access active payment methods use method [getActivePaymentMethods()](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md#getactivepaymentmethods).

To access applicable payment methods for a customer, country and/or payment
amount use method [getApplicablePaymentMethods(Customer, String, Number)](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md#getapplicablepaymentmethodscustomer-string-number).

## Property Summary

| Property                                                                                                                                   | Description                                                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [activePaymentMethods](#activepaymentmethods): [List](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.List.md) `(read-only)` | Returns the sorted list of all enabled payment methods of the current  site, regardless of any customer group, country, payment amount or currency  restrictions. |

## Constructor Summary

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

## Method Summary

| Method                                                                                                                                                                                                                                                                                                                                                                                                                                  | Description                                                                                                                                                       |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| static [getActivePaymentMethods](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md#getactivepaymentmethods)()                                                                                                                                                                                                                                                                                                | Returns the sorted list of all enabled payment methods of the current  site, regardless of any customer group, country, payment amount or currency  restrictions. |
| static [getApplicablePaymentMethods](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md#getapplicablepaymentmethodscustomer-string-number)([Customer](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.Customer.md), [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)) | Returns the sorted list of all enabled payment methods of the current  site applicable for the session currency, specified customer, country and payment amount.  |
| static [getPaymentCard](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md#getpaymentcardstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                                                          | Returns the payment card for the specified cardType or null if no such  card exists in the current site.                                                          |
| static [getPaymentMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMgr.md#getpaymentmethodstring)([String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md))                                                                                                                                                                                                                      | Returns the payment method for the specified ID or null if no such method  exists in the current site.                                                            |

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

### activePaymentMethods

- activePaymentMethods: [List](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.List.md) `(read-only)`
  - : Returns the sorted list of all enabled payment methods of the current
    site, regardless of any customer group, country, payment amount or currency
    restrictions. The payment methods are sorted as defined in the Business
    Manager.

***

## Method Details

### getActivePaymentMethods()

- static getActivePaymentMethods(): [List](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.List.md)
  - : Returns the sorted list of all enabled payment methods of the current
    site, regardless of any customer group, country, payment amount or currency
    restrictions. The payment methods are sorted as defined in the Business
    Manager.

    **Returns:**

    - List of enabled payment methods of current site

***

### getApplicablePaymentMethods(Customer, String, Number)

- static getApplicablePaymentMethods(customer: [Customer](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.customer.Customer.md), countryCode: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md), paymentAmount: [Number](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.Number.md)): [List](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.util.List.md)
  - : Returns the sorted list of all enabled payment methods of the current
    site applicable for the session currency, specified customer, country and payment amount.
    The payment methods are sorted as defined in the Business Manager.

    A payment method is applicable if

    - the method is restricted by customer group, and at least one of  the groups of the specified customer is assigned to the method

    - the method is restricted by billing country, and the specified  country code is assigned to the method

    - the method is restricted by payment amount for the session currency,  and the specified payment amount is within the limits of the min/max  payment amount defined for the method and the session currency

    - the method is restricted by currency code, and the specified  currency code matches session currency.

    All parameters are optional, and if not specified, the respective
    restriction won't be validated. For example, if a method is restricted
    by billing country, but no country code is specified, this method will
    be returned, unless it is filtered out by customer group or payment
    amount.

    **Parameters:**

    - customer - Customer or null
    - countryCode - Billing country code or null
    - paymentAmount - Payment amount or null

    **Returns:**

    - List of applicable payment methods of current site

***

### getPaymentCard(String)

- static getPaymentCard(cardType: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [PaymentCard](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentCard.md)
  - : Returns the payment card for the specified cardType or null if no such
    card exists in the current site.

    **Parameters:**

    - cardType - PaymentCard type

    **Returns:**

    - PaymentCard or null

***

### getPaymentMethod(String)

- static getPaymentMethod(id: [String](/docs/commerce/b2c-commerce/references/b2c-script-api/TopLevel.String.md)): [PaymentMethod](/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.PaymentMethod.md)
  - : Returns the payment method for the specified ID or null if no such method
    exists in the current site.

    **Parameters:**

    - id - PaymentMethod ID

    **Returns:**

    - PaymentMethod or null

***
