Changeset 1258901
- Timestamp:
- 10/03/2015 06:19:06 PM (11 years ago)
- Location:
- ec-authorizenet/trunk
- Files:
-
- 3 edited
-
index.php (modified) (10 diffs)
-
readme.txt (modified) (5 diffs)
-
scripts/ajax_req.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ec-authorizenet/trunk/index.php
r892521 r1258901 11 11 * 2. Get Images name through admin settings and use it from the plugin image directory 12 12 * 3. test comment 13 14 * Updates (To be tested) 15 * 1. Updated Header text on receipt page through x_header_html_receipt 126 => Done 16 * 2. Added invoice number in payment form 17 * 3. Added in admin enable/disable invoice number field 18 * 4. Added div around form for styling id=ec_authorize_form_div and class=ec_authorize_form_div 19 * 5. Updated the label for transaction mode "live" is now "live (Production Environment)" 20 * 13 21 */ 14 22 … … 30 38 private $auth_description = ''; 31 39 private $default_amount = ''; 40 //v 0.2 updates 41 private $receipt_header_text = 'THANK YOU FOR MAKING A PAYMENT'; 42 private $invoice_number = 'Invoice Number'; 43 private $enable_invoice = 'disable'; 44 //end v 0.2 updates 32 45 private $error_code = array(); 33 46 … … 73 86 if ($custom_amount == true && $custom_amount != '') { 74 87 $amount_type = 'text'; 75 76 return "<form id='ajaxform' method='post' action='{$action_url }'> 88 $enable_invoice = ($enable_invoice=='' || $enable_invoice =='disable') ? 'hidden' : 'text'; 89 90 91 return "<div id='ec_authorize_form_div' class='ec_authorize_form_div'><form id='ajaxform' method='post' action='{$action_url }'> 77 92 <table border='0' style='border:none; width:135px;' > 78 93 <tr><td><input type='{$amount_type}' id='amount_ajax' name='amount_ajax' placeholder='{$placeholder_text}' style='width:95%;' /></td></tr> 94 <tr><td><input type='{$enable_invoice}' id='invoice_ajax' name='invoice_ajax' placeholder='{$invoice_number}' style='width:95%;' /></td></tr> 79 95 <tr><td><input type = 'image' id='image_submit_auth_ajax' src ='{$button_image}' /></td></tr> 80 96 </table> 81 </form>< div id='auth_form_div'></div>";97 </form></div><div id='auth_form_div'></div>"; 82 98 } else { 83 99 $this->get_auth_form($param_arr); … … 97 113 $test_mode = 'false'; 98 114 } 99 100 return "<form name='auth_form' id='auth_form' method='post' action='{$action_url}'> 115 //v 0.2 updated x_header_html_receipt to have receipt_header_text and include invoice number 116 $enable_invoice = ($enable_invoice=='' || $enable_invoice =='disable') ? 'hidden' : 'text'; 117 118 return "<div id='ec_authorize_form_div' class='ec_authorize_form_div'>" 119 . "<form name='auth_form' id='auth_form' method='post' action='{$action_url}'> 101 120 <input type='hidden' name='x_login' value='" . $api_login_id . "' /> 102 121 <input type='hidden' name='x_fp_hash' value='" . $fingerprint . "' /> … … 112 131 <input type='hidden' name='x_logo_url' value='{$logo_url}' /> 113 132 <input type='hidden' name='x_receipt_link_method' value='{$logo_url}' /> 114 <input type='hidden' name='x_header_html_receipt' value='{$ logo_url}' />133 <input type='hidden' name='x_header_html_receipt' value='{$receipt_header_text}' /> 115 134 <input type='hidden' name='x_test_request' value='{$test_mode}' /> 116 135 <input type='{$enable_invoice}' name='x_invoice_num' placeholder='{$invoice_number}' value='{$invoice_number}' /> 117 136 <input type = 'image' src ='{$button_image}' /> 118 </form> ";137 </form></div>"; 119 138 } 120 139 121 140 public function shortcode_func($atts, $content = null) { 122 extract(shortcode_atts( array('amount' => '','custom_amount' => false), $atts));123 $auth_param = array();141 extract(shortcode_atts( array('amount' => '','custom_amount' => false, 'invoice_number' => $invoice_number), $atts)); 142 $auth_param = array(); 124 143 $auth_param['api_login_id'] = (get_option('api_login_id')=='') ? $this->api_login_id : get_option('api_login_id'); 125 144 $auth_param['transaction_key'] = (get_option('transaction_key')=='') ? $this->transaction_key : get_option('transaction_key'); … … 132 151 $auth_param['placeholder_text'] = (get_option('placeholder_text')=='') ? $this->placeholder_text : get_option('placeholder_text'); 133 152 $auth_param['transaction_mode'] = (get_option('transaction_mode')=='') ? $this->transaction_mode : get_option('transaction_mode'); 153 //Added in v 0.2 154 $auth_param['receipt_header_text'] = (get_option('receipt_header_text')=='') ? $this->receipt_header_text: get_option('receipt_header_text'); 155 $auth_param['invoice_number'] = ($invoice_number != '') ? $invoice_number : $this->invoice_number; 156 $auth_param['enable_invoice'] = (get_option('enable_invoice')=='') ? $this->enable_invoice : get_option('enable_invoice'); 134 157 135 158 $auth_param['header_text'] = (get_option('header_text')=='') ? $this->header_text : get_option('header_text'); 136 159 if(empty($auth_param['header_text']) || $auth_param['header_text']=='') $this->error_code[] = 4; 137 160 138 $auth_param['logo_url'] = (get_option('logo_url')=='') ? $this->logo_url : get_option('logo_url');161 $auth_param['logo_url'] = (get_option('logo_url')=='') ? $this->logo_url : get_option('logo_url'); 139 162 $auth_param['auth_description'] = (get_option('auth_description')=='') ? $this->auth_description : get_option('auth_description'); 140 163 if(empty($auth_param['auth_description']) || $auth_param['auth_description']=='') $this->error_code[] = 5; 141 164 142 $auth_param['default_amount'] = (get_option('default_amount')=='') ? $this->default_amount : get_option('default_amount');165 $auth_param['default_amount'] = (get_option('default_amount')=='') ? $this->default_amount : get_option('default_amount'); 143 166 $auth_param['amount'] = ($amount=='') ? $auth_param['default_amount'] : $amount; 144 167 … … 190 213 $auth_param['default_amount'] = (get_option('default_amount')=='') ? $this->default_amount : get_option('default_amount'); 191 214 $amount = ($_REQUEST['custom_amount']=='' || $_REQUEST['custom_amount'] < 1) ? $auth_param['default_amount'] : $_REQUEST['custom_amount']; 215 $invoice_number = ($_REQUEST['invoice_ajax']=='' || $_REQUEST['invoice_ajax'] < 1) ? $auth_param['invoice_ajax'] : $_REQUEST['invoice_ajax']; 192 216 193 217 $TPAuthorizeNetObj = new TPAuthorizeNet; 194 echo $TPAuthorizeNetObj->shortcode_func(array('custom_amount' => false, 'amount' => $amount ));218 echo $TPAuthorizeNetObj->shortcode_func(array('custom_amount' => false, 'amount' => $amount, 'invoice_number' => $invoice_number)); 195 219 } 196 220 die(); … … 212 236 register_setting('ecAuthorizenet-settings-group', 'placeholder_text'); 213 237 register_setting('ecAuthorizenet-settings-group', 'transaction_mode'); 238 //Added in v 0.2 239 register_setting('ecAuthorizenet-settings-group', 'receipt_header_text'); 240 register_setting('ecAuthorizenet-settings-group', 'enable_invoice'); 241 //end Added in v 0.2 214 242 } 215 243 … … 247 275 <td><input type="text" name="auth_description" value="<?php echo get_option('auth_description'); ?>" /></td> 248 276 </tr> 249 277 <!--Added in v 0.2--> 278 <tr valign="top"> 279 <th scope="row">Header Text To be displayed on Receipt page</th> 280 <td><input type="text" name="receipt_header_text" value="<?php echo get_option('receipt_header_text'); ?>" /></td> 281 </tr> 282 <!--end Added in v 0.2--> 283 250 284 <tr valign="top"> 251 285 <th scope="row">Submit Button Image</th> … … 271 305 272 306 ?> 273 <td><input type="radio" name="transaction_mode" value="live" <?php echo $live_checked;?> >live<br><input type="radio" name="transaction_mode" value="test" <?php echo $test_checked;?>>test</td> 274 </tr> 307 <td><input type="radio" name="transaction_mode" value="live" <?php echo $live_checked;?> >live (Production Environment)<br><input type="radio" name="transaction_mode" value="test" <?php echo $test_checked;?>>test</td> 308 </tr> 309 310 <tr valign="top"> 311 <th scope="row">Enable Invoice Field</th> 312 <?php 313 $enable_invoice_checked = $disable_invoice_checked = ''; 314 $enable_invoice_checked = (get_option('enable_invoice')=='enable') ? 'checked="checked"' : ''; 315 $disable_invoice_checked = (get_option('enable_invoice')=='disable') ? 'checked="checked"' : ''; 316 317 ?> 318 <td><input type="radio" name="enable_invoice" value="enable" <?php echo $enable_invoice_checked;?> >enable<br><input type="radio" name="enable_invoice" value="disable" <?php echo $disable_invoice_checked;?>>disable</td> 319 </tr> 320 321 275 322 276 323 </table> -
ec-authorizenet/trunk/readme.txt
r892581 r1258901 4 4 Tags: Payment, payment gateway, Authorize.net, Paypal, Stripe, 5 5 Requires at least: 3.0.1 6 Tested up to: 3.8.17 Stable tag: 0. 16 Tested up to: 4.1.8 7 Stable tag: 0.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 24 24 This section describes how to install the plugin and get it working. 25 25 e.g. 26 26 27 1. Upload `ec-authorize-net` to the `/wp-content/plugins/` directory 27 28 … … 40 41 41 42 = What is the priority wise hierarchy of the amount = 42 Amount can be specified at three levels as below 43 Amount can be specified at three levels as below 44 43 45 1. Shortcode (Highest priority) 46 44 47 2. Admin Panel 48 45 49 3. Plugin's default (Don't mess with it as this is in code) (Least priority) -- deprecated 46 50 … … 50 54 = May I get some sample Usage of the shortcode?? = 51 55 Yep Sure, You can Use following 56 52 57 1. [authorize_net] 58 53 59 2. [authorize_net amount=56] 60 54 61 3. [authorize_net custom_amount=true] 55 62 … … 59 66 60 67 == Changelog == 68 Based on your suggestions and comments plugin is updated to version 0.2. 69 Changes in this version includes 61 70 71 1. Updated Header text on receipt page 72 73 2. Added invoice number in payment form 74 75 3. Added in admin enable/disable invoice number field 76 77 4. Added div around form for styling id=ec_authorize_form_div and class=ec_authorize_form_div 78 79 5. Updated the label for transaction mode "live" is now "live (Production Environment)" 80 81 Please keep posting you suggestions and bugs. We will Incorporate your suggestions in next version. 82 83 Thanks 62 84 = 0.1 = 63 85 First Version. 86 = 0.2 = 87 1. Updated Header text on receipt page 88 89 2. Added invoice number in payment form 90 91 3. Added in admin enable/disable invoice number field 92 93 4. Added div around form for styling id=ec_authorize_form_div and class=ec_authorize_form_div 94 95 5. Updated the label for transaction mode "live" is now "live (Production Environment)" 96 97 == Upgrade Notice == 98 Although this plugin does not disturb your site settings still for a security measure please backup your data before upgrading 64 99 65 100 == Arbitrary section == 66 101 You can use shortcode as following 102 67 103 1. [authorize_net] 104 68 105 2. [authorize_net amount=56] 106 69 107 3. [authorize_net custom_amount=true] 70 108 -
ec-authorizenet/trunk/scripts/ajax_req.js
r892521 r1258901 3 3 event.preventDefault(); 4 4 var custom_amount = jQuery("#ajaxform input[name=amount_ajax]").val(); 5 //alert("custom_amount "+custom_amount ); 5 var invoice_ajax = jQuery("#ajaxform input[name=invoice_ajax]").val();//v 0.2 added for invoice number 6 //alert("invoice_ajax "+invoice_ajax ); 6 7 $.ajax({ 7 8 url: ajaxurl, 8 9 data: { 9 10 'custom_amount': custom_amount, 11 'invoice_ajax': invoice_ajax, //v 0.2 added for invoice number 10 12 'rand': Math.random()/Math.random(), 11 13 'action':'wp_tp_authorize_net_ajax'
Note: See TracChangeset
for help on using the changeset viewer.