1
getAssetsManager(): IAssetsManager
ts
copy

Get an instance of IAssetsManager, which can be used to load and manage Primer's checkout assets.

Returns

IAssetsManager

An instance of IAssetsManager.

IAssetsManager
getPaymentMethodAsset
(type: PaymentMethodType) => Promise<ButtonPaymentMethodAsset | null>

Retrieves the asset for a given PaymentMethodType. Returns a promise that resolves to the asset or null if the asset is not available.

Parameters
type
PaymentMethodType

One of PaymentMethodType.

Returns
The background color of the payment method button.
Properties
colored
stringRequired
The color to use when theme is colored.
dark
stringRequired
The color to use when theme is dark.
light
stringRequired
The color to use when theme is light.
iconUrl
object
The URL of the payment method icon that is displayed on the payment method button.
Properties
colored
stringRequired
The color to use when theme is colored.
dark
stringRequired
The color to use when theme is dark.
light
stringRequired
The color to use when theme is light.
⚠️ This property is Deprecated. Please use buttonText or displayName instead.

The name of the payment method that is displayed on the payment method button. Optional.
The name of the payment method that is displayed on the payment method button. This will be null for payment methods without a button title. Optional.
The name of the payment method. Optional.
getCardNetworkAsset
(cardNetwork: string) => Promise<CardNetworkAsset>

Retrieves the asset for a given card network. Returns a promise that resolves to the asset object.

Parameters

The network value, for example: VISA, MASTERCARD.

Returns
cardUrl
string
The URL for retrieving the asset in a "card" style.

The name of the card network.
Can be used as alt and title for the image.