# Recurring charges with PHP and Card on File

DevFeed: [Recurring charges with PHP and Card on File](<https://devfeed.tech/articles/recurring-charges-with-php-and-card-on-file-15821.md>)

Original publisher: [Read original article](<https://developer.squareup.com/blog/recurring-charges-with-php-and-card-on-file>)

Author: Tristan Sokol

Published: 2017-07-20T17:01:41Z

Content type: tutorial

Language: en

Sources: [Square Corner](<https://devfeed.tech/sources/square-corner-blog-medium.md>)

Topics: [API Business Models](<https://devfeed.tech/topics/api-business-models.md>), [PSR-4: Autoloader](<https://devfeed.tech/topics/psr-4.md>)

Tags: [apis](<https://devfeed.tech/tags/apis.md>), [billing](<https://devfeed.tech/tags/billing.md>), [card](<https://devfeed.tech/tags/card.md>), [charges](<https://devfeed.tech/tags/charges.md>), [charging](<https://devfeed.tech/tags/charging.md>), [e-commerce](<https://devfeed.tech/tags/e-commerce.md>), [file](<https://devfeed.tech/tags/file.md>), [php](<https://devfeed.tech/tags/php.md>), [subscription](<https://devfeed.tech/tags/subscription.md>)

## AI overview

Square's PHP SDK example stores a buyer's card on a customer record, then charges that saved card for recurring payments. The buyer enters card details through SqPaymentForm to generate a nonce; the app must obtain permission to keep the card and cannot attach a previously recorded card number. The PHP flow creates a customer, attaches the nonce as a customer card, then charges using the customer ID and card ID instead of a nonce. For later recurring charges, the excerpt says only the charge step is needed once the customer and card already exist.

## Source excerpt

Whether you have a subscription service, or regular clients that you want to charge repeatedly, you can use Square's e-commerce APIs and...