Remove Static payment processing fees from database and update field hints with useful info when adding / editing payment provider

This commit is contained in:
johnnyq
2026-07-22 17:32:01 -04:00
parent 8ee780566e
commit 5402578ce6
7 changed files with 166 additions and 77 deletions

View File

@@ -16,11 +16,6 @@ ob_start();
<div class="modal-body">
<div class="alert alert-info text-center">
<h6>Before Adding a Payment Provider!</h6>
We recommend you add an <strong>Account</strong> and <strong>Vendor</strong> based off the Provider name before continuing eg <strong>Stripe</strong>
</div>
<ul class="nav nav-pills nav-justified mb-3">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#pills-details">Details</a>
@@ -90,6 +85,7 @@ ob_start();
?>
</select>
</div>
<small class="form-text text-muted">Should havea seperate account created off the payment provider's name e.g. Stripe</small>
</div>
<div class="form-group">
@@ -107,6 +103,10 @@ ob_start();
<div class="tab-pane fade" id="pills-expense">
<div class="alert alert-info text-center">
Payment Processing Fee Expenses get reconciled nighly via the cron
</div>
<div class="form-group">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" name="enable_expense" checked value="1" id="enableExpenseSwitch">
@@ -136,6 +136,7 @@ ob_start();
?>
</select>
</div>
<small class="form-text text-muted">Payment Privider name e.g. Stripe</small>
</div>
<div class="form-group">
@@ -166,29 +167,8 @@ ob_start();
</button>
</div>
</div>
</div>
<div class="form-group">
<label>Percentage Fee to expense</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-percent"></i></span>
</div>
<input type="text" class="form-control" inputmode="decimal" pattern="[0-9]*\.?[0-9]{0,2}" name="percentage_fee" placeholder="Enter Percentage">
</div>
<small class="form-text text-muted">See <a href="https://stripe.com/pricing" target="_blank">here <i class="fas fa-fw fa-external-link-alt"></i></a> for the latest Stripe Fees.</small>
</div>
<div class="form-group">
<label>Flat Fee to expense</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-shopping-cart"></i></span>
</div>
<input type="text" class="form-control" inputmode="decimal" pattern="[0-9]*\.?[0-9]{0,3}" name="flat_fee" placeholder="0.030">
</div>
<small class="form-text text-muted">See <a href="https://stripe.com/pricing" target="_blank">here <i class="fas fa-fw fa-external-link-alt"></i></a> for the latest Stripe Fees.</small>
</div>
<small class="form-text text-muted">Processing Fee, Credit Card Fee etc</small>
</div>
</div>
</div>

View File

@@ -14,12 +14,11 @@ $account_id = intval($row['payment_provider_account']);
$threshold = floatval($row['payment_provider_threshold']);
$vendor_id = intval($row['payment_provider_expense_vendor']);
$category_id = intval($row['payment_provider_expense_category']);
$percent_fee = floatval($row['payment_provider_expense_percentage_fee']) * 100;
$flat_fee = floatval($row['payment_provider_expense_flat_fee']);
// Generate the HTML form content using output buffering.
ob_start();
?>
<div class="modal-header bg-dark">
<h5 class="modal-title"><i class="fa fa-fw fa-credit-card mr-2"></i>Editing: <strong><?= $provider_name ?></strong></h5>
<button type="button" class="close text-white" data-dismiss="modal">
@@ -89,6 +88,7 @@ ob_start();
?>
</select>
</div>
<small class="form-text text-muted">Should havea seperate account created off the payment provider's name e.g. Stripe</small>
</div>
<div class="form-group">
@@ -106,6 +106,10 @@ ob_start();
<div class="tab-pane fade" id="pills-expense">
<div class="alert alert-info text-center">
Payment Processing Fee Expenses get reconciled nighly via the cron
</div>
<div class="form-group">
<label>Payment Provider Vendor <strong class="text-danger">*</strong></label>
<div class="input-group">
@@ -130,6 +134,7 @@ ob_start();
?>
</select>
</div>
<small class="form-text text-muted">Payment Privider name e.g. Stripe</small>
</div>
<div class="form-group">
@@ -160,28 +165,7 @@ ob_start();
</button>
</div>
</div>
</div>
<div class="form-group">
<label>Percentage Fee to expense</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-percent"></i></span>
</div>
<input type="text" class="form-control" inputmode="decimal" pattern="[0-9]*\.?[0-9]{0,2}" name="percentage_fee" value="<?php echo $percent_fee; ?>" placeholder="Enter Percentage">
</div>
<small class="form-text text-muted">See <a href="https://stripe.com/pricing" target="_blank">here <i class="fas fa-fw fa-external-link-alt"></i></a> for the latest Stripe Fees.</small>
</div>
<div class="form-group">
<label>Flat Fee to expense</label>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-fw fa-shopping-cart"></i></span>
</div>
<input type="text" class="form-control" inputmode="decimal" pattern="[0-9]*\.?[0-9]{0,3}" name="flat_fee" value="<?php echo $flat_fee; ?>" placeholder="0.030">
</div>
<small class="form-text text-muted">See <a href="https://stripe.com/pricing" target="_blank">here <i class="fas fa-fw fa-external-link-alt"></i></a> for the latest Stripe Fees.</small>
<small class="form-text text-muted">Processing Fee, Credit Card Fee etc</small>
</div>
</div>
</div>