This is a sample application created using instructions in https://docs.connect.squareup.com/payments/sqpaymentform/setup
I had few issues while creating this form, hopefully this sample application will get other people going easily.
Form submission to api can be implemented using API reference https://docs.connect.squareup.com/payments/transactions/overview