As the title is descriptive, I would like to create a subscription pallet. A user needs to subscribe first and the receiver can receive the payment every month. Any idea how to design this pallet?
2 Answers
This can be solved in various ways. Depending on the duration also aspects like building a reserve can be relevant. E.g. one time payment is simple but recurring payments, maybe collected in a map with blocktime to execute the subscription payment on_finalize
, could also raise questions, when the subscriber has insufficient funds. Otoh, if they would pay e.g. one year in advance you could build a reserve in the subscriber account or transfer to the service provider account and release through something like a vesting scheduler.
hth
Yeah, there are couple ways to do it. Maybe you can clarify your requirement exactly, so we can cut off many ways that is inappropriate.