Flexible Shipping for WooCommerce - Version 3.1.7

Version Description

  • 2019-02-12 =
  • Fixed warnings in cart or checkout when shipment default method is not valid for current package
Download this release

Release Info

Developer jablonowski
Plugin Icon 128x128 Flexible Shipping for WooCommerce
Version 3.1.7
Comparing to
See all releases

Code changes from version 3.1.6 to 3.1.7

Files changed (34) hide show
  1. classes/class-flexible-shipping-plugin.php +27 -3
  2. flexible-shipping.php +2 -2
  3. readme.txt +4 -1
  4. vendor/autoload.php +1 -1
  5. vendor/composer/autoload_classmap.php +2 -5
  6. vendor/composer/autoload_real.php +7 -7
  7. vendor/composer/autoload_static.php +6 -9
  8. vendor/composer/installed.json +15 -13
  9. vendor/moneyphp/money/CHANGELOG.md +19 -0
  10. vendor/moneyphp/money/Dockerfile +0 -18
  11. vendor/moneyphp/money/README.md +1 -1
  12. vendor/moneyphp/money/composer.json +2 -1
  13. vendor/moneyphp/money/resources/generate-money-factory.php +1 -1
  14. vendor/moneyphp/money/src/Calculator/BcMathCalculator.php +2 -2
  15. vendor/moneyphp/money/src/Currency.php +4 -0
  16. vendor/moneyphp/money/src/Money.php +16 -9
  17. vendor/moneyphp/money/src/MoneyFactory.php +178 -178
  18. vendor/moneyphp/money/src/Parser/AggregateMoneyParser.php +6 -0
  19. vendor/moneyphp/money/src/Parser/BitcoinMoneyParser.php +16 -1
  20. vendor/wpdesk/wp-saas-platform-client/changelog.txt +6 -0
  21. vendor/wpdesk/wp-saas-platform-client/composer.json +2 -1
  22. vendor/wpdesk/wp-saas-platform-client/src/ApiClient/ClientImplementation.php +1 -1
  23. vendor/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientCommodity.php +163 -0
  24. vendor/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientWeight.php +50 -0
  25. vendor/wpdesk/wp-saas-platform-client/src/Model/Shipment/ShipmentRequest.php +17 -0
  26. vendor/wpdesk/wp-saas-platform-client/src/Persistence/ElementNotExistsException.php +0 -12
  27. vendor/wpdesk/wp-saas-platform-client/src/Persistence/MemoryContainer.php +0 -37
  28. vendor/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainer.php +0 -19
  29. vendor/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainerFactory.php +1 -0
  30. vendor/wpdesk/wp-saas-platform-client/src/Persistence/Wordpress/WordpressOptionsContainer.php +0 -56
  31. vendor/wpdesk/wp-saas-platform-client/src/Persistence/Wordpress/WordpressTransientContainer.php +0 -59
  32. vendor/wpdesk/wp-saas-platform-client/src/Platform.php +2 -2
  33. vendor/wpdesk/wp-saas-platform-client/src/PlatformFactoryOptions.php +1 -1
  34. vendor/wpdesk/wp-saas-platform-client/src/PlatformFactoryWordpressOptions.php +1 -1
classes/class-flexible-shipping-plugin.php CHANGED
@@ -341,14 +341,18 @@ class Flexible_Shipping_Plugin
341
  *
342
  * @return string
343
  */
344
- function woocommerce_default_shipment_method( $default, array $available_methods, $chosen_method ) {
345
- if ( $chosen_method === null || $chosen_method === false ) {
346
  foreach ( $available_methods as $available_method ) {
347
  $method_meta = $available_method->get_meta_data();
348
  $default_meta_key = WPDesk_Flexible_Shipping::META_DEFAULT;
349
 
350
  if ( $method_meta && isset( $method_meta[ $default_meta_key ] ) && $method_meta[ $default_meta_key ] === 'yes' ) {
351
- return $available_method->get_id();
 
 
 
 
352
  }
353
  }
354
 
@@ -358,6 +362,26 @@ class Flexible_Shipping_Plugin
358
  return $chosen_method;
359
  }
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  /**
362
  * @param $hooq
363
  */
341
  *
342
  * @return string
343
  */
344
+ public function woocommerce_default_shipment_method( $default, array $available_methods, $chosen_method ) {
345
+ if ( $chosen_method === null || $chosen_method === false || !$this->check_if_shipment_available_for_current_cart( $chosen_method ) ) {
346
  foreach ( $available_methods as $available_method ) {
347
  $method_meta = $available_method->get_meta_data();
348
  $default_meta_key = WPDesk_Flexible_Shipping::META_DEFAULT;
349
 
350
  if ( $method_meta && isset( $method_meta[ $default_meta_key ] ) && $method_meta[ $default_meta_key ] === 'yes' ) {
351
+
352
+ $candidate_id = $available_method->get_id();
353
+ if ( $this->check_if_shipment_available_for_current_cart( $candidate_id ) ) {
354
+ return $candidate_id;
355
+ }
356
  }
357
  }
358
 
362
  return $chosen_method;
363
  }
364
 
365
+ /**
366
+ * Shipment can be possible but not for the current cart. Check if possible for cart.
367
+ *
368
+ * @param $shipment_method_id
369
+ *
370
+ * @return bool Possible or not
371
+ */
372
+ private function check_if_shipment_available_for_current_cart($shipment_method_id) {
373
+ $shipping_packages = WC()->shipping()->calculate_shipping( WC()->cart->get_shipping_packages() );
374
+ if ( is_array( $shipping_packages ) ) {
375
+ foreach ( $shipping_packages as $package ) {
376
+ if ( isset( $package['rates'][ $shipment_method_id ] ) && $package['rates'][ $shipment_method_id ] ) {
377
+ return true;
378
+ }
379
+ }
380
+ }
381
+
382
+ return false;
383
+ }
384
+
385
  /**
386
  * @param $hooq
387
  */
flexible-shipping.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Flexible Shipping
4
  Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
- Version: 3.1.6
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
@@ -44,7 +44,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) {
44
 
45
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
46
 
47
- $plugin_version = '3.1.6';
48
  $plugin_release_timestamp = '2019-02-06';
49
 
50
  $plugin_name = 'Flexible Shipping';
3
  Plugin Name: Flexible Shipping
4
  Plugin URI: https://wordpress.org/plugins/flexible-shipping/
5
  Description: Create additional shipment methods in WooCommerce and enable pricing based on cart weight or total.
6
+ Version: 3.1.7
7
  Author: WP Desk
8
  Author URI: https://www.wpdesk.net/
9
  Text Domain: flexible-shipping
44
 
45
  /* THESE TWO VARIABLES CAN BE CHANGED AUTOMATICALLY */
46
 
47
+ $plugin_version = '3.1.7';
48
  $plugin_release_timestamp = '2019-02-06';
49
 
50
  $plugin_name = 'Flexible Shipping';
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://flexibleshipping.com/table-rate/
4
  Tags: table rate, table rate shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes
5
  Requires at least: 4.5
6
  Tested up to: 5.0.3
7
- Stable tag: 3.1.6
8
  Requires PHP: 5.6
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -175,6 +175,9 @@ If you are upgrading from the old Flexible Shipping version (1.3.2, woo-flexible
175
 
176
  == Changelog ==
177
 
 
 
 
178
  = 3.1.6 - 2019-02-07 =
179
  * Added filter for deactivation data in tracker
180
 
4
  Tags: table rate, table rate shipping, woocommerce shipping, flexible shipping, woocommerce table rate shipping, cart based shipping, weight shipping, weight based shipping, totals based shipping, order based shipping, shipping zones, shipping classes
5
  Requires at least: 4.5
6
  Tested up to: 5.0.3
7
+ Stable tag: 3.1.7
8
  Requires PHP: 5.6
9
  License: GPLv3 or later
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
175
 
176
  == Changelog ==
177
 
178
+ = 3.1.7 - 2019-02-12 =
179
+ * Fixed warnings in cart or checkout when shipment default method is not valid for current package
180
+
181
  = 3.1.6 - 2019-02-07 =
182
  * Added filter for deactivation data in tracker
183
 
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitf41b80c822a8656cf5a1645fecc357f4::getLoader();
vendor/composer/autoload_classmap.php CHANGED
@@ -327,7 +327,9 @@ return array(
327
  'WPDesk\\SaasPlatformClient\\Model\\Reset' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Reset.php',
328
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Actor' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Actor.php',
329
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Address' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Address.php',
 
330
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ClientMoney' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientMoney.php',
 
331
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Package' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Package.php',
332
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Package\\Dimensions' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Package/Dimensions.php',
333
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ShipmentAdminContext' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ShipmentAdminContext.php',
@@ -343,12 +345,7 @@ return array(
343
  'WPDesk\\SaasPlatformClient\\Model\\Status' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Status.php',
344
  'WPDesk\\SaasPlatformClient\\Model\\Token' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Token.php',
345
  'WPDesk\\SaasPlatformClient\\Model\\User' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/User.php',
346
- 'WPDesk\\SaasPlatformClient\\Persistence\\ElementNotExistsException' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Persistence/ElementNotExistsException.php',
347
- 'WPDesk\\SaasPlatformClient\\Persistence\\MemoryContainer' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Persistence/MemoryContainer.php',
348
- 'WPDesk\\SaasPlatformClient\\Persistence\\PersistentContainer' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainer.php',
349
  'WPDesk\\SaasPlatformClient\\Persistence\\PersistentContainerFactory' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainerFactory.php',
350
- 'WPDesk\\SaasPlatformClient\\Persistence\\Wordpress\\WordpressOptionsContainer' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Persistence/Wordpress/WordpressOptionsContainer.php',
351
- 'WPDesk\\SaasPlatformClient\\Persistence\\Wordpress\\WordpressTransientContainer' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Persistence/Wordpress/WordpressTransientContainer.php',
352
  'WPDesk\\SaasPlatformClient\\Platform' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Platform.php',
353
  'WPDesk\\SaasPlatformClient\\PlatformAdminContext' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/PlatformAdminContext.php',
354
  'WPDesk\\SaasPlatformClient\\PlatformFactory' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/PlatformFactory.php',
327
  'WPDesk\\SaasPlatformClient\\Model\\Reset' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Reset.php',
328
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Actor' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Actor.php',
329
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Address' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Address.php',
330
+ 'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ClientCommodity' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientCommodity.php',
331
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ClientMoney' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientMoney.php',
332
+ 'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ClientWeight' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientWeight.php',
333
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Package' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Package.php',
334
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Package\\Dimensions' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Package/Dimensions.php',
335
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ShipmentAdminContext' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ShipmentAdminContext.php',
345
  'WPDesk\\SaasPlatformClient\\Model\\Status' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Status.php',
346
  'WPDesk\\SaasPlatformClient\\Model\\Token' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/Token.php',
347
  'WPDesk\\SaasPlatformClient\\Model\\User' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Model/User.php',
 
 
 
348
  'WPDesk\\SaasPlatformClient\\Persistence\\PersistentContainerFactory' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainerFactory.php',
 
 
349
  'WPDesk\\SaasPlatformClient\\Platform' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/Platform.php',
350
  'WPDesk\\SaasPlatformClient\\PlatformAdminContext' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/PlatformAdminContext.php',
351
  'WPDesk\\SaasPlatformClient\\PlatformFactory' => $vendorDir . '/wpdesk/wp-saas-platform-client/src/PlatformFactory.php',
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672
6
  {
7
  private static $loader;
8
 
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
- call_user_func(\Composer\Autoload\ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit87e9e7f70ae0673cfec948c8ccfad672
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
- $includeFiles = Composer\Autoload\ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
- composerRequire87e9e7f70ae0673cfec948c8ccfad672($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
- function composerRequire87e9e7f70ae0673cfec948c8ccfad672($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitf41b80c822a8656cf5a1645fecc357f4
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitf41b80c822a8656cf5a1645fecc357f4', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitf41b80c822a8656cf5a1645fecc357f4', 'loadClassLoader'));
25
 
26
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
  if ($useStaticLoader) {
28
  require_once __DIR__ . '/autoload_static.php';
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInitf41b80c822a8656cf5a1645fecc357f4::getInitializer($loader));
31
  } else {
32
  $map = require __DIR__ . '/autoload_namespaces.php';
33
  foreach ($map as $namespace => $path) {
48
  $loader->register(true);
49
 
50
  if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInitf41b80c822a8656cf5a1645fecc357f4::$files;
52
  } else {
53
  $includeFiles = require __DIR__ . '/autoload_files.php';
54
  }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
+ composerRequiref41b80c822a8656cf5a1645fecc357f4($fileIdentifier, $file);
57
  }
58
 
59
  return $loader;
60
  }
61
  }
62
 
63
+ function composerRequiref41b80c822a8656cf5a1645fecc357f4($fileIdentifier, $file)
64
  {
65
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
66
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672
8
  {
9
  public static $files = array (
10
  '46ae4ad8c3479aabff48f598a0e4b93f' => __DIR__ . '/..' . '/wpdesk/wp-mutex/src/WPDesk/functions.php',
@@ -416,7 +416,9 @@ class ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672
416
  'WPDesk\\SaasPlatformClient\\Model\\Reset' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Reset.php',
417
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Actor' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Actor.php',
418
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Address' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Address.php',
 
419
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ClientMoney' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientMoney.php',
 
420
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Package' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Package.php',
421
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Package\\Dimensions' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Package/Dimensions.php',
422
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ShipmentAdminContext' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ShipmentAdminContext.php',
@@ -432,12 +434,7 @@ class ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672
432
  'WPDesk\\SaasPlatformClient\\Model\\Status' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Status.php',
433
  'WPDesk\\SaasPlatformClient\\Model\\Token' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Token.php',
434
  'WPDesk\\SaasPlatformClient\\Model\\User' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/User.php',
435
- 'WPDesk\\SaasPlatformClient\\Persistence\\ElementNotExistsException' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Persistence/ElementNotExistsException.php',
436
- 'WPDesk\\SaasPlatformClient\\Persistence\\MemoryContainer' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Persistence/MemoryContainer.php',
437
- 'WPDesk\\SaasPlatformClient\\Persistence\\PersistentContainer' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainer.php',
438
  'WPDesk\\SaasPlatformClient\\Persistence\\PersistentContainerFactory' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainerFactory.php',
439
- 'WPDesk\\SaasPlatformClient\\Persistence\\Wordpress\\WordpressOptionsContainer' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Persistence/Wordpress/WordpressOptionsContainer.php',
440
- 'WPDesk\\SaasPlatformClient\\Persistence\\Wordpress\\WordpressTransientContainer' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Persistence/Wordpress/WordpressTransientContainer.php',
441
  'WPDesk\\SaasPlatformClient\\Platform' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Platform.php',
442
  'WPDesk\\SaasPlatformClient\\PlatformAdminContext' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/PlatformAdminContext.php',
443
  'WPDesk\\SaasPlatformClient\\PlatformFactory' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/PlatformFactory.php',
@@ -626,9 +623,9 @@ class ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672
626
  public static function getInitializer(ClassLoader $loader)
627
  {
628
  return \Closure::bind(function () use ($loader) {
629
- $loader->prefixLengthsPsr4 = ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::$prefixLengthsPsr4;
630
- $loader->prefixDirsPsr4 = ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::$prefixDirsPsr4;
631
- $loader->classMap = ComposerStaticInit87e9e7f70ae0673cfec948c8ccfad672::$classMap;
632
 
633
  }, null, ClassLoader::class);
634
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitf41b80c822a8656cf5a1645fecc357f4
8
  {
9
  public static $files = array (
10
  '46ae4ad8c3479aabff48f598a0e4b93f' => __DIR__ . '/..' . '/wpdesk/wp-mutex/src/WPDesk/functions.php',
416
  'WPDesk\\SaasPlatformClient\\Model\\Reset' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Reset.php',
417
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Actor' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Actor.php',
418
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Address' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Address.php',
419
+ 'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ClientCommodity' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientCommodity.php',
420
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ClientMoney' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientMoney.php',
421
+ 'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ClientWeight' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientWeight.php',
422
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Package' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Package.php',
423
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\Package\\Dimensions' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/Package/Dimensions.php',
424
  'WPDesk\\SaasPlatformClient\\Model\\Shipment\\ShipmentAdminContext' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Shipment/ShipmentAdminContext.php',
434
  'WPDesk\\SaasPlatformClient\\Model\\Status' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Status.php',
435
  'WPDesk\\SaasPlatformClient\\Model\\Token' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/Token.php',
436
  'WPDesk\\SaasPlatformClient\\Model\\User' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Model/User.php',
 
 
 
437
  'WPDesk\\SaasPlatformClient\\Persistence\\PersistentContainerFactory' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainerFactory.php',
 
 
438
  'WPDesk\\SaasPlatformClient\\Platform' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/Platform.php',
439
  'WPDesk\\SaasPlatformClient\\PlatformAdminContext' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/PlatformAdminContext.php',
440
  'WPDesk\\SaasPlatformClient\\PlatformFactory' => __DIR__ . '/..' . '/wpdesk/wp-saas-platform-client/src/PlatformFactory.php',
623
  public static function getInitializer(ClassLoader $loader)
624
  {
625
  return \Closure::bind(function () use ($loader) {
626
+ $loader->prefixLengthsPsr4 = ComposerStaticInitf41b80c822a8656cf5a1645fecc357f4::$prefixLengthsPsr4;
627
+ $loader->prefixDirsPsr4 = ComposerStaticInitf41b80c822a8656cf5a1645fecc357f4::$prefixDirsPsr4;
628
+ $loader->classMap = ComposerStaticInitf41b80c822a8656cf5a1645fecc357f4::$classMap;
629
 
630
  }, null, ClassLoader::class);
631
  }
vendor/composer/installed.json CHANGED
@@ -123,20 +123,21 @@
123
  },
124
  {
125
  "name": "moneyphp/money",
126
- "version": "v3.2.0",
127
- "version_normalized": "3.2.0.0",
128
  "source": {
129
  "type": "git",
130
  "url": "https://github.com/moneyphp/money.git",
131
- "reference": "53ce6e4b9a2aac6e5194a0a633b7a556a6b04b07"
132
  },
133
  "dist": {
134
  "type": "zip",
135
- "url": "https://api.github.com/repos/moneyphp/money/zipball/53ce6e4b9a2aac6e5194a0a633b7a556a6b04b07",
136
- "reference": "53ce6e4b9a2aac6e5194a0a633b7a556a6b04b07",
137
  "shasum": ""
138
  },
139
  "require": {
 
140
  "php": ">=5.6"
141
  },
142
  "require-dev": {
@@ -164,7 +165,7 @@
164
  "florianv/swap": "Exchange rates library for PHP",
165
  "psr/cache-implementation": "Used for Currency caching"
166
  },
167
- "time": "2018-12-05T12:17:01+00:00",
168
  "type": "library",
169
  "extra": {
170
  "branch-alias": {
@@ -743,17 +744,17 @@
743
  },
744
  {
745
  "name": "wpdesk/wp-saas-platform-client",
746
- "version": "1.7.1",
747
- "version_normalized": "1.7.1.0",
748
  "source": {
749
  "type": "git",
750
  "url": "https://gitlab.com/wpdesk/wp-saas-platform-client.git",
751
- "reference": "a8c84aaf8e6d67ca9592cbc51bc9263136063a9a"
752
  },
753
  "dist": {
754
  "type": "zip",
755
- "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-saas-platform-client/repository/archive.zip?sha=a8c84aaf8e6d67ca9592cbc51bc9263136063a9a",
756
- "reference": "a8c84aaf8e6d67ca9592cbc51bc9263136063a9a",
757
  "shasum": ""
758
  },
759
  "require": {
@@ -761,7 +762,8 @@
761
  "ext-json": "*",
762
  "php": ">=5.5",
763
  "psr/log": "^1.0.1",
764
- "psr/simple-cache": "^1.0"
 
765
  },
766
  "require-dev": {
767
  "10up/wp_mock": "*",
@@ -770,7 +772,7 @@
770
  "squizlabs/php_codesniffer": "^3.0.2",
771
  "wp-coding-standards/wpcs": "^0.14.1"
772
  },
773
- "time": "2019-01-23T08:28:21+00:00",
774
  "type": "library",
775
  "installation-source": "dist",
776
  "autoload": {
123
  },
124
  {
125
  "name": "moneyphp/money",
126
+ "version": "v3.2.1",
127
+ "version_normalized": "3.2.1.0",
128
  "source": {
129
  "type": "git",
130
  "url": "https://github.com/moneyphp/money.git",
131
+ "reference": "f6085de6c565e98d2f9a7311a605987b54e06d5e"
132
  },
133
  "dist": {
134
  "type": "zip",
135
+ "url": "https://api.github.com/repos/moneyphp/money/zipball/f6085de6c565e98d2f9a7311a605987b54e06d5e",
136
+ "reference": "f6085de6c565e98d2f9a7311a605987b54e06d5e",
137
  "shasum": ""
138
  },
139
  "require": {
140
+ "ext-json": "*",
141
  "php": ">=5.6"
142
  },
143
  "require-dev": {
165
  "florianv/swap": "Exchange rates library for PHP",
166
  "psr/cache-implementation": "Used for Currency caching"
167
  },
168
+ "time": "2019-02-07T18:01:35+00:00",
169
  "type": "library",
170
  "extra": {
171
  "branch-alias": {
744
  },
745
  {
746
  "name": "wpdesk/wp-saas-platform-client",
747
+ "version": "1.8.3",
748
+ "version_normalized": "1.8.3.0",
749
  "source": {
750
  "type": "git",
751
  "url": "https://gitlab.com/wpdesk/wp-saas-platform-client.git",
752
+ "reference": "57600a1f54f148a4b85c3484e8cd399175012d6a"
753
  },
754
  "dist": {
755
  "type": "zip",
756
+ "url": "https://gitlab.com/api/v4/projects/wpdesk%2Fwp-saas-platform-client/repository/archive.zip?sha=57600a1f54f148a4b85c3484e8cd399175012d6a",
757
+ "reference": "57600a1f54f148a4b85c3484e8cd399175012d6a",
758
  "shasum": ""
759
  },
760
  "require": {
762
  "ext-json": "*",
763
  "php": ">=5.5",
764
  "psr/log": "^1.0.1",
765
+ "psr/simple-cache": "^1.0",
766
+ "wpdesk/wp-persistence": "^1.0"
767
  },
768
  "require-dev": {
769
  "10up/wp_mock": "*",
772
  "squizlabs/php_codesniffer": "^3.0.2",
773
  "wp-coding-standards/wpcs": "^0.14.1"
774
  },
775
+ "time": "2019-02-12T08:41:18+00:00",
776
  "type": "library",
777
  "installation-source": "dist",
778
  "autoload": {
vendor/moneyphp/money/CHANGELOG.md CHANGED
@@ -10,6 +10,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
10
  ## [Unreleased]
11
 
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ## [3.2.0] - 2018-12-05
14
 
15
  ### Added
10
  ## [Unreleased]
11
 
12
 
13
+ ## [3.2.1] - 2019-02-07
14
+
15
+ ### Changed
16
+
17
+ - `Money::allocate` now maintains keys of ratios array
18
+ - All parsers now emit a deprecation warning when passing currency as string
19
+
20
+ ### Fixed
21
+
22
+ - Docs fix : plus sign in numeric strings is allowed
23
+ - Added ext-json as required extension
24
+ - Throw exception in case of empty currency
25
+ - BCMath calculator now uses scale parameters for addition and subtracting
26
+ - Fixed allocation remainder bug
27
+ - Added PHP 7.3 in test suite
28
+ - Fixed dockerignore to ignore Dockerfile
29
+ - Fixed Bitcoin parsing bug when using trailing zeros
30
+
31
+
32
  ## [3.2.0] - 2018-12-05
33
 
34
  ### Added
vendor/moneyphp/money/Dockerfile DELETED
@@ -1,18 +0,0 @@
1
- FROM php:7.2-cli
2
-
3
- RUN set -xe \
4
- && apt-get update \
5
- && apt-get install -qqy libicu-dev locales libgmp-dev \
6
- && docker-php-ext-install -j$(nproc) intl bcmath gmp
7
-
8
- RUN set -xe \
9
- && echo en_US ISO-8859-1 >> /etc/locale.gen \
10
- && echo en_US.UTF-8 UTF-8 >> /etc/locale.gen \
11
- && echo en_CA ISO-8859-1 >> /etc/locale.gen \
12
- && echo en_CA.UTF-8 UTF-8 >> /etc/locale.gen \
13
- && echo es_ES ISO-8859-1 >> /etc/locale.gen \
14
- && echo es_ES.UTF-8 UTF-8 >> /etc/locale.gen \
15
- && echo ru_RU ISO-8859-5 >> /etc/locale.gen \
16
- && echo ru_RU.UTF-8 UTF-8 >> /etc/locale.gen \
17
- && locale-gen \
18
- && update-locale
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/moneyphp/money/README.md CHANGED
@@ -1,7 +1,7 @@
1
  # Money
2
 
3
  [![Latest Version](https://img.shields.io/github/release/moneyphp/money.svg?style=flat-square)](https://github.com/moneyphp/money/releases)
4
- [![Build Status](https://img.shields.io/travis/moneyphp/money.svg?style=flat-square)](https://travis-ci.org/moneyphp/money)
5
  [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/moneyphp/money.svg?style=flat-square)](https://scrutinizer-ci.com/g/moneyphp/money)
6
  [![Quality Score](https://img.shields.io/scrutinizer/g/moneyphp/money.svg?style=flat-square)](https://scrutinizer-ci.com/g/moneyphp/money)
7
  [![Total Downloads](https://img.shields.io/packagist/dt/moneyphp/money.svg?style=flat-square)](https://packagist.org/packages/moneyphp/money)
1
  # Money
2
 
3
  [![Latest Version](https://img.shields.io/github/release/moneyphp/money.svg?style=flat-square)](https://github.com/moneyphp/money/releases)
4
+ [![Build Status](https://img.shields.io/travis/moneyphp/money/master.svg?style=flat-square)](https://travis-ci.org/moneyphp/money)
5
  [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/moneyphp/money.svg?style=flat-square)](https://scrutinizer-ci.com/g/moneyphp/money)
6
  [![Quality Score](https://img.shields.io/scrutinizer/g/moneyphp/money.svg?style=flat-square)](https://scrutinizer-ci.com/g/moneyphp/money)
7
  [![Total Downloads](https://img.shields.io/packagist/dt/moneyphp/money.svg?style=flat-square)](https://packagist.org/packages/moneyphp/money)
vendor/moneyphp/money/composer.json CHANGED
@@ -20,7 +20,8 @@
20
  }
21
  ],
22
  "require": {
23
- "php": ">=5.6"
 
24
  },
25
  "require-dev": {
26
  "phpunit/phpunit": "^5.7 || ^6.4 || ^7.0",
20
  }
21
  ],
22
  "require": {
23
+ "php": ">=5.6",
24
+ "ext-json": "*"
25
  },
26
  "require-dev": {
27
  "phpunit/phpunit": "^5.7 || ^6.4 || ^7.0",
vendor/moneyphp/money/resources/generate-money-factory.php CHANGED
@@ -53,7 +53,7 @@ usort($currencies, function (\Money\Currency $a, \Money\Currency $b) {
53
 
54
  /** @var \Money\Currency[] $currencies */
55
  foreach ($currencies as $currency) {
56
- $methodBuffer .= sprintf(" * @method static Money %s(string \$amount)\n", $currency->getCode());
57
  }
58
 
59
  $buffer = str_replace('PHPDOC', rtrim($methodBuffer), $buffer);
53
 
54
  /** @var \Money\Currency[] $currencies */
55
  foreach ($currencies as $currency) {
56
+ $methodBuffer .= sprintf(" * @method static Money %s(string|int \$amount)\n", $currency->getCode());
57
  }
58
 
59
  $buffer = str_replace('PHPDOC', rtrim($methodBuffer), $buffer);
vendor/moneyphp/money/src/Calculator/BcMathCalculator.php CHANGED
@@ -45,7 +45,7 @@ final class BcMathCalculator implements Calculator
45
  */
46
  public function add($amount, $addend)
47
  {
48
- return bcadd($amount, $addend, 0);
49
  }
50
 
51
  /**
@@ -58,7 +58,7 @@ final class BcMathCalculator implements Calculator
58
  */
59
  public function subtract($amount, $subtrahend)
60
  {
61
- return bcsub($amount, $subtrahend, 0);
62
  }
63
 
64
  /**
45
  */
46
  public function add($amount, $addend)
47
  {
48
+ return (string) Number::fromString(bcadd($amount, $addend, $this->scale));
49
  }
50
 
51
  /**
58
  */
59
  public function subtract($amount, $subtrahend)
60
  {
61
+ return (string) Number::fromString(bcsub($amount, $subtrahend, $this->scale));
62
  }
63
 
64
  /**
vendor/moneyphp/money/src/Currency.php CHANGED
@@ -27,6 +27,10 @@ final class Currency implements \JsonSerializable
27
  throw new \InvalidArgumentException('Currency code should be string');
28
  }
29
 
 
 
 
 
30
  $this->code = $code;
31
  }
32
 
27
  throw new \InvalidArgumentException('Currency code should be string');
28
  }
29
 
30
+ if ($code === '') {
31
+ throw new \InvalidArgumentException('Currency code should not be empty string');
32
+ }
33
+
34
  $this->code = $code;
35
  }
36
 
vendor/moneyphp/money/src/Money.php CHANGED
@@ -377,23 +377,30 @@ final class Money implements \JsonSerializable
377
  throw new \InvalidArgumentException('Cannot allocate to none, sum of ratios must be greater than zero');
378
  }
379
 
380
- foreach ($ratios as $ratio) {
381
  if ($ratio < 0) {
382
  throw new \InvalidArgumentException('Cannot allocate to none, ratio must be zero or positive');
383
  }
384
-
385
  $share = $this->getCalculator()->share($this->amount, $ratio, $total);
386
- $results[] = $this->newInstance($share);
387
  $remainder = $this->getCalculator()->subtract($remainder, $share);
388
  }
389
 
390
- for ($i = 0; $this->getCalculator()->compare($remainder, 0) > 0; ++$i) {
391
- if (!$ratios[$i]) {
392
- continue;
393
- }
 
 
 
 
 
394
 
395
- $results[$i]->amount = (string) $this->getCalculator()->add($results[$i]->amount, 1);
396
- $remainder = $this->getCalculator()->subtract($remainder, 1);
 
 
 
397
  }
398
 
399
  return $results;
377
  throw new \InvalidArgumentException('Cannot allocate to none, sum of ratios must be greater than zero');
378
  }
379
 
380
+ foreach ($ratios as $key => $ratio) {
381
  if ($ratio < 0) {
382
  throw new \InvalidArgumentException('Cannot allocate to none, ratio must be zero or positive');
383
  }
 
384
  $share = $this->getCalculator()->share($this->amount, $ratio, $total);
385
+ $results[$key] = $this->newInstance($share);
386
  $remainder = $this->getCalculator()->subtract($remainder, $share);
387
  }
388
 
389
+ if ($this->getCalculator()->compare($remainder, '0') === 0) {
390
+ return $results;
391
+ }
392
+
393
+ $fractions = array_map(function ($ratio) use ($total) {
394
+ $share = ($ratio / $total) * $this->amount;
395
+
396
+ return $share - floor($share);
397
+ }, $ratios);
398
 
399
+ while ($this->getCalculator()->compare($remainder, '0') > 0) {
400
+ $index = !empty($fractions) ? array_keys($fractions, max($fractions))[0] : 0;
401
+ $results[$index]->amount = $this->getCalculator()->add($results[$index]->amount, '1');
402
+ $remainder = $this->getCalculator()->subtract($remainder, '1');
403
+ unset($fractions[$index]);
404
  }
405
 
406
  return $results;
vendor/moneyphp/money/src/MoneyFactory.php CHANGED
@@ -5,184 +5,184 @@ namespace Money;
5
  /**
6
  * This is a generated file. Do not edit it manually!
7
  *
8
- * @method static Money AED(string $amount)
9
- * @method static Money ALL(string $amount)
10
- * @method static Money AMD(string $amount)
11
- * @method static Money ANG(string $amount)
12
- * @method static Money AOA(string $amount)
13
- * @method static Money ARS(string $amount)
14
- * @method static Money AUD(string $amount)
15
- * @method static Money AWG(string $amount)
16
- * @method static Money AZN(string $amount)
17
- * @method static Money BAM(string $amount)
18
- * @method static Money BBD(string $amount)
19
- * @method static Money BDT(string $amount)
20
- * @method static Money BGN(string $amount)
21
- * @method static Money BHD(string $amount)
22
- * @method static Money BIF(string $amount)
23
- * @method static Money BMD(string $amount)
24
- * @method static Money BND(string $amount)
25
- * @method static Money BOB(string $amount)
26
- * @method static Money BOV(string $amount)
27
- * @method static Money BRL(string $amount)
28
- * @method static Money BSD(string $amount)
29
- * @method static Money BTN(string $amount)
30
- * @method static Money BWP(string $amount)
31
- * @method static Money BYN(string $amount)
32
- * @method static Money BZD(string $amount)
33
- * @method static Money CAD(string $amount)
34
- * @method static Money CDF(string $amount)
35
- * @method static Money CHE(string $amount)
36
- * @method static Money CHF(string $amount)
37
- * @method static Money CHW(string $amount)
38
- * @method static Money CLF(string $amount)
39
- * @method static Money CLP(string $amount)
40
- * @method static Money CNY(string $amount)
41
- * @method static Money COP(string $amount)
42
- * @method static Money COU(string $amount)
43
- * @method static Money CRC(string $amount)
44
- * @method static Money CUC(string $amount)
45
- * @method static Money CUP(string $amount)
46
- * @method static Money CVE(string $amount)
47
- * @method static Money CZK(string $amount)
48
- * @method static Money DJF(string $amount)
49
- * @method static Money DKK(string $amount)
50
- * @method static Money DOP(string $amount)
51
- * @method static Money DZD(string $amount)
52
- * @method static Money EGP(string $amount)
53
- * @method static Money ERN(string $amount)
54
- * @method static Money ETB(string $amount)
55
- * @method static Money EUR(string $amount)
56
- * @method static Money FJD(string $amount)
57
- * @method static Money FKP(string $amount)
58
- * @method static Money GBP(string $amount)
59
- * @method static Money GEL(string $amount)
60
- * @method static Money GHS(string $amount)
61
- * @method static Money GIP(string $amount)
62
- * @method static Money GMD(string $amount)
63
- * @method static Money GNF(string $amount)
64
- * @method static Money GTQ(string $amount)
65
- * @method static Money GYD(string $amount)
66
- * @method static Money HKD(string $amount)
67
- * @method static Money HNL(string $amount)
68
- * @method static Money HRK(string $amount)
69
- * @method static Money HTG(string $amount)
70
- * @method static Money HUF(string $amount)
71
- * @method static Money IDR(string $amount)
72
- * @method static Money ILS(string $amount)
73
- * @method static Money INR(string $amount)
74
- * @method static Money IQD(string $amount)
75
- * @method static Money IRR(string $amount)
76
- * @method static Money ISK(string $amount)
77
- * @method static Money JMD(string $amount)
78
- * @method static Money JOD(string $amount)
79
- * @method static Money JPY(string $amount)
80
- * @method static Money KES(string $amount)
81
- * @method static Money KGS(string $amount)
82
- * @method static Money KHR(string $amount)
83
- * @method static Money KMF(string $amount)
84
- * @method static Money KPW(string $amount)
85
- * @method static Money KRW(string $amount)
86
- * @method static Money KWD(string $amount)
87
- * @method static Money KYD(string $amount)
88
- * @method static Money KZT(string $amount)
89
- * @method static Money LAK(string $amount)
90
- * @method static Money LBP(string $amount)
91
- * @method static Money LKR(string $amount)
92
- * @method static Money LRD(string $amount)
93
- * @method static Money LSL(string $amount)
94
- * @method static Money LYD(string $amount)
95
- * @method static Money MAD(string $amount)
96
- * @method static Money MDL(string $amount)
97
- * @method static Money MGA(string $amount)
98
- * @method static Money MKD(string $amount)
99
- * @method static Money MMK(string $amount)
100
- * @method static Money MNT(string $amount)
101
- * @method static Money MOP(string $amount)
102
- * @method static Money MRU(string $amount)
103
- * @method static Money MUR(string $amount)
104
- * @method static Money MVR(string $amount)
105
- * @method static Money MWK(string $amount)
106
- * @method static Money MXN(string $amount)
107
- * @method static Money MXV(string $amount)
108
- * @method static Money MYR(string $amount)
109
- * @method static Money MZN(string $amount)
110
- * @method static Money NAD(string $amount)
111
- * @method static Money NGN(string $amount)
112
- * @method static Money NIO(string $amount)
113
- * @method static Money NOK(string $amount)
114
- * @method static Money NPR(string $amount)
115
- * @method static Money NZD(string $amount)
116
- * @method static Money OMR(string $amount)
117
- * @method static Money PAB(string $amount)
118
- * @method static Money PEN(string $amount)
119
- * @method static Money PGK(string $amount)
120
- * @method static Money PHP(string $amount)
121
- * @method static Money PKR(string $amount)
122
- * @method static Money PLN(string $amount)
123
- * @method static Money PYG(string $amount)
124
- * @method static Money QAR(string $amount)
125
- * @method static Money RON(string $amount)
126
- * @method static Money RSD(string $amount)
127
- * @method static Money RUB(string $amount)
128
- * @method static Money RWF(string $amount)
129
- * @method static Money SAR(string $amount)
130
- * @method static Money SBD(string $amount)
131
- * @method static Money SCR(string $amount)
132
- * @method static Money SDG(string $amount)
133
- * @method static Money SEK(string $amount)
134
- * @method static Money SGD(string $amount)
135
- * @method static Money SHP(string $amount)
136
- * @method static Money SLL(string $amount)
137
- * @method static Money SOS(string $amount)
138
- * @method static Money SRD(string $amount)
139
- * @method static Money SSP(string $amount)
140
- * @method static Money STN(string $amount)
141
- * @method static Money SVC(string $amount)
142
- * @method static Money SYP(string $amount)
143
- * @method static Money SZL(string $amount)
144
- * @method static Money THB(string $amount)
145
- * @method static Money TJS(string $amount)
146
- * @method static Money TMT(string $amount)
147
- * @method static Money TND(string $amount)
148
- * @method static Money TOP(string $amount)
149
- * @method static Money TRY(string $amount)
150
- * @method static Money TTD(string $amount)
151
- * @method static Money TWD(string $amount)
152
- * @method static Money TZS(string $amount)
153
- * @method static Money UAH(string $amount)
154
- * @method static Money UGX(string $amount)
155
- * @method static Money USD(string $amount)
156
- * @method static Money USN(string $amount)
157
- * @method static Money UYI(string $amount)
158
- * @method static Money UYU(string $amount)
159
- * @method static Money UZS(string $amount)
160
- * @method static Money VEF(string $amount)
161
- * @method static Money VND(string $amount)
162
- * @method static Money VUV(string $amount)
163
- * @method static Money WST(string $amount)
164
- * @method static Money XAF(string $amount)
165
- * @method static Money XAG(string $amount)
166
- * @method static Money XAU(string $amount)
167
- * @method static Money XBA(string $amount)
168
- * @method static Money XBB(string $amount)
169
- * @method static Money XBC(string $amount)
170
- * @method static Money XBD(string $amount)
171
- * @method static Money XBT(string $amount)
172
- * @method static Money XCD(string $amount)
173
- * @method static Money XDR(string $amount)
174
- * @method static Money XOF(string $amount)
175
- * @method static Money XPD(string $amount)
176
- * @method static Money XPF(string $amount)
177
- * @method static Money XPT(string $amount)
178
- * @method static Money XSU(string $amount)
179
- * @method static Money XTS(string $amount)
180
- * @method static Money XUA(string $amount)
181
- * @method static Money XXX(string $amount)
182
- * @method static Money YER(string $amount)
183
- * @method static Money ZAR(string $amount)
184
- * @method static Money ZMW(string $amount)
185
- * @method static Money ZWL(string $amount)
186
  */
187
  trait MoneyFactory
188
  {
5
  /**
6
  * This is a generated file. Do not edit it manually!
7
  *
8
+ * @method static Money AED(string|int $amount)
9
+ * @method static Money ALL(string|int $amount)
10
+ * @method static Money AMD(string|int $amount)
11
+ * @method static Money ANG(string|int $amount)
12
+ * @method static Money AOA(string|int $amount)
13
+ * @method static Money ARS(string|int $amount)
14
+ * @method static Money AUD(string|int $amount)
15
+ * @method static Money AWG(string|int $amount)
16
+ * @method static Money AZN(string|int $amount)
17
+ * @method static Money BAM(string|int $amount)
18
+ * @method static Money BBD(string|int $amount)
19
+ * @method static Money BDT(string|int $amount)
20
+ * @method static Money BGN(string|int $amount)
21
+ * @method static Money BHD(string|int $amount)
22
+ * @method static Money BIF(string|int $amount)
23
+ * @method static Money BMD(string|int $amount)
24
+ * @method static Money BND(string|int $amount)
25
+ * @method static Money BOB(string|int $amount)
26
+ * @method static Money BOV(string|int $amount)
27
+ * @method static Money BRL(string|int $amount)
28
+ * @method static Money BSD(string|int $amount)
29
+ * @method static Money BTN(string|int $amount)
30
+ * @method static Money BWP(string|int $amount)
31
+ * @method static Money BYN(string|int $amount)
32
+ * @method static Money BZD(string|int $amount)
33
+ * @method static Money CAD(string|int $amount)
34
+ * @method static Money CDF(string|int $amount)
35
+ * @method static Money CHE(string|int $amount)
36
+ * @method static Money CHF(string|int $amount)
37
+ * @method static Money CHW(string|int $amount)
38
+ * @method static Money CLF(string|int $amount)
39
+ * @method static Money CLP(string|int $amount)
40
+ * @method static Money CNY(string|int $amount)
41
+ * @method static Money COP(string|int $amount)
42
+ * @method static Money COU(string|int $amount)
43
+ * @method static Money CRC(string|int $amount)
44
+ * @method static Money CUC(string|int $amount)
45
+ * @method static Money CUP(string|int $amount)
46
+ * @method static Money CVE(string|int $amount)
47
+ * @method static Money CZK(string|int $amount)
48
+ * @method static Money DJF(string|int $amount)
49
+ * @method static Money DKK(string|int $amount)
50
+ * @method static Money DOP(string|int $amount)
51
+ * @method static Money DZD(string|int $amount)
52
+ * @method static Money EGP(string|int $amount)
53
+ * @method static Money ERN(string|int $amount)
54
+ * @method static Money ETB(string|int $amount)
55
+ * @method static Money EUR(string|int $amount)
56
+ * @method static Money FJD(string|int $amount)
57
+ * @method static Money FKP(string|int $amount)
58
+ * @method static Money GBP(string|int $amount)
59
+ * @method static Money GEL(string|int $amount)
60
+ * @method static Money GHS(string|int $amount)
61
+ * @method static Money GIP(string|int $amount)
62
+ * @method static Money GMD(string|int $amount)
63
+ * @method static Money GNF(string|int $amount)
64
+ * @method static Money GTQ(string|int $amount)
65
+ * @method static Money GYD(string|int $amount)
66
+ * @method static Money HKD(string|int $amount)
67
+ * @method static Money HNL(string|int $amount)
68
+ * @method static Money HRK(string|int $amount)
69
+ * @method static Money HTG(string|int $amount)
70
+ * @method static Money HUF(string|int $amount)
71
+ * @method static Money IDR(string|int $amount)
72
+ * @method static Money ILS(string|int $amount)
73
+ * @method static Money INR(string|int $amount)
74
+ * @method static Money IQD(string|int $amount)
75
+ * @method static Money IRR(string|int $amount)
76
+ * @method static Money ISK(string|int $amount)
77
+ * @method static Money JMD(string|int $amount)
78
+ * @method static Money JOD(string|int $amount)
79
+ * @method static Money JPY(string|int $amount)
80
+ * @method static Money KES(string|int $amount)
81
+ * @method static Money KGS(string|int $amount)
82
+ * @method static Money KHR(string|int $amount)
83
+ * @method static Money KMF(string|int $amount)
84
+ * @method static Money KPW(string|int $amount)
85
+ * @method static Money KRW(string|int $amount)
86
+ * @method static Money KWD(string|int $amount)
87
+ * @method static Money KYD(string|int $amount)
88
+ * @method static Money KZT(string|int $amount)
89
+ * @method static Money LAK(string|int $amount)
90
+ * @method static Money LBP(string|int $amount)
91
+ * @method static Money LKR(string|int $amount)
92
+ * @method static Money LRD(string|int $amount)
93
+ * @method static Money LSL(string|int $amount)
94
+ * @method static Money LYD(string|int $amount)
95
+ * @method static Money MAD(string|int $amount)
96
+ * @method static Money MDL(string|int $amount)
97
+ * @method static Money MGA(string|int $amount)
98
+ * @method static Money MKD(string|int $amount)
99
+ * @method static Money MMK(string|int $amount)
100
+ * @method static Money MNT(string|int $amount)
101
+ * @method static Money MOP(string|int $amount)
102
+ * @method static Money MRU(string|int $amount)
103
+ * @method static Money MUR(string|int $amount)
104
+ * @method static Money MVR(string|int $amount)
105
+ * @method static Money MWK(string|int $amount)
106
+ * @method static Money MXN(string|int $amount)
107
+ * @method static Money MXV(string|int $amount)
108
+ * @method static Money MYR(string|int $amount)
109
+ * @method static Money MZN(string|int $amount)
110
+ * @method static Money NAD(string|int $amount)
111
+ * @method static Money NGN(string|int $amount)
112
+ * @method static Money NIO(string|int $amount)
113
+ * @method static Money NOK(string|int $amount)
114
+ * @method static Money NPR(string|int $amount)
115
+ * @method static Money NZD(string|int $amount)
116
+ * @method static Money OMR(string|int $amount)
117
+ * @method static Money PAB(string|int $amount)
118
+ * @method static Money PEN(string|int $amount)
119
+ * @method static Money PGK(string|int $amount)
120
+ * @method static Money PHP(string|int $amount)
121
+ * @method static Money PKR(string|int $amount)
122
+ * @method static Money PLN(string|int $amount)
123
+ * @method static Money PYG(string|int $amount)
124
+ * @method static Money QAR(string|int $amount)
125
+ * @method static Money RON(string|int $amount)
126
+ * @method static Money RSD(string|int $amount)
127
+ * @method static Money RUB(string|int $amount)
128
+ * @method static Money RWF(string|int $amount)
129
+ * @method static Money SAR(string|int $amount)
130
+ * @method static Money SBD(string|int $amount)
131
+ * @method static Money SCR(string|int $amount)
132
+ * @method static Money SDG(string|int $amount)
133
+ * @method static Money SEK(string|int $amount)
134
+ * @method static Money SGD(string|int $amount)
135
+ * @method static Money SHP(string|int $amount)
136
+ * @method static Money SLL(string|int $amount)
137
+ * @method static Money SOS(string|int $amount)
138
+ * @method static Money SRD(string|int $amount)
139
+ * @method static Money SSP(string|int $amount)
140
+ * @method static Money STN(string|int $amount)
141
+ * @method static Money SVC(string|int $amount)
142
+ * @method static Money SYP(string|int $amount)
143
+ * @method static Money SZL(string|int $amount)
144
+ * @method static Money THB(string|int $amount)
145
+ * @method static Money TJS(string|int $amount)
146
+ * @method static Money TMT(string|int $amount)
147
+ * @method static Money TND(string|int $amount)
148
+ * @method static Money TOP(string|int $amount)
149
+ * @method static Money TRY(string|int $amount)
150
+ * @method static Money TTD(string|int $amount)
151
+ * @method static Money TWD(string|int $amount)
152
+ * @method static Money TZS(string|int $amount)
153
+ * @method static Money UAH(string|int $amount)
154
+ * @method static Money UGX(string|int $amount)
155
+ * @method static Money USD(string|int $amount)
156
+ * @method static Money USN(string|int $amount)
157
+ * @method static Money UYI(string|int $amount)
158
+ * @method static Money UYU(string|int $amount)
159
+ * @method static Money UZS(string|int $amount)
160
+ * @method static Money VEF(string|int $amount)
161
+ * @method static Money VND(string|int $amount)
162
+ * @method static Money VUV(string|int $amount)
163
+ * @method static Money WST(string|int $amount)
164
+ * @method static Money XAF(string|int $amount)
165
+ * @method static Money XAG(string|int $amount)
166
+ * @method static Money XAU(string|int $amount)
167
+ * @method static Money XBA(string|int $amount)
168
+ * @method static Money XBB(string|int $amount)
169
+ * @method static Money XBC(string|int $amount)
170
+ * @method static Money XBD(string|int $amount)
171
+ * @method static Money XBT(string|int $amount)
172
+ * @method static Money XCD(string|int $amount)
173
+ * @method static Money XDR(string|int $amount)
174
+ * @method static Money XOF(string|int $amount)
175
+ * @method static Money XPD(string|int $amount)
176
+ * @method static Money XPF(string|int $amount)
177
+ * @method static Money XPT(string|int $amount)
178
+ * @method static Money XSU(string|int $amount)
179
+ * @method static Money XTS(string|int $amount)
180
+ * @method static Money XUA(string|int $amount)
181
+ * @method static Money XXX(string|int $amount)
182
+ * @method static Money YER(string|int $amount)
183
+ * @method static Money ZAR(string|int $amount)
184
+ * @method static Money ZMW(string|int $amount)
185
+ * @method static Money ZWL(string|int $amount)
186
  */
187
  trait MoneyFactory
188
  {
vendor/moneyphp/money/src/Parser/AggregateMoneyParser.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace Money\Parser;
4
 
 
5
  use Money\Exception;
6
  use Money\MoneyParser;
7
 
@@ -40,6 +41,11 @@ final class AggregateMoneyParser implements MoneyParser
40
  */
41
  public function parse($money, $forceCurrency = null)
42
  {
 
 
 
 
 
43
  foreach ($this->parsers as $parser) {
44
  try {
45
  return $parser->parse($money, $forceCurrency);
2
 
3
  namespace Money\Parser;
4
 
5
+ use Money\Currency;
6
  use Money\Exception;
7
  use Money\MoneyParser;
8
 
41
  */
42
  public function parse($money, $forceCurrency = null)
43
  {
44
+ if ($forceCurrency !== null && !$forceCurrency instanceof Currency) {
45
+ @trigger_error('Passing a currency as string is deprecated since 3.1 and will be removed in 4.0. Please pass a '.Currency::class.' instance instead.', E_USER_DEPRECATED);
46
+ $forceCurrency = new Currency($forceCurrency);
47
+ }
48
+
49
  foreach ($this->parsers as $parser) {
50
  try {
51
  return $parser->parse($money, $forceCurrency);
vendor/moneyphp/money/src/Parser/BitcoinMoneyParser.php CHANGED
@@ -41,10 +41,25 @@ final class BitcoinMoneyParser implements MoneyParser
41
  throw new ParserException('Value cannot be parsed as Bitcoin');
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  $decimal = str_replace(BitcoinCurrencies::SYMBOL, '', $money);
45
  $decimalSeparator = strpos($decimal, '.');
46
 
47
  if (false !== $decimalSeparator) {
 
48
  $lengthDecimal = strlen($decimal);
49
  $decimal = str_replace('.', '', $decimal);
50
  $decimal .= str_pad('', ($lengthDecimal - $decimalSeparator - $this->fractionDigits - 1) * -1, '0');
@@ -62,6 +77,6 @@ final class BitcoinMoneyParser implements MoneyParser
62
  $decimal = '0';
63
  }
64
 
65
- return new Money($decimal, new Currency(BitcoinCurrencies::CODE));
66
  }
67
  }
41
  throw new ParserException('Value cannot be parsed as Bitcoin');
42
  }
43
 
44
+ if ($forceCurrency === null) {
45
+ $forceCurrency = new Currency(BitcoinCurrencies::CODE);
46
+ }
47
+
48
+ /*
49
+ * This conversion is only required whilst currency can be either a string or a
50
+ * Currency object.
51
+ */
52
+ $currency = $forceCurrency;
53
+ if (!$currency instanceof Currency) {
54
+ @trigger_error('Passing a currency as string is deprecated since 3.1 and will be removed in 4.0. Please pass a '.Currency::class.' instance instead.', E_USER_DEPRECATED);
55
+ $currency = new Currency($currency);
56
+ }
57
+
58
  $decimal = str_replace(BitcoinCurrencies::SYMBOL, '', $money);
59
  $decimalSeparator = strpos($decimal, '.');
60
 
61
  if (false !== $decimalSeparator) {
62
+ $decimal = rtrim($decimal, '0');
63
  $lengthDecimal = strlen($decimal);
64
  $decimal = str_replace('.', '', $decimal);
65
  $decimal .= str_pad('', ($lengthDecimal - $decimalSeparator - $this->fractionDigits - 1) * -1, '0');
77
  $decimal = '0';
78
  }
79
 
80
+ return new Money($decimal, $currency);
81
  }
82
  }
vendor/wpdesk/wp-saas-platform-client/changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  = 1.7.0 - 2019-01-16 =
2
  * Changed public methods -> protected in ShipmentResponse
3
  * Changed shipment cost to be nullable
1
+ = 1.8.0 - 2019-02-11 =
2
+ * Customs values
3
+
4
+ = 1.7.1 - 2019-02-11 =
5
+ * Persistence container moved to library
6
+
7
  = 1.7.0 - 2019-01-16 =
8
  * Changed public methods -> protected in ShipmentResponse
9
  * Changed shipment cost to be nullable
vendor/wpdesk/wp-saas-platform-client/composer.json CHANGED
@@ -11,7 +11,8 @@
11
  "ext-curl": "*",
12
  "ext-json": "*",
13
  "psr/log": "^1.0.1",
14
- "psr/simple-cache": "^1.0"
 
15
  },
16
  "require-dev": {
17
  "phpunit/phpunit": "<7",
11
  "ext-curl": "*",
12
  "ext-json": "*",
13
  "psr/log": "^1.0.1",
14
+ "psr/simple-cache": "^1.0",
15
+ "wpdesk/wp-persistence": "^1.0"
16
  },
17
  "require-dev": {
18
  "phpunit/phpunit": "<7",
vendor/wpdesk/wp-saas-platform-client/src/ApiClient/ClientImplementation.php CHANGED
@@ -15,7 +15,7 @@ use WPDesk\SaasPlatformClient\HttpClient\HttpClientRequestException;
15
 
16
  class ClientImplementation implements Client, LoggerAwareInterface
17
  {
18
- const CLIENT_VERSION = '1.6.5';
19
 
20
  const DEFAULT_TIMEOUT = 10;
21
 
15
 
16
  class ClientImplementation implements Client, LoggerAwareInterface
17
  {
18
+ const CLIENT_VERSION = '1.8';
19
 
20
  const DEFAULT_TIMEOUT = 10;
21
 
vendor/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientCommodity.php ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace WPDesk\SaasPlatformClient\Model\Shipment;
5
+
6
+ use WPDesk\SaasPlatformClient\Model\AbstractModel;
7
+
8
+ class ClientCommodity extends AbstractModel
9
+ {
10
+
11
+ /**
12
+ * Name of the commodity
13
+ *
14
+ * @Constraints\NotBlank
15
+ *
16
+ * @var string
17
+ */
18
+ protected $name;
19
+
20
+ /**
21
+ * Unit price
22
+ *
23
+ * @Constraints\NotBlank
24
+ *
25
+ * @var ClientMoney
26
+ */
27
+ protected $unitPrice;
28
+
29
+ /**
30
+ * Unit weight
31
+ *
32
+ * @Constraints\NotBlank
33
+ *
34
+ * @var ClientWeight
35
+ */
36
+ protected $unitWeight;
37
+
38
+ /**
39
+ * Quantity
40
+ *
41
+ * @Constraints\NotBlank
42
+ *
43
+ * @var int
44
+ */
45
+ protected $quantity;
46
+
47
+ /**
48
+ * Description ie 200 cm x 400 cm nylon carpet samples for demonstration
49
+ * or Two steel springs for woodworking machine
50
+ *
51
+ * @Constraints\NotBlank
52
+ *
53
+ * @var string
54
+ */
55
+ protected $description;
56
+
57
+ /**
58
+ * @var string
59
+ */
60
+ protected $countryOfManufacture;
61
+
62
+ /**
63
+ * Harmonized Tariff System (HTS) codes to meet the U.S. and foreign governments' customs requirements
64
+ *
65
+ * @var string
66
+ */
67
+ protected $htsCode;
68
+
69
+ /**
70
+ * ClientCommodity constructor.
71
+ *
72
+ * @param string $name
73
+ * @param ClientMoney $unitPrice
74
+ * @param ClientWeight $unitWeight
75
+ * @param int $quantity
76
+ * @param string $description
77
+ * @param string $countryOfManufacture
78
+ * @param string $htsCode
79
+ */
80
+ public function __construct(
81
+ $name,
82
+ ClientMoney $unitPrice,
83
+ ClientWeight $unitWeight,
84
+ $quantity,
85
+ $description,
86
+ $countryOfManufacture,
87
+ $htsCode
88
+ ) {
89
+ parent::__construct(null);
90
+
91
+ $this->name = $name;
92
+
93
+ $this->unitPrice = $unitPrice;
94
+
95
+ $this->unitWeight = $unitWeight;
96
+
97
+ $this->quantity = $quantity;
98
+
99
+ $this->description = $description;
100
+
101
+ $this->countryOfManufacture = $countryOfManufacture;
102
+
103
+ $this->htsCode = $htsCode;
104
+ }
105
+
106
+ /**
107
+ * @param string $name
108
+ */
109
+ public function setName($name)
110
+ {
111
+ $this->name = $name;
112
+ }
113
+
114
+ /**
115
+ * @param ClientMoney $unitPrice
116
+ */
117
+ public function setUnitPrice($unitPrice)
118
+ {
119
+ $this->unitPrice = $unitPrice;
120
+ }
121
+
122
+ /**
123
+ * @param ClientWeight $unitWeight
124
+ */
125
+ public function setUnitWeight($unitWeight)
126
+ {
127
+ $this->unitWeight = $unitWeight;
128
+ }
129
+
130
+ /**
131
+ * @param int $quantity
132
+ */
133
+ public function setQuantity($quantity)
134
+ {
135
+ $this->quantity = $quantity;
136
+ }
137
+
138
+
139
+ /**
140
+ * @param string $description
141
+ */
142
+ public function setDescription($description)
143
+ {
144
+ $this->description = $description;
145
+ }
146
+
147
+ /**
148
+ * @param string $countryOfManufacture
149
+ */
150
+ public function setCountryOfManufacture($countryOfManufacture)
151
+ {
152
+ $this->countryOfManufacture = $countryOfManufacture;
153
+ }
154
+
155
+ /**
156
+ * @param string $htsCode
157
+ */
158
+ public function setHtsCode($htsCode)
159
+ {
160
+ $this->htsCode = $htsCode;
161
+ }
162
+
163
+ }
vendor/wpdesk/wp-saas-platform-client/src/Model/Shipment/ClientWeight.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WPDesk\SaasPlatformClient\Model\Shipment;
4
+
5
+ use WPDesk\SaasPlatformClient\Model\AbstractModel;
6
+
7
+ /**
8
+ * Class ClientMoney
9
+ * Compatible with Fowler Money.
10
+ * @see http://moneyphp.org/en/stable
11
+ * @package WPDesk\SaasPlatformClient\Model\Shipment
12
+ */
13
+ final class ClientWeight extends AbstractModel
14
+ {
15
+ /**
16
+ **
17
+ * Weight KGS by default
18
+ *
19
+ * @Constraints\NotBlank
20
+ * @Constraints\GreaterThanOrEqual(0)
21
+ *
22
+ * @var int
23
+ */
24
+ protected $amount;
25
+
26
+ /**
27
+ * @Constraints\NotBlank
28
+ * @Constraints\Choice({"G"})
29
+ *
30
+ * @var string
31
+ */
32
+ protected $unit;
33
+
34
+ /**
35
+ * @param int $amount
36
+ */
37
+ public function setAmount($amount)
38
+ {
39
+ $this->amount = $amount;
40
+ }
41
+
42
+ /**
43
+ * @param string $unit
44
+ */
45
+ public function setUnit($unit)
46
+ {
47
+ $this->unit = $unit;
48
+ }
49
+
50
+ }
vendor/wpdesk/wp-saas-platform-client/src/Model/Shipment/ShipmentRequest.php CHANGED
@@ -28,6 +28,15 @@ class ShipmentRequest extends AbstractModel
28
  */
29
  protected $packages;
30
 
 
 
 
 
 
 
 
 
 
31
  /**
32
  * @Constraints\NotBlank
33
  *
@@ -71,6 +80,14 @@ class ShipmentRequest extends AbstractModel
71
  $this->packages = $packages;
72
  }
73
 
 
 
 
 
 
 
 
 
74
  /**
75
  * @param string $serviceType
76
  */
28
  */
29
  protected $packages;
30
 
31
+ /**
32
+ * Full information about the goods sent
33
+ *
34
+ * @Constraints\Valid
35
+ *
36
+ * @var ClientCommodity[]
37
+ */
38
+ public $commodities;
39
+
40
  /**
41
  * @Constraints\NotBlank
42
  *
80
  $this->packages = $packages;
81
  }
82
 
83
+ /**
84
+ * @param ClientCommodity[] $commodities
85
+ */
86
+ public function setCommodities($commodities)
87
+ {
88
+ $this->commodities = $commodities;
89
+ }
90
+
91
  /**
92
  * @param string $serviceType
93
  */
vendor/wpdesk/wp-saas-platform-client/src/Persistence/ElementNotExistsException.php DELETED
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- namespace WPDesk\SaasPlatformClient\Persistence;
4
-
5
- /**
6
- * Class ElementNotExistsException
7
- *
8
- * @package WPDesk\SaasPlatformClient\Persistence
9
- */
10
- class ElementNotExistsException extends \RuntimeException
11
- {
12
- }
 
 
 
 
 
 
 
 
 
 
 
 
vendor/wpdesk/wp-saas-platform-client/src/Persistence/MemoryContainer.php DELETED
@@ -1,37 +0,0 @@
1
- <?php
2
-
3
- namespace WPDesk\SaasPlatformClient\Persistence;
4
-
5
- /**
6
- * Class MemoryContainer
7
- * @package WPDesk\SaasPlatformClient\Persistence
8
- */
9
- class MemoryContainer implements PersistentContainer
10
- {
11
- private $array;
12
-
13
- /**
14
- * Persist value for key
15
- *
16
- * @param string $key
17
- * @param mixed $value
18
- */
19
- public function set($key, $value)
20
- {
21
- $this->array[$key] = $value;
22
- }
23
-
24
- /**
25
- * Get persistent value for key
26
- *
27
- * @param string $key
28
- * @return mixed
29
- */
30
- public function get($key)
31
- {
32
- if (!isset($this->array[$key])) {
33
- throw new ElementNotExistsException(sprintf('Element %s not exists!', $key));
34
- }
35
- return $this->array[$key];
36
- }
37
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainer.php DELETED
@@ -1,19 +0,0 @@
1
- <?php
2
-
3
- namespace WPDesk\SaasPlatformClient\Persistence;
4
-
5
- interface PersistentContainer
6
- {
7
- /**
8
- * @param string $key
9
- * @param mixed $value
10
- * @return void
11
- */
12
- public function set($key, $value);
13
-
14
- /**
15
- * @param string $key
16
- * @return mixed
17
- */
18
- public function get($key);
19
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/wpdesk/wp-saas-platform-client/src/Persistence/PersistentContainerFactory.php CHANGED
@@ -2,6 +2,7 @@
2
 
3
  namespace WPDesk\SaasPlatformClient\Persistence;
4
 
 
5
  use WPDesk\SaasPlatformClient\PlatformOption\PersistenceOptions;
6
 
7
  class PersistentContainerFactory
2
 
3
  namespace WPDesk\SaasPlatformClient\Persistence;
4
 
5
+ use WPDesk\Persistence\PersistentContainer;
6
  use WPDesk\SaasPlatformClient\PlatformOption\PersistenceOptions;
7
 
8
  class PersistentContainerFactory
vendor/wpdesk/wp-saas-platform-client/src/Persistence/Wordpress/WordpressOptionsContainer.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
-
3
- namespace WPDesk\SaasPlatformClient\Persistence\Wordpress;
4
-
5
- use WPDesk\SaasPlatformClient\Persistence\ElementNotExistsException;
6
- use WPDesk\SaasPlatformClient\Persistence\PersistentContainer;
7
-
8
- /**
9
- * Class WordpressOptionsContainer
10
- * @package WPDesk\SaasPlatformClient\Persistence\Wordpress
11
- */
12
- class WordpressOptionsContainer implements PersistentContainer
13
- {
14
- const OPTION_PREFIX = 'saas-platform-client';
15
-
16
- /**
17
- * Set value.
18
- *
19
- * @param string $key Key.
20
- * @param mixed $value Value.
21
- */
22
- public function set($key, $value)
23
- {
24
- update_option($this->prepareKeyName($key), $value);
25
- }
26
-
27
- /**
28
- * Prepare transient name for key.
29
- *
30
- * @param string $key Key.
31
- *
32
- * @return string
33
- */
34
- private function prepareKeyName($key)
35
- {
36
- return self::OPTION_PREFIX . '-' . $key;
37
- }
38
-
39
- /**
40
- * Get value.
41
- *
42
- * @param string $key Key.
43
- *
44
- * @return mixed
45
- * @throws ElementNotExistsException Element not found.
46
- */
47
- public function get($key)
48
- {
49
- $value = get_option($this->prepareKeyName($key));
50
- if (false === $value) {
51
- throw new ElementNotExistsException(sprintf('Element %s not exists!', $key));
52
- }
53
-
54
- return $value;
55
- }
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/wpdesk/wp-saas-platform-client/src/Persistence/Wordpress/WordpressTransientContainer.php DELETED
@@ -1,59 +0,0 @@
1
- <?php
2
-
3
- namespace WPDesk\SaasPlatformClient\Persistence\Wordpress;
4
-
5
- use WPDesk\SaasPlatformClient\Persistence\ElementNotExistsException;
6
- use WPDesk\SaasPlatformClient\Persistence\PersistentContainer;
7
-
8
- /**
9
- * Class WordpressTransientContainer
10
- * @package WPDesk\SaasPlatformClient\Persistence\Wordpress
11
- */
12
- class WordpressTransientContainer implements PersistentContainer
13
- {
14
-
15
- const TRANSIENT_NAME = 'wsp_';
16
-
17
- const TRANSIENT_TIMEOUT = 86400;
18
-
19
- /**
20
- * Set value.
21
- *
22
- * @param string $key Key.
23
- * @param mixed $value Value.
24
- */
25
- public function set($key, $value)
26
- {
27
- set_transient($this->prepareTransientName($key), $value, self::TRANSIENT_TIMEOUT);
28
- }
29
-
30
- /**
31
- * Prepare transient name for key.
32
- *
33
- * @param string $key Key.
34
- *
35
- * @return string
36
- */
37
- private function prepareTransientName($key)
38
- {
39
- return self::TRANSIENT_NAME . md5($key);
40
- }
41
-
42
- /**
43
- * Get value.
44
- *
45
- * @param string $key Key.
46
- *
47
- * @return mixed
48
- * @throws ElementNotExistsException Element not found.
49
- */
50
- public function get($key)
51
- {
52
- $value = get_transient($this->prepareTransientName($key));
53
- if (false === $value) {
54
- throw new ElementNotExistsException(sprintf('Element %s not exists!', $key));
55
- }
56
-
57
- return $value;
58
- }
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/wpdesk/wp-saas-platform-client/src/Platform.php CHANGED
@@ -4,6 +4,8 @@ namespace WPDesk\SaasPlatformClient;
4
 
5
  use Psr\Log\LoggerAwareInterface;
6
  use Psr\Log\LoggerInterface;
 
 
7
  use WPDesk\SaasPlatformClient\Authentication\JWTSaasToken;
8
  use WPDesk\SaasPlatformClient\Authentication\NullToken;
9
  use WPDesk\SaasPlatformClient\Authentication\Token;
@@ -11,8 +13,6 @@ use WPDesk\SaasPlatformClient\ApiClient\Client;
11
  use WPDesk\SaasPlatformClient\Model\Rate\RateRequest;
12
  use WPDesk\SaasPlatformClient\Model\Shipment\ShipmentRequest;
13
  use WPDesk\SaasPlatformClient\Model\ShippingServiceSetting;
14
- use WPDesk\SaasPlatformClient\Persistence\ElementNotExistsException;
15
- use WPDesk\SaasPlatformClient\Persistence\PersistentContainer;
16
  use WPDesk\SaasPlatformClient\Request\Authentication\RegisterRequest;
17
  use WPDesk\SaasPlatformClient\Request\AuthRequest;
18
  use WPDesk\SaasPlatformClient\Request\Cancel\PostCancelRequest;
4
 
5
  use Psr\Log\LoggerAwareInterface;
6
  use Psr\Log\LoggerInterface;
7
+ use WPDesk\Persistence\ElementNotExistsException;
8
+ use WPDesk\Persistence\PersistentContainer;
9
  use WPDesk\SaasPlatformClient\Authentication\JWTSaasToken;
10
  use WPDesk\SaasPlatformClient\Authentication\NullToken;
11
  use WPDesk\SaasPlatformClient\Authentication\Token;
13
  use WPDesk\SaasPlatformClient\Model\Rate\RateRequest;
14
  use WPDesk\SaasPlatformClient\Model\Shipment\ShipmentRequest;
15
  use WPDesk\SaasPlatformClient\Model\ShippingServiceSetting;
 
 
16
  use WPDesk\SaasPlatformClient\Request\Authentication\RegisterRequest;
17
  use WPDesk\SaasPlatformClient\Request\AuthRequest;
18
  use WPDesk\SaasPlatformClient\Request\Cancel\PostCancelRequest;
vendor/wpdesk/wp-saas-platform-client/src/PlatformFactoryOptions.php CHANGED
@@ -4,8 +4,8 @@ namespace WPDesk\SaasPlatformClient;
4
 
5
  use Psr\Log\LoggerInterface;
6
  use Psr\Log\NullLogger;
 
7
  use WPDesk\SaasPlatformClient\HttpClient\Curl\CurlClient;
8
- use WPDesk\SaasPlatformClient\Persistence\MemoryContainer;
9
  use WPDesk\SaasPlatformClient\PlatformOption\PlatformUrlOptions;
10
  use WPDesk\SaasPlatformClient\PlatformOption\HttpClientOptions;
11
  use WPDesk\SaasPlatformClient\PlatformOption\PersistenceOptions;
4
 
5
  use Psr\Log\LoggerInterface;
6
  use Psr\Log\NullLogger;
7
+ use WPDesk\Persistence\MemoryContainer;
8
  use WPDesk\SaasPlatformClient\HttpClient\Curl\CurlClient;
 
9
  use WPDesk\SaasPlatformClient\PlatformOption\PlatformUrlOptions;
10
  use WPDesk\SaasPlatformClient\PlatformOption\HttpClientOptions;
11
  use WPDesk\SaasPlatformClient\PlatformOption\PersistenceOptions;
vendor/wpdesk/wp-saas-platform-client/src/PlatformFactoryWordpressOptions.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  namespace WPDesk\SaasPlatformClient;
4
 
5
- use WPDesk\SaasPlatformClient\Persistence\Wordpress\WordpressOptionsContainer;
6
 
7
  class PlatformFactoryWordpressOptions extends PlatformFactoryOptions
8
  {
2
 
3
  namespace WPDesk\SaasPlatformClient;
4
 
5
+ use WPDesk\Persistence\Wordpress\WordpressOptionsContainer;
6
 
7
  class PlatformFactoryWordpressOptions extends PlatformFactoryOptions
8
  {