linkleonard
linkleonard

Reputation: 93

Retrieving Card details from Square Customer

I'm trying to create a recurring payment on Square, ala Stripe subscriptions. However, I am having trouble retrieving a customer's card information (specifically customer_card_id) to pass into Charge.

Our flow is such:

  1. A customer visits to our store and subscribes to a membership, which we process via the point of sale app.
  2. We continuously poll Square to retrieve payment information, and create membership records appropriately.
  3. When the user's membership period expires, charge them for the next month's membership.

When researching RetrieveCustomer, I find that there is a cards property under Customer, but iterating through all the Customers under our account, they all have cards = None despite us having taken card payments via the point of sale app.

Also, looking at ListTransactions, there doesn't seem to be anything that might be customer_card_id. The IDs I see there are tender ID, location ID, and transaction ID. The card_fingerprint also looks promising but that doesn't seem right either, since a card can have both an ID and a fingerprint.

Am I missing something? Where might I find customer_card_id?


EDIT

Looks like I was dumb and my local instance of our application was just out of date with transactions from Square. After updating my data with customers we've processed since the last time I updated, customers with a non-None card property now show up. tristansokol's answer below is still valid however.

Upvotes: 0

Views: 723

Answers (1)

tristansokol
tristansokol

Reputation: 4271

How do you process the first charge? You need to explicitly add the card on file, it won't be added by default from processing a transaction from a customer. See: https://squareup.com/help/us/en/article/5770-use-card-on-file-with-the-square-point-of-sale-app

Upvotes: 0

Related Questions