Payment Checking
Last updated
Last updated
If your use case requires monetization (such as memberships or recurring payments), we leave you to use existing payment processors and your own implementations. You may connect it to BitBadges claims and just check it as another plugin / criteria.
While $BADGE is the native credits of the blockchain and we do offer accepting $BADGE fees per on-chain approval use, we do not recommend using it for payment purposes. We intend for $BADGE to mainly be used as a compute credits system for on-chain transactions. It is not meant to be a payment currency.
We recommend to accept payments using existing processors like Stripe or PayPal. Then, behind the scenes, check user payments with a custom plugin / webhook or use it when determining your self-hosted balances (assign based on successful payments). This can be via any payment method you want to accept.
Processors can also be crypto native like ThorSwap's SwapKit SDK.
Implementation is left up to you!
There are a couple implementation approaches you can take.
IMPORTANT: Note that these approaches show you how to implement the core success flows, but you should also consider when stuff goes wrong (Zapier is down, your handler is down, user refreshes and loses their payment ID, etc).
Connect your claim to auto-complete upon receiving successful Stripe payments using Zapier (or any other compatible processor)
You can create a claim which uses the Codes plugin and give out claim codes to those who successfully complete payments. This takes one extra step for your users (claiming on BitBadges), but it eliminates the claim logic implemntation for you.
Upon verifying a successful payment intent with Stripe, you can auto-complete the claim with the BitBadges API. For the setup, we refer you to their documentation (such as Stripe's below).
For auto-completing the claims, we refer you here.
Complete Claims w/ BitBadges APIFor the Stripe webhook approach, this may look something like the following:
You can also build a custom plugin that directs the user to your payment page and handles claims via your plugin backend handler. For this, we refer you to https://github.com/BitBadges/bitbadges-plugins with the stripe example folders and files for a full E2E quickstarter.
To implement, you will use the claim token approach where the unique claim token is the unique payment ID (thus enforcing one claim per ID).
Creating a Custom Plugin