Plugin Directory

Changeset 2630548


Ignore:
Timestamp:
11/16/2021 08:56:12 AM (4 years ago)
Author:
redboxsa
Message:

Version 1.24

Location:
redbox-pickup
Files:
3 edited
8 copied

Legend:

Unmodified
Added
Removed
  • redbox-pickup/tags/1.24/front/front.php

    r2629670 r2630548  
    114114                    isset($dataShipment["reference"]) && !empty($dataShipment["reference"]) &&
    115115                    isset($dataShipment["point_id"]) && !empty($dataShipment["point_id"]) &&
    116                     isset($dataShipment["customer_phone"]) && !empty($dataShipment["customer_phone"]) &&
    117                     isset($dataShipment["customer_name"]) && !empty($dataShipment["customer_name"]) &&
    118                     isset($dataShipment["cod_amount"]) && is_numeric($dataShipment['cod_amount']) && floatval($dataShipment['cod_amount']) >= 0 &&
    119                     isset($dataShipment["cod_currency"]) && !empty($dataShipment["cod_currency"])
     116                    isset($dataShipment["customer_phone"]) && !empty($dataShipment["customer_phone"])
    120117                ) {
    121118                    return true;
     
    160157                    $dataShipment['cod_currency'] = $priceData['curency'];
    161158                }
    162                 $urlQuery = REDBOX_URL_CREATE_SHIPMENT;
    163                 $options = array(
    164                     'headers' => array(
    165                         'Authorization' => 'Bearer ' . $this->redboxKey
    166                     ),
    167                     'body' => $dataShipment
    168                 );
    169                 $response = wp_remote_post($urlQuery, $options);
    170                 $body = json_decode( wp_remote_retrieve_body( $response ), true );
    171                 if ($body['success']) {
    172                     $note = 'RedBox tracking number: ' . $body['tracking_number'];
    173                     $order->add_order_note( $note );
    174                     $order->update_meta_data( 'redbox_shipment_url_shipping_label', $body['url_shipping_label'] );
    175                 } else {
    176                     $note = 'RedBox error: ' . $body['msg'];
    177                     $order->add_order_note( $note );
    178                 }
    179                
    180                 $order->save();
     159                if ($this->redbox_validate_body_update_shipment($dataShipment)) {
     160                    $urlQuery = REDBOX_URL_CREATE_SHIPMENT;
     161                    $options = array(
     162                        'headers' => array(
     163                            'Authorization' => 'Bearer ' . $this->redboxKey
     164                        ),
     165                        'body' => $dataShipment
     166                    );
     167                    $response = wp_remote_post($urlQuery, $options);
     168                    $body = json_decode( wp_remote_retrieve_body( $response ), true );
     169                    if ($body['success']) {
     170                        $note = 'RedBox tracking number: ' . $body['tracking_number'];
     171                        $order->add_order_note( $note );
     172                        $order->update_meta_data( 'redbox_shipment_url_shipping_label', $body['url_shipping_label'] );
     173                    } else {
     174                        $note = 'RedBox error: ' . $body['msg'];
     175                        $order->add_order_note( $note );
     176                    }
     177                   
     178                    $order->save();
     179                }
    181180            }
    182181
  • redbox-pickup/tags/1.24/readme.txt

    r2629670 r2630548  
    55Requires at least: 3.3
    66Tested up to: 5.5.1
    7 Stable tag: 1.23
     7Stable tag: 1.24
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • redbox-pickup/tags/1.24/redbox.php

    r2629670 r2630548  
    44        * Description: This plugin allows customers pickup package at RedBox Locker.
    55        * Plugin URI: https://woocommerce.com/
    6         * Version: 1.23
     6        * Version: 1.24
    77        * Author: RedBox
    88        * Author URI: https://redboxsa.com
  • redbox-pickup/trunk/front/front.php

    r2629670 r2630548  
    114114                    isset($dataShipment["reference"]) && !empty($dataShipment["reference"]) &&
    115115                    isset($dataShipment["point_id"]) && !empty($dataShipment["point_id"]) &&
    116                     isset($dataShipment["customer_phone"]) && !empty($dataShipment["customer_phone"]) &&
    117                     isset($dataShipment["customer_name"]) && !empty($dataShipment["customer_name"]) &&
    118                     isset($dataShipment["cod_amount"]) && is_numeric($dataShipment['cod_amount']) && floatval($dataShipment['cod_amount']) >= 0 &&
    119                     isset($dataShipment["cod_currency"]) && !empty($dataShipment["cod_currency"])
     116                    isset($dataShipment["customer_phone"]) && !empty($dataShipment["customer_phone"])
    120117                ) {
    121118                    return true;
     
    160157                    $dataShipment['cod_currency'] = $priceData['curency'];
    161158                }
    162                 $urlQuery = REDBOX_URL_CREATE_SHIPMENT;
    163                 $options = array(
    164                     'headers' => array(
    165                         'Authorization' => 'Bearer ' . $this->redboxKey
    166                     ),
    167                     'body' => $dataShipment
    168                 );
    169                 $response = wp_remote_post($urlQuery, $options);
    170                 $body = json_decode( wp_remote_retrieve_body( $response ), true );
    171                 if ($body['success']) {
    172                     $note = 'RedBox tracking number: ' . $body['tracking_number'];
    173                     $order->add_order_note( $note );
    174                     $order->update_meta_data( 'redbox_shipment_url_shipping_label', $body['url_shipping_label'] );
    175                 } else {
    176                     $note = 'RedBox error: ' . $body['msg'];
    177                     $order->add_order_note( $note );
    178                 }
    179                
    180                 $order->save();
     159                if ($this->redbox_validate_body_update_shipment($dataShipment)) {
     160                    $urlQuery = REDBOX_URL_CREATE_SHIPMENT;
     161                    $options = array(
     162                        'headers' => array(
     163                            'Authorization' => 'Bearer ' . $this->redboxKey
     164                        ),
     165                        'body' => $dataShipment
     166                    );
     167                    $response = wp_remote_post($urlQuery, $options);
     168                    $body = json_decode( wp_remote_retrieve_body( $response ), true );
     169                    if ($body['success']) {
     170                        $note = 'RedBox tracking number: ' . $body['tracking_number'];
     171                        $order->add_order_note( $note );
     172                        $order->update_meta_data( 'redbox_shipment_url_shipping_label', $body['url_shipping_label'] );
     173                    } else {
     174                        $note = 'RedBox error: ' . $body['msg'];
     175                        $order->add_order_note( $note );
     176                    }
     177                   
     178                    $order->save();
     179                }
    181180            }
    182181
  • redbox-pickup/trunk/readme.txt

    r2629670 r2630548  
    55Requires at least: 3.3
    66Tested up to: 5.5.1
    7 Stable tag: 1.23
     7Stable tag: 1.24
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • redbox-pickup/trunk/redbox.php

    r2629670 r2630548  
    44        * Description: This plugin allows customers pickup package at RedBox Locker.
    55        * Plugin URI: https://woocommerce.com/
    6         * Version: 1.23
     6        * Version: 1.24
    77        * Author: RedBox
    88        * Author URI: https://redboxsa.com
Note: See TracChangeset for help on using the changeset viewer.