Advanced Usage

APIs

Add Custom Frontend logics

Implement this function allows you to implement frontend logics that will run after after subscription creation.

How?

Define the following function in any of your js files, such as in your custom theme files, and implement any logic you’d like within the body.

servicebot_wp_handle_response_create_subscription({event, response, extras}){
if(event === 'create_subscription') {
// your custom handling logic goes here
}
}

Param

Description

event (string)

'create_subscription'

response (object)

The Stripe subscription object

extras (object)

Contains extra information from the Servicebot frontend