Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
More comments for percent fee & amount fee filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
pderksen committed Jun 26, 2018
1 parent a2c35bf commit 4abfbb7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
11 changes: 7 additions & 4 deletions add-fee-percent.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<?php
/**
* Plugin Name: WP Simple Pay - Add Percent Fee (non-global)
* Plugin Name: WP Simple Pay - Add Percent Fee
* Plugin URI: https://wpsimplepay.com
* Description: Add a percent fee to specific one-time payment forms for WP Simple Pay.
* Description: Add a percent fee to one-time payment forms.
* Version: 1.0
*/

/**
* Add a percent fee to a specific one-time payment form that's separate from the global
* tax rate percentage value.
* Add a percent fee to a specific one-time payment form in addition to the
* global tax percent.
*
* TODO: Does this add to global tax percent instead of override?
* TODO: Are tax amount & total amount labels correct?
*
* Replace 157 with the form ID to target.
* Note: Does not work for subscription charges.
Expand Down
2 changes: 1 addition & 1 deletion add-flat-fee-amount.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: WP Simple Pay - Add Flat Fee Amount
* Plugin URI: https://wpsimplepay.com
* Description: Add a flat fee amount to one-time payment forms for WP Simple Pay.
* Description: Add a flat fee amount to one-time payment forms.
* Version: 1.0
*/

Expand Down
16 changes: 7 additions & 9 deletions custom-tax-percent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@
/**
* Plugin Name: WP Simple Pay - Custom Tax Percent
* Plugin URI: https://wpsimplepay.com
* Description: Change the tax percent for a specific form
* Description: Override the global tax percent fee for a payment form.
* Version: 1.0
*/

/**
* In this example, we'll see how to change the tax percent for a specific form ID
*/

/**
* Repeat this function setup for each specific form ID you need to change the tax percent for.
* Override the global tax percent fee for a specific payment form.
*
* Replace 157 with the form ID to target.
* Note: Works with one-time & subscription forms.
*/

function simpay_custom_form_157_tax_percent() {

// Change to 25%
return 25;
return 7.5; // This will be an additional 7.5 %
}
add_filter( 'simpay_form_157_tax_percent', 'simpay_custom_form_157_tax_percent' );

add_filter( 'simpay_form_157_tax_percent', 'simpay_custom_form_157_tax_percent' );

0 comments on commit 4abfbb7

Please sign in to comment.