In Development

Payment Processing in FileMaker using Stripe

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

Creating a Stripe account

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.

FileMaker And Stripe Account Creation

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.

FIleMaker And Stripe API KeysProcessing a test payment

Processing a payment via Stripe requires two steps and both steps entail POST requests, which are accomplish via the BaseElements Plugin and its BE_HTTP_POST custom function.

Creating a customer

Step one is a request for a customer object and is made via BE_HTTP_POST with the following parameters:

  • stripe customer url
  • payment source, e.g. if a credit card, then “card”
  • customer name
  • credit card number
  • credit card expiration month & year
  • credit card security code
  • stripe account test secret key

An example of the BE_HTTP_POST function call would look like this:

BE_HTTP_POST ( “https://api.stripe.com/v1/customers” ; “source[object]=card” & “&source[number]=” & $cardNum & “&source[exp_month]=” & $expMonth & “&source[exp_year]=” & $expYear & “&source[cvc]=” & $CVC & “&source[name]=” & $customerName ; $testSecretKey ; “” )

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.

FileMaker And Stripe Customer ID

Processing a payment

Step two processes the payment by requesting a charge object and is made via BE_HTTP_POST with the following parameters:

  • stripe charge url
  • charge amount as total amount of the smallest unit of the charge currency, e.g. if USD, then 1 cent
  • currency of the charge, e.g. if USD, then “usd”
  • customer object ID
  • stripe account test secret key

An example of the BE_HTTP_POST function call would look like this:

BE_HTTP_POST ( “https://api.stripe.com/v1/charges” ; “amount=” & $amount & “&currency=” & $currency & “&customer=” & $tokenID ; $testSecretKey ; “” )

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.

Failed requests and error objects

Stripe has extensive error handling and will return an error object whenever a requests fails.

FileMaker And Stripe Error Object

Going live

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.

Conclusion

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.

DownloadDownload FileMaker and Stripe Integration

Please complete the form below to download your FREE FileMaker database file.

Filemaker Zapier Salesforce ComboFileMaker Cloud Logo