Checkout SDK

The FFL checkout SDK is designed to integrate FFL dealer selection interface into any client side javascript based application. The SDK expects only few set of parameters, and it opens the dealer list into an iframe. When user selects the FFL dealer, it returns the information of selected dealer on a provided callback.

Usage

Include the SDK into head

The SDK is deployed on CDN and can be directly included using script tag, preferably inside head element.

<script src="https://libs.masterffl.com/ffl-select/select-sdk/17.0.0/ffl-select-sdk.js" async=true></script>

Initialize the SDK with options

SDK exposes a dealer selector class, which can be simply used as follows:

const fflSelect = new FFLCheckoutSDK.FFLDealerSelector(zipCode, containerId, storeDomain, dealerSelectionCallback, options);

The meaning of each parameter is described below:

Parameter NameDescriptionExample
zipCodeA valid US zipcode where you want the SDK to show the dealer list.30075
containerIdA selector which can be used as a parent element, under which SDK creates an iframe.#dealer-selector-parent
storeDomainThe domain of your store, this is used for licensing purpose. This typically must match the domain of your page, otherwise handshake will fail.masterffl.com
dealerSelectionCallbackA javascript callback where SDK notifies you when the dealer is selected.
optionsA list of options to alter the default SDK behavior. A full list of options is documented in the next section.

Full list of SDK options

OptionDescriptionDefaultExamples
googleMapKeyA google map key which is required to enable the map view in dealer selection. If this is not provided, map view will not be available.
distanceThe distance in miles which should be used to search the dealers. A valid value is in between 1-50.10
onlyNFADealersIf this is true, then SDK will only show the dealers who are capable to process NFA transfers.false
includeAcceptingNonFFLSellersBy default, the dealers who do not accept transfers from non-ffl sellers (individuals), are excluded in the listing. This can be overridden by passing true to this option.false
headerColorThe color of the dialog header. You can specify any valid RGB color in hex format.#000000#FF0000
buttonColorThe color of the selection button. You can specify any valid RGB color in hex format.#000000#FF0000
envModeThe environment to be used for dealer list. By default it points to production, but can be switched to lower environment for initial testing.prodqa/prod
allowZipCodeEditsWhen set to True the zip code input should be enabled and user can edit the zip code.false
hideHeaderHides the dialog header when set to true. Useful when the host application already provides its own header and wants to maximize available space.false

To show the FFL selection dialog, just use the show method:

fflSelect.show();

A full Example

const fflSelect = new FFLCheckoutSDK.FFLDealerSelector('30075', '#dealer-selector-parent', 'masterffl.com', (dealer) => {}, {distance: 20});

fflSelect.show();

Working with the callback

As mentioned above, SDK accepts a Javascript callback, which returns the selected dealer information. Callback is a standard Javascript function with just one parameter, which contains the dealer attributes. The schema of the dealer object is as follows:

{
  fflLicenseNumber: string,
  tradeName: string,
  contact: {
    phoneNumber: string,
    address: {
      street1: string,
      city: string,
      state: string,
      zipCode: string,
    }
  },
  isOptedOutForTransferFromNonFFLSeller: true,
  masterFFLTransferPIN: string
}


Did this page help you?