payment-kit
v1.22.32
Published
The decentralized Stripe for the Blocklet platform.
Readme
Payment Kit
The decentralized Stripe for the Blocklet platform.
Contribution
Development
- Clone the repository
- Run
make build - Run
cd blocklets/core && blocklet dev
Troubleshooting
Error: "pre-start error component xxx is not running or unreachable"
- Create a
.env.localfile in the project root- Add
BLOCKLET_DEV_APP_DID="did:abt:your payment kit server did" - Add
BLOCKLET_DEV_MOUNT_POINT="/example"
- Add
- Copy
.env.localto the/coredirectory- Edit
BLOCKLET_DEV_MOUNT_POINT="/"
- Edit
Error: "Insufficient funds to pay for transaction cost from xxx, expected 1.0020909, got 0"
- Copy the
BLOCKLET_DEV_APP_DID - Transfer 2 TBA from your DID Wallet to the copied address
Configure Stripe
Before using Stripe as a payment method, you need to configure the webhook secret:
- Set the
STRIPE_WEBHOOK_SECRETenvironment variable in your Blocklet settings- Add the environment variable
STRIPE_WEBHOOK_SECRETwith your Stripe webhook signing secret - You can find this in your Stripe Dashboard > Developers > Webhooks > Signing Secret
- Add the environment variable
Debug Stripe
- Install and log in following the instructions at: https://stripe.com/docs/stripe-cli
- Start your local Payment Kit server and note its port
- Run
stripe listen --forward-to http://127.0.0.1:8188/api/integrations/stripe/webhook --log-level=debug --latest - Copy the webhook signing secret from the CLI output and set it as
STRIPE_WEBHOOK_SECRETenvironment variable
Test Stripe
Invoices for subscriptions are not finalized automatically. You can use the Stripe Postman collection to finalize them and then confirm the payment.
Easter Eggs
Non-public environment variables used in the code that can change the behavior of Payment Kit:
PAYMENT_CHANGE_LOCKED_PRICE: Allows changing locked price (must be set to "1" to enable)PAYMENT_RELOAD_SUBSCRIPTION_JOBS: Reloads subscription jobs on start (must be set to "1" to enable)PAYMENT_BILLING_THRESHOLD: Global default billing threshold (must be a number)PAYMENT_MIN_STAKE_AMOUNT: Global minimum stake amount limit (must be a number)PAYMENT_DAYS_UNTIL_DUE: Global default days until due (must be a number)PAYMENT_DAYS_UNTIL_CANCEL: Global default days until cancellation (must be a number)
