Payment from variable amount

Your code in the image above won’t work as you are missing the Wix Pay import at the top along with the pages onReady function for starters.

Have you already read the existing Wix pages about Wix Pay?
https://www.wix.com/corvid/reference/wix-pay.html
https://www.wix.com/corvid/reference/wix-pay-backend.html

Also, have a read of these pages about using Wix Pay too.
https://support.wix.com/en/article/corvid-tutorial-processing-payments
https://www.wix.com/corvid/tutorial/how-to-create-a-payment-flow-with-the-wix-pay-api

If you look at the code examples for the createPayment function in the Wix Pay API, you will be able to see an example already that gets users info too.
https://www.wix.com/corvid/reference/wix-pay-backend.html#createPayment