- Notifications
You must be signed in to change notification settings - Fork0
The platform will offer three subscription plans that users can choose from, and payment will be charged monthly in cUSD. We will also use the OpenZeppelin Defender autotask to handle the monthly subscription charges
License
olulofe/celo-sage-payment-subscription-platform
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
In this tutorial, we will show you how to create a subscription platform using the Celo composer react-app and the hardhat package. The platform will offer three subscription plans that users can choose from, and payment will be charged monthly in cUSD. We will also use the OpenZeppelin Defender autotask to handle the monthly subscription charges and an email service to notify users of the charge status. By the end of this tutorial, you will have a working subscription platform and the knowledge to customize and build upon it for your own use case.
Install dependecies
//In root folderyarn
Create.env
file inpackages/hardhat
folder.
Paste the default inside
PRIVATE_KEY=0xba28d5cea192f121db5f1dd7f501532170bb7bb984c4d3747df3e251e529f77dACCOUNT_ADDRESS=0x81cb394E24e5AeA53C3BD6f3d48b43e9A3817CC6
Generate your own private key and address.
npx hardhat create-account
Fund your address with test tokens from Celo public faucethttps://celo.org/developers/faucet.
npx hardhattest test/subscription-test.js --network hardhat
Deploy contract on Alfajores
cd packages/hardhatyarn run deloycd packages/react-appyarn run dev
Edit thescripts/transferOwnership.js
file and change the addresses for the contract and relayer respectively
npx hardhat run scripts/transferOwnership.js
Run the script to give allowance to24 cUSD and subscribe to basic plan for 12 months.
npx hardhat run scripts/suscribe.js
Most preferabbly use Defender Admin to interact with the cUSD and PaymentSubscription contracts to perform this actions
About
The platform will offer three subscription plans that users can choose from, and payment will be charged monthly in cUSD. We will also use the OpenZeppelin Defender autotask to handle the monthly subscription charges
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.