mirror of
https://github.com/itflow-org/itflow
synced 2026-11-19 10:57:24 +00:00
Stripe: when Stripe no longer has a client's customer, deleted there or made under other keys, forget it and the cards saved on it so the client sets up again, let new-card payments go ahead, tell agents, and remove the unused autopay_setup_stripe.js
This commit is contained in:
@@ -740,6 +740,13 @@ while ($row = mysqli_fetch_assoc($sql_recurring_payments)) {
|
||||
$pi_livemode = $payment_intent->livemode;
|
||||
|
||||
} catch (Exception $e) {
|
||||
// The client's Stripe customer is gone from Stripe - forgotten with its cards, so the client adds a card again
|
||||
if (billingStripeCustomerGone($e)) {
|
||||
billingStripeCustomerForget($client_id, $stripe_customer_id);
|
||||
mysqli_query($mysqli, "INSERT INTO history SET history_status = 'Payment failed', history_description = 'Stripe autopay failed - the client\\'s Stripe customer is no longer in Stripe, so its card was removed', history_invoice_id = $invoice_id");
|
||||
logAudit("Invoice", "Payment", "Failed auto Payment of invoice $invoice_prefix$invoice_number - the client's Stripe customer is no longer in Stripe", $client_id, $invoice_id);
|
||||
continue;
|
||||
}
|
||||
$error = $e->getMessage();
|
||||
error_log("Stripe payment error - encountered exception during payment intent for invoice ID $invoice_id / $invoice_prefix$invoice_number: $error");
|
||||
logApp("Stripe", "error", "Exception during PI for invoice ID $invoice_id: $error");
|
||||
|
||||
Reference in New Issue
Block a user