Docs › Releases › 1.11 › Changelog
Recurnix 1.11 changelog
Every change in 1.11, by kind. For what it means and whether to update, read the release notes.
Fixed
- Auto-pay could charge a client several times for one invoice and record none of it. The nightly run called the gateway first and wrote the
Transactionafterwards. Anything that went wrong in between — a read timeout being the ordinary case, not an exotic one — left the money moved and Recurnix with no record of it. The invoice stayed unpaid with a positive balance, so the next night selected it again. Measured on the unpatched code with a gateway that takes the money and loses the response: one 25.00 invoice, three charges, 75.00 taken, 0.00 recorded. StripeGateway::chargeToken()was not sending anIdempotency-Key. It was a bare HTTP POST with no timeout either, so a retry at any layer was a second charge and a hung connection sat on PHP's default limit.- A gateway that reported a payment without a reference silently switched off the duplicate protection on payments.
gateway_txn_idwas written as NULL, and MySQL permits any number of NULLs in a unique index. The attempt's own key now stands in whenever the gateway gives us nothing. - The nightly summary counted charges it had not recorded. If an invoice was settled by something else while the charge was in flight,
autopay=Nstill counted it. It now reports only payments this run actually wrote.
Added
payment_attempts— a row written before the gateway is called, keyed onidempotency_key, unique, derived from the invoice and the attempt number. Both of those exist before the money moves, which is the entire point: a reference the gateway hands back cannot protect the call that produced it.PaymentAttempt::idempotencyKey()andPaymentAttempt::nextAction()— the two rules, as pure static functions with no database and no clock, so they can be tested on their own.- Billing → Payment attempts, a read-only admin screen carrying a red badge with the number of unresolved attempts. Two actions, and only two: It did charge records the payment and settles the invoice; It never charged writes the attempt off and releases the invoice back into auto-pay. Both ask for a note.
Invoice::paymentAttempts().- 17 more committed tests (53 total, 92 assertions).
Changed
SupportsTokenization::chargeToken()takes an optional third argument,?string $idempotencyKey = null. Existing implementations keep working.- Auto-pay skips any invoice with an unresolved attempt. The fence is a condition in the database, not a flag held in memory, so a crash cannot forget it.
Notes
- An attempt that got no answer is deliberately never marked failed. Marking it failed would be a guess, and it is the guess that costs the client money — it would release the invoice into the next night's run. It stays unresolved until a human compares it against the gateway's own records.
- The key sent to Stripe does not stop tomorrow night, and is not meant to. Stripe honours an idempotency key for 24 hours and the run is 24 hours apart. The key protects the in-run window — a duplicate cron firing, two workers, an HTTP-layer retry. What stops tomorrow night is the
payment_attemptsrow. - The Stripe leg is implemented to Stripe's documented behaviour but has not been exercised against live Stripe, because this installation has no API keys. Everything else here was measured end to end against a gateway double.