First Steps (Delphi, Lazarus, Postman)

I have built what is known in the healthcare industry an “Electronic Medical Records” system for the medical clinic where I work. It has a “customer facing” web app where the patients can confirm appointments etc. We are usually paid by the government, but we are now moving into Private Pay services, so I need a way of doing the following:

  1. Patient (“customer”) using our WebApp selects a service from our service list.

  2. Web app lists the service name, price and tax rate or amount, patient clicks “Prepay”

  3. My web app sends patient to the Square website, (along with service name, price, tax, etc, but NO credit card info) where they see a “Square produced” dialog box to enter their credit card info, etc. they click “Pay now”

  4. The Square website processes the payment, then does one of two things…
    4a) Sends my web app a notification HTTP POST saying that the payment has been made
    4b) Sends my web app a notification HTTP POST saying that the credit card was declined

  5. My web app will then either allow the patient to book the service to a specific appointment date/time, or will disallow the patient to go further.

The EMR was built using Lazarus, which is similar to Delphi. Both Delphi and Lazarus use TIdHTTP components to make calls to external APIs. These TIdHTTP components can map to fields use by Postman, and I have found that Postman is a great intermediary tool for translating what the API is expecting to what the TIdHTTP settings need to be.


  1. What Square “tools” do I need to work with, to accomplish this?
  2. Is there a Postman “Square” collection that has all these examples already made, that I can emulate?
  3. Does anyone have a working Lazarus app or Delphi app example of what I need?

Thanks in advance for any help you can provide.

While you could have your customer redirected to a Square page using our Checkout API it may be easier to use our Web Payments SDK to have your customer enter their card information in our secure input on your page. This makes for a seamless experience for your customer. :slightly_smiling_face:

Also yes, we do have a Postman collection that test with. Unfortunately, a Lazarus app or Delphi app example isn’t currently available.