Source Code Documentation


pro\s2member-pro\includes\menu-pages\paypal-ops-tax-rates.inc.php


  1. <?php
  2. /**
  3. * Menu page for s2Member Pro (PayPal® options, Tax Rates).
  4. *
  5. * Copyright: © 2009-2011
  6. * {@link http://www.websharks-inc.com/ WebSharks, Inc.}
  7. * (coded in the USA)
  8. *
  9. * This WordPress® plugin (s2Member Pro) is comprised of two parts:
  10. *
  11. * o (1) Its PHP code is licensed under the GPL license, as is WordPress®.
  12. * You should have received a copy of the GNU General Public License,
  13. * along with this software. In the main directory, see: /licensing/
  14. * If not, see: {@link http://www.gnu.org/licenses/}.
  15. *
  16. * o (2) All other parts of (s2Member Pro); including, but not limited to:
  17. * the CSS code, some JavaScript code, images, and design;
  18. * are licensed according to the license purchased.
  19. * See: {@link http://www.s2member.com/prices/}
  20. *
  21. * Unless you have our prior written consent, you must NOT directly or indirectly license,
  22. * sub-license, sell, resell, or provide for free; part (2) of the s2Member Pro Module;
  23. * or make an offer to do any of these things. All of these things are strictly
  24. * prohibited with part (2) of the s2Member Pro Module.
  25. *
  26. * Your purchase of s2Member Pro includes free lifetime upgrades via s2Member.com
  27. * (i.e. new features, bug fixes, updates, improvements); along with full access
  28. * to our video tutorial library: {@link http://www.s2member.com/videos/}
  29. *
  30. * @package s2Member\Menu_Pages
  31. * @since 1.5
  32. */
  33. if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"]))
  34. exit ("Do not access this file directly.");
  35.  
  36. if (!class_exists ("c_ws_plugin__s2member_pro_menu_page_paypal_ops_tax_rates"))
  37. {
  38. /**
  39. * Menu page for s2Member Pro (PayPal® options, Tax Rates).
  40. *
  41. * @package s2Member\Menu_Pages
  42. * @since 110531
  43. */
  44. class c_ws_plugin__s2member_pro_menu_page_paypal_ops_tax_rates
  45. {
  46. public function __construct ()
  47. {
  48. echo '<div class="ws-menu-page-group" title="Tax Rate Calculations (Pro Form)">' . "\n";
  49.  
  50. echo '<div class="ws-menu-page-section ws-plugin--s2member-pro-tax-rates-section">' . "\n";
  51. echo '<h3>Tax Rate Calculations for PayPal® Pro Forms (optional)<br />— specifically for s2Member Pro Form integrations</h3>' . "\n";
  52. echo '<p>With PayPal® Pro, your software (s2Member Pro) is solely responsible for calculating Tax Rates. In the fields below, you can set a Global Default Tax Rate, and/or a "Custom Tax Configuration File"; which can be applied to specific countries, specific states, provinces, and even to specific zip code ranges. * Tax Rate calculations are fully compatible with international currencies and locations.</p>' . "\n";
  53. echo '<p>When you create a PayPal® Pro Form with s2Member, you\'ll be asked to supply a <em>Charge Amount</em>. Then, during checkout... s2Member calculates Tax. The calculated Tax Rate is added to the <em>Charge Amount</em> in your PayPal® Pro Shortcode. The Tax Rate will be displayed to a Customer during checkout, <strong>after</strong> they\'ve supplied a Billing Address. For example, if you create a PayPal® Pro Form that charges a Customer <strong>$24.95</strong>, and the Tax Rate is configured as 7.0%; s2Member will automatically calculate the Tax as $1.75. A Customer will pay the Total Amount (<em>Charge</em> + Tax = <strong>$26.70</strong>).</p>' . "\n";
  54. echo '<p><em><strong>*Quick Tip*</strong> If you configure Tax, it\'s good to include a note somewhere in the <code>desc=""</code> attribute of your Shortcode. Something like <code>desc="$x.xx (plus tax)"</code>.</em></p>' . "\n";
  55.  
  56. echo '<table class="form-table">' . "\n";
  57. echo '<tbody>' . "\n";
  58. echo '<tr>' . "\n";
  59.  
  60. echo '<th>' . "\n";
  61. echo '<label for="ws-plugin--s2member-pro-default-tax">' . "\n";
  62. echo 'Global Default Tax Rate:' . "\n";
  63. echo '</label>' . "\n";
  64. echo '</th>' . "\n";
  65.  
  66. echo '</tr>' . "\n";
  67. echo '<tr>' . "\n";
  68.  
  69. echo '<td>' . "\n";
  70. echo '<input type="text" autocomplete="off" name="ws_plugin__s2member_pro_default_tax" id="ws-plugin--s2member-pro-default-tax" value="' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_default_tax"]) . '" /><br />' . "\n";
  71. echo 'This can be a flat tax <code>(1.75)</code>, or a percentage <code>( 7.0% )</code>.' . "\n";
  72. echo '</td>' . "\n";
  73.  
  74. echo '</tr>' . "\n";
  75. echo '<tr>' . "\n";
  76.  
  77. echo '<th>' . "\n";
  78. echo '<label for="ws-plugin--s2member-pro-tax-rates">' . "\n";
  79. echo 'Custom Tax Configuration File (one rate per line)<br />' . "\n";
  80. echo 'Apply different Tax Rates by country, state/province, or zip code range:' . "\n";
  81. echo '</label>' . "\n";
  82. echo '</th>' . "\n";
  83.  
  84. echo '</tr>' . "\n";
  85. echo '<tr>' . "\n";
  86.  
  87. echo '<td>' . "\n";
  88. echo '<textarea name="ws_plugin__s2member_pro_tax_rates" id="ws-plugin--s2member-pro-tax-rates" rows="10" wrap="off" spellcheck="false">' . format_to_edit ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["pro_tax_rates"]) . '</textarea><br />' . "\n";
  89. echo 'Please use one of the following formats (<a href="#" onclick="alert(\'US=7.0%\nCA=12.0%\nHK=0.0%\nFLORIDA/US=7.5%\nIDAHO/US=6.0%\nALBERTA/CA=5.0%\nBRITISH COLUMBIA/CA=12.0%\n32000-34999/US=7.5%\n83200-83999/US=6.0%\n32601/US=6.5%\'); return false;">click for examples</a>)<br /><br />' . "\n";
  90. echo '<code>2-CHARACTER COUNTRY CODE = Flat rate or percentage.</code> — low precedence<br />' . "\n";
  91. echo '<code>STATE OR PROVINCE/2-CHARACTER COUNTRY CODE = Flat rate or percentage.</code> — higher precedence<br />' . "\n";
  92. echo '<code>ZIP CODE-ZIP CODE/2-CHARACTER COUNTRY CODE = Flat rate or percentage.</code> — higher precedence (zip code range)<br />' . "\n";
  93. echo '<code>ZIP CODE/2-CHARACTER COUNTRY CODE = Flat rate or percentage.</code> — highest precedence (specific zip code)' . "\n";
  94. echo '</td>' . "\n";
  95.  
  96. echo '</tr>' . "\n";
  97. echo '</tbody>' . "\n";
  98. echo '</table>' . "\n";
  99. echo '</div>' . "\n";
  100.  
  101. echo '</div>' . "\n";
  102. }
  103. }
  104. }
  105.  
  106. new c_ws_plugin__s2member_pro_menu_page_paypal_ops_tax_rates ();
  107. ?>

pro\s2member-pro\includes\menu-pages\paypal-ops-tax-rates.inc.php

Source Code Documentation