There are five types of manager that can be returned by this function,
depending on the type provided as first argument:
Card, Native, Redirect, Klarna Payment Method and ACH.In case the type specified is not supported, the function will return null instead.
Called when Headless Checkout detects BIN data from the card number entered by the user. This callback provides detailed information about the card including issuer details and card attributes.Makes available an event of type BinDataAvailableEvent.
All the detected card networks, including the ones that are not allowed. For co-badged cards, this array contains multiple networks.To get the list of selectable networks for co-badged cards, use:[preferred, ...alternatives].filter(n => n.allowed)
This happens when 8 digits or more are entered in the card number field.Headless Checkout retrieved the BIN data using Primer’s BIN data service. This provides the most accurate information including issuer details.
This happens when less than 8 digits are entered in the card number field, or when Headless Checkout fails to contact Primer’s BIN data service.Headless Checkout retrieved the card networks using static information bundled with the SDK. This information can only identify international card networks and does not include issuer details.
Called when BIN data is being fetched from Primer’s servers. Use this to show a loading indicator while card network and issuer information is being retrieved.Makes available a loading parameter of type boolean.
true when BIN data retrieval starts
false when BIN data retrieval completes (followed by an onBinDataAvailable callback)
Deprecated: This callback is deprecated. Use onBinDataAvailable instead, which provides richer BIN data including issuer information and card attributes.
Called when Headless Checkout detects new card networks from the card number entered by the user.Makes available an event of type CardNetworkChangeEvent.
All the detected card networks, including the ones that are not allowed.Use the following snippet to get the card network that should be presented to the user:detectedCardNetworks.preferred ?? detectedCardNetworks.items[0]
In case the card has zero or only one network that is allowed, undefined. Otherwise, all the allowed cards.Use this to show the card networks the user can choose from in the case of a co-badged cards.
This happens when less than 8 digits are entered in the cardnumber field.Headless Checkout retrieved the card networks using static information bundled with the SDK. This information can only identify international cards.
Create an instance of the IKlarnaPaymentMethodManager, which can be used to manage Klarna specific payment methods which also require an extra form and user interaction.
A callback that is called when the payment categories for Klarna have
changed. Sends back an array with the values needed to render the payment
categories for Klarna.
This function starts the payment process. It should be called with the
selected payment method category id, when the user has selected and
confirmed the desired payment category. The payment method category id which
needs to be sent to the start function can be retrieved from the
onPaymentMethodCategoriesChange function
This function is used so that Klarna can render the selected payment
category details (paymentMethodCategoryId) in a DOM element (containerId).
It uses a callback (onHeightChange) to inform when the height of the
contianer has changed.
Create an instance of the IAchPaymentMethodManager, which can be used to manage ACH payment methods which also require an extra form and the mandate confirmation.
Stripe Publishable Key, used to interact with Stripe’s SDK and collect the bank account details, necessary for the STRIPE_ACH payment method. The Publishable Key can be found in the Stripe Dashboard API keys.
When the payment method is STRIPE_ACH, displays the Stripe UI to collect the bank account details.Throws an error if the start method didn’t run successfully or wasn’t called before.
Submits the mandate confirmation. Should be triggered by a “Confirm” button next to the mandate text.Throws an error if the methods start and collectBankAccountDetails weren’t successfully called before.