Bitcart Docs
TwitterTest
  • Introduction
  • Bitcart Basics
    • Use Case
    • Walkthrough
    • Bitcart vs others
    • Try it out
  • Deployment
    • Configurator
    • Docker Deployment
    • Local Deployment
    • Manual Deployment
    • Hardware Deployment
    • Raspberry Pi Deployment
    • Third-Party Hosting
  • Your first invoice
    • Electrum wallet
  • Guides
    • ETH payments plugin
    • Bitcart Plugins Development
    • Default nodes/your own node
    • One domain mode
    • Backups
    • Lightning Network
    • Transaction speed
    • Fiat currencies support
    • Templates
    • Themes
    • Store POS
    • Server management settings
    • Tor
    • Multiple deployments on one server
  • Integrations
    • Shopify
    • WooCommerce
    • WHMCS
    • FOSSBilling
    • Odoo
    • Custom Integration
  • Examples
    • Atomic Tip Bot
    • Templates
  • Support and Community
    • FAQ and common issues
      • General FAQ
      • Server Settings FAQ
      • Deployment FAQ
      • Terminology FAQ
      • Stores FAQ
      • Altcoin FAQ
    • Support
    • Troubleshooting an issue
    • Contribute
    • Community
  • Development
    • Architecture
    • Developing Locally
    • How to add an Altcoin
    • Security Disclosures
Powered by GitBook
On this page

Was this helpful?

Edit on Git
Export as PDF
  1. Examples

Atomic Tip Bot

PreviousCustom IntegrationNextTemplates

Last updated 1 year ago

Was this helpful?

Atomic Tip Bot is a bot which allows you to tip other users on telegram. It is a great example of Bitcart usage.

To get some funds to tip, user needs to deposit, which means generating an address and checking status of payment. We can use Bitcart for that.

But also, users are able to withdraw their funds. It is also possible with the SDK, while this feature isn't available in many other payment processors, as Bitcart is not just a payment processor.

You can use add_request SDK method to create a new invoice.

invoice = instances[currency].add_request(amount, description, expire=20160)

See the full

To process payments, we should register an event handler on our APIManager to handle the new_payment event, which is fired when a request was completed.

async def payment_handler(instance, event, address, status, status_str):
    # bitcart: get invoice info, not necessary here
    # instance.get_request(address)
    if status_str == "Paid":
        # process

See the full

We can use manager.start_websocket() to start listening for new events.

If you are interested, read the full explanation at github or try the atomic tip bot yourself in

SDK
example
example
here
telegram