Plugin Directory

Changeset 2510313


Ignore:
Timestamp:
04/06/2021 08:38:47 PM (5 years ago)
Author:
appmaxplataforma
Message:

subindo versão 2.0.33 - 06/04/2021 17:37

Location:
appmax-woocommerce
Files:
7 deleted
7 edited
29 copied

Legend:

Unmodified
Added
Removed
  • appmax-woocommerce/tags/2.0.33/appmax-woocommerce.php

    r2468156 r2510313  
    33 * Plugin Name: AppMax WooCommerce
    44 * Description: Gateway de pagamento AppMax para WooCommerce.
    5  * Version: 2.0.32
     5 * Version: 2.0.33
    66 * License: GPLv2 or later
    77 * Author: AppMax Plataforma de Vendas Ltda
     
    2424    class AppMax_WC
    2525    {
    26         const VERSION = '2.0.32';
     26        const VERSION = '2.0.33';
    2727
    2828        /**
     
    5555                add_filter( 'woocommerce_payment_gateways', array( $this, 'awc_register_gateway' ) );
    5656                add_filter( 'woocommerce_checkout_fields', array( $this, 'awc_remove_checkout_fields' ) );
     57
     58                add_action( 'wp_ajax_add-meta',  array( $this, 'awc_send_to_appmax' ), 1);
     59                add_action( 'wp_ajax_woocommerce_correios_add_tracking_code',  array( $this, 'awc_send_correios_to_appmax' ), 1);
    5760
    5861                add_action( 'woocommerce_order_details_after_order_table', array( $this, 'awc_show_link_billet' ) );
     
    6063                add_action( 'admin_notices', array( $this, 'awc_woocommerce_not_installed' ) );
    6164            }
     65        }
     66
     67        public function awc_send_to_appmax()
     68        {
     69            $awc_tracking_code = new AWC_Tracking_Code();
     70            $awc_tracking_code->awc_send_to_appmax();
     71        }
     72
     73        public function awc_send_correios_to_appmax()
     74        {
     75            $awc_tracking_code = new AWC_Tracking_Code();
     76            $awc_tracking_code->awc_send_correios_to_appmax();
    6277        }
    6378
     
    169184            include_once AWC_ABSPATH . '/includes/class-awc-webhook.php';
    170185            include_once AWC_ABSPATH . '/includes/class-awc-webhook-post.php';
     186            include_once AWC_ABSPATH . '/includes/class-awc-tracking-code.php';
    171187        }
    172188
  • appmax-woocommerce/tags/2.0.33/includes/class-awc-api.php

    r2468156 r2510313  
    377377
    378378    }
     379
     380    /**
     381     * @param $order_id
     382     * @param $tracking_code
     383     * @return array|WP_Error
     384     */
     385    public function awc_post_tracking_code( $order_id, $tracking_code )
     386    {
     387        $data = $this->make_tracking_code_body($order_id, $tracking_code);
     388
     389        return $this->awc_post( $this->awc_get_full_url( AWC_Suffix_Api::AWS_SUFFIX_TRACKING_CODE ), $data );
     390    }
     391
     392
     393    /**
     394     * @param $order_id
     395     * @param $tracking_code
     396     * @return array
     397     */
     398    private function make_tracking_code_body($order_id, $tracking_code)
     399    {
     400        return [
     401            'access-token' => $this->gateway->awc_api_key,
     402            'order_id' => $order_id,
     403            'delivery_tracking_code' => $tracking_code
     404        ];
     405    }
    379406}
  • appmax-woocommerce/tags/2.0.33/includes/class-awc-process-payment.php

    r2341162 r2510313  
    7171        $order->add_meta_data( '_appmax_order_id', $response_order_body->data->id );
    7272
     73        $order->add_meta_data( '_appmax_tracking_code','' );
     74
    7375        update_post_meta( $order->get_order_number(),'appmax_order_id', $response_order_body->data->id );
     76
     77        update_post_meta( $order->get_order_number(),'appmax_tracking_code', '' );
    7478
    7579        if ( $this->awc_enable_debug() ) {
     
    97101        $order->add_meta_data( '_appmax_pay_reference', $response_payment_body->data->pay_reference );
    98102
     103        $order->add_meta_data( '_appmax_tracking_code', '' );
     104
    99105        update_post_meta( $order->get_order_number(),'appmax_pay_reference', $response_payment_body->data->pay_reference );
     106
     107        update_post_meta( $order->get_order_number(),'appmax_tracking_code', '' );
    100108
    101109        if ( $this->awc_enable_debug() ) {
     
    162170
    163171        $order->add_meta_data( '_appmax_order_id', $response_order_body->data->id );
     172
     173        $order->add_meta_data( '_appmax_tracking_code','' );
     174
     175        update_post_meta( $order->get_order_number(),'appmax_tracking_code', '' );
    164176
    165177        update_post_meta( $order->get_order_number(),'appmax_order_id', $response_order_body->data->id );
  • appmax-woocommerce/tags/2.0.33/includes/domain/class-awc-errors-api.php

    r2127366 r2510313  
    1313    const AWC_ERROR_PAYMENT  = "Error[P]";
    1414
     15    const AWC_ERROR_TRACKING  = "Error[T]";
     16
    1517    const AWC_MSG_001 = "Há um problema de conexão com o gateway de pagamento. Desculpe pela inconveniência.";
    1618
  • appmax-woocommerce/tags/2.0.33/includes/domain/class-awc-suffix-api.php

    r2179564 r2510313  
    1616
    1717    const AWC_SUFFIX_PAYMENT_INSTALLMENTS = "payment/installments/";
     18
     19    const AWS_SUFFIX_TRACKING_CODE = "order/delivery-tracking-code";
    1820}
  • appmax-woocommerce/tags/2.0.33/readme.txt

    r2468156 r2510313  
    44Requires at least: 4.0
    55Tested up to: 5.1
    6 Stable tag: 2.0.32
     6Stable tag: 2.0.33
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    117117== Changelog ==
    118118
     119= 2.0.33
     120
     121* Adicionado campo personalizado appmax_tracking_code.
     122* Códigos de rastreio adicionados no campo personalizado são enviados via API.
     123* Códigos de rastreio adicionados pelo plugin Claudio Sanches - Correios for WooCommerce são enviados via API.
     124
    119125= 2.0.32 =
    120126
  • appmax-woocommerce/trunk/appmax-woocommerce.php

    r2468156 r2510313  
    33 * Plugin Name: AppMax WooCommerce
    44 * Description: Gateway de pagamento AppMax para WooCommerce.
    5  * Version: 2.0.32
     5 * Version: 2.0.33
    66 * License: GPLv2 or later
    77 * Author: AppMax Plataforma de Vendas Ltda
     
    2424    class AppMax_WC
    2525    {
    26         const VERSION = '2.0.32';
     26        const VERSION = '2.0.33';
    2727
    2828        /**
     
    5555                add_filter( 'woocommerce_payment_gateways', array( $this, 'awc_register_gateway' ) );
    5656                add_filter( 'woocommerce_checkout_fields', array( $this, 'awc_remove_checkout_fields' ) );
     57
     58                add_action( 'wp_ajax_add-meta',  array( $this, 'awc_send_to_appmax' ), 1);
     59                add_action( 'wp_ajax_woocommerce_correios_add_tracking_code',  array( $this, 'awc_send_correios_to_appmax' ), 1);
    5760
    5861                add_action( 'woocommerce_order_details_after_order_table', array( $this, 'awc_show_link_billet' ) );
     
    6063                add_action( 'admin_notices', array( $this, 'awc_woocommerce_not_installed' ) );
    6164            }
     65        }
     66
     67        public function awc_send_to_appmax()
     68        {
     69            $awc_tracking_code = new AWC_Tracking_Code();
     70            $awc_tracking_code->awc_send_to_appmax();
     71        }
     72
     73        public function awc_send_correios_to_appmax()
     74        {
     75            $awc_tracking_code = new AWC_Tracking_Code();
     76            $awc_tracking_code->awc_send_correios_to_appmax();
    6277        }
    6378
     
    169184            include_once AWC_ABSPATH . '/includes/class-awc-webhook.php';
    170185            include_once AWC_ABSPATH . '/includes/class-awc-webhook-post.php';
     186            include_once AWC_ABSPATH . '/includes/class-awc-tracking-code.php';
    171187        }
    172188
  • appmax-woocommerce/trunk/includes/class-awc-api.php

    r2468156 r2510313  
    377377
    378378    }
     379
     380    /**
     381     * @param $order_id
     382     * @param $tracking_code
     383     * @return array|WP_Error
     384     */
     385    public function awc_post_tracking_code( $order_id, $tracking_code )
     386    {
     387        $data = $this->make_tracking_code_body($order_id, $tracking_code);
     388
     389        return $this->awc_post( $this->awc_get_full_url( AWC_Suffix_Api::AWS_SUFFIX_TRACKING_CODE ), $data );
     390    }
     391
     392
     393    /**
     394     * @param $order_id
     395     * @param $tracking_code
     396     * @return array
     397     */
     398    private function make_tracking_code_body($order_id, $tracking_code)
     399    {
     400        return [
     401            'access-token' => $this->gateway->awc_api_key,
     402            'order_id' => $order_id,
     403            'delivery_tracking_code' => $tracking_code
     404        ];
     405    }
    379406}
  • appmax-woocommerce/trunk/includes/class-awc-process-payment.php

    r2341162 r2510313  
    7171        $order->add_meta_data( '_appmax_order_id', $response_order_body->data->id );
    7272
     73        $order->add_meta_data( '_appmax_tracking_code','' );
     74
    7375        update_post_meta( $order->get_order_number(),'appmax_order_id', $response_order_body->data->id );
     76
     77        update_post_meta( $order->get_order_number(),'appmax_tracking_code', '' );
    7478
    7579        if ( $this->awc_enable_debug() ) {
     
    97101        $order->add_meta_data( '_appmax_pay_reference', $response_payment_body->data->pay_reference );
    98102
     103        $order->add_meta_data( '_appmax_tracking_code', '' );
     104
    99105        update_post_meta( $order->get_order_number(),'appmax_pay_reference', $response_payment_body->data->pay_reference );
     106
     107        update_post_meta( $order->get_order_number(),'appmax_tracking_code', '' );
    100108
    101109        if ( $this->awc_enable_debug() ) {
     
    162170
    163171        $order->add_meta_data( '_appmax_order_id', $response_order_body->data->id );
     172
     173        $order->add_meta_data( '_appmax_tracking_code','' );
     174
     175        update_post_meta( $order->get_order_number(),'appmax_tracking_code', '' );
    164176
    165177        update_post_meta( $order->get_order_number(),'appmax_order_id', $response_order_body->data->id );
  • appmax-woocommerce/trunk/includes/domain/class-awc-errors-api.php

    r2127366 r2510313  
    1313    const AWC_ERROR_PAYMENT  = "Error[P]";
    1414
     15    const AWC_ERROR_TRACKING  = "Error[T]";
     16
    1517    const AWC_MSG_001 = "Há um problema de conexão com o gateway de pagamento. Desculpe pela inconveniência.";
    1618
  • appmax-woocommerce/trunk/includes/domain/class-awc-suffix-api.php

    r2179564 r2510313  
    1616
    1717    const AWC_SUFFIX_PAYMENT_INSTALLMENTS = "payment/installments/";
     18
     19    const AWS_SUFFIX_TRACKING_CODE = "order/delivery-tracking-code";
    1820}
  • appmax-woocommerce/trunk/readme.txt

    r2468156 r2510313  
    44Requires at least: 4.0
    55Tested up to: 5.1
    6 Stable tag: 2.0.32
     6Stable tag: 2.0.33
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    117117== Changelog ==
    118118
     119= 2.0.33
     120
     121* Adicionado campo personalizado appmax_tracking_code.
     122* Códigos de rastreio adicionados no campo personalizado são enviados via API.
     123* Códigos de rastreio adicionados pelo plugin Claudio Sanches - Correios for WooCommerce são enviados via API.
     124
    119125= 2.0.32 =
    120126
Note: See TracChangeset for help on using the changeset viewer.