Plugin Directory

Changeset 1374790


Ignore:
Timestamp:
03/19/2016 09:23:23 PM (10 years ago)
Author:
zonalhost
Message:

Debug Option Added

Location:
2cpay/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 2cpay/trunk/2cpay.php

    r1374659 r1374790  
    55Plugin URI: https://www.zonalhost.com
    66Description: 2Checkout Payment Gateway Plugin for Woocommerce.
    7 Version: 1.1
     7Version: 1.2
    88Author: ZonalHost
    99Author URI: https://www.zonalhost.com
  • 2cpay/trunk/includes/gateway.php

    r1374635 r1374790  
    4747        $hashOrder = $_REQUEST['order_number']; //2Checkout Order Number
    4848        $StringToHash = strtoupper(md5($hashSecretWord . $hashSid . $hashOrder . $hashTotal));
     49        $header_received = json_encode(print_r($_POST, true));
    4950        if ($StringToHash != $_REQUEST['key']) {
    5051            wc_add_notice('2Checkout payment could not be completed. Error - Hash Mismatch', 'error');
    51         $order->add_order_note( __( 'Error: 2Checkout payment could not be completed.') );
    52          
     52            $order->add_order_note( __( 'Error: 2Checkout payment could not be completed.') );
    5353        } else {
    54           $header_received = json_encode(print_r($_POST, true));
    55         $order->add_order_note( __( 'Header Received: ' .$header_received , 'zh-2cpay' ) );
    56         $order->payment_complete();
    57         $woocommerce->cart->empty_cart();
     54            $order->payment_complete();
     55            $woocommerce->cart->empty_cart();
    5856        }
    59                        
    6057        } else {
    6158        wc_add_notice('2Checkout payment could not be completed', 'error');
    6259        $order->add_order_note( __( 'Error: 2Checkout payment could not be completed.') );
     60        }
     61        if ($this->debug == '1') {
     62        $order->add_order_note( __( 'Header Received: ' .$header_received , 'zh-2cpay' ) );
    6363        }
    6464    }
     
    104104            'type'      => 'select',
    105105            'description' => __( 'Place the payment gateway in test mode.', 'zh-2cpay' ),
     106            'options'     => array(
     107                '0'          => __( 'No', 'woocommerce' ),
     108                '1' => __( 'Yes', 'woocommerce' )
     109            )
     110        ),
     111        'debug' => array(
     112            'title'     => __( 'Debug Mode', 'zh-2cpay' ),
     113            'label'     => __( 'Enable Debug Mode', 'zh-2cpay' ),
     114            'type'      => 'select',
     115            'description' => __( 'Store headers as order note received from 2Checkout.', 'zh-2cpay' ),
    106116            'options'     => array(
    107117                '0'          => __( 'No', 'woocommerce' ),
  • 2cpay/trunk/readme.txt

    r1374653 r1374790  
    55Requires at least: 4.1
    66Tested up to: 4.4.2
    7 Stable tag: 1.1
     7Stable tag: 1.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3434
    3535== Changelog ==
     36= 1.2 =
     37* Debug option added.
     38
    3639= 1.1 =
    3740* Installation instruction improved.
Note: See TracChangeset for help on using the changeset viewer.