Hi, I am a developer using C#. I recently developed web payment project with Square. I hope this message helps you out little bit. I am just writing this message to share my experience, so no offense. I am guessing you are using C# and asp.net
Good starting point is code example link that you can find from developer page.
using Square.Models; as minimal.
In this asp.net controller,
You will refer to Square’s API reference on calling CreatePaymentAsync() for your project’s need. In this method (Post call), you will create Square’s client instance. Square’s API Explorer does not show about client instance, but you need create instance of [Square client] to call any Square’s API.
This api controller must handle ‘cross origin’ for debugging in Visual Studio. → please research. Your web project in Visual Studio works on specific local host port [WHEN DEBUGGING], not the Square provided quick start port (3000). This is for debugging purpose only. You do not need implement ‘cross origin’ for production.
Now, the code behind page of your aspx.
Another thing to check is OAuth. Your web application must be able to handle OAuth if you are building application for other merchants. I used Asp handler for this.
Every developer has different way to create or handle the situation. This message is not the only answer. I am sorry that I cannot expose the actual lines of code.