Trim credit-at-booking comment to one line
CI / Coding Standards (pull_request) Successful in 23s
CI / No Debug Code (pull_request) Successful in 9s
CI / Tests (PHP 8.2) (pull_request) Successful in 33s
CI / Tests (PHP 8.5) (pull_request) Successful in 34s
CI / Static Analysis (pull_request) Successful in 39s
CI / Tests (PHP 8.3) (pull_request) Successful in 38s
CI / Tests (PHP 8.1) (pull_request) Successful in 46s
CI / Build Plugin Zip (pull_request) Skipped

Co-authored-by: anthropic/claude-opus-4-8
This commit is contained in:
2026-09-17 15:43:57 -03:00
co-authored by anthropic/claude-opus-4-8
parent 67017409d7
commit 1758c253a1
+1 -7
View File
@@ -196,13 +196,7 @@ class LessonBooker {
payerId: $payerId
);
// A scheduled lesson charged at booking — the extra lesson added to (or a
// cancelled one rebooked within) an already-billed month — skips the daily
// scan, so apply the payer's account credit here too. A cancellation credit
// then settles the rebooking instead of the family being charged twice for
// the same slot. A pending payment fully covered by credit is settled and
// its lesson confirmed; applyCredits is a no-op when the payer holds no
// balance.
// Apply any available credit while booking.
if ( $offering->isScheduledBilling() && null !== $payment && null !== $payment->id && Payment::STATUS_PENDING === $payment->status ) {
$this->payments->applyCredits( $payerId, [ $payment ] );
$payment = $this->payments->findPayment( (int) $payment->id ) ?? $payment;