Plugin Directory

Changeset 2851092


Ignore:
Timestamp:
01/19/2023 01:35:45 PM (3 years ago)
Author:
devcashfree
Message:

Update to version 4.3.9

Location:
cashfree
Files:
30 added
3 edited

Legend:

Unmodified
Added
Removed
  • cashfree/trunk/cashfree.php

    r2822157 r2851092  
    22/**
    33 * Plugin Name: Cashfree
    4  * Version: 4.3.8
     4 * Version: 4.3.9
    55 * Plugin URI: https://github.com/cashfree/cashfree-woocommerce
    66 * Description: Payment gateway plugin by Cashfree Payments for Woocommerce sites.
     
    2222
    2323defined( 'ABSPATH' ) || exit;
     24
     25// to read main.js file
     26define ('WPCO_URL', trailingslashit(plugins_url('/',__FILE__)));
    2427
    2528/**
     
    6871        add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( __CLASS__, 'plugin_action_links' ) );
    6972        add_filter( 'woocommerce_payment_gateways', array( __CLASS__, 'load_gateways' ) );
     73        add_filter( 'woocommerce_before_add_to_cart_form' , array( $this, 'wp_cashfree_offers' ) );
    7074
    7175        add_action( 'wp_enqueue_scripts', array( $this, 'load_scripts' ) );
     76    }
     77
     78    public function wp_cashfree_offers() {
     79        if ( $this->settings['enabledOffers'] === 'yes' && $this->settings['sandbox'] === 'no') {
     80            // External Scripts
     81            wp_register_script('cf-woocommerce-js', 'https://sdk.cashfree.com/js/widget/index.js', null, null, true );
     82            wp_enqueue_script('cf-woocommerce-js');
     83
     84            wp_enqueue_script('cf-woocommerce-main-js', WPCO_URL . 'dist/main.js', ['jquery','wp-element'], wp_rand(), true);
     85           
     86            wp_register_style( 'cf-woocommerce-css', 'https://sdk.cashfree.com/js/widget/style.css', array(), '20120208', 'all' );
     87            wp_enqueue_style( 'cf-woocommerce-css' );
     88           
     89            add_filter( 'woocommerce_enqueue_styles', '__return_false' );
     90       
     91            global $product;
     92            $price = $product->get_price();
     93
     94            echo'<div id="cashfree-offer-widget" data-amount='.$price.' data-appId='.$this->settings['app_id'].' data-isOffers='.$this->settings['offers'].' data-isPayLater='.$this->settings['payLater'].' data-isEmi='.$this->settings['emi'].'></div>';
     95           
     96        }
    7297    }
    7398
  • cashfree/trunk/includes/settings/cashfree-payments.php

    r2773476 r2851092  
    1212        'label'         => __( 'Enable Cashfree Payments', 'cashfree' ),
    1313        'default'       => 'yes',
     14       
    1415    ),
    1516    'title'                  => array(
     
    6970        'desc_tip'    => true
    7071    ),
     72    'enabledOffers'     => array(
     73        'title'         => __( 'Widget Enable/Disable', 'cashfree' ),
     74        'type'          => 'checkbox',
     75        'label'         => __( 'Widget Enable of Cashfree Payments', 'cashfree' ),
     76        'default'       => 'no',
     77    ),
     78    'offers'            => array(
     79        'title'         => __( 'Enable/Disable Offers', 'cashfree' ),
     80        'type'          => 'checkbox',
     81        'label'         => __( 'Enable/Disable Offers on widget', 'cashfree' ),
     82        'default'       => 'no',
     83    ), 
     84    'payLater'          => array(
     85        'title'         => __( 'Enable/Disable Paylater', 'cashfree' ),
     86        'type'          => 'checkbox',
     87        'label'         => __( 'Enable/Disable Paylater on widget', 'cashfree' ),
     88        'default'       => 'no',
     89    ),
     90    'emi'               => array(
     91        'title'         => __( 'Enable/Disable EMI', 'cashfree' ),
     92        'type'          => 'checkbox',
     93        'label'         => __( 'Enable/Disable EMI on widget', 'cashfree' ),
     94        'default'       => 'no',
     95    ),
    7196);
  • cashfree/trunk/readme.txt

    r2822157 r2851092  
    44Tested up to: 6.0
    55Requires PHP: 5.6
    6 Stable tag: 4.3.8
    7 Version: 4.3.8
     6Stable tag: 4.3.9
     7Version: 4.3.9
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    1616This is the official Cashfree Payment Gateway plugin for WooCommerce. By integrating this plugin with your WooCommerce store you can accept payments via 100+ domestic as well as international payment modes and use advanced features such as instant refunds for online and COD orders, pre-authorization for card payments, instant settlements, and more.
    1717
    18 For more information about Cashfree Payments please visit [cashfree.com](https://cashfree.com).
     18For more information about Cashfree Payments please go to https://cashfree.com.
    1919
    2020== Installation ==
     
    3232The manual installation method involves downloading our plugin and uploading it to your web server via your favorite FTP application. The WordPress codex contains [instructions on how to do this here](https://wordpress.org/support/article/managing-plugins/#manual-plugin-installation).
    3333
    34 == Dependencies ==
     34== Changelog ==
    3535
    36 1. Wordpress v3.9.2 and later
    37 2. Woocommerce v2.6 and later
    38 3. PHP v5.6.0 and later
    39 4. php-curl extension
    40 
    41 == Configuration ==
    42 
    43 1. Visit the WooCommerce settings page, and click on the Checkout/Payment Gateways tab.
    44 2. Click on Cashfree to edit the settings. If you do not see Cashfree in the list at the top of the screen make sure you have activated the plugin in the WordPress Plugin Manager.
    45 3. Enable the Payment Method, add in your App Id and Secret Key.
    46 4. Enable Cashfree sanbox if you want to use test mode.
    47 
    48 == Changelog ==
     36= 4.3.9 =
     37* Add offer section to the product and checkout page
    4938
    5039= 4.3.8 =
     
    10291= 1.0 =
    10392* First release on Plugins marketplace
    104 
    105 == Support ==
    106 
    107 Visit [cashfree.com](https://www.cashfree.com/help/hc) for support requests.
Note: See TracChangeset for help on using the changeset viewer.