Changeset 2932622
- Timestamp:
- 06/30/2023 12:08:12 PM (3 years ago)
- Location:
- shiip/trunk
- Files:
-
- 3 edited
-
README.txt (modified) (2 diffs)
-
includes/shiipFunctions.php (modified) (2 diffs)
-
shiip.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shiip/trunk/README.txt
r2820044 r2932622 2 2 Contributors: oife 3 3 Donate link: https://goshiip.com 4 Tags: logistics, shipping,delivery,ecommerce,kwik,gig,dhl,fedex,naira,dollar,guo, gig,uber,gokada,import,export,nigeria4 Tags: logistics, shipping,delivery,ecommerce,kwik,gig,dhl,fedex,naira,dollar,guo,flutterwave 5 5 Requires at least: 4.7 6 Tested up to: 6. 17 Stable tag: 1.0. 56 Tested up to: 6.2 7 Stable tag: 1.0.6 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 42 42 == Changelog == 43 43 44 = 1.0.5 = 45 * Added more carriers to service your shipments 46 44 47 = 1.0 = 45 48 * First Release -
shiip/trunk/includes/shiipFunctions.php
r2923398 r2932622 7 7 8 8 9 function getAccessToken(){10 $email = get_option("wc_shiip_settings_email", "-" );11 $password = get_option("wc_shiip_settings_password", "-" );9 // function getAccessToken(){ 10 // $email = get_option("wc_shiip_settings_email", "-" ); 11 // $password = get_option("wc_shiip_settings_password", "-" ); 12 12 13 13 14 $body = [15 'email_phone' => $email,16 'password' => $password,17 ];18 19 $body = wp_json_encode( $body );20 21 // error_log($body);22 23 24 $options = [25 'body' => $body,26 'headers' => [27 'Content-Type' => 'application/json',28 ],29 'timeout' => 60,30 'redirection' => 5,31 'blocking' => true,32 'httpversion' => '1.0',33 'sslverify' => false,34 'data_format' => 'body',35 ];36 37 $response = wp_remote_post( "https://delivery.apiideraos.com/api/v2/auth/login", $options );38 $responseBody = wp_remote_retrieve_body( $response );39 40 $json = json_decode($responseBody);41 42 43 // error_log($responseBody);44 45 if($json->status){46 add_option("wc_shiip_user", $responseBody);47 add_option("wc_shiip_user_token", $json->data->token);48 add_option("wc_shiip_user_name", $json->data->user->firstname.' '.$json->data->user->lastname);49 50 51 }52 53 }14 // $body = [ 15 // 'email_phone' => $email, 16 // 'password' => $password, 17 // ]; 18 19 // $body = wp_json_encode( $body ); 20 21 // // error_log($body); 22 23 24 // $options = [ 25 // 'body' => $body, 26 // 'headers' => [ 27 // 'Content-Type' => 'application/json', 28 // ], 29 // 'timeout' => 60, 30 // 'redirection' => 5, 31 // 'blocking' => true, 32 // 'httpversion' => '1.0', 33 // 'sslverify' => false, 34 // 'data_format' => 'body', 35 // ]; 36 37 // $response = wp_remote_post( "https://delivery.apiideraos.com/api/v2/auth/login", $options ); 38 // $responseBody = wp_remote_retrieve_body( $response ); 39 40 // $json = json_decode($responseBody); 41 42 43 // // error_log($responseBody); 44 45 // if($json->status){ 46 // add_option("wc_shiip_user", $responseBody); 47 // add_option("wc_shiip_user_token", $json->data->token); 48 // add_option("wc_shiip_user_name", $json->data->user->firstname.' '.$json->data->user->lastname); 49 50 51 // } 52 53 // } 54 54 55 55 function getAddressDetails($address){ … … 95 95 //end of get aaccount details 96 96 97 if(!isset($acctJson->data->user->firstname)){//if it doesnt exist i must login98 getAccessToken();99 $acctData = get_option("wc_shiip_user");100 $acctJson = json_decode($acctData);101 }97 // if(!isset($acctJson->data->user->firstname)){//if it doesnt exist i must login 98 // getAccessToken(); 99 // $acctData = get_option("wc_shiip_user"); 100 // $acctJson = json_decode($acctData); 101 // } 102 102 103 103 $toCountry = WC()->countries->countries[$pack['destination']['country']]; //To get country name by code -
shiip/trunk/shiip.php
r2923398 r2932622 17 17 * Plugin URI: https://app.goshiip.com/ 18 18 * Description: The only shipping app you will ever need for your business. You can “Shiip” with top logistics companies at half their standard rates 19 * Version: 1.0. 619 * Version: 1.0.7 20 20 * Author: Shiip LLC 21 21 * Author URI: https://goshiip.com/ … … 40 40 * Rename this for your plugin and update it as you release new versions. 41 41 */ 42 define( 'SHIIP_VERSION', '1.0. 6' );42 define( 'SHIIP_VERSION', '1.0.7' ); 43 43 44 44 … … 165 165 } 166 166 167 168 function getAccessToken(){ 169 $email = get_option("wc_shiip_settings_email", "-" ); 170 $password = get_option("wc_shiip_settings_password", "-" ); 171 172 173 $body = [ 174 'email_phone' => $email, 175 'password' => $password, 176 ]; 177 178 $body = wp_json_encode( $body ); 179 180 // error_log($body); 181 182 183 $options = [ 184 'body' => $body, 185 'headers' => [ 186 'Content-Type' => 'application/json', 187 ], 188 'timeout' => 60, 189 'redirection' => 5, 190 'blocking' => true, 191 'httpversion' => '1.0', 192 'sslverify' => false, 193 'data_format' => 'body', 194 ]; 195 196 $response = wp_remote_post( "https://delivery.apiideraos.com/api/v2/auth/login", $options ); 197 $responseBody = wp_remote_retrieve_body( $response ); 198 199 $json = json_decode($responseBody); 200 201 202 // error_log($responseBody); 203 204 if($json->status){ 205 add_option("wc_shiip_user", $responseBody); 206 add_option("wc_shiip_user_token", $json->data->token); 207 add_option("wc_shiip_user_name", $json->data->user->firstname.' '.$json->data->user->lastname); 208 209 210 } 211 212 } 167 213 168 214 function shiip_shiping_init() { … … 1513 1559 add_action( 'woocommerce_shipping_init', 'your_shipping_method_init' ); 1514 1560 function shiip_shipping_methods( $methods ) { 1515 1561 getAccessToken(); 1562 1516 1563 if(get_option('woocommerce_currency') == "NGN"){ 1517 1564 //only work if the platform is using naira
Note: See TracChangeset
for help on using the changeset viewer.