Plugin Directory

Changeset 3432938


Ignore:
Timestamp:
01/05/2026 05:29:04 PM (3 months ago)
Author:
bulletproofcheckout
Message:

Remove unsused admin notice

Location:
bulletproof-checkout-lite/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • bulletproof-checkout-lite/trunk/README.txt

    r3404386 r3432938  
    33Tags: woocommerce, 3DS, payment gateway, bulletproof, chargeback, fraud prevention
    44WC requires at least: 5.0
    5 WC tested up to: 10.3.5
     5WC tested up to: 10.3.7
    66Tested up to: 6.8.3
    7 Stable tag: 1.0.22
     7Stable tag: 1.0.24
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    237237= 1.0.22 =
    238238Added custom logger to the Wordpress Logs
     239= 1.0.24 =
     240Remove unused admin notices
  • bulletproof-checkout-lite/trunk/bulletproof-checkout-lite.php

    r3404386 r3432938  
    44 * Plugin URI: https://www.bulletproof-checkout.com/
    55 * Description: Protect your credit card payments with 3D Secure (3DS) and say goodbye to chargebacks.
    6  * Version: 1.0.23
     6 * Version: 1.0.24
    77 * Author: BulletProof Checkout <support@bulletproof-checkout.com>
    88 * Author URI: https://www.bulletproof-checkout.com/
     
    1111 * Text Domain: bulletproof-checkout-lite
    1212 * WC requires at least: 5.0
    13  * WC tested up to: 10.3.5
    14  * Tested up to: 6.8.3
     13 * WC tested up to: 10.3.7
     14 * Tested up to: 6.9
    1515 * Requires PHP: 7.4
    1616 * Requires Plugins: woocommerce
  • bulletproof-checkout-lite/trunk/includes/class-wc-bulletproof-payment-gateway-lite.php

    r3404386 r3432938  
    350350    public function bulletproof_payment_response_handler()
    351351    {
     352        $logger = wc_get_logger();
     353        $context = array('source' => 'bpcheckout-App');
    352354        // Check if the order status has already been updated.
    353355        $status_updated = false;
     
    365367        // Code for processing payment responses based on query parameters.
    366368        // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     369
     370        $logger->info("Data received in the payment response handler: bulletproof_payment_response_handler()", $context);
     371        $logger->info(print_r($_GET, true), $context);
    367372
    368373        // Non-3DS customers also will be able to update their postmeta information
     
    382387                    if ($status_after_payment_completed != "bp_donotchange") {
    383388                        $order->update_status($status_after_payment_completed, __('Status after payment received updated by the BulletProof Plugin. ', 'bulletproof-checkout-lite'));
    384                         $the_msg = 'Status updated by the BulletProof Plugin due to sale method found is:' . $sale_method_found . '. ';
     389                        $the_msg = 'Status updated by the BulletProof Plugin Order#:' . $order_id . ' due to sale method found is:' . $sale_method_found . '. Status assigned:' . $status_after_payment_completed;
     390                        $logger->info($the_msg, $context);
    385391                    }
    386392                }
     
    394400                if ($order) {
    395401                    $order->update_status('wc-on-hold', __($the_msg, 'bulletproof-checkout-lite'));
     402                    $the_msg .= ' Status assigned: on-hold . Order#'     . $order_id;
     403                    $logger->info($the_msg, $context);
    396404                }
    397405            }
     
    400408                $order->update_meta_data('_bulletproof_gateway_action_type', $sale_method_found);
    401409                $order->save();
     410                $logger->info("Update the transaction ID  for Order#:" . $order_id." to: " . $transaction_id, $context);
    402411            }
    403412            WC()->cart->empty_cart();
     
    420429                    $order->update_status('wc-failed');
    421430                    $order->add_order_note($failed_msg);
     431                    $logger->info("The transaction for Order#:" . $order_id." was failed. " . $failed_msg, $context);
    422432                }
    423433            }
     
    710720    public function process_refund($order_id, $amount = null, $reason = '')
    711721    {
    712 
     722        error_log('BulletProof is Starting refund Order id#: ' . $order_id);
    713723        // setting log class
    714724        $logger = wc_get_logger();
  • bulletproof-checkout-lite/trunk/includes/class-wc-bulletproof-shop-orders.php

    r3404386 r3432938  
    9494
    9595                $transaction_id = return_meta_data_lite($result_found, '_transaction_id');
    96                 $card_type = return_meta_data_lite($result_found, "_gateway_cctype", true);
     96                $card_type = return_meta_data_lite($result_found, "_gateway_cctype");
    9797                // Check the transaction information
    9898                if (($card_type == "") && ($transaction_id != "")) {
     
    165165                $refund_date = return_meta_data_lite($result_found, '_bulletproof_gateway_void_or_refund_date');
    166166                $action_type = return_meta_data_lite($result_found, '_bulletproof_gateway_action_type');
    167                 $any_cancel_reason = return_meta_data_lite($result_found, "_order_cancelled_reason", true);
    168                 $transaction_type = strtoupper(return_meta_data_lite($result_found, '_bulletproof_gateway_action_type', true));
    169                 $billing_first_name = return_meta_data_lite($result_found, "_gateway_first_name", true);
    170                 $billing_last_name = return_meta_data_lite($result_found, "_gateway_last_name", true);
     167                $any_cancel_reason = return_meta_data_lite($result_found, "_order_cancelled_reason");
     168                $transaction_type = strtoupper(return_meta_data_lite($result_found, '_bulletproof_gateway_action_type'));
     169                $billing_first_name = return_meta_data_lite($result_found, "_gateway_first_name");
     170                $billing_last_name = return_meta_data_lite($result_found, "_gateway_last_name");
    171171                if ($card_last4 == "") {
    172                     $card_last4 = return_meta_data_lite($result_found, "_gateway_last4", true);
     172                    $card_last4 = return_meta_data_lite($result_found, "_gateway_last4");
    173173                }
    174174                if ($card_first6 == "") {
    175                     $card_first6 = return_meta_data_lite($result_found, "_gateway_first6", true);
     175                    $card_first6 = return_meta_data_lite($result_found, "_gateway_first6");
    176176                }
    177177                // Cardholder Authentication
    178                 $cavv = return_meta_data_lite($result_found, "_gateway_cavv", true);
    179                 $eci = return_meta_data_lite($result_found, "_gateway_eci", true);
    180                 $cardholder_auth = return_meta_data_lite($result_found, "_gateway_cardholder_auth", true);
    181                 $display_transaction_id = return_meta_data_lite($result_found, '_payment_gateway_tx_received_prewebhook', true);
     178                $cavv = return_meta_data_lite($result_found, "_gateway_cavv");
     179                $eci = return_meta_data_lite($result_found, "_gateway_eci");
     180                $cardholder_auth = return_meta_data_lite($result_found, "_gateway_cardholder_auth");
     181                $display_transaction_id = return_meta_data_lite($result_found, '_payment_gateway_tx_received_prewebhook');
    182182                if ($display_transaction_id == "") $display_transaction_id = $transaction_id;
    183183
     
    18351835        $context = array('source' => 'bpcheckout-App');
    18361836        $logger->info("Status update of the order ID#:" . $order_id . " was detected, the old status was:" . $old_status . ", the new status is:" . $new_status, $context);
    1837         if (($order_id != "") && ($old_status == "completed" || $old_status == "processing") && (($new_status == "cancelled") || ($new_status == "refunded"))) {
    1838 
    1839             $logger->info("Starting refund from the BulletProof Lite Plugin for the Order ID#:" . $order_id, $context);
     1837        if (($order_id != "") && (($new_status == "cancelled") || ($new_status == "refunded"))) {
     1838
     1839            $logger->info("New status for a potential refund for the Order ID#:" . $order_id . " was detected", $context);
    18401840            // Check if the order was paid using the BulletProof Lite plugin (or the BulletProof plus plugin)
    18411841            // $order = wc_get_order($order_id); // not needed as the action has a extra new parameter which includes the $order
     
    18471847
    18481848                if ((!empty($payment_method_used)) && (($payment_method_used == "bulletproof_bpcheckout_lite") || ($payment_method_used == "bulletproof_bpcheckout"))) {
     1849                    $logger->info("Starting refund from the BulletProof Lite Plugin for the Order ID#:" . $order_id, $context);
    18491850                    // check if was previously refunded
    18501851                    $earlier_refund = $order->get_meta('_bulletproof_refunded', true);
     
    18611862                    if ($days_diff < 365) {  // limited to two years refund period
    18621863                        $lite_gateway = new Bulletproof_Payment_Gateway_Lite();
    1863                         $response_refund = $lite_gateway->process_refund($order_id, $order->get_total());
     1864                        $response_refund = $lite_gateway->process_refund($order_id, $order->get_total(), "");
    18641865                        unset($lite_gateway); // Remove the Object from memory ASAP
    18651866                        if (is_wp_error($response_refund)) {
     
    18831884                            return false;
    18841885                        } else {
    1885                             $the_msg = "Order " . $order_id . " was refunded succesfully after status update from ".$old_status." to ".$new_status.".";
     1886                            $the_msg = "Order " . $order_id . " was refunded succesfully after status update from " . $old_status . " to " . $new_status . ".";
    18861887                            $logger->info($the_msg, $context);
    1887                                 /*
     1888                            /*
    18881889                            try {
    18891890                                $current_user = wp_get_current_user();
     
    19461947                    }
    19471948                } else {
    1948                     error_log("Order " . $order_id . " was not refunded by BulletProof because was originally paid with other payment gateway");
    1949                     $order->add_order_note("This order can not be refunded by BulletProof because was paid on another payment gateway");
    1950                     $order->save();
    1951                     return false;
     1949                    $logger->info("Order " . $order_id . " was not refunded by BulletProof because was originally paid with other payment gateway", $context);
     1950                    //$order->add_order_note("This order can not be refunded by BulletProof because was paid on another payment gateway");
     1951                    //$order->save();
     1952                    //return false;
    19521953                }
    19531954            }
     
    20092010                $security_key = "";
    20102011            }
    2011             if (($username == "") || ($password == "") || ($security_key == "")) {
    2012                 // Add admin notice
     2012            if (class_exists('WC_Admin_Notices')) {
    20132013                $adminnotice = new WC_Admin_Notices();
    2014                 $setting_link = admin_url('admin.php?page=wc-settings&tab=checkout&section=bulletproof_bpcheckout_lite');
    2015                 $adminnotice->add_custom_notice("", sprintf(__("BulletProof Checkout Lite is almost ready. To get started, <a href='%s'>set your BulletProof Checkout Lite account keys</a>.", 'wc-nmi'), $setting_link));
    2016                 $adminnotice->output_custom_notices();
     2014                if ((is_plugin_active('bulletproof-checkout-lite/bulletproof-checkout-lite.php')) && is_plugin_active('woocommerce/woocommerce.php')) {
     2015
     2016                    // The enabled property will be 'yes' if enabled, 'no' if disabled in settings.
     2017
     2018                    if ((isset($gateway_settings['enabled'] )&&($gateway_settings['enabled'] === 'yes'))) {
     2019                        if (($username == "") || ($password == "") || ($security_key == "")) {
     2020                            // Add admin notice
     2021                            $setting_link = admin_url('admin.php?page=wc-settings&tab=checkout&section=bulletproof_bpcheckout_lite');
     2022                            $adminnotice->add_custom_notice("BPLITEADD", sprintf(__("BulletProof Checkout Lite is almost ready. To get started, <a href='%s'>set your BulletProof Checkout Lite account keys</a>.", 'wc-nmi'), $setting_link));
     2023                            //$adminnotice->output_custom_notices();
     2024                        } else {
     2025                            if ($adminnotice->has_notice("BPLITEADD")) {
     2026                                $adminnotice->remove_notice("BPLITEADD");
     2027                            }
     2028                        }
     2029                    } else {
     2030                        if ($adminnotice->has_notice("BPLITEADD")) {
     2031                            $adminnotice->remove_notice("BPLITEADD");
     2032                        }
     2033                    }
     2034                } else {
     2035                    if ($adminnotice->has_notice("BPLITEADD")) {
     2036                        $adminnotice->remove_notice("BPLITEADD");
     2037                    }
     2038                }
    20172039            }
    20182040            if (class_exists('Jetpack') && Jetpack::is_module_active('notes')) {
  • bulletproof-checkout-lite/trunk/includes/class-wc-bulletproof-webhook.php

    r3368943 r3432938  
    230230    {
    231231        if ((isset($data['order_id'])) && (is_numeric($data['order_id']))) {
     232            if (isset($data['transaction_id'])){
     233                $transaction_id = $data['transaction_id'];
     234            } else {
     235                $transaction_id = "";
     236            }
    232237            $order = wc_get_order($data['order_id']);
    233238            if ($order) {
    234                 if ($order && ($order->get_status() === 'pending' || $order->get_status() === 'Pending payment') || ($order->get_status() === 'completed') || ($order->get_status() === $status_after_order_completed)) {
     239                //if ($order && ($order->get_status() === 'pending' || $order->get_status() === 'Pending payment') || ($order->get_status() === 'completed') || ($order->get_status() === $status_after_order_completed)) {
     240                if ($order && ($order->get_status() != 'refunded' && $order->get_status() != 'cancelled')) {
    235241                    // Only if the payment method used was the BulletProof Lite Plugin will update the status
    236242                    $payment_method_used = $order->get_meta('_payment_method', true);
     
    261267                            $currency_symbol = get_woocommerce_currency_symbol($currency_code);
    262268                            $the_msg = "Partial refund issued by the BulletProof Gateway for " . $currency_symbol . number_format($data['requested_amount'], 2, '.', '');
     269                            if ($transaction_id!=""){
     270                                $the_msg .= " for transaction " . $transaction_id;
     271                            }
    263272                            $order->add_order_note($the_msg);
    264273                        }
     
    439448                                        header("HTTP/1.0 404 " . $msg, true, 404);
    440449                                        echo json_encode($msg);
     450                                        error_log("BulletProof Webhook error: " . $msg . " IP Address:" . $the_ip. " Event Type:".$event_type);
    441451                                        die();
    442452                                        break;
    443453                                }
    444454                                echo json_encode("OK");
     455                                error_log("BulletProof executed webhook successfully for IP Address:" . $the_ip . " Event Type:".$event_type);
    445456                                die();
    446457                            } else {
     
    466477            header("HTTP/1.0 404 " . $msg, true, 404);
    467478            echo json_encode($msg);
     479            error_log("BulletProof Webhook error: " . $msg . " IP Address:" . $the_ip);
    468480        } else {
    469481            header("HTTP/1.0 404 Not Authorized", true, 404);
    470482            echo json_encode("Not Authorized. IP Address:" . $the_ip);
     483            error_log("BulletProof Webhook unauthorized access attempt from IP Address:" . $the_ip);
    471484        }
    472485    }
Note: See TracChangeset for help on using the changeset viewer.