The Javascript SDK can be used for a simple, lightweight integration, but it also includes an in-context mode which will host the Sezzle checkout in a modal iframe or pop-up window.
Checkouts
Create checkouts and capture payments with Sezzle.
Integrations
Checkout in an iframe, pop-up window, or redirect to Sezzle.
Payments
Handle payment success, failure, or cancel with your Sezzle orders.
popup mode will work out-of-the-box. No additional configuration is required to use popup. Sezzle currently recommends popup mode. iframe mode will not work properly without first contacting Sezzle. For security reasons, Sezzle must enable iframe for your domain(s). To have it enabled, please submit a request with your Sezzle Merchant UUID and a list of domains to be allowed per environment (production and sandbox). For example, please enable uat1.mysite.com, uat2.mysite.com in sandbox and www.mysite.com, mysite.com in production. The integration for popup and iframe are identical, aside from the mode. Using popup mode will expedite your development. Upon completing the integration, if iframe is a requirement, then contact Sezzle to enable your domain(s) and switch the mode to iframe.
This section covers how to present Sezzle as a payment method at checkout. Depending on your webpage’s design, you might wish to display Sezzle as an alternative payment method (APM) button, a radio option in a list of payment methods, and/or as an alternative submission button. Below are some examples of how to implement the front-end component.
If you wish to use a different design from the options displayed below, please refer to our Co-Branded Guidelines for Approved Messaging and Sezzle logo acceptable use.
The button option is available as a component of this SDK library. It is comprised of two parts: the configurable element plcaeholder and the render function.
Place the element snippet from the Template tab where you wish the Sezzle Button to be rendered on the page, then update the Options attributes as needed.
Image
Template
Example
Options
Sezzle as a button alongside other APMs
Sezzle as a Submit button as alternative to default button
The theme corresponds to your site’s background color. If theme: dark, the button will be white with dark text. Else, the button will be dark purple with white text.Available options: dark, light
Add the following function to render the button when it is appropriate, such as when payment methods section loads, or when Sezzle is selected as a payment method. The parameter corresponds to the element created in the previous step.
Sezzle payment is successfully completed. A successfully completed Sezzle checkout will trigger an event to the onComplete handler. The event should include a data object with data relevant to the start checkout input parameter.
If your checkout flow requires the user to confirm their checkout on your site after being approved by Sezzle, use “AUTH” as your intent. If you prefer the checkout be captured immediately, use “CAPTURE”.Available options: AUTH, CAPTURE
Start checkout should be implemented in the checkout onClick handler. There are two methods for hosting a checkout.Use a checkout payload as detailed in the Session Object
The cancel and complete URLs are not required for iframe and popup mode.
Use an existing checkout URL
The mode used when configuring the SDK checkout must match the checkout_mode when creating a session.
The parent window origin must be provided in the cancel and complete urls when the checkout_mode is iframe or popup.
Customer Tokenization This is not supported in the onComplete event. To receive a customer UUID, subscribe to the customer.tokenized event.
function onCompleteHandler(event) { var data = event.data || Object.create(null); console.log("session data:", data.session_uuid, data.order_uuid);}checkout.init({ onComplete: onCompleteHandler,});
function onCompleteHandler(event) { var data = event.data || Object.create(null); console.log("checkout data:", data.checkout_uuid);}checkout.init({ onComplete: onCompleteHandler,});
This function will provide the installment details based on an amount in cents. An existing checkout can be used, or a checkout without any configuration can also be used to quickly get installment details.