How to connect Stripe to puzzlebot

Views:292

Connecting Stripe to puzzlebot lets you accept payments from abroad right inside your Telegram bot, with no workarounds or third-party links. It's the perfect option if you work with clients from other countries

Written by Alina Chernova, developer of Telegram bots and mini apps. Author of the @deabots channel

Step 1. Get an API key in Stripe

First, let's get a secret API key:

  1. Log in to your Stripe account

  2. In the bottom left corner, click Developers

  3. Go to API Keys

  4. Click Create secret key

The system will then give you a key that looks like this:

sk_live_xxxxxxxxxxxxxxxxxxxxxxxxx

Important:

  • Make sure you use the secret key (sk_live)

  • Don't share it with anyone: it gives access to your payments

Once you add this key to puzzlebot, users will be able to proceed to payment right from the bot

Step 2. Set up a webhook

For puzzlebot to know whether a payment went through, connect a webhook:

  1. In Stripe, go to Developers → Webhooks

  2. Click Add destination

  3. Paste the URL: https://pay.puzzlebot.top/payment_result.php?ps=stripe_native

  4. Select the events. We recommend:

  • either selecting all events

  • or at least payment_intent.succeeded and payment_intent.payment_failed

5. Then save the settings

Step 3. Test it

Once connected:

  • the user taps the payment button in the bot

  • goes to the Stripe payment form

  • pays

  • Stripe sends the result to the webhook

  • puzzlebot receives the status and grants access / delivers the result

With this automation, your bot is ready to accept payments from abroad without intermediaries, and the expert can focus on other things

Was this page helpful?