A basic payment system for the Ethereum blockchain using TypeScript and Node.js
You can read more about this project in this article: https://codecapsule.com/2022/06/01/building-payment-system-ethereum/
The following use cases and product flows have been tested.
- Connect and sign with wallet
- Product page shows options to buy
- Connect and sign with wallet
- Product page shows current plan, and options to buy are greyed out
- Select product on product page
- Click payment
- Transaction is found by backend, plan is activated.
- Access granted.
- Select whitelist product on product page
- Click payment
- Whitelist is found by backend, plan is activated.
- Access granted.
This scenario is not testable via a wallet because there is no way to update the amount. However, an attacker could call the API programmatically and this test is here to ensure this cannot be exploited.
- Select product on product page
- Click payment
- User changes value.
- Transaction is found by backend, and rejected.
- Access denied.
- User is signed out.
- User selects a plan and clicks buys
- User should get rejected.
- Transaction is not possible.
- User can access restricted page
- Once “valid_until” date is met, the user loses access to that data.
MIT License - Copyright (c) 2022 Emmanuel Goossaert