globe-and-citizen / layer8

This repo contains the Layer8 Resource/Authentication Server, Proxy, and Service Provider Mocks
GNU General Public License v2.0
1 stars 2 forks source link

Integrate Layer8 Payments With Web3.0 #68

Open stravid87 opened 3 months ago

stravid87 commented 3 months ago

Overview

The clients of Layer8 will be using crypto to pay for our services. When a client logs in, they will see their usage statistics displayed for them to see. This usage is convertible to a fee that must be paid in crypto.

Notes

1) I do NOT want to integrate "Sign In With Ethereum." Instead we will keep the web2.0 sign in flow. 2) For now Metamask will be assumed the wallet of choice. 3) The amount of $$$ charged will be set low and does not need to be thought through from a business perspective.

User Stories

1)

As a client of Layer8 I want to pay my bill with money from my crypto wallet. When I click the connect wallet button I see that my wallet is connected and get the necessary prompts from Metamask to make this possible.

2)

As a client of Layer8 I want to pay my bill with money from my crypto wallet. When I click a "Pay Now" button I see the correct amount of crypto get bundled into a transaction and sent to my wallet where I can click accept. My "total owing" is decreased by the amount paid once the transaction is accepted.

### Tasks
- [x] Connect Metamask to Layer8
- [x] Calculate "Total Owing" using gathered statistics
- [x] Use the "Total Owing" to create a transaction for approval by Metamask
- [x] Connet the transaction to a "Pay Now" button.
- [x] Create a layer8 smart contract that will recieve payment
stravid87 commented 1 month ago

@huzaifamk can you help me to review and provide feedback?

stravid87 commented 1 month ago

Great work on V1. Let's try a simple v2 that involves a contract being used as a Payment Gateway. You only need to accept one curency (i.e., Matic) but the price in USD should be stable. The contract you deploy simply routes payment to another contract of your choice (what would be the "bank") and emits an event that is accepted by the backend certifying payment and updating the client bill.

stravid87 commented 1 month ago

Consider implementing this as a microchannel? https://docs.soliditylang.org/en/latest/solidity-by-example.html#micropayment-channel