Store a Card on File using Reader SDK

New Feature in Square Reader SDK

Gabriel Jinich
Square Corner Blog
2 min readFeb 13, 2019

--

Heads up, we’ve moved! If you’d like to continue keeping up with the latest technical content from Square please visit us at our new home https://developer.squareup.com/blog

Last year, we announced the release of Square Reader SDK for iOS and Android, along with plugins for React Native and Flutter. While Reader SDK makes it easy to take in-person payments within your own app using Square hardware, you may also want to store customer card information securely to use in the future (for example, to create a recurring billing plan).

To help you create a seamless experience for returning customers and enable recurring payments, Reader SDK now supports storing a card on file using Square hardware. This new functionality works in tandem with the Customers API and Transactions API, allowing you to create a customer profile; swipe, tap, or dip a card to store it securely; and then charge the card for future purchases at any time.

Here’s how it works:

Create a Customer

Use the Customers API to create a customer profile, including contact information such as name, address, email, and phone number.

Store a Card on File

Use Reader SDK to swipe, tap, or dip a customer’s card and store it as a card on file. Reader SDK handles all payment information securely and creates a Customer Card object for you, so you don’t have to worry about handling raw card details or dealing with PCI compliance.

Android

Create a CustomerCardManager:

Write a callback to handle the result:

Add code to start the Store Customer Card flow:

iOS

Implement StoreCustomerCardControllerDelegate Methods:

Add code to start the Store Customer Card flow:

Charge the Card on File

Once you’ve stored a Card on File for a given Customer, you can use the Transactions API to charge the card for future payments.

Meet your buyers wherever they are

With Square’s omnichannel developer platform and the addition of Card on File to Reader SDK, you can now add cards to a customer profile regardless of where the customer relationship starts: online, in-store, or in-app. We are excited to see what you’ll build!

You can read more about Reader SDK in our documentation. Be sure to read and follow the requirements for obtaining customer consent and disclosing terms and conditions outlined in the documentation.

If you want to keep up to date with the rest of our content, be sure to follow this blog, follow our Twitter account, and sign up for our developer newsletter! We also have a Slack community for connecting with and talking to other developers implementing Square APIs.

--

--