Changeset 3288430
- Timestamp:
- 05/06/2025 12:12:08 PM (10 months ago)
- Location:
- woo-razorpay/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
woo-razorpay.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woo-razorpay/trunk/readme.txt
r3282256 r3288430 4 4 Requires at least: 3.9.2 5 5 Tested up to: 6.8 6 Stable tag: 4.7. 36 Stable tag: 4.7.4 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 69 69 70 70 == Changelog == 71 72 = 4.7.4 = 73 * Added cron instrumentation. 74 * Changed order status in webhook table on callback failure. 71 75 72 76 = 4.7.3 = -
woo-razorpay/trunk/woo-razorpay.php
r3282256 r3288430 4 4 * Plugin URI: https://razorpay.com 5 5 * 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. 37 * Stable tag: 4.7. 36 * Version: 4.7.4 7 * Stable tag: 4.7.4 8 8 * Author: Team Razorpay 9 9 * WC tested up to: 9.1.2 … … 1931 1931 $this->updateOrder($order, $success, $error, $razorpayPaymentId, null); 1932 1932 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 } 1963 1966 } 1964 1967 … … 3097 3100 * Create cron with 5 min interval 3098 3101 **/ 3099 if (!wp_next_scheduled('rzp_webhook_exec_cron'))3102 try 3100 3103 { 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); 3103 3121 } 3104 3122 … … 3198 3216 rzpLogInfo("Webhook table creation failed: ". $e->getMessage()); 3199 3217 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); 3200 3227 } 3201 3228 }
Note: See TracChangeset
for help on using the changeset viewer.