Widget configuration

Most stores need two attributes. Everything else is optional and only changes the look.

The essentials

Every widget needs to know who you are and where your price is. With these two attributes and the default settings, the widget is ready to go live.

<scalapay-widget
  merchant-token="YOUR_MERCHANT_TOKEN"
  amount-selectors='["#product-price"]'
></scalapay-widget>
AttributeWhat it tells the widget
merchant-tokenWho you are, so it shows the plans in your contract
amount-selectorsWhere the price is, so it can calculate the installments and follow price changes

Then add type for pages other than the product page, and locale if your site isn't in English.


Recipes

Copy the one that matches your case.

My site is in another language

Set locale to the page language: it, fr, es, de, pt or en. The currency symbol moves to the usual position for that language.

<scalapay-widget locale="it" merchant-token="YOUR_MERCHANT_TOKEN" amount-selectors='["#product-price"]'></scalapay-widget>

I show a sale price and a regular price

List both selectors, the sale price first. The widget uses the first one that holds a valid amount.

amount-selectors='[".price .sale", ".price .regular"]'

My prices use a dot for decimals

For prices written like 1,299.00:

amount-separator="."

The price isn't in the page

If a script calculates the price and no element holds it, pass it directly. amount is used only when amount-selectors finds nothing.

amount="300,64"

I want a smaller widget

Hide the info band, use the small font and remove the grey background.

info-band="hidden" font-size="small" background="false"

My site has a dark theme

Use always for a site that is always dark, system to follow the customer's device setting.

dark-mode="always"

I want the widget only within a price range

Narrow the range in which the widget appears. You can narrow your contract limits but not widen them.

min-amount="100" max-amount="1500"

I want to set every option

The full tag for each page type, with every attribute that page accepts set explicitly. Leave out any attribute you don't need: it falls back to its default. The attribute reference lists the values and defaults.

<scalapay-widget
  type="product"
  merchant-token="YOUR_MERCHANT_TOKEN"
  environment="production"
  amount-selectors='["#product-price"]'
  amount="99.90"
  amount-separator=","
  min-amount="5"
  max-amount="2000"
  currency-position="after"
  locale="en"
  channel=""
  info-band="visible"
  background="true"
  font-size="normal"
  dark-mode="never"
  logo-color="black"
  alignment="left"
  max-width="auto"
></scalapay-widget>
<scalapay-widget
  type="cart"
  merchant-token="YOUR_MERCHANT_TOKEN"
  environment="production"
  amount-selectors='["#cart-total"]'
  amount="99.90"
  amount-separator=","
  min-amount="5"
  max-amount="2000"
  currency-position="after"
  locale="en"
  channel=""
  info-band="visible"
  background="true"
  font-size="normal"
  dark-mode="never"
  logo-color="black"
  alignment="left"
  max-width="auto"
></scalapay-widget>
<scalapay-widget
  type="listing"
  merchant-token="YOUR_MERCHANT_TOKEN"
  environment="production"
  amount-selectors='[".catalog .card .amount"]'
  position-selectors='[".catalog .card .actions"]'
  amount-separator=","
  min-amount="5"
  max-amount="2000"
  currency-position="after"
  locale="en"
  channel=""
  background="true"
  font-size="small"
  dark-mode="never"
  logo-color="black"
  alignment="left"
  max-width="auto"
></scalapay-widget>
<scalapay-widget
  type="checkout"
  merchant-token="YOUR_MERCHANT_TOKEN"
  environment="production"
  amount-selectors='["#order-total"]'
  amount="99.90"
  amount-separator=","
  min-amount="5"
  max-amount="2000"
  currency-position="after"
  locale="en"
  dark-mode="never"
  alignment="left"
  max-width="auto"
></scalapay-widget>

amount is used only when amount-selectors finds no price. An empty channel means the standard text. min-amount and max-amount must stay within your contract limits. On listing, position-selectors is required.

I sell travel

The text then refers to bookings instead of purchases.

channel="travel"
🚧

What you can't change

The text, the costs shown and the link to the details window follow the consumer credit rules, including CCD2. No attribute changes them. If a setting looks missing, that's usually why.


Attribute reference

The attribute works on that page type. It has no effect there.

Required

AttributeDescriptionValuesDefaultProductListingCartCheckout
merchant-tokenIdentifies your store and its contractYour token, from Developer in the Merchant Portal, or from your acquirer setup. Test token: 8KDS3SPELNone
amount-selectorsWhere the widget reads the priceJSON array of CSS selectorsNone
position-selectorsRequired on listing. Where the label goes in each product cardJSON array of CSS selectors. The label goes after the matched elementNone

Page and environment

AttributeDescriptionValuesDefaultProductListingCartCheckout
typeThe page the widget is onproduct · listing · cart · checkoutproduct
environmentTest or live environment. Must match your tokenintegration · productionproduction

Price

AttributeDescriptionValuesDefaultProductListingCartCheckout
amountFixed price, used if amount-selectors finds noneA price, e.g. 99.90None
amount-separatorDecimal separator in your prices, · .,
min-amount / max-amountPrice range in which the widget appearsWithin your contract limitsContract limits
currency-positionCurrency symbol before or after the amountbefore · afterDepends on locale

Language

AttributeDescriptionValuesDefaultProductListingCartCheckout
localeLanguage of the widget texten · it · fr · es · de · pten
channelTravel wording: bookings instead of purchasestravelNone

Look

AttributeDescriptionValuesDefaultProductListingCartCheckout
info-bandBand listing all the ways to payvisible · hiddenvisible
backgroundGrey background behind the widgettrue · falsetrue, false on listing
font-sizeText sizenormal · smallnormal
dark-modeVersion for dark backgroundsnever · always · systemnever
logo-colorColor of the Scalapay logoblack · pinkblack
alignmentText alignmentleft · center · rightleft
max-widthMaximum width in its containerauto or a percentage of the container, e.g. 60%auto
📘

Settings saved for your account

Widget settings saved for your account, for example in the Merchant Portal, take precedence over the attributes on your tag. Change them where they were saved.


Release notes

Release notes are in the widget changelog.