Cancel Flows

Pause Wall

Supported for Stripe and Chargebee.

Overview

Pause wall

Churnkey can automatically block access to your web app for customers whose subscription is currently paused. This is done by calling a function listed under window.churnkey following the same patterns as initializing the cancel flow. Note that this must be called after the Churnkey script is loaded i.e. Step 1.

  window.churnkey.check('pause', {
    subscriptionId: 'SUBSCRIPTION_ID' // optional
    customerId: 'CUSTOMER_ID', // required
    authHash: 'HMAC_HASH', // required
    appId: 'YOUR_APP_ID', // required
    mode: 'live', // set to 'test' to hit test billing provider environment
    provider: 'stripe', // set to 'stripe', 'chargebee'
    softWall: false, // set to true to allow exiting wall
    forceCheck: false, // recommended to leave this to false to avoid redundant checks
    handleLogout() {
      // optional, if defined, a "Logout" button will show
    },
    handleResume(customer), { }, // Promise, optional, overrides default billing action
    handleCancel(customer), { }, // Promise, optional, overrides default billing action
    onPauseWallActivated(){
      // optional, called when wall is activated
    },
    onCancel(customer) { }, // optional
    onResume(customer) { }, // optional
    onPauseWallClose() { }, // optional
    onError(error, type) {
       // types below
    },
  })

This will trigger an asynchronous check of the customer’s current subscription status. If the subscription is currently paused, a blocking pause wall will be displayed on top of your application UI, which allows the option for a customer to resume their subscription immediately, or cancel their subscription at the end of the term.

Error Types

The following errors can be sent to your onError(error, type) function while using the Pause Wall:

  • PAUSE_WALL_INITIALIZATION_ERROR
  • PAUSE_WALL_CANCEL_ERROR
  • PAUSE_WALL_RESUME_ERROR