Software tips, techniques, and news.
By Damien Howell Posted on October 5th, 2016 in Free Downloads, FileMaker
Imagine a company called Larry's Landscapers. It's a landscaping company that uses FileMaker in variety of ways as part of its day to day operations and has a group of customers for which it maintains lawns and driveways on an as needed basis. Wouldn't it be great if Larry could provide these customers with the same sort of payment convenience that we've all become used to when paying recurring bills? That is, give them the ability to provide payment information just once and then reuse that information, in an easy and secure way, for any and all future payments? Well, Larry, or any business for that matter, can do just that by integrating the Stripe payment platform with their FileMaker solution.
Watch on Youtube: FileMaker and Stripe Integration
First, you'll need a basic Stripe account. They are free, can be created with just an email address and by default are set up for testing.
Once you have an account, the only piece of information you will need for testing is your Test Secret Key. It can be found in the API Keys tab of your Account Settings via the Stripe dashboard. This key will be passed to Stripe as a means of account authentication.
Processing a payment via Stripe requires multiple steps and both steps entail POST requests, which are accomplish via the Insert from URL script step.
Step one is a request for a customer object and is made with the following parameters:
An example of the POST function call would look like this:
Insert from URL ( $response ; "https://api.stripe.com/v1/customers" ; "-X POST" & " -u " & $SecretKey & " -d description=\"" & $customerName & "\"" & " -d source=" & $cardToken )
The parameters passed in this example represent the standard minimal amount of customer information for a credit card. Additional information, like the cardholder's address, can also be passed along as part of the customer request. You can refer to Stripe's API documentation for more details.
A successful customer request results in Stripe creating a customer and returning a customer object, which, like all objects returned by Stripe, is in JSON format.
A customer is Stripe's secure way of allowing users to create a reusable means by which to charge the same payment source multiple times. It's secure because all the customer data is stored on their servers. (Servers which have been audited by a PCI-certified auditor and are certified to PCI Service Provider Level 1.) It's easy because, once a customer is created, all that's needed for processing a payment is the id of the customer object because this id now represents the customer and all their information.
Step two processes the payment by requesting a charge object and is made with the following parameters:
An example of the POST function call would look like this:
Insert from URL ( $response ; "https://api.stripe.com/v1/charges" ; "-X POST" & " -u " & $SecretKey & " -d amount=" & $amount & "¤cy=" & $currency & "&customer=" & $customerID )
As with the request for a customer object, the parameters passed in this example represent the standard minimal amount of charge information. Additional information, like a description of the charge or an email address to send a receipt to, can also be passed along. As before, you can refer to Stripe's API documentation for more details.
A successful charge request results in Stripe returning a charge object. It contains various details about the charge, like if the charge itself was successful, the type of charge it was and how it was verified.
Stripe has extensive error handling and will return an error object whenever a requests fails.
Moving beyond testing and processing real payments with Stripe requires the activation of your Stripe account via an account application. Then, once live, you just use your Live Secret Key in place of your Test Secret Key.
Integrating a FileMaker solution and Stripe is both straightforward and simple, and the result is an efficient and secure way for any business to process a wide variety of payments.
Did you know we are an authorized reseller for FileMaker Licensing?
Contact us to discuss upgrading your FileMaker software.
Damien is an experienced FileMaker developer who is thoughtful and calm in manner with a logical, objective approach.