Skip to main content

Cancel Flow initialization

This guide helps identify and resolve common Cancel Flow implementation issues.

Lucas Soares avatar
Written by Lucas Soares
Updated over 5 months ago

1st Common Issue: Cancel Flow Not Appearing

You implemented the code in your cancel button. However, when you click on it, you can't see anything.

1. Check the Console for Errors

Open your browser's developer tools (F12) and look for these common errors:

  • window.churnkey is undefined
    Check if Churnkey's script referred to in the Quick Step Guide is loading properly. If you don't any message, you can proceed checking for Network Errors.

  • Network errors
    In network tab, you must filter for "embed". Then you'll be able to find the requests done by our script. If working correctly, two requests are done:
    - POST. Returning status 200
    - OPTIONS. Returning status 204
    ​
    If any of them fail check for any error message in the requests.

2. CSS/Visual Issues

Considering you had no error in the console and in the requests, the Churnkey's modal is probably loaded but hidden behind other elements. In this case, you can implement this CSS to bring the modal to the front.

#ck-app .ck-modal-container { z-index: 999 !important}

Keep in mind that this is not a definitive solution. Ideally, you must review your CSS implementation and make sure to avoid any conflicts.


2nd Common Issue: "Sorry, something went wrong." Message

From here, the basic script integration is done. However, you're not able to go through the error message.

1. Verify the Customer's Data

Use our Sample Implementation
The goal here is to check if the customer you're using is eligible to see the Cancel Flow.

  • Open our reference code.

  • Enter your customer's information.

  • If it works, the customer is eligible and you must follow the 2nd step of the troubleshooting (Check the Initialization's parameters).

  • If it fails here too, verify the customer. He must have an active subscription.

2. Check the Initialization's parameters

  1. Environment Mismatch

    • mode must match the customer's environment on your payment provider

    • Make sure to use the correct API key according to the environment
      ​

  2. HMAC Authentication

    • Check the HMAC hash generated. In our sample code, we print the HMAC hash used so that you can compare it with yours.
      ​

      Screenshot of Firefox's devtools in the console tab with console.log of the HMAC used


      ​

  3. Required Parameters

Parameter

Example & Explanation

Required

subscriptionId

sub_1QhH8dA3np33huFNTj4TtZN3

Not mandatory, but recommended if customers can have multiple subscriptions at the same time

No

customerId

cus_QuqH26MomlIEbF

Customer's unique identifier

Yes

authHash

add3c29976b3c07e0fafe03042c134143df769867ea222d8cfe287aa13d789e8
The HMAC hash generated from your back-end

Yes

appId

8y46gcx3a

Obtained in your Churnkey's dashboard. Settings > Organization > Scroll down to Cancel Flow API Keys

Yes

mode

live | test

Based on the customer's environment

Yes

provider

stripe

Yes

3. Cancel Flow Configuration

Make sure to have at least your Primary Cancel Flow active on your Churnkey's dashboard.

  • Open your Churnkey dashboard

  • Verify at least one Primary Cancel Flow is active


Need Support?

If after following our guide you still need, get in touch with us via chat in the platform or directly via email at [email protected].

To make it easier for us to help you, gather the following information before opening a ticket:

  • Your implementation code

  • The customer ID and subscription ID being tested

Did this answer your question?