For HeyLight Financing you need Public API Key, that you can request from your account manager or find in your merchant portal Settings section.
<!-- DEFINE CUSTOM TERMS HERE -->
{% assign minimum_amount = 100 %}
{% assign maximum_amount = 500000 %}
{% assign available_terms = '12,24,36' | split:"," %}
{% assign min_instalment_amount = 100 %}
<!-- DON'T CHANGE ANYTHING BELOW THIS LINE -->
{%- if product.price >= minimum_amount and product.price <= maximum_amount -%}
{% assign term_ceiling = product.price | divided_by: min_instalment_amount %}
{% assign acceptable_terms = '' %}
{% for term in available_terms %}
{% assign test_term = term | times: 1 %}
{% if test_term <= term_ceiling %}
{% assign acceptable_terms = acceptable_terms | append: "," %}
{% assign acceptable_terms = acceptable_terms | append: term %}
{% endif %}
{% endfor %}
<div class="heidi_messaging">
<div
id="heidipay-container"
data-heidipay="true"
data-heidipay-minorAmount="{{ product.price }}"
data-heidipay-allowedterms="{{ acceptable_terms | split: "," | last }}"
data-heidipay-currencySymbol="CHF"
data-heidipay-lang="{{ localization.language.iso_code | slice: 0, 2 }}"
data-heidipay-type="PRODUCT_DESCRIPTION_HEYLIGHT_FINANCING_CH"
data-heidipay-apiKey="PUBLIC_API_KEY"
data-heidipay-cadence="MONTHLY"
data-heidipay-thousandsSeparator="."
data-heidipay-decimalSeparator=","
data-heidipay-symbolOnLeft="false"
data-heylight-logo-variant="black"
data-heidipay-spaceBetweenAmountAndSymbol="true"
data-heidipay-decimalDigits="2"
/>
</div>
{%- endif -%}
You will also need to include the script below for both sandbox and production versions. We recommend it be included somewhere it will always load (typically the theme file or index or a footer).
<!-- FOR DEMO / SANDBOX VERSION -->
<script src="https://sbx-upstream.heidipay.io/sdk/heidi-upstream-lib.js" ></script>
<!-- FOR PRODUCTION / LIVE VERSION -->
<script src="https://upstream.heidipay.com/sdk/heidi-upstream-lib.js" ></script>
This script will load the promotional message.