Use the API to collect payment from users or payout users.
This step will create a charge on the server and return the inAppPurchase object required for the next step.On the server, use the chargeUser method to create a charge:
In this step the user will be prompted to confirm the previously created charge in a modal.
After a payment is processed, you should validate it on your server using webhooks to ensure the payment was successful and update your application accordingly.Set up a webhook route to handle payment events:
WHOP_WEBHOOK_SECRET
environment variable.