Changeset 3194989
- Timestamp:
- 11/22/2024 01:55:11 PM (16 months ago)
- Location:
- bpost-shipping/trunk
- Files:
-
- 25 edited
-
bpost-shipping.php (modified) (2 diffs)
-
languages/bpost_shipping.pot (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/.github/workflows/test.yml (modified) (1 diff)
-
vendor/antidot-be/bpost-api-library/src/Bpost.php (modified) (1 diff)
-
vendor/antidot-be/bpost-api-library/src/Bpost/HttpRequestBuilder/CreateLabelInBulkForOrdersBuilder.php (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/HttpRequestBuilder/ModifyOrderBuilder.php (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order.php (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box.php (modified) (4 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/At247.php (modified) (3 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/AtBpost.php (modified) (4 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/AtHome.php (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/AtIntlPugo.php (modified) (4 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/BpostOnAppointment.php (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/International.php (modified) (3 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/National.php (modified) (5 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/AutomaticSecondPresentation.php (modified) (1 diff)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/CashOnDelivery.php (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Insured.php (modified) (5 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Messaging.php (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Option.php (modified) (2 diffs)
-
vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Signed.php (modified) (1 diff)
-
vendor/antidot-be/bpost-api-library/src/FormHandler.php (modified) (8 diffs)
-
vendor/composer/installed.json (modified) (2 diffs)
-
vendor/composer/installed.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bpost-shipping/trunk/bpost-shipping.php
r3171290 r3194989 6 6 * Author: bpost 7 7 * Author URI: https://www.bpost.be/ 8 * Version: 3.1.1 18 * Version: 3.1.12 9 9 * WC requires at least: 3.0 10 10 * WC tested up to: 8.9 … … 15 15 define( 'BPOST_PLUGIN_DIR', __DIR__ ); 16 16 define( 'BPOST_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 17 define( 'BPOST_PLUGIN_VERSION', '3.1.1 1' );17 define( 'BPOST_PLUGIN_VERSION', '3.1.12' ); 18 18 19 19 /** -
bpost-shipping/trunk/languages/bpost_shipping.pot
r3171290 r3194989 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: bpost shipping 3.1.1 1\n"5 "Project-Id-Version: bpost shipping 3.1.12\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/package\n" 7 "POT-Creation-Date: 2024-1 0-18 08:36:58+00:00\n"7 "POT-Creation-Date: 2024-11-22 13:53:58+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=UTF-8\n" … … 197 197 msgstr "" 198 198 199 #. #-#-#-#-# bpost_shipping.pot (bpost shipping 3.1.1 1) #-#-#-#-#199 #. #-#-#-#-# bpost_shipping.pot (bpost shipping 3.1.12) #-#-#-#-# 200 200 #. Author of the plugin/theme 201 201 #: classes/class-wc-bpost-shipping-method.php:261 -
bpost-shipping/trunk/readme.txt
r3171290 r3194989 8 8 Tested up to: 6.5 9 9 Requires PHP: 7.4 10 Stable tag: 3.1.1 110 Stable tag: 3.1.12 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 120 120 5. Configure your bpost shipping settings under the Woocommerce shipping > bpost shipping tab 121 121 == Changelog == 122 123 #### 3.1.12 124 125 * label creation could fail with Insurance option 122 126 123 127 #### 3.1.11 -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/.github/workflows/test.yml
r3119293 r3194989 1 on: [push] 1 on: 2 push: 3 pull_request: 4 2 5 jobs: 3 6 build-and-test: -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost.php
r3119293 r3194989 43 43 const LABEL_FORMAT_A4 = 'A4'; 44 44 const LABEL_FORMAT_A6 = 'A6'; 45 46 const NS_V3_GLOBAL = 'http://schema.post.be/shm/deepintegration/v3/'; 47 const NS_V3_COMMON = 'http://schema.post.be/shm/deepintegration/v3/common'; 48 const NS_V3_NATIONAL = 'http://schema.post.be/shm/deepintegration/v3/national'; 49 const NS_V3_INTERNATIONAL = 'http://schema.post.be/shm/deepintegration/v3/international'; 50 const NS_V5_GLOBAL = 'http://schema.post.be/shm/deepintegration/v5/'; 51 const NS_V5_COMMON = 'http://schema.post.be/shm/deepintegration/v5/common'; 52 const NS_V5_NATIONAL = 'http://schema.post.be/shm/deepintegration/v5/national'; 53 const NS_V5_INTERNATIONAL = 'http://schema.post.be/shm/deepintegration/v5/international'; 45 54 46 55 // URL for the api -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/HttpRequestBuilder/CreateLabelInBulkForOrdersBuilder.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\HttpRequestBuilder; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Common\ValidatedValue\LabelFormat; 6 7 use DOMDocument; … … 58 59 59 60 $batchLabels = $document->createElement('batchLabels'); 60 $batchLabels->setAttribute('xmlns', 'http://schema.post.be/shm/deepintegration/v3/');61 $batchLabels->setAttribute('xmlns', Bpost::NS_V3_GLOBAL); 61 62 foreach ($this->references as $reference) { 62 63 $batchLabels->appendChild( -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/HttpRequestBuilder/ModifyOrderBuilder.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\HttpRequestBuilder; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Bpost\Order\Box; 6 7 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException; … … 41 42 42 43 $orderUpdate = $document->createElement('orderUpdate'); 43 $orderUpdate->setAttribute('xmlns', 'http://schema.post.be/shm/deepintegration/v3/');44 $orderUpdate->setAttribute('xmlns', Bpost::NS_V3_GLOBAL); 44 45 $orderUpdate->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); 45 46 $orderUpdate->appendChild( -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Bpost\Order\Box; 6 7 use Bpost\BpostApiClient\Bpost\Order\Line; … … 159 160 'tns:order' 160 161 ); 161 $order->setAttribute( 162 'xmlns:common', 163 'http://schema.post.be/shm/deepintegration/v5/common' 164 ); 165 $order->setAttribute( 166 'xmlns:tns', 167 'http://schema.post.be/shm/deepintegration/v5/' 168 ); 169 $order->setAttribute( 170 'xmlns', 171 'http://schema.post.be/shm/deepintegration/v5/national' 172 ); 173 $order->setAttribute( 174 'xmlns:international', 175 'http://schema.post.be/shm/deepintegration/v5/international' 176 ); 177 $order->setAttribute( 178 'xmlns:xsi', 179 'http://www.w3.org/2001/XMLSchema-instance' 180 ); 181 $order->setAttribute( 182 'xsi:schemaLocation', 183 'http://schema.post.be/shm/deepintegration/v5/' 184 ); 162 $order->setAttribute('xmlns:common', Bpost::NS_V5_COMMON); 163 $order->setAttribute('xmlns:tns', Bpost::NS_V5_GLOBAL); 164 $order->setAttribute('xmlns', Bpost::NS_V5_NATIONAL); 165 $order->setAttribute('xmlns:international', Bpost::NS_V5_INTERNATIONAL); 166 $order->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance'); 167 $order->setAttribute('xsi:schemaLocation', Bpost::NS_V5_GLOBAL); 185 168 186 169 $document->appendChild($order); -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Common\XmlHelper; 6 7 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException; … … 233 234 Sender::createFromXML( 234 235 $xml->sender->children( 235 'http://schema.post.be/shm/deepintegration/v3/common'236 Bpost::NS_V3_COMMON 236 237 ) 237 238 ) … … 240 241 if (isset($xml->nationalBox)) { 241 242 /** @var SimpleXMLElement $nationalBoxData */ 242 $nationalBoxData = $xml->nationalBox->children( 'http://schema.post.be/shm/deepintegration/v3/national');243 $nationalBoxData = $xml->nationalBox->children(Bpost::NS_V3_NATIONAL); 243 244 244 245 // build classname based on the tag name 245 $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\' . ucfirst($nationalBoxData->getName());246 246 if ($nationalBoxData->getName() == 'at24-7') { 247 247 $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\At247'; 248 } else { 249 $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\' . ucfirst($nationalBoxData->getName()); 248 250 } 249 251 … … 256 258 if (isset($xml->internationalBox)) { 257 259 /** @var SimpleXMLElement $internationalBoxData */ 258 $internationalBoxData = $xml->internationalBox->children( 'http://schema.post.be/shm/deepintegration/v3/international');260 $internationalBoxData = $xml->internationalBox->children(Bpost::NS_V3_INTERNATIONAL); 259 261 260 262 // build classname based on the tag name -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/At247.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Bpost\Order\Box\National\Unregistered; 6 7 use Bpost\BpostApiClient\Bpost\Order\Box\Option\Messaging; … … 10 11 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException; 11 12 use Bpost\BpostApiClient\Exception\BpostNotImplementedException; 13 use Bpost\BpostApiClient\Exception\XmlException\BpostXmlInvalidItemException; 12 14 use DOMDocument; 13 15 use DOMElement; … … 313 315 public static function createFromXML(SimpleXMLElement $xml, National $self = null) 314 316 { 315 $at247 = new At247(); 316 317 if (isset($xml->{'at24-7'}->product) && $xml->{'at24-7'}->product != '') { 318 $at247->setProduct( 319 (string) $xml->{'at24-7'}->product 320 ); 321 } 322 if (isset($xml->{'at24-7'}->options)) { 323 /** @var SimpleXMLElement $optionData */ 324 foreach ($xml->{'at24-7'}->options as $optionData) { 325 $optionData = $optionData->children('http://schema.post.be/shm/deepintegration/v3/common'); 326 327 if (in_array($optionData->getName(), array(Messaging::MESSAGING_TYPE_INFO_DISTRIBUTED))) { 328 $option = Messaging::createFromXML($optionData); 329 } else { 330 $option = self::getOptionFromOptionData($optionData); 331 } 332 333 $at247->addOption($option); 334 } 335 } 336 if (isset($xml->{'at24-7'}->weight) && $xml->{'at24-7'}->weight != '') { 337 $at247->setWeight( 338 (int) $xml->{'at24-7'}->weight 339 ); 340 } 341 if (isset($xml->{'at24-7'}->memberId) && $xml->{'at24-7'}->memberId != '') { 342 $at247->setMemberId( 343 (string) $xml->{'at24-7'}->memberId 344 ); 345 } 346 if (isset($xml->{'at24-7'}->receiverName) && $xml->{'at24-7'}->receiverName != '') { 347 $at247->setReceiverName( 348 (string) $xml->{'at24-7'}->receiverName 349 ); 350 } 351 if (isset($xml->{'at24-7'}->receiverCompany) && $xml->{'at24-7'}->receiverCompany != '') { 352 $at247->setReceiverCompany( 353 (string) $xml->{'at24-7'}->receiverCompany 354 ); 355 } 356 if (isset($xml->{'at24-7'}->parcelsDepotId) && $xml->{'at24-7'}->parcelsDepotId != '') { 357 $at247->setParcelsDepotId( 358 (string) $xml->{'at24-7'}->parcelsDepotId 359 ); 360 } 361 if (isset($xml->{'at24-7'}->parcelsDepotName) && $xml->{'at24-7'}->parcelsDepotName != '') { 362 $at247->setParcelsDepotName( 363 (string) $xml->{'at24-7'}->parcelsDepotName 364 ); 365 } 366 if (isset($xml->{'at24-7'}->parcelsDepotAddress)) { 317 if ($self === null) { 318 $self = new self(); 319 } 320 321 if (!isset($xml->{'at24-7'})) { 322 throw new BpostXmlInvalidItemException(); 323 } 324 325 $at247Xml = $xml->{'at24-7'}[0]; 326 327 /** @var static $self */ 328 $self = parent::createFromXML($at247Xml, $self); 329 330 if (!empty($at247Xml->memberId)) { 331 $self->setMemberId( 332 (string) $at247Xml->memberId 333 ); 334 } 335 if (!empty($at247Xml->receiverName)) { 336 $self->setReceiverName( 337 (string) $at247Xml->receiverName 338 ); 339 } 340 if (!empty($at247Xml->receiverCompany)) { 341 $self->setReceiverCompany( 342 (string) $at247Xml->receiverCompany 343 ); 344 } 345 if (!empty($at247Xml->parcelsDepotId)) { 346 $self->setParcelsDepotId( 347 (string) $at247Xml->parcelsDepotId 348 ); 349 } 350 if (!empty($at247Xml->parcelsDepotName)) { 351 $self->setParcelsDepotName( 352 (string) $at247Xml->parcelsDepotName 353 ); 354 } 355 if (isset($at247Xml->parcelsDepotAddress)) { 367 356 /** @var SimpleXMLElement $parcelsDepotAddressData */ 368 $parcelsDepotAddressData = $xml->{'at24-7'}->parcelsDepotAddress->children( 369 'http://schema.post.be/shm/deepintegration/v3/common' 370 ); 371 $at247->setParcelsDepotAddress( 357 $parcelsDepotAddressData = $at247Xml->parcelsDepotAddress->children(Bpost::NS_V3_COMMON); 358 $self->setParcelsDepotAddress( 372 359 ParcelsDepotAddress::createFromXML($parcelsDepotAddressData) 373 360 ); 374 361 } 375 if ( isset($xml->{'at24-7'}->requestedDeliveryDate) && $xml->{'at24-7'}->requestedDeliveryDate != '') {376 $ at247->setRequestedDeliveryDate(377 (string) $ xml->{'at24-7'}->requestedDeliveryDate378 ); 379 } 380 381 return $ at247;362 if (!empty($at247Xml->requestedDeliveryDate)) { 363 $self->setRequestedDeliveryDate( 364 (string) $at247Xml->requestedDeliveryDate 365 ); 366 } 367 368 return $self; 382 369 } 383 370 } -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/AtBpost.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Bpost\Order\Box\National\ShopHandlingInstruction; 6 7 use Bpost\BpostApiClient\Bpost\Order\Box\Option\Messaging; … … 10 11 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException; 11 12 use Bpost\BpostApiClient\Exception\BpostNotImplementedException; 13 use Bpost\BpostApiClient\Exception\XmlException\BpostXmlInvalidItemException; 12 14 use DOMDocument; 13 15 use DOMElement; … … 272 274 public static function createFromXML(SimpleXMLElement $xml, National $self = null) 273 275 { 274 $atBpost = new AtBpost(); 275 276 if (isset($xml->atBpost->product) && $xml->atBpost->product != '') { 277 $atBpost->setProduct( 278 (string) $xml->atBpost->product 279 ); 280 } 281 if (isset($xml->atBpost->options)) { 282 /** @var SimpleXMLElement $optionData */ 283 foreach ($xml->atBpost->options as $optionData) { 284 $optionData = $optionData->children('http://schema.post.be/shm/deepintegration/v3/common'); 285 286 if (in_array( 287 $optionData->getName(), 288 array( 289 Messaging::MESSAGING_TYPE_INFO_DISTRIBUTED, 290 Messaging::MESSAGING_TYPE_INFO_NEXT_DAY, 291 Messaging::MESSAGING_TYPE_INFO_REMINDER, 292 Messaging::MESSAGING_TYPE_KEEP_ME_INFORMED, 293 ) 294 ) 295 ) { 296 $option = Messaging::createFromXML($optionData); 297 } else { 298 $option = self::getOptionFromOptionData($optionData); 299 } 300 301 $atBpost->addOption($option); 302 } 303 } 304 if (isset($xml->atBpost->weight) && $xml->atBpost->weight != '') { 305 $atBpost->setWeight( 306 (int) $xml->atBpost->weight 307 ); 308 } 309 if (isset($xml->atBpost->receiverName) && $xml->atBpost->receiverName != '') { 310 $atBpost->setReceiverName( 276 if ($self === null) { 277 $self = new self(); 278 } 279 280 if (!isset($xml->atBpost)) { 281 throw new BpostXmlInvalidItemException(); 282 } 283 284 $atBpostXml = $xml->atBpost[0]; 285 286 /** @var static $self */ 287 $self = parent::createFromXML($atBpostXml, $self); 288 289 if (!empty($atBpostXml->receiverName)) { 290 $self->setReceiverName( 311 291 (string) $xml->atBpost->receiverName 312 292 ); 313 293 } 314 if ( isset($xml->atBpost->receiverCompany) && $xml->atBpost->receiverCompany != '') {315 $ atBpost->setReceiverCompany(294 if (!empty($atBpostXml->receiverCompany)) { 295 $self->setReceiverCompany( 316 296 (string) $xml->atBpost->receiverCompany 317 297 ); 318 298 } 319 if ( isset($xml->atBpost->pugoId) && $xml->atBpost->pugoId != '') {320 $ atBpost->setPugoId(299 if (!empty($atBpostXml->pugoId)) { 300 $self->setPugoId( 321 301 (string) $xml->atBpost->pugoId 322 302 ); 323 303 } 324 if ( isset($xml->atBpost->pugoName) && $xml->atBpost->pugoName != '') {325 $ atBpost->setPugoName(304 if (!empty($atBpostXml->pugoName)) { 305 $self->setPugoName( 326 306 (string) $xml->atBpost->pugoName 327 307 ); … … 329 309 if (isset($xml->atBpost->pugoAddress)) { 330 310 /** @var SimpleXMLElement $pugoAddressData */ 331 $pugoAddressData = $xml->atBpost->pugoAddress->children( 332 'http://schema.post.be/shm/deepintegration/v3/common' 333 ); 334 $atBpost->setPugoAddress( 311 $pugoAddressData = $atBpostXml->pugoAddress->children(Bpost::NS_V3_COMMON); 312 $self->setPugoAddress( 335 313 PugoAddress::createFromXML($pugoAddressData) 336 314 ); 337 315 } 338 if ( isset($xml->atBpost->requestedDeliveryDate) && $xml->atBpost->requestedDeliveryDate != '') {339 $ atBpost->setRequestedDeliveryDate(316 if (!empty($atBpostXml->requestedDeliveryDate)) { 317 $self->setRequestedDeliveryDate( 340 318 (string) $xml->atBpost->requestedDeliveryDate 341 319 ); 342 320 } 343 if ( isset($xml->atBpost->shopHandlingInstruction) && $xml->atBpost->shopHandlingInstruction != '') {344 $ atBpost->setShopHandlingInstruction(321 if (!empty($atBpostXml->shopHandlingInstruction)) { 322 $self->setShopHandlingInstruction( 345 323 (string) $xml->atBpost->shopHandlingInstruction 346 324 ); 347 325 } 348 326 349 return $ atBpost;327 return $self; 350 328 } 351 329 } -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/AtHome.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Bpost\Order\Receiver; 6 7 use Bpost\BpostApiClient\Bpost\ProductConfiguration\Product; … … 160 161 $self->setReceiver( 161 162 Receiver::createFromXML( 162 $atHomeXml->receiver->children( 'http://schema.post.be/shm/deepintegration/v3/common')163 $atHomeXml->receiver->children(Bpost::NS_V3_COMMON) 163 164 ) 164 165 ); -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/AtIntlPugo.php
r3119293 r3194989 2 2 namespace Bpost\BpostApiClient\Bpost\Order\Box; 3 3 4 use Bpost\BpostApiClient\Bpost; 4 5 use Bpost\BpostApiClient\Bpost\Order\Box\National\ShopHandlingInstruction; 5 6 use Bpost\BpostApiClient\Bpost\Order\Box\Option\Messaging; … … 253 254 /** @var \SimpleXMLElement $optionData */ 254 255 foreach ($xml->atIntlPugo->options as $optionData) { 255 $optionData = $optionData->children( 'http://schema.post.be/shm/deepintegration/v3/common');256 $optionData = $optionData->children(Bpost::NS_V3_COMMON); 256 257 257 258 if (in_array( … … 289 290 $self->setReceiver( 290 291 Receiver::createFromXML( 291 $xml->atIntlPugo->receiver->children( 'http://schema.post.be/shm/deepintegration/v3/common')292 $xml->atIntlPugo->receiver->children(Bpost::NS_V3_COMMON) 292 293 ) 293 294 ); … … 305 306 if (isset($xml->atIntlPugo->pugoAddress)) { 306 307 /** @var \SimpleXMLElement $pugoAddressData */ 307 $pugoAddressData = $xml->atIntlPugo->pugoAddress->children( 308 'http://schema.post.be/shm/deepintegration/v3/common' 309 ); 308 $pugoAddressData = $xml->atIntlPugo->pugoAddress->children(Bpost::NS_V3_COMMON); 310 309 $self->setPugoAddress( 311 310 PugoAddress::createFromXML($pugoAddressData) -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/BpostOnAppointment.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Bpost\Order\Receiver; 6 7 use Bpost\BpostApiClient\Common\XmlHelper; … … 126 127 $self->setReceiver( 127 128 Receiver::createFromXML( 128 $bpostOnAppointmentXml->receiver->children( 'http://schema.post.be/shm/deepintegration/v3/common')129 $bpostOnAppointmentXml->receiver->children(Bpost::NS_V3_COMMON) 129 130 ) 130 131 ); -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/International.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Bpost\Order\Box\CustomsInfo\CustomsInfo; 6 7 use Bpost\BpostApiClient\Bpost\Order\Box\International\ParcelContent; … … 296 297 if (isset($xml->international->options)) { 297 298 /** @var SimpleXMLElement $optionData */ 298 $options = $xml->international->options->children( 'http://schema.post.be/shm/deepintegration/v3/common');299 $options = $xml->international->options->children(Bpost::NS_V3_COMMON); 299 300 foreach ($options as $optionData) { 300 301 switch ($optionData->getName()) { … … 323 324 } 324 325 if (isset($xml->international->receiver)) { 325 $receiverData = $xml->international->receiver->children( 326 'http://schema.post.be/shm/deepintegration/v3/common' 327 ); 326 $receiverData = $xml->international->receiver->children(Bpost::NS_V3_COMMON); 328 327 $international->setReceiver( 329 328 Receiver::createFromXML($receiverData) -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/National.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Bpost\Order\Box\OpeningHour\Day; 7 use Bpost\BpostApiClient\Bpost\Order\Box\Option\CashOnDelivery; 6 8 use Bpost\BpostApiClient\Bpost\Order\Box\Option\Messaging; 7 9 use Bpost\BpostApiClient\Bpost\Order\Box\Option\Option; … … 9 11 use Bpost\BpostApiClient\Common\ComplexAttribute; 10 12 use Bpost\BpostApiClient\Common\XmlHelper; 13 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidLengthException; 14 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException; 11 15 use Bpost\BpostApiClient\Exception\BpostNotImplementedException; 12 16 use Bpost\BpostApiClient\Exception\XmlException\BpostXmlInvalidItemException; … … 215 219 * @param National $self 216 220 * 217 * @return AtHome221 * @return National 218 222 * 219 223 * @throws BpostException … … 232 236 } 233 237 234 if ( isset($nationalXml->options) &&!empty($nationalXml->options)) {238 if (!empty($nationalXml->options)) { 235 239 /** @var SimpleXMLElement $optionData */ 236 foreach ($nationalXml->options as $optionData) { 237 $optionData = $optionData->children('http://schema.post.be/shm/deepintegration/v3/common'); 238 239 if (in_array($optionData->getName(), array( 240 Messaging::MESSAGING_TYPE_INFO_DISTRIBUTED, 241 Messaging::MESSAGING_TYPE_INFO_NEXT_DAY, 242 Messaging::MESSAGING_TYPE_INFO_REMINDER, 243 Messaging::MESSAGING_TYPE_KEEP_ME_INFORMED, 244 )) 245 ) { 246 $option = Messaging::createFromXML($optionData); 247 } else { 248 $option = self::getOptionFromOptionData($optionData); 249 } 250 251 $self->addOption($option); 240 foreach ($nationalXml->options->children(Bpost::NS_V3_COMMON) as $optionData) { 241 $self->addOption(self::getOptionFromOptionData($optionData)); 252 242 } 253 243 } … … 280 270 * 281 271 * @throws BpostNotImplementedException 272 * @throws BpostInvalidLengthException 273 * @throws BpostInvalidValueException 282 274 */ 283 275 protected static function getOptionFromOptionData(SimpleXMLElement $optionData) 284 276 { 285 $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\' . ucfirst($optionData->getName()); 286 XmlHelper::assertMethodCreateFromXmlExists($className); 287 288 return call_user_func( 289 array($className, 'createFromXML'), 290 $optionData 291 ); 277 switch ($optionData->getName()) { 278 case Messaging::MESSAGING_TYPE_INFO_DISTRIBUTED: 279 case Messaging::MESSAGING_TYPE_INFO_NEXT_DAY: 280 case Messaging::MESSAGING_TYPE_INFO_REMINDER: 281 case Messaging::MESSAGING_TYPE_KEEP_ME_INFORMED: 282 return Messaging::createFromXML($optionData); 283 284 case 'cod': 285 return CashOnDelivery::createFromXML($optionData); 286 287 default: 288 $className = '\\Bpost\\BpostApiClient\\Bpost\\Order\\Box\\Option\\' . ucfirst($optionData->getName()); 289 290 XmlHelper::assertMethodCreateFromXmlExists($className); 291 292 return call_user_func( 293 array($className, 'createFromXML'), 294 $optionData 295 ); 296 } 292 297 } 293 298 } -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/AutomaticSecondPresentation.php
r3119293 r3194989 32 32 return $document->createElement(XmlHelper::getPrefixedTagName('automaticSecondPresentation', $prefix)); 33 33 } 34 35 /**36 * @param SimpleXMLElement $xml37 *38 * @return static39 */40 public static function createFromXML(SimpleXMLElement $xml)41 {42 return new static();43 }44 34 } -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/CashOnDelivery.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box\Option; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Common\XmlHelper; 7 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidLengthException; 8 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException; 6 9 use DomDocument; 7 10 use DomElement; 11 use SimpleXMLElement; 8 12 9 13 /** … … 133 137 return $cod; 134 138 } 139 140 /** 141 * @param SimpleXMLElement $xml 142 * 143 * @return static 144 * 145 * @throws BpostInvalidLengthException 146 * @throws BpostInvalidValueException 147 */ 148 public static function createFromXML(SimpleXMLElement $xml) 149 { 150 $details = $xml->children(Bpost::NS_V3_COMMON); 151 152 return new static(floatval($details->codAmount), (string) $details->iban, (string) $details->bic); 153 } 135 154 } -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Insured.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box\Option; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Common\XmlHelper; 6 7 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidValueException; … … 27 28 const INSURANCE_AMOUNT_UP_TO_2500_EUROS = 2; 28 29 const INSURANCE_AMOUNT_UP_TO_5000_EUROS = 3; 30 /** @deprecated From SHM API v3.3.24: insurance is limited to 5000€ */ 29 31 const INSURANCE_AMOUNT_UP_TO_7500_EUROS = 4; 32 /** @deprecated From SHM API v3.3.24: insurance is limited to 5000€ */ 30 33 const INSURANCE_AMOUNT_UP_TO_10000_EUROS = 5; 34 /** @deprecated From SHM API v3.3.24: insurance is limited to 5000€ */ 31 35 const INSURANCE_AMOUNT_UP_TO_12500_EUROS = 6; 36 /** @deprecated From SHM API v3.3.24: insurance is limited to 5000€ */ 32 37 const INSURANCE_AMOUNT_UP_TO_15000_EUROS = 7; 38 /** @deprecated From SHM API v3.3.24: insurance is limited to 5000€ */ 33 39 const INSURANCE_AMOUNT_UP_TO_17500_EUROS = 8; 40 /** @deprecated From SHM API v3.3.24: insurance is limited to 5000€ */ 34 41 const INSURANCE_AMOUNT_UP_TO_20000_EUROS = 9; 42 /** @deprecated From SHM API v3.3.24: insurance is limited to 5000€ */ 35 43 const INSURANCE_AMOUNT_UP_TO_22500_EUROS = 10; 44 /** @deprecated From SHM API v3.3.24: insurance is limited to 5000€ */ 36 45 const INSURANCE_AMOUNT_UP_TO_25000_EUROS = 11; 37 46 … … 109 118 self::INSURANCE_AMOUNT_UP_TO_2500_EUROS, 110 119 self::INSURANCE_AMOUNT_UP_TO_5000_EUROS, 111 self::INSURANCE_AMOUNT_UP_TO_7500_EUROS,112 self::INSURANCE_AMOUNT_UP_TO_10000_EUROS,113 self::INSURANCE_AMOUNT_UP_TO_12500_EUROS,114 self::INSURANCE_AMOUNT_UP_TO_15000_EUROS,115 self::INSURANCE_AMOUNT_UP_TO_17500_EUROS,116 self::INSURANCE_AMOUNT_UP_TO_20000_EUROS,117 self::INSURANCE_AMOUNT_UP_TO_22500_EUROS,118 self::INSURANCE_AMOUNT_UP_TO_25000_EUROS,119 120 ); 120 121 } … … 138 139 * 139 140 * @param DomDocument $document 140 * @param string $prefix141 141 * 142 142 * @return DomElement … … 167 167 public static function createFromXML(SimpleXMLElement $xml) 168 168 { 169 $insuranceDetail = $xml->children('common', true); 170 169 $insuranceDetail = $xml->children(Bpost::NS_V3_COMMON); 171 170 $type = $insuranceDetail->getName(); 172 $value = $insuranceDetail->attributes()->value !== null ? (int) $insuranceDetail->attributes()->value: null;171 $value = intval($insuranceDetail->attributes()->value) ?: null; 173 172 174 173 if ($type === static::INSURANCE_TYPE_ADDITIONAL_INSURANCE && $value === 1) { -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Messaging.php
r3119293 r3194989 3 3 namespace Bpost\BpostApiClient\Bpost\Order\Box\Option; 4 4 5 use Bpost\BpostApiClient\Bpost; 5 6 use Bpost\BpostApiClient\Common\XmlHelper; 6 7 use Bpost\BpostApiClient\Exception\BpostLogicException\BpostInvalidLengthException; … … 237 238 $messaging = new Messaging($xml->getName(), (string) $xml->attributes()->language); 238 239 239 $children = $xml->children( 'http://schema.post.be/shm/deepintegration/v3/common');240 $children = $xml->children(Bpost::NS_V3_COMMON); 240 241 if ((string) $children->emailAddress !== '') { 241 242 $messaging->setEmailAddress((string) $children->emailAddress); -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Option.php
r3119293 r3194989 5 5 use DOMDocument; 6 6 use DOMElement; 7 use SimpleXMLElement; 7 8 8 9 /** … … 25 26 */ 26 27 abstract public function toXML(DOMDocument $document, $prefix = null); 28 29 public static function createFromXML(SimpleXMLElement $xml) 30 { 31 return new static(); 32 } 27 33 } -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/Bpost/Order/Box/Option/Signed.php
r3119293 r3194989 32 32 return $document->createElement(XmlHelper::getPrefixedTagName('signed', $prefix)); 33 33 } 34 35 /**36 * @param SimpleXMLElement $xml37 *38 * @return static39 */40 public static function createFromXML(SimpleXMLElement $xml)41 {42 return new static();43 }44 34 } -
bpost-shipping/trunk/vendor/antidot-be/bpost-api-library/src/FormHandler.php
r3119293 r3194989 130 130 break; 131 131 132 // maximum 2 chars132 // maximum 2 chars 133 133 case 'customerCountry': 134 134 if (mb_strlen($value) > 2) { … … 138 138 break; 139 139 140 // maximum 8 chars 140 // maximum 8 chars 141 case 'customerPostalCode': 141 142 case 'customerStreetNumber': 142 143 case 'customerBox': … … 147 148 break; 148 149 149 // maximum 20 chars150 // maximum 20 chars 150 151 case 'customerPhoneNumber': 151 152 if (mb_strlen($value) > 20) { … … 155 156 break; 156 157 157 // maximum 32 chars 158 case 'customerPostalCode': 159 if (mb_strlen($value) > 32) { 160 throw new BpostInvalidLengthException($key, mb_strlen($value), 32); 161 } 162 $this->parameters[$key] = (string) $value; 163 break; 164 165 // maximum 40 chars 166 case 'customerFirstName': 167 case 'customerLastName': 158 // maximum 40 chars 168 159 case 'customerCompany': 169 160 case 'customerStreet': … … 175 166 break; 176 167 177 // maximum 50 chars 168 // sum = maximum 40 chars 169 case 'customerFirstName': 170 case 'customerLastName': 171 $names = array( 172 'customerFirstName' => $this->parameters['customerFirstName'] ?: '', 173 'customerLastName' => $this->parameters['customerLastName'] ?: '', 174 ); 175 $names[$key] = $value; 176 $sum = array_sum(array_map(function ($item) { 177 return mb_strlen($item); 178 }, $names)); 179 if ($sum > 40) { 180 throw new BpostInvalidLengthException($key, $sum, 40); 181 } 182 $this->parameters[$key] = (string) $value; 183 break; 184 185 // maximum 50 chars 178 186 case 'orderReference': 179 187 case 'costCenter': … … 185 193 break; 186 194 187 // integers195 // integers 188 196 case 'orderTotalPrice': 189 197 case 'orderWeight': … … 191 199 break; 192 200 193 // array201 // array 194 202 case 'orderLine': 195 203 if (!isset($this->parameters[$key])) { … … 199 207 break; 200 208 201 // unknown209 // unknown 202 210 case 'deliveryMethodOverrides': 203 211 case 'extra': -
bpost-shipping/trunk/vendor/composer/installed.json
r3119293 r3194989 8 8 "type": "git", 9 9 "url": "https://github.com/Antidot-be/bpost-api-library.git", 10 "reference": " f7a3a903e7acb7e7e159016ed37bef05c4aa408d"10 "reference": "eec236b2b2f5373e91d6ce41ea93db57430f78f2" 11 11 }, 12 12 "dist": { 13 13 "type": "zip", 14 "url": "https://api.github.com/repos/Antidot-be/bpost-api-library/zipball/ f7a3a903e7acb7e7e159016ed37bef05c4aa408d",15 "reference": " f7a3a903e7acb7e7e159016ed37bef05c4aa408d",14 "url": "https://api.github.com/repos/Antidot-be/bpost-api-library/zipball/eec236b2b2f5373e91d6ce41ea93db57430f78f2", 15 "reference": "eec236b2b2f5373e91d6ce41ea93db57430f78f2", 16 16 "shasum": "" 17 17 }, … … 28 28 "phpunit/phpunit": "^5" 29 29 }, 30 "time": "2024- 07-16T14:04:09+00:00",30 "time": "2024-10-15T14:27:22+00:00", 31 31 "default-branch": true, 32 32 "type": "library", -
bpost-shipping/trunk/vendor/composer/installed.php
r3119293 r3194989 19 19 0 => '9999999-dev', 20 20 ), 21 'reference' => ' f7a3a903e7acb7e7e159016ed37bef05c4aa408d',21 'reference' => 'eec236b2b2f5373e91d6ce41ea93db57430f78f2', 22 22 'dev_requirement' => false, 23 23 ),
Note: See TracChangeset
for help on using the changeset viewer.