How to add Square to SimpleInvoices

Download Script

Download Script

I love the website application SimpleInvoices (I did not code it), I dislike invoicing through Excel as I did in the past, because I needed to physically be at my desktop computer, and complete too many steps to send it. SimpleInvoices is a great tool because once the “Biller” (your company) and the “Customers” (your clients) are recorded into the database, completing the invoice and sending it off can be completed on your phone in just a few clicks. Seriously, like 30 seconds of work, and no stupid mobile app to deal with.

The problem with SimpleInvoices (IMHO) was that it was written in 2008, a time period with fairly limited payment options. While the script includes options for PayPal and eWay, it doesn’t include options for Square or LevelUp.

Most of these convenient payment gateways offer some type of URL for fast cash transactions. For instance the URL for Square’s service is http://cash.me/*yourusername/*amount

*variables to be filled in by you

It took me a couple of hours, but I found the script that generates the PayPal button on the invoice and made it generate the Square button nearby with a link to my http://cash.me site (square creates it when you install the Sqaure Cash app).

The file to edit can be found in your SimpleInvoices installation in the templates/invoices/default/plugins directory, and is named function.online_payment_link.php .

pay_with_squareOnce you find the directory, you should make a nice looking button in your favorite photo editor or graphics program, the PayPal button is 150×52 px in size. Making the buttons roughly match in size and shape might be nice. Feel free to use the one I made, it has the rounded corners similar to the PayPal button that comes with SimpleInvoices.

You need to upload the button you make to images/common directory inside of your SimpleInvoices installation.

Here is the code you need to paste into the  function.online_payment_link.php file, right after the “echo $link;” line:

$link2 = “<a href=’http://cash.me/*yourusername/”.urlencode(number_format($params[‘amount’], 2, ‘.’, ”)).”‘><img style=’margin-left:10px;’ border=’0′ src='”.urlsafe($url).”/images/common/pay_with_square.gif’/></a></div>”;

echo $link2;

Once your paste this line of code in, save function.online_payment_link.php. Now go build a phony invoice and check and make sure the link works.

Enjoy.



Leave a Reply

Your email address will not be published. Required fields are marked *

Tue Nov 14, 2017
Happy Fall, ya'll! #Dogs #Samoyed #Autumn https://t.co/QkLmoZx1tc
Sun Feb 19, 2017
Check out "Beauty an the Beast" by Stephen Hutti - https://t.co/sV83UwlHOl
Thu Jan 05, 2017
Can you see me? #snowday #snowdog #Samoyed https://t.co/HW5mHK5vRr
Tue Dec 27, 2016
RT @STLSamRescue: Y Not Save A Sam a Samoyed Rescue in Utah, rescues Samoyeds from Korea and China. Please see the attached link... https…