Widget
Widget examples
We recommend using the following CSS code for all widgets
.octany-wrapper {
text-align: center;
margin: 0 auto;
width: 100%;
max-width: 600px;
border: 0px solid #D5D8DF;
}
Donation Widget
This widget is for donations
<div class="octany-wrapper">
<div class="octany-wrapper">
<octany-widget
version="2"
url="https://app.octany.com"
account-id="[ACCOUNT_ID]"
product-id="[PRODUCT_ID_1]|[PRODUCT_ID_2]"
tab-title="Bli månadsgivare|Engångsgåva"
page-title="Ge en gåva varje månad|Ge en engångsgåva"
type="iframe"
locale="sv"
></octany-widget>
<script src="https://app.octany.com/js/checkout.js"></script>
</div>
</div>
Button Widget
This widget works with subscriptions and donations
<octany-widget
version="2"
url="https://app.octany.com"
account-id="[ACCOUNT_ID]"
product-id="[PRODUCT_ID]"
type="button"
locale="sv"
label="Subscribe"
price-with-vat="false"
></octany-widget>
Attributes
Here is a list of all attributes you can set.
urlThe URL to Octany (required)account-idYour specific Octany account idproduct-idThe product you want to use. We support two values for the donation widget separated by a pipe character (example: 1422|1423)typebutton or iframelocaleWe support English (en) and Swedish (sv)success-urlCustomers are sent to this URL when the payment has been completedabort-urlCustomers are sent to this URL if they close Octany without making a purchasereference-idA custom string which is sent back to your application when using Webhooks or an API endpoint, max 250 charactersreference-nameWorks exactly like reference-id, but the name is also visible in the Octany UI, max 25 charactersprice-with-vatSet this to true if you want to display price with VAT included, defaults to false (type="button" only)amountSet a custom amount (type="button" only)price-descriptionReplace the default pricing description ($100/month) in the modal with a custom text (type="button" only)first-namelast-nameemailline1Prefill postal address line 1line2zipcitypersonal-identity-numbercountry2 letter country code, according to ISO 3166-1 alpha-2phonePrefill phone number (Must be prefixed with tel:, example:tel:0701234567) and is only used for Swish paymentscompanyCheck 'pay as company' and prefill company namepartyAcceptscompany,personorallwhich shows the pay as company checkbox (default). Set this value to company to force everyone who pays to specify their company nameaccepted-termsIndicates that the user already has accepted terms in a previous stepmetadataSave custom JSON data to the paymentuse-sparMakes it possible to disable SPAR if it is enabled on the account
Success URL
It is possible to decorate the success url for recurring products, example:
https://www.example.com/thanks?first_name={firstName}&lastName={lastName}&product={product}&email={email}
Parameters
- {firstName}
- {lastName}
- {email}
- {product} – Product name
- {subscriptionId}
- {customerId}
- {total} – Today's total excluding VAT in the smallest common currency unit (i.e cents/öre)