twisto-payment-widget

Checkout widget for payment selection. Shows all available Twisto payment options — Pay in 30 days and Pay in 3 — or a single product when product is specified. Includes a brief explanation of each option and a "Learn more" link.

Step 1: Add this script to the page ⬇️

<script src="https://cdn.twistopay.com/widget/twisto-widget.js" async></script>

Step 2: Insert the widget at checkout where payment methods are listed ⬇️

All products — omit product to show both Pay in 30 days and Pay in 3. Requires amount and currency:

<twisto-payment-widget amount="AMOUNT" currency="CZK" language="en" ></twisto-payment-widget>

Pay in 30 days only — no amount or currency required:

<twisto-payment-widget product="pay-in-30-days" language="en" ></twisto-payment-widget>

Pay in 3 only — requires amount and currency:

<twisto-payment-widget product="pay-in-3" amount="AMOUNT" currency="CZK" language="en" ></twisto-payment-widget>

Always pass the product price to amount.

 

Reading the selected product

The widget reflects the currently selected product back to the element via the selected-type attribute. This lets you read which payment option the customer chose.

selected-type is set to "standard" when Pay in 30 days is selected, and "pay-in-three" when Pay in 3 is selected.

To read the selected value:

const selected = document.querySelector('twisto-payment-widget').getAttribute('selected-type') // returns "standard" or "pay-in-three"

Attributes

AttributeDescriptionTypeDefault value
productTwisto product. Options: pay-in-30-days or pay-in-3. Omit to show all products.Stringnull
amountProduct price. Required when product="pay-in-3" or when product is omitted.Numbernull
currencyCurrency of amount. Required with amount. For example, CZK, EUR, PLN, etc.Stringnull
languageLanguage. Options: cs, en or pl.Stringen
themeTheme. Options: light or dark.Stringlight
widthWidget width. Options: auto or full.Stringauto
siteRedirect target. Can be cz or pl. By default decided by language.Stringnull
selected-typeRead-only. Reflects the selected product — "standard" or "pay-in-three". Set by the widget.Stringnull

For a full list of available attributes, see How to edit Twisto widgets.

 

Examples

All products

<twisto-payment-widget amount="2000" currency="CZK" language="en"></twisto-payment-widget>

Pay in 30 days only

<twisto-payment-widget product="pay-in-30-days" language="en"></twisto-payment-widget>

Pay in 3 only

<twisto-payment-widget product="pay-in-3" amount="2000" currency="CZK" language="en"></twisto-payment-widget>