Charging cards automatically

The easy part is taking the first payment. The part that decides whether you get paid next month is what happens when the second one is refused.

Saving the card

You send the customer a link; they enter the card on the payment provider's own page. The number never touches our servers — we hold two references and a label like "Visa ···4242". That is not modesty, it is the only arrangement that does not require us to hold card data, which we are not going to do.

What happens on the due date

The nightly run charges the saved card for invoices that are due, off-session. Success marks the invoice paid and sends a receipt. A refusal is where the design matters.

Refusals are not all the same

Needs bank approvalThe card requires the customer to authenticate. This is not a decline. We email them a link to approve the payment, and keep the invoice open and waiting.
TemporaryInsufficient funds, issuer unavailable. We retry on a schedule and keep chasing.
PermanentCard cancelled, stolen, closed account. We stop immediately, mark the card unusable and ask the customer for a new one. Retrying a permanently dead card just accumulates failures on your merchant record.

Treating a bank-authentication request as a decline is the single most common way European card billing loses money — the customer would have paid, nobody asked them, and the subscription cancels itself a month later.

Never twice

Every charge carries an idempotency key built from the invoice and the attempt. If the job dies between sending the charge and recording it, the next run does not charge again — it reads back the result of the first attempt.

Expiring cards

We keep the card's expiry month and warn before it passes, not after the first failed charge. A card that expires on the 31st fails on the 1st, which is exactly when you least want to be emailing a customer about payment details.

Questions people actually ask

Do you store card numbers?

No. The card is entered on the payment provider’s page and we keep only their references and a display label. There is no card data in our database to leak.

What happens if the customer’s bank asks for authentication?

We treat it as "waiting", not "declined": the customer gets a link to approve, and the invoice stays open. Handling this as a decline is how European card billing quietly loses money.

Can a customer remove their card?

Yes, from their own portal page, and you can remove it from their record. Either way the automatic charging stops at once.

Next

← All guides