mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
- Finish updating URLs from /portal to /client
- Add a basic Stripe management page to admin settings to remove cards/reset Stripe customer IDs
This commit is contained in:
@@ -88,7 +88,7 @@ if (!$config_stripe_enable || !$config_stripe_publishable || !$config_stripe_sec
|
||||
// Manage the saved card
|
||||
else { ?>
|
||||
|
||||
<b>Manage saved card details</b>
|
||||
<b>Manage saved payment methods</b>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -120,7 +120,7 @@ if (!$config_stripe_enable || !$config_stripe_publishable || !$config_stripe_sec
|
||||
|
||||
<hr>
|
||||
<b>Actions</b><br>
|
||||
- <a href="post.php?stripe_remove_card&pm=<?php echo $stripe_pm; ?>">Remove saved card</a>
|
||||
- <a href="post.php?stripe_remove_pm&pm=<?php echo $stripe_pm; ?>">Remove saved payment method</a>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ $settings = mysqli_fetch_array($sql_settings);
|
||||
$client_id = $settings['config_azure_client_id'];
|
||||
$client_secret = $settings['config_azure_client_secret'];
|
||||
|
||||
$redirect_uri = "https://$config_base_url/portal/login_microsoft.php";
|
||||
$redirect_uri = "https://$config_base_url/client/login_microsoft.php";
|
||||
|
||||
# https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow
|
||||
$auth_code_url = "https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize";
|
||||
|
||||
@@ -633,15 +633,15 @@ if (isset($_GET['stripe_save_card'])) {
|
||||
}
|
||||
|
||||
// Logging
|
||||
logAction("Stripe", "Update", "$session_contact_name added saved card ($card_info) for future automatic payments (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
logAction("Stripe", "Update", "$session_contact_name saved payment method ($card_info) for future automatic payments (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
|
||||
// Redirect
|
||||
$_SESSION['alert_message'] = "Card saved - thank you";
|
||||
$_SESSION['alert_message'] = "Payment method saved - thank you";
|
||||
header('Location: autopay.php');
|
||||
|
||||
}
|
||||
|
||||
if (isset($_GET['stripe_remove_card'])) {
|
||||
if (isset($_GET['stripe_remove_pm'])) {
|
||||
|
||||
if ($session_contact_primary == 0 && !$session_contact_is_billing_contact) {
|
||||
header("Location: post.php?logout");
|
||||
@@ -678,8 +678,8 @@ if (isset($_GET['stripe_remove_card'])) {
|
||||
mysqli_query($mysqli, "UPDATE client_stripe SET stripe_pm = NULL WHERE client_id = $session_client_id LIMIT 1");
|
||||
|
||||
// Logging & Redirect
|
||||
logAction("Stripe", "Update", "$session_contact_name deleted saved card (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
logAction("Stripe", "Update", "$session_contact_name deleted saved Stripe payment method (PM: $payment_method)", $session_client_id, $session_client_id);
|
||||
|
||||
$_SESSION['alert_message'] = "Card removed";
|
||||
$_SESSION['alert_message'] = "Payment method removed";
|
||||
header('Location: autopay.php');
|
||||
}
|
||||
Reference in New Issue
Block a user