Changeset 2367528
- Timestamp:
- 08/24/2020 02:38:33 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fitweb-bizappay-for-woocommerce/trunk/src/bizappay.php
r2366673 r2367528 149 149 $status_id = filter_input(INPUT_GET, "status_id", FILTER_SANITIZE_NUMBER_INT); 150 150 $transaction_id = !filter_input(INPUT_GET, "transaction_id", FILTER_SANITIZE_FULL_SPECIAL_CHARS); 151 $hash = !filter_input(INPUT_GET, "hash", FILTER_SANITIZE_FULL_SPECIAL_CHARS); 152 153 // if ( isset( $_REQUEST['status_id'] ) && isset( $_REQUEST['order_id'] ) && isset( $_REQUEST['msg'] ) && isset( $_REQUEST['transaction_id'] ) && isset( $_REQUEST['hash'] ) ) { 151 $hash = filter_input(INPUT_GET, "hash", FILTER_SANITIZE_FULL_SPECIAL_CHARS); 152 $porder_id = filter_input(INPUT_POST, "order_id", FILTER_SANITIZE_FULL_SPECIAL_CHARS); 153 # Check if the data sent is valid based on the hash value 154 $hash_value = filter_var(md5( $this->secretkey . $_REQUEST['status_id'] . $_REQUEST['order_id'] . $_REQUEST['transaction_id'] . $_REQUEST['msg'] ),FILTER_SANITIZE_SPECIAL_CHARS); 155 154 156 if ( isset($status_id) && isset($order_id) && $msg==true && isset($transaction_id) && isset($hash) ) { 155 157 156 158 global $woocommerce; 157 159 158 $is_callback = isset( $ _POST['order_id']) ? true : false;159 160 $order = wc_get_order( $ _REQUEST['order_id']);160 $is_callback = isset( $porder_id ) ? true : false; 161 162 $order = wc_get_order( $order_id ); 161 163 162 164 $old_wc = version_compare( WC_VERSION, '3.0', '<' ); … … 165 167 166 168 if ( $order && $order_id != 0 ) { 167 168 # Check if the data sent is valid based on the hash value 169 $hash_value = md5( $this->secretkey . $_REQUEST['status_id'] . $_REQUEST['order_id'] . $_REQUEST['transaction_id'] . $_REQUEST['msg'] ); 170 171 172 if ( $hash_value == $_REQUEST['hash'] ) { 173 if ( $_REQUEST['status_id'] == 1 || $_REQUEST['status_id'] == '1' ) { 169 170 if ( $hash_value == $hash ) { 171 if ( $status_id == 1 || $status_id == '1' ) { 174 172 if ( strtolower( $order->get_status() ) == 'pending' || strtolower( $order->get_status() ) == 'processing' ) { 175 173 # only update if order is pending … … 177 175 $order->payment_complete(); 178 176 179 $order->add_order_note( 'Payment successfully made through Bizappay. Transaction reference is ' . $ _REQUEST['transaction_id']);177 $order->add_order_note( 'Payment successfully made through Bizappay. Transaction reference is ' . $transaction_id ); 180 178 } 181 179
Note: See TracChangeset
for help on using the changeset viewer.