Set up recurring payments
Last updated
Last updated
This guide covers step by step what you need to do in order to start accepting recurring crypto payments with 8Pay.
We will assume you are a streaming service provider who offers a monthly plan of 10 USDT and wants to integrate a Subscribe button into its website.
Go to the Payments page of the web app and click on Create payment.
Select Automatic Payments then fill the form selecting the billing model that better suits your needs. For this specific case, we need billings to be performed in advance so the Fixed Recurring billing model is the perfect fit.
Fill the rest of the parameters and confirm the creation through your wallet.
Go to the newly created plan's page and click on Buttons.
Configure the behaviour by customizing the available parameters (full details are available here) then click on Generate.
The HTML code for the button will be automatically copied to your clipboard.
Go into your website's source code and paste it there.
To receive notifications whenever a new event related to your plan occurs (e.g. when a customer subscribes) you can setup a webhook URL.
To do so, go to the plan page and click on Actions > Webhook.
More info on webhook notifications can be found here.
Upon clicking on the button generated in step 2, customers will be redirected to 8Pay's hosted checkout page where they will be guided through the payment process.
After payment is completed, you will get a notification to the webhook configured in step 3 which will look like this:
After the current cycle is over, customers will have to be billed for the next cycle in order to continue using the service. To do so, you can use the Javascript SDK and program a server side script that triggers billing for the subscription when it's due.
Here is a simple script used the charge the customer of a subscription:
Notes:
The plan's ID can be found in the url of the plan's page.
SDKs for different programming languages will be release in the near future. Until then, you will need to develop a custom integration to call our smart contracts directly.