Unleak

Manager

Show the widget

This will show the manager widget. Requires the Stripe customer ID to be set.
      window.Unleak('manager').then((response) => {
  // Success promise.
}, (error) => {
  // Error promise.
});
    

Success promise

Property Type Description
source string Always MANAGER
code string Response status code. Value can be:
CUSTOMER_CREATED: The widget was called without an stripe_customer_id set on your customer and therefore we created a new customer in stripe for you.
OK: Everything went fine and the customer closed the widget.
CANCELED_ACCOUNT: The customer canceled their subscription.
data object When code is CUSTOMER_CREATED, { stripe_customer_id: 'cus_xxx' }
You should store the returned stripe_customer_id in your database.
No need to call window.Unleak('customer', { id: stripe_customer_id } ), it has been done for you.
If any other code, this will be null.

Error promise

Property Type Description
source string Always MANAGER
code string Response status code. Value can be:
NO_CUSTOMER_EMAIL: You failed to provide the customer email.
NO_CUSTOMER_ID: You failed to provide the Stripe customer ID.
data object Always null.