Configuration
The Sezzle Express checkout button is a powerful tool for custom platform merchants. Integrated directly into the cart page, the button allows shoppers to select Sezzle as their payment method with a single click, leveraging their Sezzle account for a seamless payment experience. This feature is designed to reduce cart abandonment, increase conversion rate, and enhance customer satisfaction.
Installation
Include SDK code
Include the following script in the <head>
section of the page.
Checkout Configuration
Configuration Options
Available options: popup
, iframe
, redirect
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.
Used when creating a checkout or capturing payment. Find your API keys at https://dashboard.sezzle.com/merchant/settings/apikeys
Environment in which the checkout is to be completed
Available options: live
, sandbox
Sezzle Checkout SDK Version
Available options: v2
Sezzle Button
Sezzle Button Configuration
Create a placeholder element for the Sezzle Button to be rendered on the page(s).
Text to appear inside the button. Use %%logo%%
inside the text to
display the Sezzle image
Available options: square
, semi-rounded
Custom classes to be applied
Negative space between top of content and edge of button
Negative space between bottom of content and edge of button
Negative space between left side of content and edge of button
Negative space between right side of content and edge of button
Width of the Sezzle logo within the button
Position of the Sezzle logo from top.
Position of the Sezzle logo from bottom.
Position of the Sezzle logo from left.
Position of the Sezzle logo from right.
Spacing between the templateText letter.
Width of the button
Height of the button.
Render the Sezzle Button
Requires having the checkout object created from above to render the button. Call renderSezzleButton passing the id of the placeholder element defined in Button Configuration, above.
Initialize the Checkout
Event Handlers
The SDK requires the following event handlers that can be used to extend features in your application.
Sezzle Button is clicked by the user.
See Checkout Initialization section for payload options.
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.
See capturePayment section for payload options.
Sezzle payment is cancelled. If the user exits the Sezzle checkout for any reason, the onCancel
handler will be executed.
Sezzle payment has failed. If there is an error loading the Sezzle checkout page, the onFailure
handler will be executed.
Required if is_express_checkout
is true
. Once shopper has provided shipping address via Sezzle express checkout, this function should return tax and shipping costs to Sezzle.
Checkout Initialization
The HTTP request information used to redirect the customer in the case of a cancellation
The HTTP request information used to redirect the customer upon completion of the session
Indicates whether checkout should follow the express checkout protocol . For this implementation, be sure to use true
The order for this session
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
andpopup
mode.
Use an existing checkout URL
- The
mode
used when configuring the SDK checkout must match thecheckout_mode
when creating a session. - The parent window
origin
must be provided in the cancel and complete urls when thecheckout_mode
isiframe
orpopup
.
Customer Tokenization This is not supported in the onComplete
event.
To receive a customer UUID, subscribe to the
customer.tokenized
event.
Capture Payment
Capturing an order is not required if the CAPTURE
intent was used when
creating the checkout.
onCalculateAddressRelatedCosts
For security purposes, authentication and checkout update must originate from merchant’s back-end code.
- Get authentication token
- Call the authentication endpoint to obtain a bearer token
- You should have already set this up in your back-end for the standard integration
- Instead of pointing directly to Sezzle as in the below example, you can re-use your existing function
- Update the order
- Call the Update and Checkout endpoint to update shipping and tax amount
- See
Options
tab below for more details
The total amount in cents
The 3 character currency code as defined by ISO 4217
The shipping amount in cents for the order
The tax amount in cents for the order
The address UUID for the order