This year, at the 2016 annual FileMaker Developer’s conference (DevCon), I presented a session titled E-Payments in FileMaker apps. One of the most popular portions of my session was demonstrating how easy it is to integrate FileMaker with the Stripe application program interface (API) to accept credit card payments in your FileMaker custom apps.
(Bonus: FileMaker has provided a free recording of this entire session)
How does this work?
FileMaker has a number of ways to work with web-based APIs. For e-payments, I've found that FileMaker's Custom Web Publishing (CWP) makes it easy to communicate between FileMaker and the rest of the web. Using CWP, we create a PHP page that communicates with both FileMaker and Stripe.
To start, information is extracted from FileMaker to create details of the payment; those details are then sent to Stripe. The page then opens up a payment pop-up, which has a secure connection to Stripe to make a charge. Once the payment information is received and placed into a token, the user is redirected to a second page where the token is charged. The information is sent back to FileMaker, and the user can see the result of the charge.
Why use this method for payments?
One of the best reasons to use Stripe is that it removes the risk of storing any credit card information either in your FileMaker database or on the CWP site. This method is compatible in FileMaker Pro, Go and WebDirect. You can even send a link to people that need to pay, without the need for FileMaker at all.
Additionally, Stripe is much easier to set up and receive approval than a traditional merchant processor. However, if you do need a terminal (point of sale or payments over the phone), this may not meet all of your needs.
How do I integrate this?
- Sign up for a Stripe account and obtain your API keys
- Host the FileMakerEPayments folder content on your website
- Add your API keys to the stripe.php file
- Update the CWP connection information to your database in the index.php and charge.php files. Make sure that you use a user that has CWP privileges enabled!
- Copy the invoices and StripePayment layouts from the AcmeCorp sample file to your file
- Check out the "Pay Invoice" script on how to send a user to the payment page
The files
Ready to start your own integration, and take payments today? Download my demo files for everything you need to get started in this integration.
About the Author
Mike Beargie has been with MainSpring since 2013 and has over 10 years of application development experience. As a developer, he creates solutions for clients in a wide variety of sectors across the U.S. and abroad. Prior to working at MainSpring, Mike worked as the lead developer for a consulting company, serving high profile political, special interest and nonprofit clients in the Washington, D.C., and Columbus, Ohio, markets. Mike regularly presents solutions and best practices to the FileMaker development community around the country, and is well known as an answer man online as well. In 2014 and 2016, Mike was recognized with the FileMaker Excellence Award for community contributions. Mike is a man of many hobbies, including woodworking, home brewing, art and music.