pakkelabels / pakkelabels-php-sdk Goto Github PK
View Code? Open in Web Editor NEWPakkelabels.dk's PHP official PHP library (DEPRECATED)
License: Other
Pakkelabels.dk's PHP official PHP library (DEPRECATED)
License: Other
Could a function to get /documents/end_of_day
be added to the lib?
Hello there.
Does this library require any special PHP extensions?
I made a example with the provided code in your Readme page, and it doesnt work on Localhost.
try {
$label = new Pakkelabels('**********', '**********');
$pdk_stores = $label->pdk_droppoints(array(
'zipcode' => '5240',
'street' => 'Strandvejen'
));
echo $pdk_stores;
}
catch(PakkelabelsException $e) {
echo $e->getMessage();
echo 'something is wrong...';
}
NOTE: This is a simplyfied example, a lot has been trimmed
The getMessage is not returning anything, but i get the message "Something is wrong" meaning that the "try" failed.
The very same code works perfect on a webserver, but my project is developed using GitHub, so i prefer having the library work on localhost.
This is the error message i get:
Fatal error: Uncaught exception 'PakkelabelsException' in C:\xampp\htdocs\pakkelabels\Pakkelabels.php:120 Stack trace:
0 C:\xampp\htdocs\pakkelabels\Pakkelabels.php(18): Pakkelabels->_make_api_call('users/login', true, Array)
1 C:\xampp\htdocs\pakkelabels\Pakkelabels.php(14): Pakkelabels->login()
2 C:\xampp\htdocs\pakkelabels\index.php(7): Pakkelabels->__construct('MIN BRUGER', 'MIN NØGLE')
3 {main} thrown in C:\xampp\htdocs\pakkelabels\Pakkelabels.php on line 120
For security reasons, i have ofcourse removed the API user and key.
Hi ! Can you please replace this row
$shipment = $label->createShipment($data);
by this :
$shipment = $label->create_shipment($data);
inside README.md .
The method createShipment() does not exist.
Also, the following example is not valid by itself.
The input array requires additional fields like 'receiver_mobile' and 'receiver_email'. Otherwise, it will throw PakkelabelsException.
$data = array(
'shipping_agent' => 'pdk',
'weight' => '1000',
'receiver_name' => 'John Doe',
'receiver_address1' => 'Some Street 42',
'receiver_zipcode' => '5230',
'receiver_city' => 'Odense M',
'receiver_country' => 'DK',
'sender_name' => 'John Wayne',
'sender_address1' => 'The Batcave 1',
'sender_zipcode' => '5000',
'sender_city' => 'Odense C',
'sender_country' => 'DK',
'shipping_product_id' => '51',
'services' => '11,12',
'test' => 'true' // Change to false when going live
);$shipment = $label->createShipment($data);
echo 'Track&Trace: ' . $shipment['pkg_no'];
Best regards : )
I'm evaluating the api and I am getting the "No Shipping Product with ID 517"
when running the CreateShipment call.
Login works.
Is there anything that needs to be setup aside from the API Keys?
Please upgrade your sdk to facilitate the new api v3: https://app.pakkelabels.dk/api/public/v3/specification
among others this facilitates shipment_monitor, which I am looking forward to using.
I have tried updating, but cannot get curl basic auth to work with api v3.
If people choose to fork your repository, it will become e.g. lsolesen/php, which gives no clue what the repository contains. It would be great if you could rename the repository to e.g. pakkelabels/pakkelabels-php-sdk or something similar, because then forks will also be easy to distinguish.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.