https://discord.gg/botpress logo
Custom paywall/gated access
# 🤝help
b
Hi there! I keep searching everywhere but can't seem to find any solution. I created a botpress chatbot, and I want to have a paywall (access after paying, subscription model). I'm going to use Wayforpay as payment system (basically Ukrainian Stripe, identical features and APIs). The chatbot itself will be deployed to Telegram I already came up with the whole payment workflow, with some automation between the payment system and Airtable as the user database. However, I can't figure out how to gate content! Is there any script? Should I start a new flow after payment = success? I need people to access the chatbot freely during the subscription time (28 days) Literally any workarounds are welcome! I already though of a code-based verification system (e.g. one-time passwords for 28 days) but that doesn't really solve the issue... Any help is appreciated! Thanks!
a
You could upload a table that stores the subscription status of each customer, and if that customer has a free trial active or not. Then, if customer subscribes, after payment = success set the value of the subscribed column of that customer to 1. Every customer starts with a free trial, which has a start date. When checking if customer is allowed to enter the paywalled node, you check: -For subscription status and -Free trial status and/or start date. (If free trial status = 1, then customer can proceed to paywalled node, or if current date is > freetrial start date + 28 then the customer can not proceed to paywalled node, and they are taken to an alternative node, and so on for other cases which are really simple to set up).
b
Yep, that's what I figured out! I'm using a table with the variable of "subscription-end" and every time a user starts interacting with the chatbot (starts a session) the bot first tests the user against the conditions of "user is in the table = true" and "subscription end = more than today" Now I just setup the whole automation between the payment system and the table so that Botpress updates the subscription-end accordingly
i
hey, do you mind sharing the workflow for the stripe integration?
b
I actually don't use Stripe, but a Ukrainian alternative called WayForPay. It is almost exactly the same, but Botpress doesn't offer the native integration yet, hence the big workaround
But as soon as I manage to create the whole workflow, I'll post it here - maybe that could help someone else:)
i
Yeah so the workflow where the bot stores the status of the users that paid in a table then the bot check against it would be similar for both Stripe and the one you're using
b
Update! So this is how it's working so far: 1. User pays the subscription 2. Payment system sends a webhook with the payment data 3. A new row is created in the local table in BP 4. When a user enters a session (any, first time or just new session) - the bot searches for the row associated with the user. If they can't find it - there is a whole signup system, which then matches their phone number to a phone number given by the payment system. Otherwise, the bot just works normally This is the setup for now, I will most probably change it later, but it's better to launch it anyhow than to not launch it ever! p.s. people are loving my product! I might end up posting it for share, even though it's in Ukrainian
i
Hi Kunji you work is great! Is possibile to share the bot? i'm new in botpress and i havn't experience in coding, but i would like to do somthing of similar.
p
Hi, can you tell us more about the payment processing process? how does the payment system send a webhook with payment data?
3 Views