Plugin Directory

Changeset 2739601


Ignore:
Timestamp:
06/09/2022 04:04:17 AM (4 years ago)
Author:
integrai
Message:

Update to version 1.0.21 from GitHub

Location:
integrai
Files:
2 deleted
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • integrai/tags/1.0.21/includes/class-integrai-process-event.php

    r2620849 r2739601  
    2828            $methodName = $methodValue->name;
    2929            $methodRun = (bool)$methodValue->run;
     30            $keepModel = (bool)$methodValue->keepModel;
    3031            $methodCheckReturnType = isset($methodValue->checkReturnType) ? $methodValue->checkReturnType : null;
    3132
     
    3334                $methodArgs = $this->transform_args($methodValue);
    3435                $methodResponse = call_user_func_array(array($model, $methodName), $methodArgs);
    35 
    3636                if ($methodCheckReturnType) {
    3737                    $types = (array) $methodCheckReturnType->types;
     
    4242                }
    4343
    44                 if (!next($modelMethods)) {
     44                if (!next($modelMethods) && !$keepModel) {
    4545                    $model = $methodResponse;
    4646                }
     
    6767                    $model = $this->get_other_model($arg['otherModelName']);
    6868                    if (isset($arg['otherModelMethods'])) {
    69                         array_push($newArgs, $this->run_methods($model, $arg['otherModelMethods']));
     69                        array_push($newArgs, $this->run_methods($model, json_decode(json_encode($arg['otherModelMethods']))));
    7070                    } else {
    7171                        array_push($newArgs, $model);
     
    7777        }
    7878
    79         return json_decode(json_encode($newArgs), true);
     79        return $newArgs;
    8080    }
    8181}
  • integrai/tags/1.0.21/includes/class-integrai.php

    r2725384 r2739601  
    2929            $this->version = INTEGRAI_VERSION;
    3030        } else {
    31             $this->version = '1.0.20';
     31            $this->version = '1.0.21';
    3232        }
    3333        $this->Integrai = 'integrai';
  • integrai/tags/1.0.21/includes/controller/class-integrai-controller-events.php

    r2725384 r2739601  
    4242            $response = $processEvent->process($payload);
    4343
    44 //            Integrai_Helper::log($response, 'Response');
     44            if(!$response) return null;
    4545
    4646            $response = new WP_REST_Response($response);
    4747            $response->header( 'Content-type', 'application/json' );
    4848            $response->set_status( 200 );
     49
     50            return $response;
    4951        } else {
    5052            Integrai_Helper::log($event, 'Salvando o evento');
  • integrai/tags/1.0.21/integrai.php

    r2725384 r2739601  
    1717 * Plugin URI:        https://github.com/integrai/woocommerce
    1818 * Description:       Integração com os principais meios de pagamento e cálculo de frete para a sua plataforma de e-commerce WP WooCommerce.
    19  * Version:           1.0.20
     19 * Version:           1.0.21
    2020 * Author:            Integrai
    2121 * Author URI:        https://integrai.com.br
     
    3939 * Rename this for your plugin and update it as you release new versions.
    4040 */
    41 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.20' );
     41if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.21' );
    4242if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    4343
  • integrai/tags/1.0.21/public/class-integrai-payment-method.php

    r2620849 r2739601  
    1010    if (isset($marketplace) && count($marketplace) > 0) {
    1111      $name = !empty($marketplace['name']) ? sanitize_text_field($marketplace['name']) : '';
    12       $order_id = !empty($marketplace['order_id']) ? sanitize_text_field($marketplace['order_id']) : '';
    13       $created_at = !empty($marketplace['created_at']) ? date_format(date_create($marketplace['created_at']), 'd/m/Y H:i:s') : '';
    14       $updated_at = !empty($marketplace['updated_at']) ? date_format(date_create($marketplace['updated_at']), 'd/m/Y H:i:s') : '';
     12      $order_id = !empty($marketplace['orderId']) ? sanitize_text_field($marketplace['orderId']) : '';
     13      $created_at = !empty($marketplace['createdAt']) ? date_format(date_create($marketplace['createdAt']), 'd/m/Y H:i:s') : '';
     14      $updated_at = !empty($marketplace['updatedAt']) ? date_format(date_create($marketplace['updatedAt']), 'd/m/Y H:i:s') : '';
    1515
    1616      $marketplace_data = array(
     
    2525      foreach ($payments as $payment) {
    2626        $method = !empty($payment['method']) ? sanitize_text_field($payment['method']) : '';
    27         $module_name = !empty($payment['module_name']) ? sanitize_text_field($payment['module_name']) : '';
     27        $module_name = !empty($payment['moduleName']) ? sanitize_text_field($payment['moduleName']) : '';
    2828        $value = !empty($payment['value']) ? 'R$' . number_format($payment['value'],2,",",".") : '';
    29         $transaction_id = !empty($payment['transaction_id']) ? sanitize_text_field($payment['transaction_id']) : '';
    30         $date_approved = !empty($payment['date_approved']) ? date_format(date_create($payment['date_approved']), 'd/m/Y H:i:s') : '';
     29        $transaction_id = !empty($payment['transactionId']) ? sanitize_text_field($payment['transactionId']) : '';
     30        $date_approved = !empty($payment['dateApproved']) ? date_format(date_create($payment['dateApproved']), 'd/m/Y H:i:s') : '';
    3131        $installments = !empty($payment['installments']) ? sanitize_text_field($payment['installments']) . 'x' : '';
    3232        $boleto = !empty($payment['boleto']) ? (array) $payment['boleto']: '';
     
    3636        $card_data = '';
    3737        if (isset($card) && is_array($card)) {
    38           $card_number = !empty($card['last_four_digits']) ? $card['last_four_digits'] : '';
     38          $card_number = !empty($card['lastFourDigits']) ? $card['lastFourDigits'] : '';
    3939          $card_brand = !empty($card['brand']) ? $card['brand'] : '';
    4040          $card_holder = !empty($card['holder']) ? $card['holder'] : '';
    41           $expiration_month = !empty($card['expiration_month']) ? $card['expiration_month'] : '';
    42           $expiration_year = !empty($card['expiration_year']) ? $card['expiration_year'] : '';
     41          $expiration_month = !empty($card['expirationMonth']) ? $card['expirationMonth'] : '';
     42          $expiration_year = !empty($card['expirationYear']) ? $card['expirationYear'] : '';
    4343          $expiration = implode('/', array_filter(array($expiration_month, $expiration_year)));
    4444
  • integrai/tags/1.0.21/public/class-integrai-public.php

    r2724878 r2739601  
    108108        if ( ! class_exists( 'Integrai_Process_Event' ) ) :
    109109            include_once INTEGRAI__PLUGIN_DIR . '/includes/class-integrai-process-event.php';
    110         endif;
    111 
    112         if ( ! class_exists( 'Integrai_Order' ) ) :
    113             include_once INTEGRAI__PLUGIN_DIR . '/includes/class-integrai-order.php';
    114110        endif;
    115111
  • integrai/tags/1.0.21/readme.txt

    r2725384 r2739601  
    66Requires PHP: 5.6
    77Tested up to: 5.7
    8 Stable tag: 1.0.20
     8Stable tag: 1.0.21
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • integrai/trunk/includes/class-integrai-process-event.php

    r2620849 r2739601  
    2828            $methodName = $methodValue->name;
    2929            $methodRun = (bool)$methodValue->run;
     30            $keepModel = (bool)$methodValue->keepModel;
    3031            $methodCheckReturnType = isset($methodValue->checkReturnType) ? $methodValue->checkReturnType : null;
    3132
     
    3334                $methodArgs = $this->transform_args($methodValue);
    3435                $methodResponse = call_user_func_array(array($model, $methodName), $methodArgs);
    35 
    3636                if ($methodCheckReturnType) {
    3737                    $types = (array) $methodCheckReturnType->types;
     
    4242                }
    4343
    44                 if (!next($modelMethods)) {
     44                if (!next($modelMethods) && !$keepModel) {
    4545                    $model = $methodResponse;
    4646                }
     
    6767                    $model = $this->get_other_model($arg['otherModelName']);
    6868                    if (isset($arg['otherModelMethods'])) {
    69                         array_push($newArgs, $this->run_methods($model, $arg['otherModelMethods']));
     69                        array_push($newArgs, $this->run_methods($model, json_decode(json_encode($arg['otherModelMethods']))));
    7070                    } else {
    7171                        array_push($newArgs, $model);
     
    7777        }
    7878
    79         return json_decode(json_encode($newArgs), true);
     79        return $newArgs;
    8080    }
    8181}
  • integrai/trunk/includes/class-integrai.php

    r2725384 r2739601  
    2929            $this->version = INTEGRAI_VERSION;
    3030        } else {
    31             $this->version = '1.0.20';
     31            $this->version = '1.0.21';
    3232        }
    3333        $this->Integrai = 'integrai';
  • integrai/trunk/includes/controller/class-integrai-controller-events.php

    r2725384 r2739601  
    4242            $response = $processEvent->process($payload);
    4343
    44 //            Integrai_Helper::log($response, 'Response');
     44            if(!$response) return null;
    4545
    4646            $response = new WP_REST_Response($response);
    4747            $response->header( 'Content-type', 'application/json' );
    4848            $response->set_status( 200 );
     49
     50            return $response;
    4951        } else {
    5052            Integrai_Helper::log($event, 'Salvando o evento');
  • integrai/trunk/integrai.php

    r2725384 r2739601  
    1717 * Plugin URI:        https://github.com/integrai/woocommerce
    1818 * Description:       Integração com os principais meios de pagamento e cálculo de frete para a sua plataforma de e-commerce WP WooCommerce.
    19  * Version:           1.0.20
     19 * Version:           1.0.21
    2020 * Author:            Integrai
    2121 * Author URI:        https://integrai.com.br
     
    3939 * Rename this for your plugin and update it as you release new versions.
    4040 */
    41 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.20' );
     41if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.21' );
    4242if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI__PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    4343
  • integrai/trunk/public/class-integrai-payment-method.php

    r2620849 r2739601  
    1010    if (isset($marketplace) && count($marketplace) > 0) {
    1111      $name = !empty($marketplace['name']) ? sanitize_text_field($marketplace['name']) : '';
    12       $order_id = !empty($marketplace['order_id']) ? sanitize_text_field($marketplace['order_id']) : '';
    13       $created_at = !empty($marketplace['created_at']) ? date_format(date_create($marketplace['created_at']), 'd/m/Y H:i:s') : '';
    14       $updated_at = !empty($marketplace['updated_at']) ? date_format(date_create($marketplace['updated_at']), 'd/m/Y H:i:s') : '';
     12      $order_id = !empty($marketplace['orderId']) ? sanitize_text_field($marketplace['orderId']) : '';
     13      $created_at = !empty($marketplace['createdAt']) ? date_format(date_create($marketplace['createdAt']), 'd/m/Y H:i:s') : '';
     14      $updated_at = !empty($marketplace['updatedAt']) ? date_format(date_create($marketplace['updatedAt']), 'd/m/Y H:i:s') : '';
    1515
    1616      $marketplace_data = array(
     
    2525      foreach ($payments as $payment) {
    2626        $method = !empty($payment['method']) ? sanitize_text_field($payment['method']) : '';
    27         $module_name = !empty($payment['module_name']) ? sanitize_text_field($payment['module_name']) : '';
     27        $module_name = !empty($payment['moduleName']) ? sanitize_text_field($payment['moduleName']) : '';
    2828        $value = !empty($payment['value']) ? 'R$' . number_format($payment['value'],2,",",".") : '';
    29         $transaction_id = !empty($payment['transaction_id']) ? sanitize_text_field($payment['transaction_id']) : '';
    30         $date_approved = !empty($payment['date_approved']) ? date_format(date_create($payment['date_approved']), 'd/m/Y H:i:s') : '';
     29        $transaction_id = !empty($payment['transactionId']) ? sanitize_text_field($payment['transactionId']) : '';
     30        $date_approved = !empty($payment['dateApproved']) ? date_format(date_create($payment['dateApproved']), 'd/m/Y H:i:s') : '';
    3131        $installments = !empty($payment['installments']) ? sanitize_text_field($payment['installments']) . 'x' : '';
    3232        $boleto = !empty($payment['boleto']) ? (array) $payment['boleto']: '';
     
    3636        $card_data = '';
    3737        if (isset($card) && is_array($card)) {
    38           $card_number = !empty($card['last_four_digits']) ? $card['last_four_digits'] : '';
     38          $card_number = !empty($card['lastFourDigits']) ? $card['lastFourDigits'] : '';
    3939          $card_brand = !empty($card['brand']) ? $card['brand'] : '';
    4040          $card_holder = !empty($card['holder']) ? $card['holder'] : '';
    41           $expiration_month = !empty($card['expiration_month']) ? $card['expiration_month'] : '';
    42           $expiration_year = !empty($card['expiration_year']) ? $card['expiration_year'] : '';
     41          $expiration_month = !empty($card['expirationMonth']) ? $card['expirationMonth'] : '';
     42          $expiration_year = !empty($card['expirationYear']) ? $card['expirationYear'] : '';
    4343          $expiration = implode('/', array_filter(array($expiration_month, $expiration_year)));
    4444
  • integrai/trunk/public/class-integrai-public.php

    r2724878 r2739601  
    108108        if ( ! class_exists( 'Integrai_Process_Event' ) ) :
    109109            include_once INTEGRAI__PLUGIN_DIR . '/includes/class-integrai-process-event.php';
    110         endif;
    111 
    112         if ( ! class_exists( 'Integrai_Order' ) ) :
    113             include_once INTEGRAI__PLUGIN_DIR . '/includes/class-integrai-order.php';
    114110        endif;
    115111
  • integrai/trunk/readme.txt

    r2725384 r2739601  
    66Requires PHP: 5.6
    77Tested up to: 5.7
    8 Stable tag: 1.0.20
     8Stable tag: 1.0.21
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.