Create a dynamic payment amount for online checkout

I have been using square payment form, which I understand is being deprecated. Currently, I allow my clients to enter their name and email address, along with an amount to contribute. That information is passed to the square payment form and they can pay online. This allows me to mark them according to their client ID in my system as paid, so if they want all their payments at the end of the year, I can send it easily in one click.

I’m switching my office to be entirely funded by donations (for lack of a better word). I’ve got 1 variable amount item called Honor Box, and I also have added 3 plans to allow them to automatically contribute weekly, bi-weekly, or monthly via subscription.

How can I use one of the APIs to associate their client ID in my system with this item? I’d like to make this available for them to sign up on my web site, OR send the regular Honor Box item via a link.

What’s the best way to do this? I feel lost.

:wave: There are a few different options you have now with Square. You could use our Checkout Links to easily allow your customers to pay a custom amount or sing up for various subscriptions. Or you can migrate to the Web Payments SDK for taking custom amounts as well as build a custom subscription signup flow with the Subscriptions API. :slightly_smiling_face:

Ok, so I love the idea of using the checkout links. I have a few created:

This is an example of one. The way I WAS doing it was to pass a custom amount, name and email address to the payment form. Once they paid, it would email them a custom receipt on my letterhead with their name. For some folks, the square receipts alone are not good enough to be reimbursed for their HSA or FSA accounts, so I need to be able to send my own receipt.

I need to either be able to use the checkout links as above, and then have it create a record of the payment in my system (so I can send them the email with the receipt) OR figure out how to get this dang payments sdk to work (which it isn’t).

So, how can I make whichever is easiest happen? A for-dummies version, if you have one. The walkthrough for the new SDK isn’t dummy proof like the last one was, or I’d have it by now. I’m using Laravel.

:wave: Glad to hear you enjoy the Checkout Link. With the Payments API you’ll get the receipt_url that you can email to your customer. The Payments API will return all payments processed with Square on an account. :slightly_smiling_face:

Ok, receipt URL is not enough for all customers. They need it on my letterhead with specific things on there. How can I setup the payments API to pull in new payments, including the name and email if they used those variable fields?

Okay, you can use the Order API to pull in all the order information and populate it on your letterhead to send to your customers. :slightly_smiling_face:

Awesome. I already use the paymentsApi to pull in payments from Square, which I then can attach the order (which I think the additional fields are attached to). I have extra fields of First Name, Last Name and Email that they can fill out, and need to bring that in. Do you know where in the JSON object that data would be stored?

With our APIs orders are created before the payment. The created order_id is then passed in with the Payment request so it’ll be associated with the payment. If your wanting to collect customer information you can use the Customers API to create a customer. We’ll return a customer_id once the customer profile is created and you can use that to pass in when creating the order and payment. :slightly_smiling_face:

I figured it out. It is under $order->line_items[0]->modifiers and is an array, with each field and it’s value listed as “{{ field name}}: {{field_value}}”.

I’m sure the customers API is good, but I don’t need to create customers in Square and prefer NOT to do this. I simply need them to found in my system, if they want to be found (many prefer to contribute anonymously), so I can give them a receipt at the end of the year on my letterhead for tax or health savings account purposes. Many of the HSAs won’t accept the Square receipt for some reason.

Okay, if your storing the customer elsewhere you can pass in a reference_id that maps back to the customer in your other system. :slightly_smiling_face:

1 Like