Plugin Directory

Changeset 3198819


Ignore:
Timestamp:
11/28/2024 11:49:03 AM (16 months ago)
Author:
devcashfree
Message:

Update to version 4.7.5

Location:
cashfree
Files:
30 added
8 edited

Legend:

Unmodified
Added
Removed
  • cashfree/trunk/cashfree.php

    r3112122 r3198819  
    22/**
    33 * Plugin Name: Cashfree
    4  * Version: 4.7.2
     4 * Version: 4.7.5
    55 * Plugin URI: https://github.com/cashfree/cashfree-woocommerce
    66 * Description: Payment gateway plugin by Cashfree Payments for Woocommerce sites.
     
    1212 * Domain Path: /languages
    1313 * Requires at least: 4.4
    14  * Tested up to: 6.5
     14 * Tested up to: 6.7
    1515 * WC requires at least: 3.0
    16  * WC tested up to: 8.8
     16 * WC tested up to: 9.4
    1717 *
    1818 *
     
    5151     */
    5252    private $settings;
     53
     54    private $enabled;
    5355
    5456    /**
  • cashfree/trunk/includes/class-wc-cashfree-api.php

    r2742179 r3198819  
    1616     * @param string $id Api identifier.
    1717     */
     18    private $id;
     19   
    1820    public function __construct( $id ) {
    1921        $this->id = $id;
  • cashfree/trunk/includes/gateways/class-wc-cashfree-block-support.php

    r3038899 r3198819  
    88
    99    protected $name = 'cashfree';
     10    protected $settings = [];
     11    protected $gateway;
    1012
    1113    /**
  • cashfree/trunk/includes/gateways/class-wc-cashfree-gateway.php

    r3101786 r3198819  
    1313abstract class WC_Cashfree_Gateway extends WC_Payment_Gateway {
    1414
    15     /**
    16      * Cashfree adapter instance.
    17      *
    18      * @var WC_Cashfree_Adapter
    19      */
    20 
    21     protected $adapter;
     15     /**
     16     * Cashfree adapter instance.
     17     *
     18     * @var WC_Cashfree_Adapter
     19     */
     20    protected $adapter;
     21
     22    /**
     23     * Sandbox mode enabled.
     24     *
     25     * @var bool
     26     */
     27    protected $sandbox;
     28
     29    /**
     30     * Debug mode enabled.
     31     *
     32     * @var bool
     33     */
     34    protected $debug;
     35
     36    /**
     37     * Token parameter name.
     38     *
     39     * @var string
     40     */
     41    protected $token_param;
     42
     43    /**
     44     * Order ID prefix enabled.
     45     *
     46     * @var bool
     47     */
     48    protected $order_id_prefix_text;
     49
     50    /**
     51     * Order in context enabled.
     52     *
     53     * @var bool
     54     */
     55    protected $order_in_context;
    2256
    2357    /**
  • cashfree/trunk/includes/http/class-wc-cashfree-adapter.php

    r3112122 r3198819  
    163163        $getEnvValue = $this->getCurlValue();
    164164        $cartData = array(
    165             'refund_amount' => $amount,
     165            'refund_amount' => (float) str_replace(',', '', $amount),
    166166            'refund_id'     => $refund_id,
    167167            'refund_note'   => $description,
     
    219219        $http_code = wp_remote_retrieve_response_code( $response );
    220220        $body     = json_decode(wp_remote_retrieve_body( $response ));
    221 
    222221        if($http_code === 200) {
    223222            return $body;
  • cashfree/trunk/includes/request/class-wc-cashfree-request-checkout.php

    r3101786 r3198819  
    5252            ),
    5353            'order_id' => (string) $cf_order_id,
    54             'order_amount' => $order->get_total(),
     54            'order_amount' => self::cfConvertToNumber($order->get_total()),
    5555            'order_currency' => $order->get_currency(),
    5656            'order_note' => 'WooCommerce',
     
    178178        return $customerPhone;
    179179    }
     180
     181    public static function cfConvertToNumber($input) {
     182        return (float) str_replace(',', '', $input);
     183    }
    180184}
  • cashfree/trunk/includes/request/class-wc-cashfree-request-items.php

    r3108628 r3198819  
    2020     */
    2121    public static function build( $order, $item ) {
     22        require_once WC_CASHFREE_DIR_PATH . 'includes/request/class-wc-cashfree-request-checkout.php';
    2223        $product = $item->get_product();
    23 
    2424        return array(
    2525            'item_id'                   => substr( $item->get_variation_id() ? $item->get_variation_id() : $item->get_product_id(), 0, 254 ),
     
    2929            'item_details_url'          => get_permalink( $item->get_product_id() ),
    3030            'item_image_url'            => (string) wp_get_attachment_image_url( $product->get_image_id(), 'full' ),
    31             'item_original_unit_price'  => $product->get_regular_price() ? $product->get_regular_price() : 0,
    32             'item_discounted_unit_price'=> $product->get_price() ? $product->get_price() : 0,
     31            'item_original_unit_price'  => self::cfConvertToNumber($product->get_regular_price() ? $product->get_regular_price() : 0),
     32            'item_discounted_unit_price'=> self::cfConvertToNumber($product->get_price() ? $product->get_price() : 0),
    3333            'item_quantity'             => $item->get_quantity(),
    3434            'item_currency'             =>  $order->get_currency()
    3535        );
    3636    }
     37
     38    public static function cfConvertToNumber($input) {
     39        return (float) str_replace(',', '', $input);
     40    }
    3741}
  • cashfree/trunk/readme.txt

    r3112122 r3198819  
    44Tested up to: 6.5
    55Requires PHP: 5.6
    6 Stable tag: 4.7.2
    7 Version: 4.7.2
     6Stable tag: 4.7.5
     7Version: 4.7.5
    88License: GPLv3
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    5050
    5151== Changelog ==
     52
     53= 4.7.4 =
     54* Bug Fix: Order amount correction
     55
     56= 4.7.3 =
     57* Deprecated Property Fix: Updated the cashfree classes to prevent deprecated warnings in PHP 8.2 and later by explicitly declaring properties instead of using dynamic properties.
    5258
    5359= 4.7.2 =
Note: See TracChangeset for help on using the changeset viewer.