Skip to content
Shahid Malla
Payment gateways In Stock

Square Saved Card Recovery and Gateway for WHMCS

Lost the saved cards in WHMCS after a bad restore or migration? Pull the Square tokens back, match them to clients and bill them again.

WHMCS 8.x (confirmed at purchase) PHP 7.4+ with cURL and OpenSSL

What does the Square card recovery module do?

When WHMCS loses its stored payment methods through a bad restore, a failed migration or a damaged table, the cards are usually not gone. Square still has every card on file, and those tokens still work. What was lost is the link between each Square card and a WHMCS client. This module rebuilds that link and writes the cards back as proper WHMCS pay methods, so automatic billing can charge them again.

It recovers tokens, not card numbers. Square never returns a full card number or security code to anyone, so what comes back is the card token, brand, last four digits, expiry month and year, and the cardholder name and billing address. That is enough to charge the card through Square again. It is not enough to move the cards to another processor.

How does a recovery run?

StageWhat happens
ScanSquare customers and cards copied into a local mirror; nothing at Square changes
MatchEach Square customer scored against your WHMCS clients
ReviewUncertain matches shown to you with their candidates and scores
RestoreConfirmed cards written back as WHMCS pay methods
ExportCSV reports of cards, customer matches and transactions

Matching uses the WHMCS client ID stored in Square, the client email and contact emails; looser signals such as phone, company and name are off by default. A customer is matched on its own only at a score of 90 or more, and two candidates within ten points of each other always go to review. Automatic restore stays off until you switch it on. Expired and disabled cards are reported rather than restored, cards a client already has are not duplicated, and one client can be recovered on its own for a single support ticket.

How does the Square gateway take payments?

New cards go into Square's hosted card form, so card numbers travel from the browser to Square and never touch your server, and Strong Customer Authentication runs on payments. Renewals charge saved cards as merchant-initiated payments, and refunds start from the WHMCS invoice. Invoices are marked paid only from signed callbacks, Square webhooks checked with HMAC-SHA256, or a cron check against the Square API for payments still pending, and a transaction ID check stops any payment being applied twice. When Square reissues a card, the existing pay method takes the new token instead of gaining a second card.

Who is it for, and what do you need?

Hosting companies that bill through Square and found their saved cards missing after a restore or a move, and anyone who wants a Square gateway with a recovery path built in. Requirements: WHMCS 8.x (I confirm the exact version with you at purchase), PHP 7.4 or newer with cURL and OpenSSL, a cron job every five minutes, and a Square access token, application ID and location ID whose currency matches your invoices.

Limits: only cards Square still holds can be restored, and a card whose issuer asks the cardholder to authenticate cannot be charged unattended. I also sell a plain Square gateway; if your saved cards are intact, that is the smaller purchase.

It costs $199 once for a lifetime license with twelve months of updates and support, an instant download and license key, and a seven-day refund window.

Key features

  • Read-only mirror of Square customers and saved cards
  • Scored matching of Square customers to WHMCS clients
  • Review queue for close or uncertain matches
  • Cards restored as WHMCS pay methods, automatic restore off by default
  • Expired, disabled and duplicate cards reported, not restored
  • Single-client recovery for one support ticket
  • CSV exports of cards, matches and transactions
  • Square hosted card form with Strong Customer Authentication
  • Recurring charges, refunds and cron checks of pending payments
  • Webhooks verified by HMAC-SHA256, credentials encrypted at rest

Why customers buy this module

  • →Saved cards back on file without asking every client to enter them again
  • →No card lands on the wrong client because of a close match
  • →Paid invoices show as paid even when a webhook goes missing
  • →A CSV record of exactly what each recovery changed

Frequently asked questions

Can this module recover full card numbers?

<p>No, and nothing can. Square does not return full card numbers or security codes through any part of its API. The module recovers the Square card token with the brand, last four digits and expiry, which is all WHMCS needs to charge the card through Square again.</p>

What if a Square customer could belong to two WHMCS clients?

<p>It is not matched automatically. When two candidate clients score within ten points of each other, the customer goes to the review queue with both candidates and their scores, and you decide. Automatic restore is also off by default, so you can read the match report before any card is written back.</p>

How is this different from your Square card gateway?

<p>This package adds the recovery side: scanning Square, matching customers to clients, reviewing and restoring saved cards, plus CSV reports of what changed. It also includes its own Square gateway to charge those cards. If your saved cards are fine and you only need to take Square payments, the plain gateway is the smaller purchase.</p>

Technical specifications

WHMCS
8.x (confirmed at purchase)
PHP
7.4+ with cURL and OpenSSL
Processor
Square
Package
Addon module and payment gateway
Cron
Every 5 minutes
License
Lifetime, 1 year of updates and support included
Delivery
Instant download and license key
Refund window
7 days