Plugin Directory

Changeset 3288430


Ignore:
Timestamp:
05/06/2025 12:12:08 PM (10 months ago)
Author:
razorpay
Message:

Update: 4.7.4

Location:
woo-razorpay/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • woo-razorpay/trunk/readme.txt

    r3282256 r3288430  
    44Requires at least: 3.9.2
    55Tested up to: 6.8
    6 Stable tag: 4.7.3
     6Stable tag: 4.7.4
    77Requires PHP: 7.0
    88License: GPLv2 or later
     
    6969
    7070== Changelog ==
     71
     72= 4.7.4 =
     73* Added cron instrumentation.
     74* Changed order status in webhook table on callback failure.
    7175
    7276= 4.7.3 =
  • woo-razorpay/trunk/woo-razorpay.php

    r3282256 r3288430  
    44 * Plugin URI: https://razorpay.com
    55 * Description: Razorpay Payment Gateway Integration for WooCommerce.Razorpay Welcome Back Offer: New to Razorpay? Sign up to enjoy FREE payments* of INR 2 lakh till March 31st! Transact before January 10th to grab the offer.
    6  * Version: 4.7.3
    7  * Stable tag: 4.7.3
     6 * Version: 4.7.4
     7 * Stable tag: 4.7.4
    88 * Author: Team Razorpay
    99 * WC tested up to: 9.1.2
     
    19311931            $this->updateOrder($order, $success, $error, $razorpayPaymentId, null);
    19321932
    1933             try
    1934             {
    1935                 // update order status in webhook table
    1936                 $sessionKey = $this->getOrderSessionKey($orderId);
    1937                 $razorpayOrderId = '';
    1938 
    1939                 if(get_transient($sessionKey))
    1940                 {
    1941                     $razorpayOrderId = get_transient($sessionKey);
    1942                 }
    1943                 else
    1944                 {
    1945                     $razorpayOrderId = $woocommerce->session->get($sessionKey);
    1946                 }
    1947 
    1948                 $wpdb->update(
    1949                     $wpdb->prefix . 'rzp_webhook_requests',
    1950                     array(
    1951                         'rzp_update_order_cron_status' => self::RZP_ORDER_PROCESSED_BY_CALLBACK
    1952                     ),
    1953                     array(
    1954                         'integration'   => self::RZP_INTEGRATION,
    1955                         'order_id'      => $orderId,
    1956                         'rzp_order_id'  => $razorpayOrderId
    1957                     )
    1958                 );
    1959             }
    1960             catch (Exception $e)
    1961             {
    1962                 rzpLogError("Failed to update order by callback in rzp_webhook_requests table: " . $e->getMessage());
     1933            if ($success)
     1934            {
     1935                try
     1936                {
     1937                    // update order status in webhook table
     1938                    $sessionKey = $this->getOrderSessionKey($orderId);
     1939                    $razorpayOrderId = '';
     1940
     1941                    if(get_transient($sessionKey))
     1942                    {
     1943                        $razorpayOrderId = get_transient($sessionKey);
     1944                    }
     1945                    else
     1946                    {
     1947                        $razorpayOrderId = $woocommerce->session->get($sessionKey);
     1948                    }
     1949
     1950                    $wpdb->update(
     1951                        $wpdb->prefix . 'rzp_webhook_requests',
     1952                        array(
     1953                            'rzp_update_order_cron_status' => self::RZP_ORDER_PROCESSED_BY_CALLBACK
     1954                        ),
     1955                        array(
     1956                            'integration'   => self::RZP_INTEGRATION,
     1957                            'order_id'      => $orderId,
     1958                            'rzp_order_id'  => $razorpayOrderId
     1959                        )
     1960                    );
     1961                }
     1962                catch (Exception $e)
     1963                {
     1964                    rzpLogError("Failed to update order by callback in rzp_webhook_requests table: " . $e->getMessage());
     1965                }
    19631966            }
    19641967
     
    30973100     * Create cron with 5 min interval
    30983101     **/
    3099     if (!wp_next_scheduled('rzp_webhook_exec_cron'))
     3102    try
    31003103    {
    3101         wp_schedule_event(time(), 'rzp_webhook_cron_interval', 'rzp_webhook_exec_cron');
    3102         rzpLogInfo("rzp_webhook_exec_cron cron created");
     3104        if (!wp_next_scheduled('rzp_webhook_exec_cron'))
     3105        {
     3106            wp_schedule_event(time(), 'rzp_webhook_cron_interval', 'rzp_webhook_exec_cron');
     3107            rzpLogInfo("rzp_webhook_exec_cron cron created");
     3108        }
     3109    }
     3110    catch (Exception $e)
     3111    {
     3112        $rzp = new WC_Razorpay();
     3113        $key_id = $rzp->getSetting('key_id');
     3114        $trackObject = $rzp->newTrackPluginInstrumentation($key_id, '');
     3115
     3116        $properties = [
     3117            'webhookCronCreationSuccess' => false
     3118        ];
     3119
     3120        $trackObject->rzpTrackDataLake('webhookCron.creation', $properties);
    31033121    }
    31043122
     
    31983216            rzpLogInfo("Webhook table creation failed: ". $e->getMessage());
    31993217            delete_option('rzp_webhook_setup');
     3218           
     3219            $rzp = new WC_Razorpay();
     3220            $key_id = $rzp->getSetting('key_id');
     3221            $trackObject = $rzp->newTrackPluginInstrumentation($key_id, '');
     3222            $properties = [
     3223                'webhookCronTableSetupSuccess' => false
     3224            ];
     3225
     3226            $trackObject->rzpTrackDataLake('webhookCron.tableSetup', $properties);
    32003227        }
    32013228    }
Note: See TracChangeset for help on using the changeset viewer.