Plugin Directory

Changeset 1258901


Ignore:
Timestamp:
10/03/2015 06:19:06 PM (11 years ago)
Author:
sftranna
Message:

tagging version 0.2

Location:
ec-authorizenet/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ec-authorizenet/trunk/index.php

    r892521 r1258901  
    1111 * 2. Get Images name through admin settings and use it from the plugin image directory
    1212 * 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 *
    1321 */
    1422
     
    3038    private $auth_description  = '';
    3139    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
    3245    private $error_code = array();
    3346
     
    7386        if ($custom_amount == true && $custom_amount != '') {
    7487            $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 }'>
    7792            <table border='0' style='border:none; width:135px;' >
    7893                <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>
    7995                <tr><td><input type = 'image' id='image_submit_auth_ajax' src ='{$button_image}' /></td></tr>
    8096            </table>
    81         </form><div id='auth_form_div'></div>";
     97        </form></div><div id='auth_form_div'></div>";
    8298        } else {
    8399            $this->get_auth_form($param_arr);
     
    97113            $test_mode = 'false';
    98114        }
    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}'>
    101120            <input type='hidden' name='x_login' value='" . $api_login_id . "' />
    102121            <input type='hidden' name='x_fp_hash' value='" . $fingerprint . "' />
     
    112131            <input type='hidden' name='x_logo_url' value='{$logo_url}' /> 
    113132            <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}' /> 
    115134            <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}' />
    117136            <input type = 'image' src ='{$button_image}' />
    118         </form>";
     137        </form></div>";
    119138    }
    120139
    121140    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();
    124143       $auth_param['api_login_id'] = (get_option('api_login_id')=='') ? $this->api_login_id : get_option('api_login_id');
    125144       $auth_param['transaction_key'] = (get_option('transaction_key')=='') ? $this->transaction_key : get_option('transaction_key');
     
    132151       $auth_param['placeholder_text'] = (get_option('placeholder_text')=='') ? $this->placeholder_text : get_option('placeholder_text');
    133152       $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');       
    134157       
    135158       $auth_param['header_text'] = (get_option('header_text')=='') ? $this->header_text : get_option('header_text');
    136159       if(empty($auth_param['header_text']) || $auth_param['header_text']=='') $this->error_code[] = 4;
    137160
    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');
    139162       $auth_param['auth_description'] = (get_option('auth_description')=='') ? $this->auth_description : get_option('auth_description');
    140163       if(empty($auth_param['auth_description']) || $auth_param['auth_description']=='') $this->error_code[] = 5;
    141164       
    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');
    143166       $auth_param['amount'] = ($amount=='') ? $auth_param['default_amount'] : $amount;
    144167           
     
    190213            $auth_param['default_amount'] = (get_option('default_amount')=='') ? $this->default_amount : get_option('default_amount');
    191214            $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'];
    192216           
    193217            $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));
    195219        }
    196220        die();
     
    212236    register_setting('ecAuthorizenet-settings-group', 'placeholder_text');
    213237    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
    214242}
    215243
     
    247275                    <td><input type="text" name="auth_description" value="<?php echo get_option('auth_description'); ?>" /></td>
    248276                </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               
    250284                <tr valign="top">
    251285                    <th scope="row">Submit Button Image</th>
     
    271305                         
    272306                    ?>
    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               
    275322                       
    276323            </table>
  • ec-authorizenet/trunk/readme.txt

    r892581 r1258901  
    44Tags: Payment, payment gateway, Authorize.net, Paypal, Stripe,
    55Requires at least: 3.0.1
    6 Tested up to: 3.8.1
    7 Stable tag: 0.1
     6Tested up to: 4.1.8
     7Stable tag: 0.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2424This section describes how to install the plugin and get it working.
    2525e.g.
     26
    26271. Upload `ec-authorize-net` to the `/wp-content/plugins/` directory
    2728
     
    4041
    4142= What is the priority wise hierarchy of the amount =
    42 Amount can be specified at three levels as below
     43Amount can be specified at three levels as below
     44
    43451. Shortcode (Highest priority)
     46
    44472. Admin Panel
     48
    45493. Plugin's default (Don't mess with it as this is in code) (Least priority) -- deprecated
    4650
     
    5054= May I get some sample Usage of the shortcode?? =
    5155Yep Sure, You can Use following
     56
    52571. [authorize_net]
     58
    53592. [authorize_net amount=56]
     60
    54613. [authorize_net custom_amount=true]
    5562
     
    5966
    6067== Changelog ==
     68Based on your suggestions and comments plugin is updated to version 0.2.
     69Changes in this version includes
    6170
     711. Updated Header text on receipt page
     72
     732. Added invoice number in payment form
     74
     753. Added in admin enable/disable invoice number field
     76
     774. Added div around form for styling id=ec_authorize_form_div and class=ec_authorize_form_div
     78
     795. Updated the label for  transaction mode "live" is now "live (Production Environment)"
     80
     81Please keep posting you suggestions and bugs. We will Incorporate your suggestions in next version.
     82
     83Thanks
    6284= 0.1 =
    6385First Version.
     86= 0.2 =
     871. Updated Header text on receipt page
     88
     892. Added invoice number in payment form
     90
     913. Added in admin enable/disable invoice number field
     92
     934. Added div around form for styling id=ec_authorize_form_div and class=ec_authorize_form_div
     94
     955. Updated the label for  transaction mode "live" is now "live (Production Environment)"
     96
     97== Upgrade Notice ==
     98Although this plugin does not disturb your site settings still for a security measure please backup your data before upgrading
    6499
    65100== Arbitrary section ==
    66101You can use shortcode as following
     102
    671031. [authorize_net]
     104
    681052. [authorize_net amount=56]
     106
    691073. [authorize_net custom_amount=true]
    70108
  • ec-authorizenet/trunk/scripts/ajax_req.js

    r892521 r1258901  
    33        event.preventDefault();
    44        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 );
    67        $.ajax({
    78            url: ajaxurl,
    89            data: {
    910                'custom_amount': custom_amount,
     11                'invoice_ajax': invoice_ajax,   //v 0.2 added for invoice number
    1012                'rand': Math.random()/Math.random(),
    1113                'action':'wp_tp_authorize_net_ajax'
Note: See TracChangeset for help on using the changeset viewer.