mirror of
https://github.com/itflow-org/itflow
synced 2026-12-02 00:59:03 +00:00
Autopay offered to clients: database 4.3.7 adds settings.config_invoice_offer_autopay and recurring_invoices.recurring_invoice_offer_autopay, an invoice from a recurring invoice with no autopay offers Set up autopay in its email and on its guest and portal pages, guest/guest_autopay.php sets it up with no sign-in through a Stripe Checkout Session in setup mode (name, email and agreement kept in its metadata and the recurring invoice's history), the card is saved and autopay turned on when Stripe sends them back, agents are told and the client gets a confirmation, the portal turns it on with a saved card, Settings > Invoices and each recurring invoice's Autopay card can turn the offer off; 26.12.3 changelog
This commit is contained in:
@@ -1760,13 +1760,22 @@ if (isset($_POST['set_recurring_payment'])) {
|
||||
$recurring_payment_id = mysqli_insert_id($mysqli);
|
||||
|
||||
logAudit("Recurring Invoice", "Auto Payment", "$session_contact_name created Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . billingMoney($recurring_invoice_amount, $recurring_invoice_currency_code), $session_client_id, $recurring_invoice_id);
|
||||
// In its history, and the agents told - as when it is set up from an invoice's link (autopayCheckoutFinish())
|
||||
$card_label = billingCardParts(stripslashes($saved_payment_description))['label'];
|
||||
billingLog('recurring', $recurring_invoice_id, 'Autopay', "Autopay turned on with $card_label by " . stripslashes($session_contact_name) . ' (' . stripslashes($session_contact_email) . ') in the client portal');
|
||||
appNotify("Autopay", stripslashes($session_contact_name) . " set up autopay for " . $session_client_name . "'s recurring invoice " . stripslashes($recurring_invoice_prefix) . "$recurring_invoice_number with $card_label, in the client portal",
|
||||
"/agent/recurring_invoice.php?recurring_invoice_id=$recurring_invoice_id", $session_client_id, $recurring_invoice_id);
|
||||
|
||||
flashAlert("Automatic payment with $saved_payment_description turned on for recurring invoice $recurring_invoice_prefix$recurring_invoice_number");
|
||||
} else {
|
||||
// Delete
|
||||
mysqli_query($mysqli, "DELETE FROM recurring_payments WHERE recurring_payment_recurring_invoice_id = $recurring_invoice_id");
|
||||
$was_on = mysqli_affected_rows($mysqli) > 0;
|
||||
|
||||
logAudit("Recurring Invoice", "Auto Payment", "$session_contact_name removed Auto Pay for Recurring Invoice $recurring_invoice_prefix$recurring_invoice_number in the amount of " . billingMoney($recurring_invoice_amount, $recurring_invoice_currency_code), $session_client_id, $recurring_invoice_id);
|
||||
if ($was_on) {
|
||||
billingLog('recurring', $recurring_invoice_id, 'Autopay', 'Autopay turned off by ' . stripslashes($session_contact_name) . ' (' . stripslashes($session_contact_email) . ') in the client portal');
|
||||
}
|
||||
|
||||
flashAlert("Automatic payment turned off for recurring invoice $recurring_invoice_prefix$recurring_invoice_number");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user