Developer Guide
Integrations
Failed Payment Wall
Churnkey can automatically block access to your web app for customers whose most recent payment failed. 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('failed-payment', {
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',
handleLogout() {
// optional, if defined, a "Logout" button will show
},
handleSupportRequest() {
// optional, if defined, a "Contact Support" button will show
}
onUpdatePaymentInformation(customer) {
// optional, called after customer updates payment information and overdue invoice is charged
}
})
This will trigger an asynchronous check to see if the customer has an outstanding failed payment. If their is a failed payment, a blocking wall will be displayed on top of your application with a streamlined UI to allow customers to update their payment information. In addition to charging the outstanding invoice, Churnkey will automatically add this card to the customer’s Stripe account and set the new payment method as the default for future invoices.
On this page