PluginProbe ʕ •ᴥ•ʔ
Razorpay for WooCommerce / 4.8.6
Razorpay for WooCommerce v4.8.6
4.8.6 4.8.5 4.8.4 trunk 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.5.0 1.5.1 1.5.2 1.5.3 1.6.0 1.6.0-beta 1.6.1 1.6.2 1.6.3 1.6.5 2.0.0 2.0.1 2.1.0 2.2.0 2.3.0 2.3.1 2.3.2 2.4.0 2.4.1 2.4.2 2.4.3 2.5.0 2.6.0 2.7.0 2.7.1 2.7.2 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 3.0.0 3.0.1 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 3.3.0 3.4.0 3.4.1 3.5.0 3.5.1 3.6.0 3.7.0 3.7.1 3.7.2 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.0.1 4.1.0 4.2.0 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.4.0 4.4.1 4.4.2 4.4.3 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 4.5.7 4.5.8 4.5.9 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.6.8 4.6.9 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.7.6 4.7.7 4.7.8 4.7.9 4.8.0 4.8.1 4.8.2 4.8.3
woo-razorpay / includes / support / smart-coupons.php
woo-razorpay / includes / support Last commit date
abandoned-cart-hooks.php 3 years ago cartbounty.php 3 years ago smart-coupons.php 5 months ago wati.php 2 years ago
smart-coupons.php
26 lines
1 <?php
2 //Support for smart coupon plugin - restricted by payment method options
3 function smartCouponPaymentRestriction($couponCode){
4 $coupon = new WC_Coupon($couponCode);
5
6 // Get payment methods meta
7 $methodsMeta = get_post_meta( $coupon->get_id(), '_wt_sc_payment_methods', true );
8
9 // Normalize to array (handle both array and comma-separated string cases)
10 // - If it's already an array, use it as-is.
11 // - If it's a non-empty comma-separated string, split by commas and remove extra spaces or empty values.
12 // - Otherwise, use an empty array.
13 $methods = is_array($methodsMeta)
14 ? $methodsMeta
15 : (is_string($methodsMeta) && $methodsMeta !== ''
16 ? array_filter(preg_split('/\s*,\s*/', $methodsMeta))
17 : array());
18
19 // Normalize case (lowercase all methods)
20 $methods = array_map( 'strtolower', $methods );
21
22 // Check if Razorpay is allowed
23 if ( in_array( 'razorpay', $methods, true ) && function_exists( 'WC' ) && WC()->session ) {
24 WC()->session->set( 'chosen_payment_method', 'razorpay' );
25 }
26 }