• I am writing to report a logical bug identified in the latest version (1.0.2) of the Viva.com Smart Checkout for WooCommerce plugin.

    Problem Description: After a successful payment, customers are redirected to the “Thank You” page but frequently see the message: “Order is currently awaiting payment. After successful payment, we will send you an email confirmation.” alongside the payment buttons. This happens even when the transaction is successful and the order status has already been updated to “Processing” via webhook.

    Technical Root Cause: In includes/class-wc-vivacom-smart-endpoints.php, the function notify_pending_payment() is hooked to woocommerce_thankyou_vivacom_smart. This function prints the “pending” message without verifying the actual status of the order.

    Recommended Fix: The function should be updated to check the order status before rendering the message. Here is the suggested code correction:

    PHP

    public function notify_pending_payment() {
        global $wp;
        $order_id = isset( $wp->query_vars['order-received'] ) ? intval( $wp->query_vars['order-received'] ) : 0;
        if ( $order_id ) {
            $order = wc_get_order( $order_id );
            if ( $order && $order->get_status() === 'pending' ) {
                echo '<p>' . esc_html__( 'Order is currently awaiting payment...', 'viva-com-smart-for-woocommerce' ) . '</p>';
            }
        }
    }
    

    Please forward this to your development team for inclusion in the next update to prevent customer confusion.

You must be logged in to reply to this topic.