Post-Checkout
You can customize the buyer's experience once the Checkout closes. Here we'll look at Success and Close callbacks, the Checkout Complete Pop-up and displaying order information such as a license code.
Checkout Success & Close Callbacks
Upon your checkout being completed successfully, or being closed/abandoned, you may wish to take additional actions, for example loading a Thank You page or showing a message to the user.
Paddle's checkout supports successCallback
and closeCallback
parameters, which specify JS functions that are fired upon the checkout completing a transaction or being closed, respectively.
The success callback will prevent the default checkout success message from being displayed. If you want to allow the checkout to continue with its typical functionality, please use the Event Callback here with the "Checkout.Complete" event instead.
You can specify an anonymous function or pass in the name of a explicitly defined function, for example:
preparing...
The success callback will override any success redirect URL set in your Seller Dashboard.
Success and Close Callbacks can also be specified on a Paddle purchase button with the equivalent HTML data attributes data-success-callback
and data-close-callback
. If setting callbacks with data attributes, you must specify an explicit JavaScript function name.
Checkout Complete Popup
The Paddle Checkout has several options on what to do on a completed checkout, by default the checkout will show a ‘Success’ message indicating that the transaction was successful.
One option is to display a popup containing order, receipt and payment information as an alternate success screen.
You can enable the Checkout Complete Popup in the Setup()
function of Paddle.js by setting completeDetails
to true.
Order Details
You may wish to display to the customer’s order, license or transaction information, on your Thank You page after a checkout completes.
Paddle.js provides the Paddle.Order.details
method to pull the transaction data on checkout complete. You can also call the Order Details API directly.
The best way to use the method is to call it within the Paddle.js eventCallback
. This allows you to create a process where the customer’s order information is immediately available to the customer once the checkout has completed.
If a transaction fails or is flagged as high-risk, no order object will be returned.
For example, you can listen for a successful checkout using the event callback, retrieve the checkout ID and pass it into the Paddle.Order.details
method:
preparing...
If you’re delivering a license key for a one-time product, the key will be inside a lockers
object returned in the response.