> ## Documentation Index
> Fetch the complete documentation index at: https://primer.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getPaymentMethodResource

Call this method to retrieve resources for a given `paymentMethodType`.

```kotlin KOTLIN theme={"dark"}
@Throws(SdkUninitializedException::class)
@JvmStatic
fun getPaymentMethodResource(
  context: Context,
  paymentMethodType: String
): PrimerPaymentMethodResource
```

## Parameters

**Parameters**

**context** `Context` *required*

Android [Context](https://developer.android.com/reference/android/content/Context.html) of
your `Activity` or `Fragment`.

**paymentMethodType** `String` *required*

A unique string identifier for the payment method. Supported payment methods for current client session are returned in [onAvailablePaymentMethodsLoaded](https://primer.io/docs/sdk/android/v2.x.x/primer-headless-checkout/listeners/PrimerHeadlessUniversalCheckoutListener.md#onavailablepaymentmethodsloaded) callback.

## Returns

**PrimerPaymentMethodResource**

**PrimerPaymentMethodAsset**

**Properties**

**paymentMethodType** `String` *required*

A unique string identifier for the payment method. Supported payment methods for current client session are returned in [onAvailablePaymentMethodsLoaded](https://primer.io/docs/sdk/android/v2.x.x/primer-headless-checkout/listeners/PrimerHeadlessUniversalCheckoutListener.md#onavailablepaymentmethodsloaded) callback.

**paymentMethodName** `String` *required*

A user friendly English localized string identifier for the payment method.

**paymentMethodLogo** `PrimerPaymentMethodLogo` *required*

**Properties**

**colored** `Drawable?`

A `Drawable` to be used anywhere.

**dark** `Drawable?`

A `Drawable` to be used on dark theme.

**light** `Drawable?`

A `Drawable` to be used on light theme.

**paymentMethodBackgroundColor** `PrimerPaymentMethodBackgroundColor` *required*

**Properties**

**colored** `@ColorInt Int?`

A `@ColorInt` to be used anywhere.

**dark** `@ColorInt Int?`

A `@ColorInt` to be used on dark theme.

**light** `@ColorInt Int?`

A `@ColorInt` to be used on light theme.

**PrimerPaymentMethodNativeView**

**Properties**

**paymentMethodType** `String` *required*

A unique string identifier for the payment method. Supported payment methods for current client session are returned in [onAvailablePaymentMethodsLoaded](https://primer.io/docs/sdk/android/v2.x.x/primer-headless-checkout/listeners/PrimerHeadlessUniversalCheckoutListener.md#onavailablepaymentmethodsloaded) callback.

**paymentMethodName** `String` *required*

A user friendly English localized string identifier for the payment method.

**createView** `createView: (Context) -\> View` *required*

A function to create a native view.

## Throws

**Throws**

**SdkUninitializedException**

An exception that will be thrown in case the SDK was not initialized properly.
Before calling any of the manager's method, the SDK must be initialized using [start](https://primer.io/docs/sdk/android/v2.x.x/primer-headless-checkout/methods/start.md) method.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.