Changeset 2739601
- Timestamp:
- 06/09/2022 04:04:17 AM (4 years ago)
- Location:
- integrai
- Files:
-
- 2 deleted
- 14 edited
- 1 copied
-
tags/1.0.21 (copied) (copied from integrai/trunk)
-
tags/1.0.21/includes/class-integrai-order.php (deleted)
-
tags/1.0.21/includes/class-integrai-process-event.php (modified) (5 diffs)
-
tags/1.0.21/includes/class-integrai.php (modified) (1 diff)
-
tags/1.0.21/includes/controller/class-integrai-controller-events.php (modified) (1 diff)
-
tags/1.0.21/integrai.php (modified) (2 diffs)
-
tags/1.0.21/public/class-integrai-payment-method.php (modified) (3 diffs)
-
tags/1.0.21/public/class-integrai-public.php (modified) (1 diff)
-
tags/1.0.21/readme.txt (modified) (1 diff)
-
trunk/includes/class-integrai-order.php (deleted)
-
trunk/includes/class-integrai-process-event.php (modified) (5 diffs)
-
trunk/includes/class-integrai.php (modified) (1 diff)
-
trunk/includes/controller/class-integrai-controller-events.php (modified) (1 diff)
-
trunk/integrai.php (modified) (2 diffs)
-
trunk/public/class-integrai-payment-method.php (modified) (3 diffs)
-
trunk/public/class-integrai-public.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
integrai/tags/1.0.21/includes/class-integrai-process-event.php
r2620849 r2739601 28 28 $methodName = $methodValue->name; 29 29 $methodRun = (bool)$methodValue->run; 30 $keepModel = (bool)$methodValue->keepModel; 30 31 $methodCheckReturnType = isset($methodValue->checkReturnType) ? $methodValue->checkReturnType : null; 31 32 … … 33 34 $methodArgs = $this->transform_args($methodValue); 34 35 $methodResponse = call_user_func_array(array($model, $methodName), $methodArgs); 35 36 36 if ($methodCheckReturnType) { 37 37 $types = (array) $methodCheckReturnType->types; … … 42 42 } 43 43 44 if (!next($modelMethods) ) {44 if (!next($modelMethods) && !$keepModel) { 45 45 $model = $methodResponse; 46 46 } … … 67 67 $model = $this->get_other_model($arg['otherModelName']); 68 68 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'])))); 70 70 } else { 71 71 array_push($newArgs, $model); … … 77 77 } 78 78 79 return json_decode(json_encode($newArgs), true);79 return $newArgs; 80 80 } 81 81 } -
integrai/tags/1.0.21/includes/class-integrai.php
r2725384 r2739601 29 29 $this->version = INTEGRAI_VERSION; 30 30 } else { 31 $this->version = '1.0.2 0';31 $this->version = '1.0.21'; 32 32 } 33 33 $this->Integrai = 'integrai'; -
integrai/tags/1.0.21/includes/controller/class-integrai-controller-events.php
r2725384 r2739601 42 42 $response = $processEvent->process($payload); 43 43 44 // Integrai_Helper::log($response, 'Response');44 if(!$response) return null; 45 45 46 46 $response = new WP_REST_Response($response); 47 47 $response->header( 'Content-type', 'application/json' ); 48 48 $response->set_status( 200 ); 49 50 return $response; 49 51 } else { 50 52 Integrai_Helper::log($event, 'Salvando o evento'); -
integrai/tags/1.0.21/integrai.php
r2725384 r2739601 17 17 * Plugin URI: https://github.com/integrai/woocommerce 18 18 * 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.2 019 * Version: 1.0.21 20 20 * Author: Integrai 21 21 * Author URI: https://integrai.com.br … … 39 39 * Rename this for your plugin and update it as you release new versions. 40 40 */ 41 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.2 0' );41 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.21' ); 42 42 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 43 43 -
integrai/tags/1.0.21/public/class-integrai-payment-method.php
r2620849 r2739601 10 10 if (isset($marketplace) && count($marketplace) > 0) { 11 11 $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') : ''; 15 15 16 16 $marketplace_data = array( … … 25 25 foreach ($payments as $payment) { 26 26 $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']) : ''; 28 28 $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') : ''; 31 31 $installments = !empty($payment['installments']) ? sanitize_text_field($payment['installments']) . 'x' : ''; 32 32 $boleto = !empty($payment['boleto']) ? (array) $payment['boleto']: ''; … … 36 36 $card_data = ''; 37 37 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'] : ''; 39 39 $card_brand = !empty($card['brand']) ? $card['brand'] : ''; 40 40 $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'] : ''; 43 43 $expiration = implode('/', array_filter(array($expiration_month, $expiration_year))); 44 44 -
integrai/tags/1.0.21/public/class-integrai-public.php
r2724878 r2739601 108 108 if ( ! class_exists( 'Integrai_Process_Event' ) ) : 109 109 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';114 110 endif; 115 111 -
integrai/tags/1.0.21/readme.txt
r2725384 r2739601 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.7 8 Stable tag: 1.0.2 08 Stable tag: 1.0.21 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
integrai/trunk/includes/class-integrai-process-event.php
r2620849 r2739601 28 28 $methodName = $methodValue->name; 29 29 $methodRun = (bool)$methodValue->run; 30 $keepModel = (bool)$methodValue->keepModel; 30 31 $methodCheckReturnType = isset($methodValue->checkReturnType) ? $methodValue->checkReturnType : null; 31 32 … … 33 34 $methodArgs = $this->transform_args($methodValue); 34 35 $methodResponse = call_user_func_array(array($model, $methodName), $methodArgs); 35 36 36 if ($methodCheckReturnType) { 37 37 $types = (array) $methodCheckReturnType->types; … … 42 42 } 43 43 44 if (!next($modelMethods) ) {44 if (!next($modelMethods) && !$keepModel) { 45 45 $model = $methodResponse; 46 46 } … … 67 67 $model = $this->get_other_model($arg['otherModelName']); 68 68 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'])))); 70 70 } else { 71 71 array_push($newArgs, $model); … … 77 77 } 78 78 79 return json_decode(json_encode($newArgs), true);79 return $newArgs; 80 80 } 81 81 } -
integrai/trunk/includes/class-integrai.php
r2725384 r2739601 29 29 $this->version = INTEGRAI_VERSION; 30 30 } else { 31 $this->version = '1.0.2 0';31 $this->version = '1.0.21'; 32 32 } 33 33 $this->Integrai = 'integrai'; -
integrai/trunk/includes/controller/class-integrai-controller-events.php
r2725384 r2739601 42 42 $response = $processEvent->process($payload); 43 43 44 // Integrai_Helper::log($response, 'Response');44 if(!$response) return null; 45 45 46 46 $response = new WP_REST_Response($response); 47 47 $response->header( 'Content-type', 'application/json' ); 48 48 $response->set_status( 200 ); 49 50 return $response; 49 51 } else { 50 52 Integrai_Helper::log($event, 'Salvando o evento'); -
integrai/trunk/integrai.php
r2725384 r2739601 17 17 * Plugin URI: https://github.com/integrai/woocommerce 18 18 * 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.2 019 * Version: 1.0.21 20 20 * Author: Integrai 21 21 * Author URI: https://integrai.com.br … … 39 39 * Rename this for your plugin and update it as you release new versions. 40 40 */ 41 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.2 0' );41 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI_VERSION', '1.0.21' ); 42 42 if ( ! defined( 'INTEGRAI__PLUGIN_DIR' ) ) define( 'INTEGRAI__PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 43 43 -
integrai/trunk/public/class-integrai-payment-method.php
r2620849 r2739601 10 10 if (isset($marketplace) && count($marketplace) > 0) { 11 11 $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') : ''; 15 15 16 16 $marketplace_data = array( … … 25 25 foreach ($payments as $payment) { 26 26 $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']) : ''; 28 28 $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') : ''; 31 31 $installments = !empty($payment['installments']) ? sanitize_text_field($payment['installments']) . 'x' : ''; 32 32 $boleto = !empty($payment['boleto']) ? (array) $payment['boleto']: ''; … … 36 36 $card_data = ''; 37 37 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'] : ''; 39 39 $card_brand = !empty($card['brand']) ? $card['brand'] : ''; 40 40 $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'] : ''; 43 43 $expiration = implode('/', array_filter(array($expiration_month, $expiration_year))); 44 44 -
integrai/trunk/public/class-integrai-public.php
r2724878 r2739601 108 108 if ( ! class_exists( 'Integrai_Process_Event' ) ) : 109 109 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';114 110 endif; 115 111 -
integrai/trunk/readme.txt
r2725384 r2739601 6 6 Requires PHP: 5.6 7 7 Tested up to: 5.7 8 Stable tag: 1.0.2 08 Stable tag: 1.0.21 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.