Changeset 2630548
- Timestamp:
- 11/16/2021 08:56:12 AM (4 years ago)
- Location:
- redbox-pickup
- Files:
-
- 3 edited
- 8 copied
-
tags/1.24 (copied) (copied from redbox-pickup/trunk)
-
tags/1.24/admin/config.php (copied) (copied from redbox-pickup/trunk/admin/config.php)
-
tags/1.24/admin/new_method.php (copied) (copied from redbox-pickup/trunk/admin/new_method.php)
-
tags/1.24/css/front.css (copied) (copied from redbox-pickup/trunk/css/front.css)
-
tags/1.24/front/front.php (copied) (copied from redbox-pickup/trunk/front/front.php) (2 diffs)
-
tags/1.24/js/front.js (copied) (copied from redbox-pickup/trunk/js/front.js)
-
tags/1.24/readme.txt (copied) (copied from redbox-pickup/trunk/readme.txt) (1 diff)
-
tags/1.24/redbox.php (copied) (copied from redbox-pickup/trunk/redbox.php) (1 diff)
-
trunk/front/front.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/redbox.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
redbox-pickup/tags/1.24/front/front.php
r2629670 r2630548 114 114 isset($dataShipment["reference"]) && !empty($dataShipment["reference"]) && 115 115 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"]) 120 117 ) { 121 118 return true; … … 160 157 $dataShipment['cod_currency'] = $priceData['curency']; 161 158 } 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 } 181 180 } 182 181 -
redbox-pickup/tags/1.24/readme.txt
r2629670 r2630548 5 5 Requires at least: 3.3 6 6 Tested up to: 5.5.1 7 Stable tag: 1.2 37 Stable tag: 1.24 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
redbox-pickup/tags/1.24/redbox.php
r2629670 r2630548 4 4 * Description: This plugin allows customers pickup package at RedBox Locker. 5 5 * Plugin URI: https://woocommerce.com/ 6 * Version: 1.2 36 * Version: 1.24 7 7 * Author: RedBox 8 8 * Author URI: https://redboxsa.com -
redbox-pickup/trunk/front/front.php
r2629670 r2630548 114 114 isset($dataShipment["reference"]) && !empty($dataShipment["reference"]) && 115 115 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"]) 120 117 ) { 121 118 return true; … … 160 157 $dataShipment['cod_currency'] = $priceData['curency']; 161 158 } 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 } 181 180 } 182 181 -
redbox-pickup/trunk/readme.txt
r2629670 r2630548 5 5 Requires at least: 3.3 6 6 Tested up to: 5.5.1 7 Stable tag: 1.2 37 Stable tag: 1.24 8 8 License: GPLv2 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html -
redbox-pickup/trunk/redbox.php
r2629670 r2630548 4 4 * Description: This plugin allows customers pickup package at RedBox Locker. 5 5 * Plugin URI: https://woocommerce.com/ 6 * Version: 1.2 36 * Version: 1.24 7 7 * Author: RedBox 8 8 * Author URI: https://redboxsa.com
Note: See TracChangeset
for help on using the changeset viewer.