I am making an online store, where you can buy physical products. And I want to be able to pay with metamask. Is it possible to sign the transaction with metamask and send it in the backend (to verify that the correct amount is paid for the product, and that the payment is made correctly to ship the product).
For this I have made my own erc777 token.
The option I am implementing is to have the customer's private key and perform all operations in the backend. But I would like to use the purchase conformation via metamask.
I have tried with ethersjs to sign in the server and do the send in the metamask but it gives error.... I do not know if this is possible, and if you can think of an option.
I would appreciate an example and/or article