Skip to content

Commit

Permalink
Fixed a contruct function, and removed some unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
berntjs committed Dec 4, 2018
1 parent 69f2a16 commit 150f2a6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
40 changes: 20 additions & 20 deletions include/api/CargonizerApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CargonizerApi{
*
* @consignment_id bool
**/
function __construct($consignment_id int=false){
function __construct($consignment_id){

if ( get_option( 'cargonizer-sandbox-modus' ) ){
// _log('sandbox');
Expand All @@ -36,15 +36,15 @@ function __construct($consignment_id int=false){
//_log($this);
}

if ( $set_transport_agreements ){
$this->TransportAgreements = $this->getTransportAgreements();
}
// if ( $set_transport_agreements ){
// $this->TransportAgreements = $this->getTransportAgreements();
// }
}


/**
* gets all transport agreements by sender id
**/
* gets all transport agreements by sender id
**/
function getTransportAgreements(){
// curl -g -XGET -H'X-Cargonizer-Key: b38515a578db604ba77f063801155add075a56e4' -H'X-Cargonizer-Sender: 1142' 'http://sandbox.cargonizer.no/transport_agreements.xml'
//_log('CargonizerApi::getTransportAgreements');
Expand All @@ -54,8 +54,8 @@ function getTransportAgreements(){


/**
* gets all printers by sender id
**/
* gets all printers by sender id
**/
function getPrinters(){
// curl -g -XGET -H'X-Cargonizer-Key: b38515a578db604ba77f063801155add075a56e4' -H'X-Cargonizer-Sender: 1142' 'http://sandbox.cargonizer.no/transport_agreements.xml'
//_log('CargonizerApi::getPrinters()');
Expand All @@ -64,21 +64,21 @@ function getPrinters(){


/**
* gets all service partners by country, postcode and carrier
* service partner = delivery location (leveringssted. i.e. Coop Mega, Joker Naustdal )
*
* @postcode int
* @country string
* @carrier string
**/
* gets all service partners by country, postcode and carrier
* service partner = delivery location (leveringssted. i.e. Coop Mega, Joker Naustdal )
*
* @postcode int
* @country string
* @carrier string
**/
function getServicePartners( $postcode, $country, $carrier ){
//curl -g -XGET -H'X-Cargonizer-Key: 12345' 'http://cargonizer.no/service_partners.xml?country=NO&postcode=1337&carrier=postnord'
$args =
array(
'country' => $country,
'postcode' => $postcode,
'carrier' => $carrier
);
array(
'country' => $country,
'postcode' => $postcode,
'carrier' => $carrier
);

$resource = 'service_partners.xml?';
if ( $query_string = $this->buildQueryString($args) ){
Expand Down
2 changes: 1 addition & 1 deletion woocommerce-cargonizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*woo
Plugin Name: Woocommerce Cargonizer
Description:
Version: 0.5.3
Version: 0.5.4
Author: Mediebruket AS
Author URI: http://mediebruket.no
*/
Expand Down

0 comments on commit 150f2a6

Please sign in to comment.