Plugin Directory

Changeset 2931842


Ignore:
Timestamp:
06/28/2023 12:59:52 PM (3 years ago)
Author:
SplitIt
Message:

release version 3.3.2

Location:
splitit-installment-payments
Files:
521 added
3 edited

Legend:

Unmodified
Added
Removed
  • splitit-installment-payments/trunk/CHANGELOG.md

    r2931359 r2931842  
    33All notable changes to this project will be documented in this file
    44-
     5
     6### 3.3.2
     7
     8* Added update interruption in case of PHP version mismatch
    59
    610### 3.3.1
  • splitit-installment-payments/trunk/readme.txt

    r2931359 r2931842  
    66WC requires at least: 4.5
    77WC tested up to: 6.5
    8 Stable tag: 3.3.1
     8Stable tag: 3.3.2
    99License: GPLv3
    1010License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    6262== Changelog ==
    6363
     64= 3.3.2 - 2023-06-28 =
     65Added update interruption in case of PHP version mismatch
     66
     67= 3.3.1 - 2023-06-27 =
     68Rollback version with php-7 compatibility
     69
     70= 3.3.0 - 2023-06-26 =
     71Implemented a new design and new logic for the plugin settings page with authorization through the Splitit Merchant Portal.
     72Implemented new On-Site Messaging.
     73Implemented new version of the SDK based on a new version of the API v.3
     74Tested compatibility with WordPress version 6.2.2 and Woocommerce version 7.7.2
     75Some minor code improvements and bug fixes
     76
    6477= 3.2.2 - 2022-06-23 =
    6578Tested compatibility with WordPress version 6.0 and Woocommerce version 6.5.1
  • splitit-installment-payments/trunk/splitIt-flexfields-payment-gateway.php

    r2931363 r2931842  
    55 * Plugin Name: Splitit - WooCommerce plugin
    66 * Plugin URI: https://github.com/Splitit/Splitit.Plugins.WooCommerce.FF
    7  * Description: Plugin available to WooCommerce users that would allow adding Splitit as a payment method at checkout.
     7 * Description: ATTENTION! Please note that the new version of the plugin only works with PHP version >= 8.1. Plugin available to WooCommerce users that would allow adding Splitit as a payment method at checkout. You can download the plugin version compatible with PHP < 8.1 from https://downloads.wordpress.org/plugin/splitit-installment-payments.3.2.3.zip
    88 * Author: Splitit
    99 * Author URI: https://www.splitit.com/
    10  * Version: 3.3.1
     10 * Version: 3.3.2
    1111 */
    1212
     
    2121$plguin_id = 'splitit';
    2222global $plugin_version;
    23 $plugin_version = '3.3.1';
     23$plugin_version = '3.3.2';
    2424/**
    2525 * @Check that WooCommerce is active
     
    2929}
    3030
     31add_filter( 'upgrader_pre_install', 'php_version_check_function', 99, 2 );
     32
     33function php_version_check_function( $return, $plugin ) {
     34    if ( plugin_basename( __FILE__ ) === $plugin['plugin'] ) {
     35
     36        $required_php_version = '8.1';
     37        $current_php_version  = phpversion();
     38
     39        if ( version_compare( $current_php_version, $required_php_version, '<' ) ) {
     40            $return = new WP_Error( 'php_version', 'The plugin requires a PHP version >= ' . $required_php_version . ' to update. Your current version ' . $current_php_version . '.' );
     41        }
     42
     43        return $return;
     44    }
     45}
     46
    3147define( 'URL', get_site_url() );
    3248define( 'DOMAIN', parse_url( URL, PHP_URL_HOST ) );
     
    3652
    3753/**
    38  * Send notification to slack when plugin is activate
     54 * Send notification to slack when plugin is activated
    3955 */
    4056function splitit_activate() {
    41     send_slack_notification( 'Splitit app has been activate \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
     57    send_slack_notification( 'Splitit app has been activated \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
    4258    send_info( 'activate' );
    4359}
     
    4561
    4662/**
    47  * Send notification to slack when plugin is deactivate
     63 * Send notification to slack when plugin is deactivated
    4864 */
    4965function splitit_deactivate() {
    50     send_slack_notification( 'Splitit app has been deactivate \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
     66    send_slack_notification( 'Splitit app has been deactivated \n Domain: <' . URL . '|' . DOMAIN . '> \n Platform: Woocommerce' );
    5167    send_info( 'deactivate' );
    5268}
     
    86102 */
    87103function send_info( $action_type ) {
    88     $msg = [
    89         'platform' => 'Woocommerce',
     104    $msg = array(
     105        'platform'   => 'Woocommerce',
    90106        'actionType' => $action_type,
    91         'domain' => DOMAIN
    92     ];
     107        'domain'     => DOMAIN,
     108    );
    93109
    94110    $c = curl_init( 'https://internalapi.production.splitit.com/api/plugins-action-logs/save' );
     
    290306         */
    291307        public function payment_fields() {
    292             if ( ! is_ajax()  && ! is_wc_endpoint_url( 'order-pay' ) ) {
     308            if ( ! is_ajax() && ! is_wc_endpoint_url( 'order-pay' ) ) {
    293309                return;
    294310            }
     
    395411                        }
    396412                    } else {
    397                         $data    = array(
     413                        $data = array(
    398414                            'user_id' => $order->user_id ?? null,
    399415                            'method'  => __( 'process_payment() Splitit', 'splitit_ff_payment' ),
     
    406422                    $api->update( $order_id, $flex_field_ipn );
    407423                } catch ( Exception $e ) {
    408                     $data    = array(
     424                    $data = array(
    409425                        'user_id' => $order->user_id ?? null,
    410426                        'method'  => __( 'process_payment() Splitit', 'splitit_ff_payment' ),
     
    413429                }
    414430
    415                 $data    = array(
     431                $data = array(
    416432                    'user_id' => get_current_user_id(),
    417433                    'method'  => __( 'process_payment() Splitit', 'splitit_ff_payment' ),
     
    11171133                            }
    11181134
    1119                             $data     = array(
     1135                            $data = array(
    11201136                                'user_id'                 => $order_info->user_id,
    11211137                                'order_id'                => $order_id,
     
    11781194                $order_by_transaction = SplitIt_FlexFields_Payment_Plugin_Log::select_from_transaction_log_by_ipn( $ipn );
    11791195                if ( $order_by_transaction && $order_by_transaction->order_id ) {
    1180                     $order = wc_get_order( $order_by_transaction->order_id );
     1196                    $order              = wc_get_order( $order_by_transaction->order_id );
    11811197                    $order_total_amount = $order->get_total() ?? 0;
    11821198                }
     
    12101226            $api = new SplitIt_FlexFields_Payment_Plugin_API( $this->settings, self::DEFAULT_INSTALMENT_PLAN );
    12111227
    1212             $installments = $this->get_array_of_installments( (float) str_replace(',', '', $total ) );
     1228            $installments = $this->get_array_of_installments( (float) str_replace( ',', '', $total ) );
    12131229
    12141230            $data = array();
     
    12211237                $post_data['ipn']                  = isset( $_POST['ipn'] ) ? wc_clean( $_POST['ipn'] ) : null;
    12221238                $post_data['numberOfInstallments'] = isset( $_POST['numberOfInstallments'] ) ? wc_clean( $_POST['numberOfInstallments'] ) : '';
    1223                 $post_data['currency_code']        = isset( $_POST['currency'] ) && !empty ( $_POST['currency'] ) ? wc_clean( $_POST['currency'] ) : get_woocommerce_currency();
     1239                $post_data['currency_code']        = isset( $_POST['currency'] ) && ! empty( $_POST['currency'] ) ? wc_clean( $_POST['currency'] ) : get_woocommerce_currency();
    12241240
    12251241                foreach ( $post_data as $key => $value ) {
     
    12541270            }
    12551271
    1256             $data['amount']        = (float) str_replace( ',', '', $total );
    1257             $data['installments']  = $installments;
    1258             $data['culture']       = str_replace( '_', '-', get_locale() );
     1272            $data['amount']       = (float) str_replace( ',', '', $total );
     1273            $data['installments'] = $installments;
     1274            $data['culture']      = str_replace( '_', '-', get_locale() );
    12591275
    12601276            echo $api->initiate( $data ); // @already json_encode, WPCS: XSS ok.
     
    17521768        }
    17531769
    1754         $return          = $price;
     1770        $return = $price;
    17551771
    17561772        /**
Note: See TracChangeset for help on using the changeset viewer.