$row) { $cents = (int) round((floatval($row['invoice_amount']) - floatval($row['paid'])) * 100); $open[$i]['cents'] = $cents; $currency = $currency ?: strtoupper((string) $row['invoice_currency_code']); // One payment can carry so many invoices - the oldest are ticked first if ($select === null ? count($ticked) < BILLING_PAY_MAX_INVOICES : in_array(intval($row['invoice_id']), $select, true)) { $ticked[intval($row['invoice_id'])] = true; $total_cents += $cents; } } $limit_cents = $provider ? (int) round(floatval($provider['payment_provider_threshold']) * 100) : 0; // The card fee, worked out again by js/portal.js as the ticks change - in hundredths of a percent and cents $fee_rates = $provider ? billingCardFeeFor($session_client_id) : null; $fee_cents = billingCardFeeCents($total_cents, $fee_rates); $locale = str_replace('_', '-', (string) ($session_company_locale ?: 'en_US')); $pay_token = bin2hex(random_bytes(16)); ?>
Tick what to pay - it goes through as one card payment.