The data-data-callback allows you to create a function that occurs each time the SBL loads. This is useful when performing actions based on the data within FastSpring. The data-data-callback returns the entire object associated with the session. You can use this for the following:
- Bypass directives to display information
- Apply gathered data to a native react app to display it
- 1 object
- 1 parameter
Use the data-popup-closed callback to create a function that occurs each time your Popup Storefront closes. This only takes place after a successful purchase; abandoned carts result in null.
- 1 object, which will contain the internal FastSpring Order ID (key: id)
- 1 customer-facing order reference (key: reference)
The callback will not fire if a customer closes the browser window instead of the popup.
Create a function that occurs when FastSpring receives a webhook from your Popup Storefront. You can use the data-popup-webhook-received callback with API calls to post information on your server. For example, you can pass information to create a customer account following a purchase.
The data-popup-webhook-received callback must accept 1 parameter. Browser Scripts are not required to send this callback.
The data-popup-webhook-received callback excludes personal information. To gather this information, set up Webhooks events.
After the SBL makes a call to Builder, it updates the webpage with the markup to display relevant directives.
- data-before-markup-callback: Create a JavasScript function that will occur before the markup is performed. No parameters are passed to this function.
When you make a request against the SBL, you can make a callback request to occur before or after the original request.
- data-before-requests-callback: Create a JavasScript function that will occur before the request is performed. No parameters are passed to this function.
- data-after-requests-callback: Create a JavasScript function that will occur immediately after the request is performed. No parameters are passed to this function.
Updated almost 2 years ago