Changeset 3489939
- Timestamp:
- 03/24/2026 12:04:50 PM (10 days ago)
- Location:
- makecommerce/trunk
- Files:
-
- 8 added
- 64 edited
-
README.txt (modified) (2 diffs)
-
config.php (modified) (1 diff)
-
includes/i18n.php (modified) (1 diff)
-
makecommerce.php (modified) (1 diff)
-
makecommerce/admin/dashboard.php (modified) (2 diffs)
-
makecommerce/composer.json (modified) (1 diff)
-
makecommerce/composer.lock (added)
-
makecommerce/includes/i18n.php (modified) (1 diff)
-
makecommerce/makecommerce.php (modified) (1 diff)
-
makecommerce/payment/gateway/woocommerce/woocommerce.php (modified) (1 diff)
-
makecommerce/payment/payment.php (modified) (1 diff)
-
makecommerce/shipping/method/method.php (modified) (4 diffs)
-
makecommerce/shipping/shipping.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/composer/autoload_classmap.php (modified) (3 diffs)
-
makecommerce/vendor-prefixed/composer/autoload_static.php (modified) (5 diffs)
-
makecommerce/vendor-prefixed/composer/installed.json (modified) (25 diffs)
-
makecommerce/vendor-prefixed/composer/installed.php (modified) (8 diffs)
-
makecommerce/vendor-prefixed/composer/platform_check.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/CurlFactory.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/StreamHandler.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Middleware.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/guzzlehttp/psr7/src/LimitStream.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MessageTrait.php (modified) (6 diffs)
-
makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MimeType.php (modified) (66 diffs)
-
makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MultipartStream.php (modified) (4 diffs)
-
makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Request.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Uri.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Utils.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/maksekeskus/php-shipping-sdk/src/MakeCommerce/Http/HttpClientInterface.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/maksekeskus/php-shipping-sdk/src/MakeCommerce/Http/MakeCommerceClient.php (modified) (11 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigFilter.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigFunction.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigTest.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Environment.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Error/Error.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Infix/ArgumentsTrait.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Infix/AssignmentExpressionParser.php (added)
-
makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Infix/DotExpressionParser.php (modified) (4 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/InfixExpressionParserInterface.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Prefix/LiteralExpressionParser.php (modified) (3 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Prefix/UnaryOperatorExpressionParser.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/PrefixExpressionParserInterface.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Extension/AttributeExtension.php (modified) (4 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Extension/CoreExtension.php (modified) (9 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Extension/ExtensionInterface.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/ExtensionSet.php (modified) (3 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Lexer.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/EmbedNode.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/ArrayExpression.php (modified) (3 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Binary/MatchesBinary.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Binary/NotSameAsBinary.php (added)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Binary/ObjectDestructuringSetBinary.php (added)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Binary/SameAsBinary.php (added)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Binary/SequenceDestructuringSetBinary.php (added)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Binary/SetBinary.php (added)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/EmptyExpression.php (added)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/FunctionNode/EnumCasesFunction.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/FunctionNode/EnumFunction.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/GetAttrExpression.php (modified) (5 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Test/DefinedTest.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Node/TypesNode.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Parser.php (modified) (3 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Resources/debug.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Resources/string_loader.php (modified) (1 diff)
-
makecommerce/vendor-prefixed/twig/twig/src/Runtime/EscaperRuntime.php (modified) (6 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Template.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/Test/IntegrationTestCase.php (modified) (2 diffs)
-
makecommerce/vendor-prefixed/twig/twig/src/TokenParser/GuardTokenParser.php (modified) (1 diff)
-
payment/gateway/woocommerce/woocommerce.php (modified) (1 diff)
-
payment/payment.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
makecommerce/trunk/README.txt
r3447693 r3489939 4 4 Requires at least: 6.8.1 5 5 Tested up to: 6.9 6 Stable tag: 4.0. 66 Stable tag: 4.0.7 7 7 Requires PHP: 8.1 8 8 License: GPLv2 or later … … 60 60 61 61 == Changelog == 62 63 = 4.0.7 2026-03-24 = 64 * Feature - Added order locking to prevent race conditions during payment processing 65 * Feature - Improved shipping rate caching for faster responses from the MakeCommerce Shipping API 66 * Feature - Added webhook support for automated order status updates 67 * Feature - Added webhook support for fetching WooCommerce product categories 68 * Fix - Resolved static property issue with DefaultLocale in i18n 62 69 63 70 = 4.0.6 2026-01-27 = -
makecommerce/trunk/config.php
r3447693 r3489939 11 11 * Start at version 3.0.0 and use SemVer - https://semver.org 12 12 */ 13 define( 'MAKECOMMERCE_VERSION', '4.0. 6' );13 define( 'MAKECOMMERCE_VERSION', '4.0.7' ); 14 14 define( 'MAKECOMMERCE_PLUGIN_ID', 'makecommerce' ); 15 15 -
makecommerce/trunk/includes/i18n.php
r2622774 r3489939 30 30 31 31 //set default locale when there is nothing specified 32 public $defaultLocale = "et";32 public static string $defaultLocale = "et"; 33 33 34 34 /** -
makecommerce/trunk/makecommerce.php
r3447693 r3489939 9 9 * Plugin URI: https://makecommerce.net/ 10 10 * Description: Adds MakeCommerce payment gateway and shipping methods to WooCommerce checkout 11 * Version: 4.0. 611 * Version: 4.0.7 12 12 * Author: Maksekeskus AS 13 13 * Author URI: https://makecommerce.net/ -
makecommerce/trunk/makecommerce/admin/dashboard.php
r3447693 r3489939 204 204 205 205 $token = $client->connectShop( 206 $_SERVER['HTTP_USER_AGENT'] ?? 'unknown', 207 get_site_url() ?? $_SERVER['REMOTE_ADDR'], 208 admin_url( 'post.php?post={id}&action=edit' ) 206 userAgent: $_SERVER['HTTP_USER_AGENT'] ?? 'unknown', 207 remoteAddr: get_site_url() ?? $_SERVER['REMOTE_ADDR'], 208 orderUrl: admin_url( 'post.php?post={id}&action=edit' ), 209 webhookUrl: home_url('/') 209 210 ); 210 211 … … 446 447 $client = $this->get_client(); 447 448 $client->connectShop( 448 $_SERVER['HTTP_USER_AGENT'] ?? 'unknown', 449 get_site_url() ?? $_SERVER['REMOTE_ADDR'], 450 admin_url( 'post.php?post={id}&action=edit' ) 449 userAgent: $_SERVER['HTTP_USER_AGENT'] ?? 'unknown', 450 remoteAddr: get_site_url() ?? $_SERVER['REMOTE_ADDR'], 451 orderUrl: admin_url( 'post.php?post={id}&action=edit' ), 452 webhookUrl: home_url('/') 451 453 ); 452 454 update_option('mc_credentials_error', ''); -
makecommerce/trunk/makecommerce/composer.json
r3318735 r3489939 9 9 ], 10 10 "require": { 11 "maksekeskus/php-shipping-sdk": "1.5. 1",11 "maksekeskus/php-shipping-sdk": "1.5.5", 12 12 "twig/twig": "^3.11.0" 13 13 }, -
makecommerce/trunk/makecommerce/includes/i18n.php
r3447693 r3489939 30 30 31 31 //set default locale when there is nothing specified 32 public $defaultLocale = "en";32 public static string $defaultLocale = "en"; 33 33 34 34 /** -
makecommerce/trunk/makecommerce/makecommerce.php
r3447693 r3489939 11 11 * Start at version 3.0.0 and use SemVer - https://semver.org 12 12 */ 13 define( 'MAKECOMMERCE_VERSION', '4.0. 6' );13 define( 'MAKECOMMERCE_VERSION', '4.0.7' ); 14 14 define( 'MAKECOMMERCE_PLUGIN_ID', 'makecommerce' ); 15 15 -
makecommerce/trunk/makecommerce/payment/gateway/woocommerce/woocommerce.php
r3447693 r3489939 13 13 public $id = MAKECOMMERCE_PLUGIN_ID; 14 14 15 public $version = '4.0. 6';15 public $version = '4.0.7'; 16 16 17 17 public $payment_return_url; -
makecommerce/trunk/makecommerce/payment/payment.php
r3447693 r3489939 287 287 } 288 288 289 //check if we already processed this status in the past. 289 // Lock processing for this order+status to avoid race conditions between callback and redirect 290 $lock_key = '_makecommerce_payment_lock_status_' . $paymentStatus; 291 $locked = add_post_meta( $orderId, $lock_key, time(), true ); 292 if ( ! $locked ) { 293 return $returnUrl; 294 } 295 290 296 if ( $check_status && $order->get_meta( '_makecommerce_payment_processed_status', true ) == $paymentStatus ) { 291 297 return $returnUrl; -
makecommerce/trunk/makecommerce/shipping/method/method.php
r3447693 r3489939 104 104 } 105 105 106 $totalWeight = $this->getCartTotalWeight($package['contents']); 107 $dst = $package['destination']['country']; 108 $address = $package['destination']['address']; 109 $city = $package['destination']['city']; 110 $postcode = $package['destination']['postcode']; 111 112 $details = ['package' => $this->filter_package_details($package)]; 113 $details = $this->add_woo_conf($details); 106 $request_payload = $this->build_rates_request_payload($package); 114 107 115 108 $location = []; 109 110 // Build a hash of the full request payload 111 $cache_hash = $this->build_rates_cache_hash($request_payload); 112 $session = null; 113 114 if (function_exists('WC') && WC()->session) { 115 $session = WC()->session; 116 $cached_hash = $session->get('mc_last_rates_hash'); 117 $cached_rates = $session->get('mc_last_rates'); 118 $cached_ts = (int) $session->get('mc_last_rates_timestamp'); 119 120 // Allow sites to change TTL via filter if needed. 121 $cache_ttl = (int) apply_filters('mc_shipping_rates_cache_ttl', 30); 122 123 if ( 124 !empty($cached_hash) && 125 $cached_hash === $cache_hash && 126 !empty($cached_rates) && 127 !empty($cached_ts) && 128 (time() - $cached_ts) < $cache_ttl 129 ) { 130 // Re-use cached rates 131 $this->register_mc_rates($cached_rates, $package); 132 return; 133 } 134 } 135 116 136 try { 117 137 $client = Shipping::init_client(); 118 $rates = $client->getRates([ 119 'details' => $details, 120 'weight' => $totalWeight, 121 'destination' => $dst, 122 'location' => [ 123 'address' => $address, 124 'city' => $city, 125 'zip' => $postcode, 126 ] 127 ], $location); 138 $rates = $client->getRates($request_payload, $location); 139 if (is_object($rates)) { 140 $rates = (array) $rates; 141 } 128 142 129 143 $decoded_location = is_string($location) ? json_decode($location) : $location; … … 131 145 is_array($decoded_location) && 132 146 isset($decoded_location[0]->latitude, $decoded_location[0]->longitude) && 133 WC()->session147 $session 134 148 ) { 135 WC()->session->set('mc_coordinates', [149 $session->set('mc_coordinates', [ 136 150 'lat' => (float) $decoded_location[0]->latitude, 137 151 'lng' => (float) $decoded_location[0]->longitude, … … 139 153 } 140 154 141 foreach ($rates as $method => $carriers) { 142 // If does not fit and is pickuppoint, then do not add shipping rate 143 if ($method === 'pickuppoint' && !$this->fits_parcel_machine($package)) { 144 continue; 155 if ($session) { 156 $session->set('mc_last_rates_hash', $cache_hash); 157 $session->set('mc_last_rates', $rates); 158 $session->set('mc_last_rates_timestamp', time()); 159 160 $session_rates = $session->get('mc_last_rates'); 161 if (!empty($session_rates)) { 162 $this->register_mc_rates($session_rates, $package); 163 } else { 164 $this->register_mc_rates($rates, $package); // fallback 145 165 } 146 147 foreach ($carriers as $carrier) { 148 $this->add_rate([ 149 'id' => 'mc_' . $method . '_' . $carrier->carrier, 150 'label' => $carrier->title, 151 'cost' => $carrier->price / 100, 152 'taxes' => '', 153 'calc_tax' => 'per_order', 154 ]); 155 } 156 166 } else { 167 $this->register_mc_rates($rates, $package); 157 168 } 158 169 … … 220 231 } 221 232 233 /** 234 * Build MakeCommerce rates request payload from WooCommerce package. 235 * 236 * @param array $package 237 * @return array 238 */ 239 private function build_rates_request_payload(array $package): array 240 { 241 $totalWeight = $this->getCartTotalWeight($package['contents']); 242 $destination = $package['destination'] ?? []; 243 244 $details = ['package' => $this->filter_package_details($package)]; 245 $details = $this->add_woo_conf($details); 246 247 return [ 248 'details' => $details, 249 'weight' => $totalWeight, 250 'destination' => $destination['country'] ?? '', 251 'location' => [ 252 'address' => $destination['address'] ?? '', 253 'city' => $destination['city'] ?? '', 254 'zip' => $destination['postcode'] ?? '', 255 ], 256 ]; 257 } 258 259 /** 260 * Build a stable hash for the current request payload 261 * to decide when to reuse cached shipping rates. 262 * 263 * @param array $request_payload 264 * @return string 265 */ 266 private function build_rates_cache_hash(array $request_payload): string 267 { 268 return hash('sha256', wp_json_encode($request_payload)); 269 } 270 271 /** 272 * Register MakeCommerce shipping rates with WooCommerce. 273 * 274 * @param $rates 275 * @param array $package 276 * @return void 277 */ 278 private function register_mc_rates($rates, array $package): void 279 { 280 foreach ($rates as $method => $carriers) { 281 // If does not fit and is pickuppoint, then do not add shipping rate 282 if ($method === 'pickuppoint' && !$this->fits_parcel_machine($package)) { 283 continue; 284 } 285 286 foreach ($carriers as $carrier) { 287 $this->add_rate([ 288 'id' => 'mc_' . $method . '_' . $carrier->carrier, 289 'label' => $carrier->title, 290 'cost' => $carrier->price / 100, 291 'taxes' => '', 292 'calc_tax' => 'per_order', 293 ]); 294 } 295 } 296 } 222 297 223 298 /** -
makecommerce/trunk/makecommerce/shipping/shipping.php
r3447693 r3489939 82 82 // Add blocks support 83 83 add_action( 'woocommerce_blocks_loaded', [$this, 'woocommerce_blocks_support'] ); 84 85 // Shipping Webhook endpoint 86 add_filter( 'query_vars', array( $this, 'register_webhook_query_var') ); 87 add_action( 'template_redirect', array( $this, 'handle_webhooks') ); 84 88 } 85 89 … … 155 159 156 160 $this->loader->add_action( 'woocommerce_review_order_after_shipping', $this, 'mc_pickuppoint_after_shipping_details'); 161 } 162 163 /** 164 * Register shared webhook query variable. 165 * 166 * @since 4.0.7 167 */ 168 public function register_webhook_query_var( $vars ) { 169 $vars[] = 'makecommerce_shipping_webhook'; 170 171 return $vars; 172 } 173 174 /** 175 * Unified webhook dispatcher. Routes to specific handlers based on query var. 176 * 177 * Usage examples: 178 * - ?makecommerce_shipping_webhook=status_automation 179 * - ?makecommerce_shipping_webhook=categories 180 * 181 * @since 4.0.7 182 */ 183 public function handle_webhooks() { 184 $type = get_query_var( 'makecommerce_shipping_webhook' ); 185 186 if ( empty( $type ) ) { 187 return; 188 } 189 190 if ( $type === 'status_automation' ) { 191 $this->handle_shipping_status_automation_webhook(); 192 return; 193 } 194 195 if ( $type === 'categories' ) { 196 $this->handle_categories_webhook(); 197 return; 198 } 199 } 200 201 /** 202 * Handles shipping webhook callback 203 * 204 * @since 4.0.7 205 */ 206 public function handle_shipping_status_automation_webhook() { 207 try{ 208 209 $data = stripslashes_deep( $_POST ); 210 211 $api = \MakeCommerce::get_api(); 212 213 $this->validate_auth($api->getShopId(), $api->getSecretKey()); 214 215 if (!$api->verifyMac( $data )){ 216 wp_send_json( [ 217 'code' => 'MAC_VALIDATION_ERROR', 218 'status' => 'error', 219 'message' => 'Mac validation failed' 220 ], 422 ); 221 } 222 223 $json = json_decode($data['json'], true); 224 225 $orderId = $json['order_id']; 226 $trackingId = $json['tracking_id']; 227 $shipment_status = (int) $json['shipment_status']; 228 229 $order = wc_get_order( $orderId ); 230 231 if ( !$order || !$order->get_id() ) { 232 wp_send_json([ 233 'code' => 'ORDER_NOT_FOUND', 234 'status' => 'error', 235 'message' => 'Order with id: ' . $orderId . ' not found' 236 ], 422 ); 237 } 238 239 if ($shipment_status < 200){ 240 wp_send_json([ 241 'code' => 'SHIPMENT_STATUS_BELOW_THRESHOLD', 242 'status' => 'success', 243 'message' => 'Order with id: ' . $orderId . ' got shipment_status: ' . $shipment_status 244 ], 200 ); 245 } 246 247 // Check if our plugin has already moved this order to completed before 248 if ( $order->get_meta( '_mc_has_set_to_completed' ) === 'yes' ) { 249 wp_send_json([ 250 'code' => 'ORDER_ALREADY_COMPLETED_BY_MC', 251 'status' => 'success', 252 'message' => 'Order with id: ' . $orderId . ' has already been moved to completed status by MakeCommerce.' 253 ], 200 ); 254 } 255 256 // Only move status to completed if order in processing 257 if ($order->get_status() !== 'processing') { 258 wp_send_json([ 259 'code' => 'ORDER_NOT_IN_PROCESSING_STATE', 260 'status' => 'success', 261 'message' => 'Order with id: ' . $orderId . ' is not in processing status: ' . $order->get_status() 262 ], 200 ); 263 } 264 265 266 // Mark that our plugin was the one who set this order to completed status 267 $order->update_meta_data( '_mc_has_set_to_completed', 'yes' ); 268 $order->add_order_note( 269 sprintf( 270 __( 'Received status %s for shipment %s, marking order as completed', 'wc_makecommerce_domain' ), 271 $shipment_status, 272 $trackingId 273 )); 274 $order->update_status( 'completed' ); 275 276 $order->save(); 277 278 wp_send_json( [ 279 'status' => 'success', 280 'message' => 'Order with id: ' . $orderId . ' status set to completed' 281 ], 200 ); 282 283 } catch (\Exception $e) { 284 wp_send_json( [ 285 'code' => 'WOOCOMMERCE_UNEXPECTED_ERROR', 286 'status' => 'error', 287 'message' => substr($e->getMessage(), 0, 500) 288 ], 500 ); 289 } 290 } 291 292 /** 293 * Handles categories webhook callback 294 * 295 * Allows external MakeCommerce service to fetch WooCommerce product categories. 296 * 297 * @since 4.0.7 298 */ 299 public function handle_categories_webhook() { 300 301 $api = \MakeCommerce::get_api(); 302 303 $this->validate_auth($api->getShopId(), $api->getSecretKey()); 304 305 $terms = get_terms( 306 [ 307 'taxonomy' => 'product_cat', 308 'hide_empty' => false, 309 ] 310 ); 311 312 if ( is_wp_error( $terms ) ) { 313 wp_send_json( 314 [ 315 'code' => 'TERM_FETCH_ERROR', 316 'status' => 'error', 317 'message' => $terms->get_error_message(), 318 ], 319 500 320 ); 321 } 322 323 $categories = array_map( 324 function ( $term ) { 325 return [ 326 'id' => (string) $term->term_id, 327 'name' => $term->name, 328 'parent_id' => (string) $term->parent, 329 'description' => $term->description, 330 ]; 331 }, 332 $terms 333 ); 334 335 wp_send_json( 336 [ 337 'status' => 'success', 338 'categories' => $categories, 339 ], 340 200 341 ); 342 } 343 344 /** 345 * Validate HTTP Basic Auth header for webhook requests. 346 * 347 * Username must match shop ID and password must match secret key. 348 * Responds with 401 JSON error and terminates execution on failure. 349 * 350 * @param string $shop_id 351 * @param string $secret_key 352 * 353 * @since 4.0.7 354 */ 355 private function validate_auth(string $shop_id, string $secret_key ) { 356 $authorization = ''; 357 358 if ( function_exists( 'getallheaders' ) ) { 359 $headers = getallheaders(); 360 361 $authorization = isset( $headers['Authorization'] ) ? $headers['Authorization'] : ''; 362 } 363 364 if ( empty( $authorization ) || stripos( $authorization, 'Basic ' ) !== 0 ) { 365 wp_send_json( 366 [ 367 'code' => 'UNAUTHORIZED', 368 'status' => 'error', 369 'message' => 'Missing or invalid Authorization header', 370 ], 371 401 372 ); 373 } 374 375 $encoded_credentials = trim( substr( $authorization, 6 ) ); // Remove 'Basic ' 376 $decoded_credentials = base64_decode( $encoded_credentials, true ); 377 378 if ( $decoded_credentials === false || strpos( $decoded_credentials, ':' ) === false ) { 379 wp_send_json( 380 [ 381 'code' => 'UNAUTHORIZED', 382 'status' => 'error', 383 'message' => 'Malformed Authorization header', 384 ], 385 401 386 ); 387 } 388 389 list( $username, $password ) = explode( ':', $decoded_credentials, 2 ); 390 391 $username_valid = $shop_id === $username; 392 $password_valid = $secret_key === $password; 393 394 if ( ! $username_valid || ! $password_valid ) { 395 wp_send_json( 396 [ 397 'code' => 'UNAUTHORIZED', 398 'status' => 'error', 399 'message' => 'Invalid Basic Auth credentials', 400 ], 401 401 402 ); 403 } 157 404 } 158 405 -
makecommerce/trunk/makecommerce/vendor-prefixed/composer/autoload_classmap.php
r3318735 r3489939 147 147 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ArgumentsTrait' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/ArgumentsTrait.php', 148 148 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ArrowExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/ArrowExpressionParser.php', 149 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\AssignmentExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/AssignmentExpressionParser.php', 149 150 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\BinaryOperatorExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/BinaryOperatorExpressionParser.php', 150 151 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ConditionalTernaryExpressionParser' => $vendorDir . '/twig/twig/src/ExpressionParser/Infix/ConditionalTernaryExpressionParser.php', … … 232 233 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotEqualBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php', 233 234 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotInBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NotInBinary.php', 235 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotSameAsBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NotSameAsBinary.php', 234 236 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NullCoalesceBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/NullCoalesceBinary.php', 237 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\ObjectDestructuringSetBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/ObjectDestructuringSetBinary.php', 235 238 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\OrBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/OrBinary.php', 236 239 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\PowerBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/PowerBinary.php', 237 240 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\RangeBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/RangeBinary.php', 241 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SameAsBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SameAsBinary.php', 242 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SequenceDestructuringSetBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SequenceDestructuringSetBinary.php', 243 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SetBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SetBinary.php', 238 244 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SpaceshipBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php', 239 245 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\StartsWithBinary' => $vendorDir . '/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php', … … 244 250 'MakeCommercePrefix\\Twig\\Node\\Expression\\ConditionalExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ConditionalExpression.php', 245 251 'MakeCommercePrefix\\Twig\\Node\\Expression\\ConstantExpression' => $vendorDir . '/twig/twig/src/Node/Expression/ConstantExpression.php', 252 'MakeCommercePrefix\\Twig\\Node\\Expression\\EmptyExpression' => $vendorDir . '/twig/twig/src/Node/Expression/EmptyExpression.php', 246 253 'MakeCommercePrefix\\Twig\\Node\\Expression\\FilterExpression' => $vendorDir . '/twig/twig/src/Node/Expression/FilterExpression.php', 247 254 'MakeCommercePrefix\\Twig\\Node\\Expression\\Filter\\DefaultFilter' => $vendorDir . '/twig/twig/src/Node/Expression/Filter/DefaultFilter.php', -
makecommerce/trunk/makecommerce/vendor-prefixed/composer/autoload_static.php
r3318735 r3489939 20 20 21 21 public static $prefixLengthsPsr4 = array ( 22 'M' => 22 'M' => 23 23 array ( 24 24 'MakeCommercePrefix\\Twig\\' => 24, … … 35 35 36 36 public static $prefixDirsPsr4 = array ( 37 'MakeCommercePrefix\\Twig\\' => 37 'MakeCommercePrefix\\Twig\\' => 38 38 array ( 39 39 0 => __DIR__ . '/..' . '/twig/twig/src', 40 40 ), 41 'MakeCommercePrefix\\Symfony\\Polyfill\\Mbstring\\' => 41 'MakeCommercePrefix\\Symfony\\Polyfill\\Mbstring\\' => 42 42 array ( 43 43 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', 44 44 ), 45 'MakeCommercePrefix\\Symfony\\Polyfill\\Ctype\\' => 45 'MakeCommercePrefix\\Symfony\\Polyfill\\Ctype\\' => 46 46 array ( 47 47 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', 48 48 ), 49 'MakeCommercePrefix\\Psr\\Http\\Message\\' => 49 'MakeCommercePrefix\\Psr\\Http\\Message\\' => 50 50 array ( 51 51 0 => __DIR__ . '/..' . '/psr/http-factory/src', 52 52 1 => __DIR__ . '/..' . '/psr/http-message/src', 53 53 ), 54 'MakeCommercePrefix\\Psr\\Http\\Client\\' => 54 'MakeCommercePrefix\\Psr\\Http\\Client\\' => 55 55 array ( 56 56 0 => __DIR__ . '/..' . '/psr/http-client/src', 57 57 ), 58 'MakeCommercePrefix\\MakeCommerceShipping\\SDK\\' => 58 'MakeCommercePrefix\\MakeCommerceShipping\\SDK\\' => 59 59 array ( 60 60 0 => __DIR__ . '/..' . '/maksekeskus/php-shipping-sdk/src/MakeCommerce', 61 61 ), 62 'MakeCommercePrefix\\GuzzleHttp\\Psr7\\' => 62 'MakeCommercePrefix\\GuzzleHttp\\Psr7\\' => 63 63 array ( 64 64 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', 65 65 ), 66 'MakeCommercePrefix\\GuzzleHttp\\Promise\\' => 66 'MakeCommercePrefix\\GuzzleHttp\\Promise\\' => 67 67 array ( 68 68 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', 69 69 ), 70 'MakeCommercePrefix\\GuzzleHttp\\' => 70 'MakeCommercePrefix\\GuzzleHttp\\' => 71 71 array ( 72 72 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', … … 215 215 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ArgumentsTrait' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/ArgumentsTrait.php', 216 216 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ArrowExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/ArrowExpressionParser.php', 217 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\AssignmentExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/AssignmentExpressionParser.php', 217 218 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\BinaryOperatorExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/BinaryOperatorExpressionParser.php', 218 219 'MakeCommercePrefix\\Twig\\ExpressionParser\\Infix\\ConditionalTernaryExpressionParser' => __DIR__ . '/..' . '/twig/twig/src/ExpressionParser/Infix/ConditionalTernaryExpressionParser.php', … … 300 301 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotEqualBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php', 301 302 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotInBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NotInBinary.php', 303 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NotSameAsBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NotSameAsBinary.php', 302 304 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\NullCoalesceBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/NullCoalesceBinary.php', 305 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\ObjectDestructuringSetBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/ObjectDestructuringSetBinary.php', 303 306 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\OrBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/OrBinary.php', 304 307 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\PowerBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/PowerBinary.php', 305 308 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\RangeBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/RangeBinary.php', 309 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SameAsBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SameAsBinary.php', 310 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SequenceDestructuringSetBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SequenceDestructuringSetBinary.php', 311 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SetBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SetBinary.php', 306 312 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\SpaceshipBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/SpaceshipBinary.php', 307 313 'MakeCommercePrefix\\Twig\\Node\\Expression\\Binary\\StartsWithBinary' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php', … … 312 318 'MakeCommercePrefix\\Twig\\Node\\Expression\\ConditionalExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ConditionalExpression.php', 313 319 'MakeCommercePrefix\\Twig\\Node\\Expression\\ConstantExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/ConstantExpression.php', 320 'MakeCommercePrefix\\Twig\\Node\\Expression\\EmptyExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/EmptyExpression.php', 314 321 'MakeCommercePrefix\\Twig\\Node\\Expression\\FilterExpression' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/FilterExpression.php', 315 322 'MakeCommercePrefix\\Twig\\Node\\Expression\\Filter\\DefaultFilter' => __DIR__ . '/..' . '/twig/twig/src/Node/Expression/Filter/DefaultFilter.php', -
makecommerce/trunk/makecommerce/vendor-prefixed/composer/installed.json
r3318735 r3489939 3 3 "12": { 4 4 "name": "guzzlehttp/guzzle", 5 "version": "7. 9.3",6 "version_normalized": "7. 9.3.0",5 "version": "7.10.0", 6 "version_normalized": "7.10.0.0", 7 7 "source": { 8 8 "type": "git", 9 9 "url": "https://github.com/guzzle/guzzle.git", 10 "reference": " 7b2f29fe81dc4da0ca0ea7d42107a0845946ea77"11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ 7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",15 "reference": " 7b2f29fe81dc4da0ca0ea7d42107a0845946ea77",10 "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" 11 }, 12 "dist": { 13 "type": "zip", 14 "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", 15 "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", 16 16 "shasum": "" 17 17 }, 18 18 "require": { 19 19 "ext-json": "*", 20 "guzzlehttp/promises": "^ 1.5.3 || ^2.0.3",21 "guzzlehttp/psr7": "^2. 7.0",20 "guzzlehttp/promises": "^2.3", 21 "guzzlehttp/psr7": "^2.8", 22 22 "php": "^7.2.5 || ^8.0", 23 23 "psr/http-client": "^1.0", … … 40 40 "psr/log": "Required for using the Log middleware" 41 41 }, 42 "time": "2025-0 3-27T13:37:11+00:00",42 "time": "2025-08-23T22:36:01+00:00", 43 43 "type": "library", 44 44 "extra": { … … 112 112 "support": { 113 113 "issues": "https://github.com/guzzle/guzzle/issues", 114 "source": "https://github.com/guzzle/guzzle/tree/7. 9.3"114 "source": "https://github.com/guzzle/guzzle/tree/7.10.0" 115 115 }, 116 116 "funding": [ … … 132 132 "13": { 133 133 "name": "guzzlehttp/promises", 134 "version": "2. 2.0",135 "version_normalized": "2. 2.0.0",134 "version": "2.3.0", 135 "version_normalized": "2.3.0.0", 136 136 "source": { 137 137 "type": "git", 138 138 "url": "https://github.com/guzzle/promises.git", 139 "reference": " 7c69f28996b0a6920945dd20b3857e499d9ca96c"140 }, 141 "dist": { 142 "type": "zip", 143 "url": "https://api.github.com/repos/guzzle/promises/zipball/ 7c69f28996b0a6920945dd20b3857e499d9ca96c",144 "reference": " 7c69f28996b0a6920945dd20b3857e499d9ca96c",139 "reference": "481557b130ef3790cf82b713667b43030dc9c957" 140 }, 141 "dist": { 142 "type": "zip", 143 "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", 144 "reference": "481557b130ef3790cf82b713667b43030dc9c957", 145 145 "shasum": "" 146 146 }, … … 150 150 "require-dev": { 151 151 "bamarni/composer-bin-plugin": "^1.8.2", 152 "phpunit/phpunit": "^8.5. 39 || ^9.6.20"153 }, 154 "time": "2025-0 3-27T13:27:01+00:00",152 "phpunit/phpunit": "^8.5.44 || ^9.6.25" 153 }, 154 "time": "2025-08-22T14:34:08+00:00", 155 155 "type": "library", 156 156 "extra": { … … 198 198 "support": { 199 199 "issues": "https://github.com/guzzle/promises/issues", 200 "source": "https://github.com/guzzle/promises/tree/2. 2.0"200 "source": "https://github.com/guzzle/promises/tree/2.3.0" 201 201 }, 202 202 "funding": [ … … 218 218 "14": { 219 219 "name": "guzzlehttp/psr7", 220 "version": "2. 7.1",221 "version_normalized": "2. 7.1.0",220 "version": "2.9.0", 221 "version_normalized": "2.9.0.0", 222 222 "source": { 223 223 "type": "git", 224 224 "url": "https://github.com/guzzle/psr7.git", 225 "reference": " c2270caaabe631b3b44c85f99e5a04bbb8060d16"226 }, 227 "dist": { 228 "type": "zip", 229 "url": "https://api.github.com/repos/guzzle/psr7/zipball/ c2270caaabe631b3b44c85f99e5a04bbb8060d16",230 "reference": " c2270caaabe631b3b44c85f99e5a04bbb8060d16",225 "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884" 226 }, 227 "dist": { 228 "type": "zip", 229 "url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884", 230 "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884", 231 231 "shasum": "" 232 232 }, … … 244 244 "bamarni/composer-bin-plugin": "^1.8.2", 245 245 "http-interop/http-factory-tests": "0.9.0", 246 "phpunit/phpunit": "^8.5.39 || ^9.6.20" 246 "jshttp/mime-db": "1.54.0.1", 247 "phpunit/phpunit": "^8.5.44 || ^9.6.25" 247 248 }, 248 249 "suggest": { 249 250 "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" 250 251 }, 251 "time": "202 5-03-27T12:30:47+00:00",252 "time": "2026-03-10T16:41:02+00:00", 252 253 "type": "library", 253 254 "extra": { … … 317 318 "support": { 318 319 "issues": "https://github.com/guzzle/psr7/issues", 319 "source": "https://github.com/guzzle/psr7/tree/2. 7.1"320 "source": "https://github.com/guzzle/psr7/tree/2.9.0" 320 321 }, 321 322 "funding": [ … … 337 338 "21": { 338 339 "name": "maksekeskus/php-shipping-sdk", 339 "version": "1.5. 1",340 "version_normalized": "1.5. 1.0",340 "version": "1.5.5", 341 "version_normalized": "1.5.5.0", 341 342 "source": { 342 343 "type": "git", 343 344 "url": "https://github.com/maksekeskus/php-shipping-sdk.git", 344 "reference": " 119c45a091f4c47ece0f5434b1f12b1a74217aff"345 }, 346 "dist": { 347 "type": "zip", 348 "url": "https://api.github.com/repos/maksekeskus/php-shipping-sdk/zipball/ 119c45a091f4c47ece0f5434b1f12b1a74217aff",349 "reference": " 119c45a091f4c47ece0f5434b1f12b1a74217aff",345 "reference": "ced07b21189c5736a91bd5116c4607b0b28a4b13" 346 }, 347 "dist": { 348 "type": "zip", 349 "url": "https://api.github.com/repos/maksekeskus/php-shipping-sdk/zipball/ced07b21189c5736a91bd5116c4607b0b28a4b13", 350 "reference": "ced07b21189c5736a91bd5116c4607b0b28a4b13", 350 351 "shasum": "" 351 352 }, … … 361 362 "symfony/var-dumper": "5.4.39" 362 363 }, 363 "time": "202 5-06-03T06:28:14+00:00",364 "time": "2026-03-13T14:50:10+00:00", 364 365 "type": "library", 365 366 "installation-source": "dist", … … 395 396 ], 396 397 "support": { 397 "source": "https://github.com/maksekeskus/php-shipping-sdk/tree/1.5. 1",398 "source": "https://github.com/maksekeskus/php-shipping-sdk/tree/1.5.5", 398 399 "issues": "https://github.com/maksekeskus/php-shipping-sdk/issues" 399 400 }, 400 401 "install-path": "../maksekeskus/php-shipping-sdk" 401 402 }, 402 "3 1": {403 "32": { 403 404 "name": "psr/http-client", 404 405 "version": "1.0.3", … … 455 456 "install-path": "../psr/http-client" 456 457 }, 457 "3 2": {458 "33": { 458 459 "name": "psr/http-factory", 459 460 "version": "1.1.0", … … 513 514 "install-path": "../psr/http-factory" 514 515 }, 515 "3 3": {516 "34": { 516 517 "name": "psr/http-message", 517 518 "version": "2.0", … … 569 570 "install-path": "../psr/http-message" 570 571 }, 571 "3 6": {572 "37": { 572 573 "name": "ralouphie/getallheaders", 573 574 "version": "3.0.3", … … 616 617 "install-path": "../ralouphie/getallheaders" 617 618 }, 618 "4 4": {619 "45": { 619 620 "name": "symfony/deprecation-contracts", 620 621 "version": "v3.6.0", … … 686 687 "install-path": "../symfony/deprecation-contracts" 687 688 }, 688 "4 7": {689 "48": { 689 690 "name": "symfony/polyfill-ctype", 690 "version": "v1.3 2.0",691 "version_normalized": "1.3 2.0.0",691 "version": "v1.33.0", 692 "version_normalized": "1.33.0.0", 692 693 "source": { 693 694 "type": "git", … … 750 751 ], 751 752 "support": { 752 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.3 2.0"753 "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" 753 754 }, 754 755 "funding": [ … … 762 763 }, 763 764 { 765 "url": "https://github.com/nicolas-grekas", 766 "type": "github" 767 }, 768 { 764 769 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 765 770 "type": "tidelift" … … 768 773 "install-path": "../symfony/polyfill-ctype" 769 774 }, 770 "5 0": {775 "51": { 771 776 "name": "symfony/polyfill-mbstring", 772 "version": "v1.3 2.0",773 "version_normalized": "1.3 2.0.0",777 "version": "v1.33.0", 778 "version_normalized": "1.33.0.0", 774 779 "source": { 775 780 "type": "git", … … 834 839 ], 835 840 "support": { 836 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.3 2.0"841 "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" 837 842 }, 838 843 "funding": [ … … 846 851 }, 847 852 { 853 "url": "https://github.com/nicolas-grekas", 854 "type": "github" 855 }, 856 { 848 857 "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 849 858 "type": "tidelift" … … 852 861 "install-path": "../symfony/polyfill-mbstring" 853 862 }, 854 " 58": {863 "60": { 855 864 "name": "twig/twig", 856 "version": "v3.2 1.1",857 "version_normalized": "3.2 1.1.0",865 "version": "v3.23.0", 866 "version_normalized": "3.23.0.0", 858 867 "source": { 859 868 "type": "git", 860 869 "url": "https://github.com/twigphp/Twig.git", 861 "reference": " 285123877d4dd97dd7c11842ac5fb7e86e60d81d"862 }, 863 "dist": { 864 "type": "zip", 865 "url": "https://api.github.com/repos/twigphp/Twig/zipball/ 285123877d4dd97dd7c11842ac5fb7e86e60d81d",866 "reference": " 285123877d4dd97dd7c11842ac5fb7e86e60d81d",870 "reference": "a64dc5d2cc7d6cafb9347f6cd802d0d06d0351c9" 871 }, 872 "dist": { 873 "type": "zip", 874 "url": "https://api.github.com/repos/twigphp/Twig/zipball/a64dc5d2cc7d6cafb9347f6cd802d0d06d0351c9", 875 "reference": "a64dc5d2cc7d6cafb9347f6cd802d0d06d0351c9", 867 876 "shasum": "" 868 877 }, … … 878 887 "symfony/phpunit-bridge": "^5.4.9|^6.4|^7.0" 879 888 }, 880 "time": "202 5-05-03T07:21:55+00:00",889 "time": "2026-01-23T21:00:41+00:00", 881 890 "type": "library", 882 891 "installation-source": "dist", … … 920 929 "support": { 921 930 "issues": "https://github.com/twigphp/Twig/issues", 922 "source": "https://github.com/twigphp/Twig/tree/v3.2 1.1"931 "source": "https://github.com/twigphp/Twig/tree/v3.23.0" 923 932 }, 924 933 "funding": [ -
makecommerce/trunk/makecommerce/vendor-prefixed/composer/installed.php
r3318735 r3489939 5 5 'pretty_version' => 'dev-master', 6 6 'version' => 'dev-master', 7 'reference' => ' 8b4cb8bcd3e5c2eac26f2f7bbfabee8818520d8c',7 'reference' => 'b619b6efbbd00a4e883143e6f266623ebb43b47a', 8 8 'type' => 'library', 9 9 'install_path' => __DIR__ . '/../', … … 17 17 'guzzlehttp/guzzle' => 18 18 array ( 19 'pretty_version' => '7. 9.3',20 'version' => '7. 9.3.0',21 'reference' => ' 7b2f29fe81dc4da0ca0ea7d42107a0845946ea77',19 'pretty_version' => '7.10.0', 20 'version' => '7.10.0.0', 21 'reference' => 'b51ac707cfa420b7bfd4e4d5e510ba8008e822b4', 22 22 'type' => 'library', 23 23 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', … … 29 29 'guzzlehttp/promises' => 30 30 array ( 31 'pretty_version' => '2. 2.0',32 'version' => '2. 2.0.0',33 'reference' => ' 7c69f28996b0a6920945dd20b3857e499d9ca96c',31 'pretty_version' => '2.3.0', 32 'version' => '2.3.0.0', 33 'reference' => '481557b130ef3790cf82b713667b43030dc9c957', 34 34 'type' => 'library', 35 35 'install_path' => __DIR__ . '/../guzzlehttp/promises', … … 41 41 'guzzlehttp/psr7' => 42 42 array ( 43 'pretty_version' => '2. 7.1',44 'version' => '2. 7.1.0',45 'reference' => ' c2270caaabe631b3b44c85f99e5a04bbb8060d16',43 'pretty_version' => '2.9.0', 44 'version' => '2.9.0.0', 45 'reference' => '7d0ed42f28e42d61352a7a79de682e5e67fec884', 46 46 'type' => 'library', 47 47 'install_path' => __DIR__ . '/../guzzlehttp/psr7', … … 53 53 'maksekeskus/php-shipping-sdk' => 54 54 array ( 55 'pretty_version' => '1.5. 1',56 'version' => '1.5. 1.0',57 'reference' => ' 119c45a091f4c47ece0f5434b1f12b1a74217aff',55 'pretty_version' => '1.5.5', 56 'version' => '1.5.5.0', 57 'reference' => 'ced07b21189c5736a91bd5116c4607b0b28a4b13', 58 58 'type' => 'library', 59 59 'install_path' => __DIR__ . '/../maksekeskus/php-shipping-sdk', … … 125 125 'symfony/polyfill-ctype' => 126 126 array ( 127 'pretty_version' => 'v1.3 2.0',128 'version' => '1.3 2.0.0',127 'pretty_version' => 'v1.33.0', 128 'version' => '1.33.0.0', 129 129 'reference' => 'a3cc8b044a6ea513310cbd48ef7333b384945638', 130 130 'type' => 'library', … … 137 137 'symfony/polyfill-mbstring' => 138 138 array ( 139 'pretty_version' => 'v1.3 2.0',140 'version' => '1.3 2.0.0',139 'pretty_version' => 'v1.33.0', 140 'version' => '1.33.0.0', 141 141 'reference' => '6d857f4d76bd4b343eac26d6b539585d2bc56493', 142 142 'type' => 'library', … … 149 149 'twig/twig' => 150 150 array ( 151 'pretty_version' => 'v3.2 1.1',152 'version' => '3.2 1.1.0',153 'reference' => ' 285123877d4dd97dd7c11842ac5fb7e86e60d81d',151 'pretty_version' => 'v3.23.0', 152 'version' => '3.23.0.0', 153 'reference' => 'a64dc5d2cc7d6cafb9347f6cd802d0d06d0351c9', 154 154 'type' => 'library', 155 155 'install_path' => __DIR__ . '/../twig/twig', -
makecommerce/trunk/makecommerce/vendor-prefixed/composer/platform_check.php
r3318735 r3489939 20 20 } 21 21 } 22 trigger_error( 23 'Composer detected issues in your platform: ' . implode(' ', $issues), 24 E_USER_ERROR 22 throw new \RuntimeException( 23 'Composer detected issues in your platform: ' . implode(' ', $issues) 25 24 ); 26 25 } -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/CurlFactory.php
r3318735 r3489939 126 126 127 127 if (\count($this->handles) >= $this->maxHandles) { 128 \curl_close($resource); 128 if (PHP_VERSION_ID < 80000) { 129 \curl_close($resource); 130 } 129 131 } else { 130 132 // Remove all callback functions as they can hold onto references … … 730 732 { 731 733 foreach ($this->handles as $id => $handle) { 732 \curl_close($handle); 734 if (PHP_VERSION_ID < 80000) { 735 \curl_close($handle); 736 } 737 733 738 unset($this->handles[$id]); 734 739 } -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php
r3318735 r3489939 241 241 unset($this->delays[$id], $this->handles[$id]); 242 242 \curl_multi_remove_handle($this->_mh, $handle); 243 \curl_close($handle); 243 244 if (PHP_VERSION_ID < 80000) { 245 \curl_close($handle); 246 } 244 247 245 248 return true; -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Handler/StreamHandler.php
r3318735 r3489939 334 334 335 335 return $this->createResource( 336 function () use ($uri, &$http_response_header,$contextResource, $context, $options, $request) {336 function () use ($uri, $contextResource, $context, $options, $request) { 337 337 $resource = @\fopen((string) $uri, 'r', false, $contextResource); 338 339 // See https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_http_response_header_predefined_variable 340 if (function_exists('http_get_last_response_headers')) { 341 /** @var array|null */ 342 $http_response_header = \http_get_last_response_headers(); 343 } 344 338 345 $this->lastHeaders = $http_response_header ?? []; 339 346 -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/guzzle/src/Middleware.php
r3318735 r3489939 188 188 * formatter. 189 189 * 190 * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests.191 *192 190 * @param LoggerInterface $logger Logs messages. 193 191 * @param MessageFormatterInterface|MessageFormatter $formatter Formatter used to create message strings. 194 192 * @param string $logLevel Level at which to log requests. 193 * 194 * @phpstan-param \Psr\Log\LogLevel::* $logLevel Level at which to log requests. 195 195 * 196 196 * @return callable Returns a function that accepts the next handler. -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/LimitStream.php
r3318735 r3489939 64 64 } elseif ($this->limit === -1) { 65 65 return $length - $this->offset; 66 } else {67 return min($this->limit, $length - $this->offset);68 66 } 67 68 return min($this->limit, $length - $this->offset); 69 69 } 70 70 -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MessageTrait.php
r3318735 r3489939 30 30 } 31 31 32 /** 33 * @return static 34 */ 32 35 public function withProtocolVersion($version): MessageInterface 33 36 { … … 70 73 } 71 74 75 /** 76 * @return static 77 */ 72 78 public function withHeader($header, $value): MessageInterface 73 79 { … … 86 92 } 87 93 94 /** 95 * @return static 96 */ 88 97 public function withAddedHeader($header, $value): MessageInterface 89 98 { … … 104 113 } 105 114 115 /** 116 * @return static 117 */ 106 118 public function withoutHeader($header): MessageInterface 107 119 { … … 129 141 } 130 142 143 /** 144 * @return static 145 */ 131 146 public function withBody(StreamInterface $body): MessageInterface 132 147 { … … 173 188 if (!is_array($value)) { 174 189 return $this->trimAndValidateHeaderValues([$value]); 175 }176 177 if (count($value) === 0) {178 throw new \InvalidArgumentException('Header value can not be an empty array.');179 190 } 180 191 -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MimeType.php
r3318735 r3489939 8 8 { 9 9 private const MIME_TYPES = [ 10 '123' => 'application/vnd.lotus-1-2-3', 10 11 '1km' => 'application/vnd.1000minds.decision-model+xml', 12 '210' => 'model/step', 11 13 '3dml' => 'text/vnd.in3d.3dml', 12 14 '3ds' => 'image/x-3ds', 13 15 '3g2' => 'video/3gpp2', 14 '3gp' => 'video/3gp ',16 '3gp' => 'video/3gpp', 15 17 '3gpp' => 'video/3gpp', 16 18 '3mf' => 'model/3mf', 17 19 '7z' => 'application/x-7z-compressed', 18 20 '7zip' => 'application/x-7z-compressed', 19 '123' => 'application/vnd.lotus-1-2-3',20 21 'aab' => 'application/x-authorware-bin', 21 22 'aac' => 'audio/aac', … … 23 24 'aas' => 'application/x-authorware-seg', 24 25 'abw' => 'application/x-abiword', 25 'ac' => 'application/ vnd.nokia.n-gage.ac+xml',26 'ac' => 'application/pkix-attr-cert', 26 27 'ac3' => 'audio/ac3', 27 28 'acc' => 'application/vnd.americandynamics.acc', … … 36 37 'age' => 'application/vnd.age', 37 38 'ahead' => 'application/vnd.ahead.space', 38 'ai' => 'application/p df',39 'ai' => 'application/postscript', 39 40 'aif' => 'audio/x-aiff', 40 41 'aifc' => 'audio/x-aiff', … … 56 57 'arc' => 'application/x-freearc', 57 58 'arj' => 'application/x-arj', 58 'asc' => 'application/pgp- signature',59 'asc' => 'application/pgp-keys', 59 60 'asf' => 'video/x-ms-asf', 60 61 'asm' => 'text/x-asm', … … 67 68 'atomsvc' => 'application/atomsvc+xml', 68 69 'atx' => 'application/vnd.antix.game-component', 69 'au' => 'audio/ x-au',70 'au' => 'audio/basic', 70 71 'avci' => 'image/avci', 71 72 'avcs' => 'image/avcs', … … 78 79 'azw' => 'application/vnd.amazon.ebook', 79 80 'b16' => 'image/vnd.pco.b16', 81 'bary' => 'model/vnd.bary', 80 82 'bat' => 'application/x-msdownload', 81 83 'bcpio' => 'application/x-bcpio', 82 84 'bdf' => 'application/x-font-bdf', 83 85 'bdm' => 'application/vnd.syncml.dm+wbxml', 84 'bdoc' => 'application/x-bdoc', 86 'bdo' => 'application/vnd.nato.bindingdataobject+xml', 87 'bdoc' => 'application/bdoc', 85 88 'bed' => 'application/vnd.realvnc.bed', 86 89 'bh2' => 'application/vnd.fujitsu.oasysprs', 87 90 'bin' => 'application/octet-stream', 88 91 'blb' => 'application/x-blorb', 92 'blend' => 'application/x-blender', 89 93 'blorb' => 'application/x-blorb', 90 94 'bmi' => 'application/vnd.bmi', … … 96 100 'bpk' => 'application/octet-stream', 97 101 'bpmn' => 'application/octet-stream', 102 'brush' => 'application/vnd.procreate.brush', 103 'brushset' => 'application/vnd.procreate.brushset', 98 104 'bsp' => 'model/vnd.valve.source.compiled-map', 99 105 'btf' => 'image/prs.btif', … … 103 109 'bz2' => 'application/x-bzip2', 104 110 'c' => 'text/x-c', 111 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', 112 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', 105 113 'c4d' => 'application/vnd.clonk.c4group', 106 114 'c4f' => 'application/vnd.clonk.c4group', … … 108 116 'c4p' => 'application/vnd.clonk.c4group', 109 117 'c4u' => 'application/vnd.clonk.c4group', 110 'c11amc' => 'application/vnd.cluetrust.cartomobile-config',111 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg',112 118 'cab' => 'application/vnd.ms-cab-compressed', 113 119 'caf' => 'audio/x-caf', … … 133 139 'cdmio' => 'application/cdmi-object', 134 140 'cdmiq' => 'application/cdmi-queue', 135 'cdr' => 'application/cdr',136 141 'cdx' => 'chemical/x-cdx', 137 142 'cdxml' => 'application/vnd.chemdraw+xml', … … 148 153 'cjs' => 'application/node', 149 154 'cla' => 'application/vnd.claymore', 150 'class' => 'application/ octet-stream',155 'class' => 'application/java-vm', 151 156 'cld' => 'model/vnd.cld', 152 157 'clkk' => 'application/vnd.crick.clicker.keyboard', … … 195 200 'dbf' => 'application/vnd.dbf', 196 201 'dbk' => 'application/docbook+xml', 202 'dcm' => 'application/dicom', 203 'dcmp' => 'application/vnd.dcmp+xml', 197 204 'dcr' => 'application/x-director', 198 205 'dcurl' => 'text/vnd.curl.dcurl', … … 222 229 'dms' => 'application/octet-stream', 223 230 'dna' => 'application/vnd.dna', 231 'dng' => 'image/x-adobe-dng', 224 232 'doc' => 'application/msword', 225 'docm' => 'application/vnd.ms-word. template.macroEnabled.12',233 'docm' => 'application/vnd.ms-word.document.macroenabled.12', 226 234 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 227 235 'dot' => 'application/msword', 228 'dotm' => 'application/vnd.ms-word.template.macro Enabled.12',236 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', 229 237 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 230 238 'dp' => 'application/vnd.osgi.dp', … … 233 241 'dra' => 'audio/vnd.dra', 234 242 'drle' => 'image/dicom-rle', 243 'drm' => 'application/vnd.procreate.dream', 235 244 'dsc' => 'text/prs.lines.tag', 236 245 'dssc' => 'application/dssc+der', 246 'dst' => 'application/octet-stream', 237 247 'dtb' => 'application/x-dtbook+xml', 238 248 'dtd' => 'application/xml-dtd', … … 286 296 'f77' => 'text/x-fortran', 287 297 'f90' => 'text/x-fortran', 298 'facti' => 'image/vnd.blockfact.facti', 288 299 'fbs' => 'image/vnd.fastbidsheet', 300 'fbx' => 'application/vnd.autodesk.fbx', 289 301 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', 290 302 'fcs' => 'application/vnd.isac.fcs', 291 'fdf' => 'application/ vnd.fdf',303 'fdf' => 'application/fdf', 292 304 'fdt' => 'application/fdt+xml', 293 305 'fe_launch' => 'application/vnd.denovo.fcselayout-link', … … 331 343 'gdl' => 'model/vnd.gdl', 332 344 'gdoc' => 'application/vnd.google-apps.document', 345 'gdraw' => 'application/vnd.google-apps.drawing', 333 346 'ged' => 'text/vnd.familysearch.gedcom', 334 347 'geo' => 'application/vnd.dynageo', 335 348 'geojson' => 'application/geo+json', 336 349 'gex' => 'application/vnd.geometry-explorer', 350 'gform' => 'application/vnd.google-apps.form', 337 351 'ggb' => 'application/vnd.geogebra.file', 352 'ggs' => 'application/vnd.geogebra.slides', 338 353 'ggt' => 'application/vnd.geogebra.tool', 339 354 'ghf' => 'application/vnd.groove-help', 340 355 'gif' => 'image/gif', 341 356 'gim' => 'application/vnd.groove-identity-message', 357 'gjam' => 'application/vnd.google-apps.jam', 342 358 'glb' => 'model/gltf-binary', 343 359 'gltf' => 'model/gltf+json', 360 'gmap' => 'application/vnd.google-apps.map', 344 361 'gml' => 'application/gml+xml', 345 362 'gmx' => 'application/vnd.gmx', 346 363 'gnumeric' => 'application/x-gnumeric', 347 'gpg' => 'application/gpg-keys',348 364 'gph' => 'application/vnd.flographit', 349 365 'gpx' => 'application/gpx+xml', … … 355 371 'grv' => 'application/vnd.groove-injector', 356 372 'grxml' => 'application/srgs+xml', 373 'gscript' => 'application/vnd.google-apps.script', 357 374 'gsf' => 'application/x-font-ghostscript', 358 375 'gsheet' => 'application/vnd.google-apps.spreadsheet', 376 'gsite' => 'application/vnd.google-apps.site', 359 377 'gslides' => 'application/vnd.google-apps.presentation', 360 378 'gtar' => 'application/x-gtar', … … 388 406 'hps' => 'application/vnd.hp-hps', 389 407 'hqx' => 'application/mac-binhex40', 390 'hsj2' => 'image/hsj2',391 408 'htc' => 'text/x-component', 392 409 'htke' => 'application/vnd.kenameaapp', … … 400 417 'ice' => 'x-conference/x-cooltalk', 401 418 'icm' => 'application/vnd.iccprofile', 402 'ico' => 'image/ x-icon',419 'ico' => 'image/vnd.microsoft.icon', 403 420 'ics' => 'text/calendar', 404 421 'ief' => 'image/ief', … … 415 432 'ims' => 'application/vnd.ms-ims', 416 433 'in' => 'text/plain', 434 'indd' => 'application/x-indesign', 417 435 'ini' => 'text/plain', 418 436 'ink' => 'application/inkml+xml', … … 422 440 'ipfix' => 'application/ipfix', 423 441 'ipk' => 'application/vnd.shana.informed.package', 442 'ipynb' => 'application/x-ipynb+json', 424 443 'irm' => 'application/vnd.ibm.rights-management', 425 444 'irp' => 'application/vnd.irepository.package+xml', … … 431 450 'jad' => 'text/vnd.sun.j2me.app-descriptor', 432 451 'jade' => 'text/jade', 452 'jaii' => 'image/jaii', 453 'jais' => 'image/jais', 433 454 'jam' => 'application/vnd.jam', 434 455 'jar' => 'application/java-archive', 435 456 'jardiff' => 'application/x-java-archive-diff', 436 457 'java' => 'text/x-java-source', 458 'jfif' => 'image/jpeg', 437 459 'jhc' => 'image/jphc', 438 460 'jisp' => 'application/vnd.jisp', … … 448 470 'jpg' => 'image/jpeg', 449 471 'jpg2' => 'image/jp2', 450 'jpgm' => ' video/jpm',472 'jpgm' => 'image/jpm', 451 473 'jpgv' => 'video/jpeg', 452 474 'jph' => 'image/jph', 453 'jpm' => ' video/jpm',475 'jpm' => 'image/jpm', 454 476 'jpx' => 'image/jpx', 455 'js' => ' application/javascript',477 'js' => 'text/javascript', 456 478 'json' => 'application/json', 457 479 'json5' => 'application/json5', … … 460 482 'jsx' => 'text/jsx', 461 483 'jt' => 'model/jt', 484 'jxl' => 'image/jxl', 462 485 'jxr' => 'image/jxr', 463 486 'jxra' => 'image/jxra', … … 469 492 'kar' => 'audio/midi', 470 493 'karbon' => 'application/vnd.kde.karbon', 494 'kbl' => 'application/kbl+xml', 471 495 'kdb' => 'application/octet-stream', 472 496 'kdbx' => 'application/x-keepass2', 473 'key' => 'application/ x-iwork-keynote-sffkey',497 'key' => 'application/vnd.apple.keynote', 474 498 'kfo' => 'application/vnd.kde.kformula', 475 499 'kia' => 'application/vnd.kidspiration', … … 496 520 'less' => 'text/less', 497 521 'lgr' => 'application/lgr+xml', 498 'lha' => 'application/ octet-stream',522 'lha' => 'application/x-lzh-compressed', 499 523 'link66' => 'application/vnd.route66.link66+xml', 500 524 'list' => 'text/plain', … … 505 529 'log' => 'text/plain', 506 530 'lostxml' => 'application/lost+xml', 531 'lottie' => 'application/zip+dotlottie', 507 532 'lrf' => 'application/octet-stream', 508 533 'lrm' => 'application/vnd.ms-lrm', … … 512 537 'lvp' => 'audio/vnd.lucent.voice', 513 538 'lwp' => 'application/vnd.lotus-wordpro', 514 'lzh' => 'application/octet-stream', 539 'lzh' => 'application/x-lzh-compressed', 540 'm13' => 'application/x-msmediaview', 541 'm14' => 'application/x-msmediaview', 515 542 'm1v' => 'video/mpeg', 543 'm21' => 'application/mp21', 516 544 'm2a' => 'audio/mpeg', 545 'm2t' => 'video/mp2t', 546 'm2ts' => 'video/mp2t', 517 547 'm2v' => 'video/mpeg', 518 548 'm3a' => 'audio/mpeg', 519 'm3u' => ' text/plain',549 'm3u' => 'audio/x-mpegurl', 520 550 'm3u8' => 'application/vnd.apple.mpegurl', 521 'm4a' => 'audio/x-m4a', 551 'm4a' => 'audio/mp4', 552 'm4b' => 'audio/mp4', 522 553 'm4p' => 'application/mp4', 523 554 'm4s' => 'video/iso.segment', 524 'm4u' => ' application/vnd.mpegurl',555 'm4u' => 'video/vnd.mpegurl', 525 556 'm4v' => 'video/x-m4v', 526 'm13' => 'application/x-msmediaview',527 'm14' => 'application/x-msmediaview',528 'm21' => 'application/mp21',529 557 'ma' => 'application/mathematica', 530 558 'mads' => 'application/mads+xml', … … 557 585 'mgp' => 'application/vnd.osgeo.mapguide.package', 558 586 'mgz' => 'application/vnd.proteus.magazine', 587 'mht' => 'message/rfc822', 588 'mhtml' => 'message/rfc822', 559 589 'mid' => 'audio/midi', 560 590 'midi' => 'audio/midi', … … 565 595 'mjp2' => 'video/mj2', 566 596 'mjs' => 'text/javascript', 567 'mk3d' => 'video/ x-matroska',568 'mka' => 'audio/ x-matroska',597 'mk3d' => 'video/matroska-3d', 598 'mka' => 'audio/matroska', 569 599 'mkd' => 'text/x-markdown', 570 600 'mks' => 'video/x-matroska', 571 'mkv' => 'video/ x-matroska',601 'mkv' => 'video/matroska', 572 602 'mlp' => 'application/vnd.dolby.mlp', 573 603 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', … … 582 612 'movie' => 'video/x-sgi-movie', 583 613 'mp2' => 'audio/mpeg', 614 'mp21' => 'application/mp21', 584 615 'mp2a' => 'audio/mpeg', 585 616 'mp3' => 'audio/mpeg', … … 588 619 'mp4s' => 'application/mp4', 589 620 'mp4v' => 'video/mp4', 590 'mp21' => 'application/mp21',591 621 'mpc' => 'application/vnd.mophun.certificate', 592 622 'mpd' => 'application/dash+xml', … … 613 643 'msg' => 'application/vnd.ms-outlook', 614 644 'msh' => 'model/mesh', 615 'msi' => 'application/ x-msdownload',645 'msi' => 'application/octet-stream', 616 646 'msix' => 'application/msix', 617 647 'msixbundle' => 'application/msixbundle', … … 621 651 'msty' => 'application/vnd.muvee.style', 622 652 'mtl' => 'model/mtl', 623 'mts' => ' model/vnd.mts',653 'mts' => 'video/mp2t', 624 654 'mus' => 'application/vnd.musician', 625 655 'musd' => 'application/mmt-usd+xml', … … 640 670 'nc' => 'application/x-netcdf', 641 671 'ncx' => 'application/x-dtbncx+xml', 672 'ndjson' => 'application/x-ndjson', 642 673 'nfo' => 'text/x-nfo', 643 674 'ngdat' => 'application/vnd.nokia.n-gage.data', … … 654 685 'nt' => 'application/n-triples', 655 686 'ntf' => 'application/vnd.nitf', 656 'numbers' => 'application/ x-iwork-numbers-sffnumbers',687 'numbers' => 'application/vnd.apple.numbers', 657 688 'nzb' => 'application/x-nzb', 658 689 'oa2' => 'application/vnd.fujitsu.oasys2', … … 679 710 'ogx' => 'application/ogg', 680 711 'omdoc' => 'application/omdoc+xml', 712 'one' => 'application/onenote', 713 'onea' => 'application/onenote', 681 714 'onepkg' => 'application/onenote', 682 715 'onetmp' => 'application/onenote', … … 687 720 'oprc' => 'application/vnd.palm', 688 721 'opus' => 'audio/ogg', 689 'org' => ' text/x-org',722 'org' => 'application/vnd.lotus-organizer', 690 723 'osf' => 'application/vnd.yamaha.openscoreformat', 691 724 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', … … 705 738 'oxt' => 'application/vnd.openofficeorg.extension', 706 739 'p' => 'text/x-pascal', 740 'p10' => 'application/pkcs10', 741 'p12' => 'application/x-pkcs12', 742 'p21' => 'model/step', 707 743 'p7a' => 'application/x-pkcs7-signature', 708 744 'p7b' => 'application/x-pkcs7-certificates', 709 745 'p7c' => 'application/pkcs7-mime', 746 'p7e' => 'application/pkcs7-mime', 710 747 'p7m' => 'application/pkcs7-mime', 711 748 'p7r' => 'application/x-pkcs7-certreqresp', 712 749 'p7s' => 'application/pkcs7-signature', 713 750 'p8' => 'application/pkcs8', 714 'p10' => 'application/x-pkcs10',715 'p12' => 'application/x-pkcs12',716 751 'pac' => 'application/x-ns-proxy-autoconfig', 717 'pages' => 'application/x-iwork-pages-sffpages', 752 'pages' => 'application/vnd.apple.pages', 753 'parquet' => 'application/vnd.apache.parquet', 718 754 'pas' => 'text/x-pascal', 719 755 'paw' => 'application/vnd.pawaafile', … … 726 762 'pct' => 'image/x-pict', 727 763 'pcurl' => 'application/vnd.curl.pcurl', 728 'pcx' => 'image/ x-pcx',729 'pdb' => 'application/ x-pilot',764 'pcx' => 'image/vnd.zbrush.pcx', 765 'pdb' => 'application/vnd.palm', 730 766 'pde' => 'text/x-processing', 731 767 'pdf' => 'application/pdf', … … 738 774 'pgm' => 'image/x-portable-graymap', 739 775 'pgn' => 'application/x-chess-pgn', 740 'pgp' => 'application/pgp ',776 'pgp' => 'application/pgp-encrypted', 741 777 'phar' => 'application/octet-stream', 742 778 'php' => 'application/x-httpd-php', … … 761 797 'portpkg' => 'application/vnd.macports.portpkg', 762 798 'pot' => 'application/vnd.ms-powerpoint', 763 'potm' => 'application/vnd.ms-powerpoint. presentation.macroEnabled.12',799 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', 764 800 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', 765 801 'ppa' => 'application/vnd.ms-powerpoint', 766 'ppam' => 'application/vnd.ms-powerpoint.addin.macro Enabled.12',802 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', 767 803 'ppd' => 'application/vnd.cups-ppd', 768 804 'ppm' => 'image/x-portable-pixmap', 769 805 'pps' => 'application/vnd.ms-powerpoint', 770 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macro Enabled.12',806 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', 771 807 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 772 'ppt' => 'application/ powerpoint',773 'pptm' => 'application/vnd.ms-powerpoint.presentation.macro Enabled.12',808 'ppt' => 'application/vnd.ms-powerpoint', 809 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', 774 810 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 775 811 'pqa' => 'application/vnd.palm', … … 780 816 'ps' => 'application/postscript', 781 817 'psb' => 'application/vnd.3gpp.pic-bw-small', 782 'psd' => ' application/x-photoshop',818 'psd' => 'image/vnd.adobe.photoshop', 783 819 'psf' => 'application/x-font-linux-psf', 784 820 'pskcxml' => 'application/pskc+xml', … … 786 822 'ptid' => 'application/vnd.pvi.ptid1', 787 823 'pub' => 'application/x-mspublisher', 824 'pv' => 'application/octet-stream', 788 825 'pvb' => 'application/vnd.3gpp.pic-bw-var', 789 826 'pwn' => 'application/vnd.3m.post-it-notes', 827 'pxf' => 'application/octet-stream', 790 828 'pya' => 'audio/vnd.ms-playready.media.pya', 791 829 'pyo' => 'model/vnd.pytha.pyox', … … 807 845 'raml' => 'application/raml+yaml', 808 846 'rapd' => 'application/route-apd+xml', 809 'rar' => 'application/ x-rar',847 'rar' => 'application/vnd.rar', 810 848 'ras' => 'image/x-cmu-raster', 811 849 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', … … 822 860 'rlc' => 'image/vnd.fujixerox.edmics-rlc', 823 861 'rld' => 'application/resource-lists-diff+xml', 824 'rm' => 'a udio/x-pn-realaudio',862 'rm' => 'application/vnd.rn-realmedia', 825 863 'rmi' => 'audio/midi', 826 864 'rmp' => 'audio/x-pn-realaudio-plugin', … … 832 870 'roff' => 'text/troff', 833 871 'rp9' => 'application/vnd.cloanto.rp9', 834 'rpm' => 'a udio/x-pn-realaudio-plugin',872 'rpm' => 'application/x-redhat-package-manager', 835 873 'rpss' => 'application/vnd.nokia.radio-presets', 836 874 'rpst' => 'application/vnd.nokia.radio-preset', … … 866 904 'sdp' => 'application/sdp', 867 905 'sdw' => 'application/vnd.stardivision.writer', 868 'sea' => 'application/ octet-stream',906 'sea' => 'application/x-sea', 869 907 'see' => 'application/vnd.seemail', 870 908 'seed' => 'application/vnd.fdsn.seed', … … 911 949 'sm' => 'application/vnd.stepmania.stepchart', 912 950 'smf' => 'application/vnd.stardivision.math', 913 'smi' => 'application/smil ',914 'smil' => 'application/smil ',951 'smi' => 'application/smil+xml', 952 'smil' => 'application/smil+xml', 915 953 'smv' => 'video/x-smv', 916 954 'smzip' => 'application/vnd.stepmania.package', … … 926 964 'spq' => 'application/scvp-vp-request', 927 965 'spx' => 'audio/ogg', 928 'sql' => 'application/x-sql', 966 'sql' => 'application/sql', 967 'sqlite' => 'application/vnd.sqlite3', 968 'sqlite3' => 'application/vnd.sqlite3', 929 969 'src' => 'application/x-wais-source', 930 970 'srt' => 'application/x-subrip', … … 939 979 'stc' => 'application/vnd.sun.xml.calc.template', 940 980 'std' => 'application/vnd.sun.xml.draw.template', 941 'step' => ' application/STEP',981 'step' => 'model/step', 942 982 'stf' => 'application/vnd.wt.stf', 943 983 'sti' => 'application/vnd.sun.xml.impress.template', 944 984 'stk' => 'application/hyperstudio', 945 985 'stl' => 'model/stl', 946 'stp' => 'application/STEP', 986 'stp' => 'model/step', 987 'stpnc' => 'model/step', 947 988 'stpx' => 'model/step+xml', 948 989 'stpxz' => 'model/step-xml+zip', … … 952 993 'styl' => 'text/stylus', 953 994 'stylus' => 'text/stylus', 954 'sub' => ' text/vnd.dvb.subtitle',995 'sub' => 'image/vnd.dvb.subtitle', 955 996 'sus' => 'application/vnd.sus-calendar', 956 997 'susp' => 'application/vnd.sus-calendar', … … 971 1012 'sxm' => 'application/vnd.sun.xml.math', 972 1013 'sxw' => 'application/vnd.sun.xml.writer', 1014 'systemverify' => 'application/vnd.pp.systemverify+xml', 973 1015 't' => 'text/troff', 974 1016 't3' => 'application/x-t3vm-image', … … 992 1034 'tfx' => 'image/tiff-fx', 993 1035 'tga' => 'image/x-tga', 994 'tgz' => 'application/ x-tar',1036 'tgz' => 'application/gzip', 995 1037 'thmx' => 'application/vnd.ms-officetheme', 996 1038 'tif' => 'image/tiff', … … 1018 1060 'txf' => 'application/vnd.mobius.txf', 1019 1061 'txt' => 'text/plain', 1062 'u32' => 'application/x-authorware-bin', 1020 1063 'u3d' => 'model/u3d', 1021 1064 'u8dsn' => 'message/global-delivery-status', … … 1023 1066 'u8mdn' => 'message/global-disposition-notification', 1024 1067 'u8msg' => 'message/global', 1025 'u32' => 'application/x-authorware-bin',1026 1068 'ubj' => 'application/ubjson', 1027 1069 'udeb' => 'application/x-debian-package', … … 1079 1121 'vdi' => 'application/x-virtualbox-vdi', 1080 1122 'vds' => 'model/vnd.sap.vds', 1123 'vdx' => 'application/vnd.ms-visio.viewer', 1124 'vec' => 'application/vec+xml', 1081 1125 'vhd' => 'application/x-virtualbox-vhd', 1082 1126 'vis' => 'application/vnd.visionary', 1083 1127 'viv' => 'video/vnd.vivo', 1084 'vlc' => 'application/videolan',1085 1128 'vmdk' => 'application/x-virtualbox-vmdk', 1086 1129 'vob' => 'video/x-ms-vob', … … 1089 1132 'vrml' => 'model/vrml', 1090 1133 'vsd' => 'application/vnd.visio', 1134 'vsdx' => 'application/vnd.visio', 1091 1135 'vsf' => 'application/vnd.vsf', 1092 1136 'vss' => 'application/vnd.visio', … … 1096 1140 'vtt' => 'text/vtt', 1097 1141 'vtu' => 'model/vnd.vtu', 1142 'vtx' => 'application/vnd.visio', 1098 1143 'vxml' => 'application/voicexml+xml', 1099 1144 'w3d' => 'application/x-director', … … 1102 1147 'war' => 'application/java-archive', 1103 1148 'wasm' => 'application/wasm', 1104 'wav' => 'audio/ x-wav',1149 'wav' => 'audio/wav', 1105 1150 'wax' => 'audio/x-ms-wax', 1106 1151 'wbmp' => 'image/vnd.wap.wbmp', 1107 1152 'wbs' => 'application/vnd.criticaltools.wbs+xml', 1108 'wbxml' => 'application/ wbxml',1153 'wbxml' => 'application/vnd.wap.wbxml', 1109 1154 'wcm' => 'application/vnd.ms-works', 1110 1155 'wdb' => 'application/vnd.ms-works', … … 1125 1170 'wmf' => 'image/wmf', 1126 1171 'wml' => 'text/vnd.wap.wml', 1127 'wmlc' => 'application/ wmlc',1172 'wmlc' => 'application/vnd.wap.wmlc', 1128 1173 'wmls' => 'text/vnd.wap.wmlscript', 1129 1174 'wmlsc' => 'application/vnd.wap.wmlscriptc', 1130 1175 'wmv' => 'video/x-ms-wmv', 1131 1176 'wmx' => 'video/x-ms-wmx', 1132 'wmz' => 'application/x-ms metafile',1177 'wmz' => 'application/x-ms-wmz', 1133 1178 'woff' => 'font/woff', 1134 1179 'woff2' => 'font/woff2', … … 1145 1190 'wtb' => 'application/vnd.webturbo', 1146 1191 'wvx' => 'video/x-ms-wvx', 1192 'x32' => 'application/x-authorware-bin', 1147 1193 'x3d' => 'model/x3d+xml', 1148 1194 'x3db' => 'model/x3d+fastinfoset', … … 1151 1197 'x3dvz' => 'model/x3d+vrml', 1152 1198 'x3dz' => 'model/x3d+xml', 1153 'x32' => 'application/x-authorware-bin',1154 1199 'x_b' => 'model/vnd.parasolid.transmit.binary', 1155 1200 'x_t' => 'model/vnd.parasolid.transmit.text', … … 1163 1208 'xca' => 'application/xcap-caps+xml', 1164 1209 'xcs' => 'application/calendar+xml', 1210 'xdcf' => 'application/vnd.gov.sk.xmldatacontainer+xml', 1165 1211 'xdf' => 'application/xcap-diff+xml', 1166 1212 'xdm' => 'application/vnd.syncml.dm+xml', … … 1178 1224 'xhvml' => 'application/xv+xml', 1179 1225 'xif' => 'image/vnd.xiff', 1180 'xl' => 'application/ excel',1226 'xl' => 'application/vnd.ms-excel', 1181 1227 'xla' => 'application/vnd.ms-excel', 1182 'xlam' => 'application/vnd.ms-excel.addin.macro Enabled.12',1228 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', 1183 1229 'xlc' => 'application/vnd.ms-excel', 1184 1230 'xlf' => 'application/xliff+xml', 1185 1231 'xlm' => 'application/vnd.ms-excel', 1186 1232 'xls' => 'application/vnd.ms-excel', 1187 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macro Enabled.12',1188 'xlsm' => 'application/vnd.ms-excel.sheet.macro Enabled.12',1233 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', 1234 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', 1189 1235 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 1190 1236 'xlt' => 'application/vnd.ms-excel', 1191 'xltm' => 'application/vnd.ms-excel.template.macro Enabled.12',1237 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', 1192 1238 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 1193 1239 'xlw' => 'application/vnd.ms-excel', … … 1206 1252 'xsd' => 'application/xml', 1207 1253 'xsf' => 'application/prs.xsf+xml', 1208 'xsl' => 'application/x ml',1254 'xsl' => 'application/xslt+xml', 1209 1255 'xslt' => 'application/xslt+xml', 1210 1256 'xsm' => 'application/vnd.syncml+xml', -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/MultipartStream.php
r3318735 r3489939 24 24 * @param array $elements Array of associative arrays, each containing a 25 25 * required "name" key mapping to the form field, 26 * name, a required "contents" key mapping to a 27 * StreamInterface/resource/string, an optional 28 * "headers" associative array of custom headers, 29 * and an optional "filename" key mapping to a 30 * string to send as the filename in the part. 26 * name, a required "contents" key mapping to any 27 * value accepted by Utils::streamFor() (scalar, 28 * null, resource, StreamInterface, Iterator, or 29 * callable), or an array for nested expansion. 30 * Optional keys include "headers" (associative 31 * array of custom headers) and "filename" (string 32 * to send as the filename in the part). 33 * When "contents" is an array, it is recursively 34 * expanded into multiple fields using bracket notation 35 * (e.g., name[0][key]). Empty arrays produce no fields. 36 * The "filename" and "headers" options cannot be used 37 * with array contents. 31 38 * @param string $boundary You can optionally provide a specific boundary 32 39 * … … 90 97 throw new \InvalidArgumentException("A '{$key}' key is required"); 91 98 } 99 } 100 101 if (!is_string($element['name']) && !is_int($element['name'])) { 102 throw new \InvalidArgumentException("The 'name' key must be a string or integer"); 103 } 104 105 if (is_array($element['contents'])) { 106 if (array_key_exists('filename', $element) || array_key_exists('headers', $element)) { 107 throw new \InvalidArgumentException( 108 "The 'filename' and 'headers' options cannot be used when 'contents' is an array" 109 ); 110 } 111 112 $this->addNestedElements($stream, $element['contents'], (string) $element['name']); 113 114 return; 92 115 } 93 116 … … 102 125 103 126 [$body, $headers] = $this->createElement( 104 $element['name'],127 (string) $element['name'], 105 128 $element['contents'], 106 129 $element['filename'] ?? null, … … 111 134 $stream->addStream($body); 112 135 $stream->addStream(Utils::streamFor("\r\n")); 136 } 137 138 /** 139 * Recursively expand array contents into multiple form fields. 140 * 141 * @param array<array-key, mixed> $contents 142 */ 143 private function addNestedElements(AppendStream $stream, array $contents, string $root): void 144 { 145 foreach ($contents as $key => $value) { 146 $fieldName = $root === '' ? sprintf('[%s]', (string) $key) : sprintf('%s[%s]', $root, (string) $key); 147 148 if (is_array($value)) { 149 $this->addNestedElements($stream, $value, $fieldName); 150 } else { 151 $this->addElement($stream, ['name' => $fieldName, 'contents' => $value]); 152 } 153 } 113 154 } 114 155 -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Request.php
r3318735 r3489939 41 41 ) { 42 42 $this->assertMethod($method); 43 if (! ($uri instanceof UriInterface)) {43 if (!$uri instanceof UriInterface) { 44 44 $uri = new Uri($uri); 45 45 } -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Uri.php
r3318735 r3489939 52 52 */ 53 53 private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; 54 private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26' ];54 private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26', '+' => '%2B']; 55 55 56 56 /** @var string Uri scheme. */ … … 662 662 private static function generateQueryString(string $key, ?string $value): string 663 663 { 664 // Query string separators ("=", "&") within the key or value need to be encoded 664 // Query string separators ("=", "&") and literal plus signs ("+") within the 665 // key or value need to be encoded 665 666 // (while preventing double-encoding) before setting the query string. All other 666 667 // chars that need percent-encoding will be encoded by withQuery(). -
makecommerce/trunk/makecommerce/vendor-prefixed/guzzlehttp/psr7/src/Utils.php
r3318735 r3489939 398 398 399 399 if ($ex) { 400 /** @var $ex \RuntimeException*/400 /** @var \RuntimeException $ex */ 401 401 throw $ex; 402 402 } … … 445 445 446 446 if ($ex) { 447 /** @var $ex \RuntimeException*/447 /** @var \RuntimeException $ex */ 448 448 throw $ex; 449 449 } -
makecommerce/trunk/makecommerce/vendor-prefixed/maksekeskus/php-shipping-sdk/src/MakeCommerce/Http/HttpClientInterface.php
r3318735 r3489939 8 8 public const POST = 'POST'; 9 9 public const PUT = 'PUT'; 10 public const DEV_ BASE_URI = 'https://shipping.dev.makecommerce.net';11 public const TEST_ BASE_URI = 'https://shipping.test.makecommerce.net';12 public const LIVE_ BASE_URI = 'https://shipping.makecommerce.net';10 public const DEV_SHIPPING_URI = 'https://shipping.dev.makecommerce.net'; 11 public const TEST_SHIPPING_URI = 'https://shipping.test.makecommerce.net'; 12 public const LIVE_SHIPPING_URI = 'https://shipping.makecommerce.net'; 13 13 public const DEV_MANAGER_URI = 'https://shipping-manager.dev.makecommerce.net'; 14 14 public const TEST_MANAGER_URI = 'https://shipping-manager.test.makecommerce.net'; 15 15 public const LIVE_MANAGER_URI = 'https://shipping-manager.makecommerce.net'; 16 public const DEV_API_URI = 'https://api.dev.maksekeskus.ee'; 17 public const TEST_API_URI = 'https://api.test.maksekeskus.ee'; 18 public const LIVE_API_URI = 'https://api.maksekeskus.ee'; 19 public const REQUEST_TYPE_MANAGER = 'manager'; 20 public const REQUEST_TYPE_SHIPPING = 'shipping'; 21 public const REQUEST_TYPE_API = 'api'; 16 22 17 23 public const PICKUPPOINT_RESOURCES = [ 18 'listPickupPoints' => '/pickuppoint',19 24 'listCarrierDestinations' => '/pickuppoint/{country}' 20 ];21 22 public const COURIER_RESOURCES = [23 'listCouriers' => '/courier'24 25 ]; 25 26 … … 43 44 ]; 44 45 46 public const CONFIGURATION_RESOURCES = [ 47 'subscription' => '/v1/subscription/activate', 48 'deactivateSubscription' => '/v1/subscription/deactivate' 49 ]; 50 45 51 public const TYPE_PICKUPPOINT = 'pickuppoint'; 46 52 -
makecommerce/trunk/makecommerce/vendor-prefixed/maksekeskus/php-shipping-sdk/src/MakeCommerce/Http/MakeCommerceClient.php
r3318735 r3489939 6 6 use MakeCommercePrefix\GuzzleHttp\Client; 7 7 use MakeCommercePrefix\GuzzleHttp\Exception\GuzzleException; 8 use MakeCommercePrefix\GuzzleHttp\Exception\InvalidArgumentException; 8 9 use MakeCommercePrefix\MakeCommerceShipping\SDK\Environment; 9 10 use MakeCommercePrefix\MakeCommerceShipping\SDK\Exception\MCException; … … 16 17 * @var string 17 18 */ 19 private string $shippingUrl; 20 21 /** 22 * @var string 23 */ 24 private string $managerUrl; 25 26 /** 27 * @var string 28 */ 18 29 private string $apiUrl; 19 20 /**21 * @var string22 */23 private string $managerUrl;24 30 25 31 /** … … 64 70 switch ($environment) { 65 71 case Environment::DEV: 66 $this->set ApiUrl(self::DEV_BASE_URI);72 $this->setShippingUrl(self::DEV_SHIPPING_URI); 67 73 $this->setManagerUrl(self::DEV_MANAGER_URI); 74 $this->setApiUrl(self::DEV_API_URI); 68 75 break; 69 76 case Environment::TEST: 70 $this->set ApiUrl(self::TEST_BASE_URI);77 $this->setShippingUrl(self::TEST_SHIPPING_URI); 71 78 $this->setManagerUrl(self::TEST_MANAGER_URI); 79 $this->setApiUrl(self::TEST_API_URI); 72 80 break; 73 81 case Environment::LIVE: 74 $this->set ApiUrl(self::LIVE_BASE_URI);82 $this->setShippingUrl(self::LIVE_SHIPPING_URI); 75 83 $this->setManagerUrl(self::LIVE_MANAGER_URI); 84 $this->setApiUrl(self::LIVE_API_URI); 76 85 break; 77 86 } … … 88 97 * @return void 89 98 */ 90 public function set ApiUrl(string $url)91 { 92 $this-> apiUrl = $url;99 public function setShippingUrl(string $url) 100 { 101 $this->shippingUrl = $url; 93 102 } 94 103 … … 102 111 } 103 112 113 /** 114 * @param string $url 115 * @return void 116 */ 117 public function setApiUrl(string $url) 118 { 119 $this->apiUrl = $url; 120 } 104 121 105 122 /** … … 110 127 { 111 128 $this->locale = $locale; 112 }113 114 /**115 * @return array116 * @throws Exception117 * @throws GuzzleException|MCException118 */119 //TODO How will this change with the flattening120 public function getPickuppoints(): array121 {122 return $this->makeApiRequest(self::GET, self::PICKUPPOINT_RESOURCES['listPickupPoints'])->body;123 129 } 124 130 … … 134 140 * @param array $body 135 141 * @param array $additionalHeaders 136 * @param bool $managerRequest142 * @param string $requestType 137 143 * @return MCResponse 138 144 * @throws GuzzleException … … 144 150 array $body = [], 145 151 array $additionalHeaders = [], 146 bool $managerRequest = false152 string $requestType = self::REQUEST_TYPE_SHIPPING 147 153 ): MCResponse { 148 $uri = $this->apiUrl . $endpoint; 149 if ($managerRequest) { 150 $uri = $this->managerUrl . $endpoint; 151 } 154 if ( 155 !in_array($requestType, [ 156 self::REQUEST_TYPE_MANAGER, 157 self::REQUEST_TYPE_SHIPPING, 158 self::REQUEST_TYPE_API]) 159 ) { 160 throw new InvalidArgumentException('Unknown request type: ' . $requestType); 161 } 162 switch ($requestType) { 163 case self::REQUEST_TYPE_API: 164 $uri = $this->apiUrl; 165 break; 166 case self::REQUEST_TYPE_SHIPPING: 167 $uri = $this->shippingUrl; 168 break; 169 case self::REQUEST_TYPE_MANAGER: 170 $uri = $this->managerUrl; 171 break; 172 } 173 $uri .= $endpoint; 152 174 153 175 $headers = [ … … 183 205 184 206 return new MCResponse($response); 185 }186 187 /**188 * @return array|mixed|object189 * @throws GuzzleException190 * @throws MCException191 */192 //TODO How will this change with the flattening193 194 public function getCouriers()195 {196 return $this->makeApiRequest(self::GET, self::COURIER_RESOURCES['listCouriers'])->body;197 207 } 198 208 … … 399 409 * @throws MCException 400 410 */ 401 public function connectShop(string $userAgent, string $remoteAddr, string $orderUrl = ''): MCResponse 402 { 411 public function connectShop( 412 string $userAgent, 413 string $remoteAddr, 414 string $orderUrl = '', 415 string $webhookUrl = '' 416 ): MCResponse { 403 417 $body = [ 404 418 'shopId' => $this->shopId, 405 419 'secretKey' => $this->secretKey, 406 420 'instanceId' => $this->instanceId, 421 'webhookUrl' => $webhookUrl, 407 422 'orderUrl' => $orderUrl, 408 423 'HTTP_USER_AGENT' => $userAgent, … … 439 454 return $response->code === 200 && $response->body == 'Valid'; 440 455 } 456 457 /** 458 * @param string $subscription 459 * @return bool 460 * @throws GuzzleException 461 * @throws MCException 462 */ 463 public function changeSubscriptionPlan(string $subscription): bool 464 { 465 $subscription = strtoupper($subscription); 466 $endpoint = self::CONFIGURATION_RESOURCES['subscription']; 467 $body = ['subscription' => $subscription]; 468 $response = $this->makeApiRequest(self::POST, $endpoint, $body, [], self::REQUEST_TYPE_API); 469 470 return $response->code === 200 && $response->rawBody == 'Success'; 471 } 472 473 474 /** 475 * @return bool 476 * @throws GuzzleException 477 * @throws MCException 478 */ 479 public function deactivateSubscriptionPlan(): bool 480 { 481 $endpoint = self::CONFIGURATION_RESOURCES['deactivateSubscription']; 482 $response = $this->makeApiRequest(self::POST, $endpoint, [], [], self::REQUEST_TYPE_API); 483 484 return $response->code === 200 && $response->rawBody == 'Success'; 485 } 441 486 } -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigFilter.php
r3318735 r3489939 30 30 { 31 31 /** 32 * @param non-empty-string $name The name of the filter in Twig.33 * @param bool|null $needsCharset Whether the filter needs the charset passed as the first argument.34 * @param bool|null $needsEnvironment Whether the filter needs the environment passed as the first argument, or after the charset.35 * @param bool|null $needsContext Whether the filter needs the context array passed as the first argument, or after the charset and the environment.36 * @param string[]|null $isSafe List of formats in which you want the raw output to be printed unescaped.37 * @param string|array|null $isSafeCallback Function called at compilation time to determine if the filter is safe.38 * @param string|null $preEscapeSome filters may need to work on input that is already escaped or safe39 * @param string[]|null $preservesSafety Preserves the safety of the value that the filter is applied to.40 * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation32 * @param non-empty-string $name The name of the filter in Twig 33 * @param bool|null $needsCharset Whether the filter needs the charset passed as the first argument 34 * @param bool|null $needsEnvironment Whether the filter needs the environment passed as the first argument, or after the charset 35 * @param bool|null $needsContext Whether the filter needs the context array passed as the first argument, or after the charset and the environment 36 * @param string[]|null $isSafe List of formats in which you want the raw output to be printed unescaped 37 * @param string|array|null $isSafeCallback Function called at compilation time to determine if the filter is safe 38 * @param string|null $preEscape Some filters may need to work on input that is already escaped or safe 39 * @param string[]|null $preservesSafety Preserves the safety of the value that the filter is applied to 40 * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation 41 41 */ 42 42 public function __construct(public string $name, public ?bool $needsCharset = null, public ?bool $needsEnvironment = null, public ?bool $needsContext = null, public ?array $isSafe = null, public string|array|null $isSafeCallback = null, public ?string $preEscape = null, public ?array $preservesSafety = null, public ?DeprecatedCallableInfo $deprecationInfo = null) -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigFunction.php
r3318735 r3489939 30 30 { 31 31 /** 32 * @param non-empty-string $name The name of the function in Twig.33 * @param bool|null $needsCharset Whether the function needs the charset passed as the first argument.34 * @param bool|null $needsEnvironment Whether the function needs the environment passed as the first argument, or after the charset.35 * @param bool|null $needsContext Whether the function needs the context array passed as the first argument, or after the charset and the environment.36 * @param string[]|null $isSafe List of formats in which you want the raw output to be printed unescaped.37 * @param string|array|null $isSafeCallback Function called at compilation time to determine if the function is safe.38 * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation32 * @param non-empty-string $name The name of the function in Twig 33 * @param bool|null $needsCharset Whether the function needs the charset passed as the first argument 34 * @param bool|null $needsEnvironment Whether the function needs the environment passed as the first argument, or after the charset 35 * @param bool|null $needsContext Whether the function needs the context array passed as the first argument, or after the charset and the environment 36 * @param string[]|null $isSafe List of formats in which you want the raw output to be printed unescaped 37 * @param string|array|null $isSafeCallback Function called at compilation time to determine if the function is safe 38 * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation 39 39 */ 40 40 public function __construct(public string $name, public ?bool $needsCharset = null, public ?bool $needsEnvironment = null, public ?bool $needsContext = null, public ?array $isSafe = null, public string|array|null $isSafeCallback = null, public ?DeprecatedCallableInfo $deprecationInfo = null) -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Attribute/AsTwigTest.php
r3318735 r3489939 30 30 { 31 31 /** 32 * @param non-empty-string $name The name of the test in Twig.33 * @param bool|null $needsCharset Whether the test needs the charset passed as the first argument.34 * @param bool|null $needsEnvironment Whether the test needs the environment passed as the first argument, or after the charset.35 * @param bool|null $needsContext Whether the test needs the context array passed as the first argument, or after the charset and the environment.36 * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation32 * @param non-empty-string $name The name of the test in Twig 33 * @param bool|null $needsCharset Whether the test needs the charset passed as the first argument 34 * @param bool|null $needsEnvironment Whether the test needs the environment passed as the first argument, or after the charset 35 * @param bool|null $needsContext Whether the test needs the context array passed as the first argument, or after the charset and the environment 36 * @param DeprecatedCallableInfo|null $deprecationInfo Information about the deprecation 37 37 */ 38 38 public function __construct(public string $name, public ?bool $needsCharset = null, public ?bool $needsEnvironment = null, public ?bool $needsContext = null, public ?DeprecatedCallableInfo $deprecationInfo = null) -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Environment.php
r3318735 r3489939 42 42 class Environment 43 43 { 44 public const VERSION = '3.2 1.1';45 public const VERSION_ID = 32 101;44 public const VERSION = '3.23.0'; 45 public const VERSION_ID = 32300; 46 46 public const MAJOR_VERSION = 3; 47 public const MINOR_VERSION = 2 1;48 public const RELEASE_VERSION = 1;47 public const MINOR_VERSION = 23; 48 public const RELEASE_VERSION = 0; 49 49 public const EXTRA_VERSION = ''; 50 50 private $charset; … … 731 731 } 732 732 /** 733 * @param callable(string): (TwigTest|false) $callable 734 */ 735 public function registerUndefinedTestCallback(callable $callable): void 736 { 737 $this->extensionSet->registerUndefinedTestCallback($callable); 738 } 739 /** 733 740 * @return void 734 741 */ -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Error/Error.php
r3318735 r3489939 149 149 } 150 150 151 if (null === $template) { 152 return; // Impossible to guess the info as the template was not found in the backtrace 153 } 154 151 155 $r = new \ReflectionObject($template); 152 156 $file = $r->getFileName(); … … 159 163 while ($e = array_pop($exceptions)) { 160 164 $traces = $e->getTrace(); 161 array_unshift($traces, ['file' => $e instanceof Error ? $e->phpFile : $e->getFile(), 'line' => $e instanceof Error? $e->phpLine : $e->getLine()]);165 array_unshift($traces, ['file' => $e instanceof self ? $e->phpFile : $e->getFile(), 'line' => $e instanceof self ? $e->phpLine : $e->getLine()]); 162 166 while ($trace = array_shift($traces)) { 163 167 if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) { -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser.php
r3318735 r3489939 215 215 makecommerceprefix_trigger_deprecation('twig/twig', '3.19', \sprintf('The "%s()" method is deprecated, use "MakeCommercePrefix\Twig\ExpressionParser\Infix\ArgumentsTrait::parseNamedArguments()" instead.', __METHOD__)); 216 216 217 $parsePrimary = new \ReflectionMethod($this->parser, 'parsePrimary');217 $parsePrimaryExpression = new \ReflectionMethod($this->parser, 'parsePrimaryExpression'); 218 218 219 219 $namedArguments = false; … … 264 264 265 265 if ($definition) { 266 $value = $parsePrimary ->invoke($this->parser);266 $value = $parsePrimaryExpression->invoke($this->parser); 267 267 268 268 if (!$this->checkConstantExpression($value)) { -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Infix/ArgumentsTrait.php
r3318735 r3489939 14 14 use MakeCommercePrefix\Twig\Error\SyntaxError; 15 15 use MakeCommercePrefix\Twig\Node\Expression\ArrayExpression; 16 use MakeCommercePrefix\Twig\Node\Expression\Binary\SetBinary; 16 17 use MakeCommercePrefix\Twig\Node\Expression\Unary\SpreadUnary; 17 18 use MakeCommercePrefix\Twig\Node\Expression\Variable\ContextVariable; … … 59 60 60 61 $name = null; 61 if (($token = $stream->nextIf(Token::OPERATOR_TYPE, '=')) || ($token = $stream->nextIf(Token::PUNCTUATION_TYPE, ':'))) { 62 if ($value instanceof SetBinary) { 63 $name = $value->getNode('left')->getAttribute('name'); 64 $value = $value->getNode('right'); 65 } elseif (($token = $stream->nextIf(Token::OPERATOR_TYPE, '=')) || ($token = $stream->nextIf(Token::PUNCTUATION_TYPE, ':'))) { 62 66 if (!$value instanceof ContextVariable) { 63 67 throw new SyntaxError(\sprintf('A parameter name must be a string, "%s" given.', $value::class), $token->getLine(), $stream->getSourceContext()); -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Infix/DotExpressionParser.php
r3318735 r3489939 38 38 public function parse(Parser $parser, AbstractExpression $expr, Token $token): AbstractExpression 39 39 { 40 $nullSafe = '?.' === $token->getValue(); 40 41 $stream = $parser->getStream(); 41 42 $token = $stream->getCurrent(); … … 56 57 $attribute = new ConstantExpression($token->getValue(), $token->getLine()); 57 58 } else { 58 throw new SyntaxError(\sprintf('Expected name or number, got value "%s" of type %s.', $token->getValue(), $token->toEnglish()), $token->getLine(), $stream->getSourceContext());59 throw new SyntaxError(\sprintf('Expected name or number, got value "%s" of type "%s".', $token->getValue(), $token->toEnglish()), $token->getLine(), $stream->getSourceContext()); 59 60 } 60 61 } … … 75 76 } 76 77 77 return new GetAttrExpression($expr, $attribute, $arguments, $type, $lineno );78 return new GetAttrExpression($expr, $attribute, $arguments, $type, $lineno, $nullSafe); 78 79 } 79 80 … … 81 82 { 82 83 return '.'; 84 } 85 86 public function getAliases(): array 87 { 88 return ['?.']; 83 89 } 84 90 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/InfixExpressionParserInterface.php
r3318735 r3489939 12 12 namespace MakeCommercePrefix\Twig\ExpressionParser; 13 13 14 use MakeCommercePrefix\Twig\Error\SyntaxError; 14 15 use MakeCommercePrefix\Twig\Node\Expression\AbstractExpression; 15 16 use MakeCommercePrefix\Twig\Parser; … … 18 19 interface InfixExpressionParserInterface extends ExpressionParserInterface 19 20 { 21 /** 22 * @throws SyntaxError 23 */ 20 24 public function parse(Parser $parser, AbstractExpression $left, Token $token): AbstractExpression; 21 25 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Prefix/LiteralExpressionParser.php
r3318735 r3489939 21 21 use MakeCommercePrefix\Twig\Node\Expression\Binary\ConcatBinary; 22 22 use MakeCommercePrefix\Twig\Node\Expression\ConstantExpression; 23 use MakeCommercePrefix\Twig\Node\Expression\EmptyExpression; 23 24 use MakeCommercePrefix\Twig\Node\Expression\Variable\ContextVariable; 24 25 use MakeCommercePrefix\Twig\Parser; … … 99 100 100 101 return new ContextVariable($token->getValue(), $token->getLine()); 101 }102 103 if ('=' === $token->getValue() && ('==' === $stream->look(-1)->getValue() || '!=' === $stream->look(-1)->getValue())) {104 throw new SyntaxError(\sprintf('Unexpected operator of value "%s". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead.', $token->getValue()), $token->getLine(), $stream->getSourceContext());105 102 } 106 103 … … 175 172 $first = false; 176 173 177 $node->addElement($parser->parseExpression()); 174 // Check for empty slots (comma with no expression) 175 if ($stream->test(Token::PUNCTUATION_TYPE, ',')) { 176 $node->addElement(new EmptyExpression($stream->getCurrent()->getLine())); 177 } else { 178 $node->addElement($parser->parseExpression()); 179 } 178 180 } 179 181 $stream->expect(Token::PUNCTUATION_TYPE, ']', 'An opened sequence is not properly closed'); -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/Prefix/UnaryOperatorExpressionParser.php
r3318735 r3489939 34 34 private ?string $description = null, 35 35 private array $aliases = [], 36 private ?int $operandPrecedence = null, 36 37 ) { 37 38 } … … 42 43 public function parse(Parser $parser, Token $token): AbstractExpression 43 44 { 44 return new ($this->nodeClass)($parser->parseExpression($this-> precedence), $token->getLine());45 return new ($this->nodeClass)($parser->parseExpression($this->operandPrecedence ?? $this->precedence), $token->getLine()); 45 46 } 46 47 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExpressionParser/PrefixExpressionParserInterface.php
r3318735 r3489939 12 12 namespace MakeCommercePrefix\Twig\ExpressionParser; 13 13 14 use MakeCommercePrefix\Twig\Error\SyntaxError; 14 15 use MakeCommercePrefix\Twig\Node\Expression\AbstractExpression; 15 16 use MakeCommercePrefix\Twig\Parser; … … 18 19 interface PrefixExpressionParserInterface extends ExpressionParserInterface 19 20 { 21 /** 22 * @throws SyntaxError 23 */ 20 24 public function parse(Parser $parser, Token $token): AbstractExpression; 21 25 } -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Extension/AttributeExtension.php
r3318735 r3489939 105 105 106 106 if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) { 107 throw new \LogicException( sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFilter, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));107 throw new \LogicException(\sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFilter, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters())); 108 108 } 109 109 … … 126 126 127 127 if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) { 128 throw new \LogicException( sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFunction, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));128 throw new \LogicException(\sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigFunction, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters())); 129 129 } 130 130 … … 133 133 134 134 foreach ($method->getAttributes(AsTwigTest::class) as $reflectionAttribute) { 135 136 135 /** @var AsTwigTest $attribute */ 137 136 $attribute = $reflectionAttribute->newInstance(); … … 146 145 147 146 if ($callable->getMinimalNumberOfRequiredArguments() > $method->getNumberOfParameters()) { 148 throw new \LogicException( sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigTest, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters()));147 throw new \LogicException(\sprintf('"%s::%s()" needs at least %d arguments to be used AsTwigTest, but only %d defined.', $reflectionClass->getName(), $method->getName(), $callable->getMinimalNumberOfRequiredArguments(), $method->getNumberOfParameters())); 149 148 } 150 149 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Extension/CoreExtension.php
r3318735 r3489939 18 18 use MakeCommercePrefix\Twig\Error\SyntaxError; 19 19 use MakeCommercePrefix\Twig\ExpressionParser\Infix\ArrowExpressionParser; 20 use MakeCommercePrefix\Twig\ExpressionParser\Infix\AssignmentExpressionParser; 20 21 use MakeCommercePrefix\Twig\ExpressionParser\Infix\BinaryOperatorExpressionParser; 21 22 use MakeCommercePrefix\Twig\ExpressionParser\Infix\ConditionalTernaryExpressionParser; … … 56 57 use MakeCommercePrefix\Twig\Node\Expression\Binary\NotEqualBinary; 57 58 use MakeCommercePrefix\Twig\Node\Expression\Binary\NotInBinary; 59 use MakeCommercePrefix\Twig\Node\Expression\Binary\NotSameAsBinary; 58 60 use MakeCommercePrefix\Twig\Node\Expression\Binary\NullCoalesceBinary; 59 61 use MakeCommercePrefix\Twig\Node\Expression\Binary\OrBinary; 60 62 use MakeCommercePrefix\Twig\Node\Expression\Binary\PowerBinary; 61 63 use MakeCommercePrefix\Twig\Node\Expression\Binary\RangeBinary; 64 use MakeCommercePrefix\Twig\Node\Expression\Binary\SameAsBinary; 62 65 use MakeCommercePrefix\Twig\Node\Expression\Binary\SpaceshipBinary; 63 66 use MakeCommercePrefix\Twig\Node\Expression\Binary\StartsWithBinary; … … 334 337 // unary operators 335 338 new UnaryOperatorExpressionParser(NotUnary::class, 'not', 50, new PrecedenceChange('twig/twig', '3.15', 70)), 336 new UnaryOperatorExpressionParser(SpreadUnary::class, '...', 512, description: 'Spread operator' ),339 new UnaryOperatorExpressionParser(SpreadUnary::class, '...', 512, description: 'Spread operator', operandPrecedence: 0), 337 340 new UnaryOperatorExpressionParser(NegUnary::class, '-', 500), 338 341 new UnaryOperatorExpressionParser(PosUnary::class, '+', 500), … … 361 364 new BinaryOperatorExpressionParser(HasSomeBinary::class, 'has some', 20), 362 365 new BinaryOperatorExpressionParser(HasEveryBinary::class, 'has every', 20), 366 new BinaryOperatorExpressionParser(SameAsBinary::class, '===', 20), 367 new BinaryOperatorExpressionParser(NotSameAsBinary::class, '!==', 20), 363 368 new BinaryOperatorExpressionParser(RangeBinary::class, '..', 25), 364 369 new BinaryOperatorExpressionParser(AddBinary::class, '+', 30), … … 374 379 new ConditionalTernaryExpressionParser(), 375 380 381 // assignment operator 382 new AssignmentExpressionParser('='), 383 376 384 // Twig callables 377 385 new IsExpressionParser(), … … 418 426 makecommerceprefix_trigger_deprecation('twig/twig', '3.12', 'Passing a non-countable sequence of values to "%s()" is deprecated.', __METHOD__); 419 427 420 return $values; 421 } 422 423 $values = self::toArray($values, false); 428 $values = self::toArray($values, false); 429 } 424 430 } 425 431 … … 1695 1701 1696 1702 if (match (true) { 1697 \is_array($object) => \array_key_exists($arrayItem , $object),1703 \is_array($object) => \array_key_exists($arrayItem = (string) $arrayItem, $object), 1698 1704 $object instanceof \ArrayAccess => $object->offsetExists($arrayItem), 1699 1705 default => false, … … 1716 1722 1717 1723 if ($object instanceof \ArrayAccess) { 1718 $message = \sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist.', $arrayItem, $object::class); 1724 if (\is_object($arrayItem) || \is_array($arrayItem)) { 1725 $message = \sprintf('Key of type "%s" does not exist in ArrayAccess-able object of class "%s".', get_debug_type($arrayItem), get_debug_type($object)); 1726 } else { 1727 $message = \sprintf('Key "%s" does not exist in ArrayAccess-able object of class "%s".', $arrayItem, get_debug_type($object)); 1728 } 1719 1729 } elseif (\is_object($object)) { 1720 $message = \sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface.', $item, $object::class);1730 $message = \sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface.', $item, get_debug_type($object)); 1721 1731 } elseif (\is_array($object)) { 1722 1732 if (!$object) { … … 1881 1891 } 1882 1892 1883 throw new RuntimeError(\sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()" /"is%1$s()"/"has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source);1893 throw new RuntimeError(\sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()", "is%1$s()", "has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source); 1884 1894 } 1885 1895 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Extension/ExtensionInterface.php
r3318735 r3489939 11 11 namespace MakeCommercePrefix\Twig\Extension; 12 12 13 use MakeCommercePrefix\Twig\ExpressionParser; 13 14 use MakeCommercePrefix\Twig\ExpressionParser\ExpressionParserInterface; 14 15 use MakeCommercePrefix\Twig\ExpressionParser\PrecedenceChange; 16 use MakeCommercePrefix\Twig\Node\Expression\Binary\AbstractBinary; 17 use MakeCommercePrefix\Twig\Node\Expression\Unary\AbstractUnary; 15 18 use MakeCommercePrefix\Twig\NodeVisitor\NodeVisitorInterface; 16 19 use MakeCommercePrefix\Twig\TokenParser\TokenParserInterface; -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/ExtensionSet.php
r3318735 r3489939 26 26 use MakeCommercePrefix\Twig\NodeVisitor\NodeVisitorInterface; 27 27 use MakeCommercePrefix\Twig\TokenParser\TokenParserInterface; 28 // Help opcache.preload discover always-needed symbols 29 // @see https://github.com/php/php-src/issues/10131 30 class_exists(BinaryOperatorExpressionParser::class); 28 31 /** 29 32 * @author Fabien Potencier <fabien@symfony.com> … … 58 61 /** @var array<callable(string): (TwigFilter|false)> */ 59 62 private $filterCallbacks = []; 63 /** @var array<callable(string): (TwigTest|false)> */ 64 private $testCallbacks = []; 60 65 /** @var array<callable(string): (TokenParserInterface|false)> */ 61 66 private $parserCallbacks = []; … … 342 347 } 343 348 } 349 foreach ($this->testCallbacks as $callback) { 350 if (false !== $test = $callback($name)) { 351 return $test; 352 } 353 } 344 354 return null; 355 } 356 /** 357 * @param callable(string): (TwigTest|false) $callable 358 */ 359 public function registerUndefinedTestCallback(callable $callable): void 360 { 361 $this->testCallbacks[] = $callable; 345 362 } 346 363 public function getExpressionParsers(): ExpressionParsers -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Lexer.php
r3318735 r3489939 526 526 private function getOperatorRegex(): string 527 527 { 528 $expressionParsers = [ '='];528 $expressionParsers = []; 529 529 foreach ($this->env->getExpressionParsers() as $expressionParser) { 530 530 $expressionParsers = array_merge($expressionParsers, [$expressionParser->getName()], $expressionParser->getAliases()); -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/EmbedNode.php
r3318735 r3489939 42 42 ->repr($this->getTemplateLine()) 43 43 ->raw(', ') 44 -> string($this->getAttribute('index'))44 ->repr($this->getAttribute('index')) 45 45 ->raw(')') 46 46 ; -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/ArrayExpression.php
r3318735 r3489939 13 13 14 14 use MakeCommercePrefix\Twig\Compiler; 15 use MakeCommercePrefix\Twig\Error\SyntaxError; 15 16 use MakeCommercePrefix\Twig\Node\Expression\Unary\SpreadUnary; 16 17 use MakeCommercePrefix\Twig\Node\Expression\Unary\StringCastUnary; … … 61 62 } 62 63 64 /** 65 * Checks if the array is a sequence (keys are sequential integers starting from 0). 66 * 67 * @internal 68 */ 69 public function isSequence(): bool 70 { 71 foreach ($this->getKeyValuePairs() as $i => $pair) { 72 $key = $pair['key']; 73 if ($key instanceof TempNameExpression) { 74 $keyValue = $key->getAttribute('name'); 75 } elseif ($key instanceof ConstantExpression) { 76 $keyValue = $key->getAttribute('value'); 77 } else { 78 return false; 79 } 80 81 if ($keyValue !== $i) { 82 return false; 83 } 84 } 85 86 return true; 87 } 88 63 89 public function addElement(AbstractExpression $value, ?AbstractExpression $key = null): void 64 90 { … … 76 102 77 103 return; 104 } 105 106 // Check for empty expressions which are only allowed in destructuring 107 foreach ($this->getKeyValuePairs() as $pair) { 108 if ($pair['value'] instanceof EmptyExpression) { 109 throw new SyntaxError('Empty array elements are only allowed in destructuring assignments.', $pair['value']->getTemplateLine(), $this->getSourceContext()); 110 } 78 111 } 79 112 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Binary/MatchesBinary.php
r3318735 r3489939 14 14 use MakeCommercePrefix\Twig\Compiler; 15 15 use MakeCommercePrefix\Twig\Error\SyntaxError; 16 use MakeCommercePrefix\Twig\Node\Expression\ConstantExpression; 16 17 use MakeCommercePrefix\Twig\Node\Expression\ReturnBoolInterface; 17 use MakeCommercePrefix\Twig\Node\Expression\ConstantExpression;18 18 use MakeCommercePrefix\Twig\Node\Node; 19 19 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/FunctionNode/EnumCasesFunction.php
r3318735 r3489939 1 1 <?php 2 3 /* 4 * This file is part of Twig. 5 * 6 * (c) Fabien Potencier 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 2 11 3 12 namespace MakeCommercePrefix\Twig\Node\Expression\FunctionNode; -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/FunctionNode/EnumFunction.php
r3318735 r3489939 1 1 <?php 2 3 /* 4 * This file is part of Twig. 5 * 6 * (c) Fabien Potencier 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 2 11 3 12 namespace MakeCommercePrefix\Twig\Node\Expression\FunctionNode; -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/GetAttrExpression.php
r3318735 r3489939 26 26 * @param ArrayExpression|NameExpression|null $arguments 27 27 */ 28 public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno )28 public function __construct(AbstractExpression $node, AbstractExpression $attribute, ?AbstractExpression $arguments, string $type, int $lineno, bool $nullSafe = false) 29 29 { 30 30 $nodes = ['node' => $node, 'attribute' => $attribute]; … … 37 37 } 38 38 39 parent::__construct($nodes, ['type' => $type, 'ignore_strict_check' => false, 'optimizable' => true], $lineno);39 parent::__construct($nodes, ['type' => $type, 'ignore_strict_check' => false, 'optimizable' => !$nullSafe, 'null_safe' => $nullSafe], $lineno); 40 40 } 41 41 … … 50 50 $env = $compiler->getEnvironment(); 51 51 $arrayAccessSandbox = false; 52 $nullSafe = $this->getAttribute('null_safe'); 53 $objectVar = null; 52 54 53 55 // optimize array calls … … 94 96 } 95 97 96 $compiler->raw('CoreExtension::getAttribute($this->env, $this->source, ');97 98 98 if ($this->getAttribute('ignore_strict_check')) { 99 99 $this->getNode('node')->setAttribute('ignore_strict_check', true); 100 100 } 101 101 102 if ($nullSafe) { 103 $objectVar = '$'.$compiler->getVarName(); 104 $compiler 105 ->raw('((null === ('.$objectVar.' = ') 106 ->subcompile($this->getNode('node')) 107 ->raw(')) ? null : '); 108 } 109 110 $compiler->raw('CoreExtension::getAttribute($this->env, $this->source, '); 111 112 if ($nullSafe) { 113 $compiler->raw($objectVar); 114 } else { 115 $compiler->subcompile($this->getNode('node')); 116 } 117 102 118 $compiler 103 ->subcompile($this->getNode('node'))104 119 ->raw(', ') 105 120 ->subcompile($this->getNode('attribute')) … … 124 139 $compiler->raw(')'); 125 140 } 141 142 if ($nullSafe) { 143 $compiler->raw(')'); 144 } 126 145 } 127 146 128 private function changeIgnoreStrictCheck( GetAttrExpression$node): void147 private function changeIgnoreStrictCheck(self $node): void 129 148 { 130 149 $node->setAttribute('optimizable', false); 131 150 $node->setAttribute('ignore_strict_check', true); 132 151 133 if ($node->getNode('node') instanceof GetAttrExpression) {152 if ($node->getNode('node') instanceof self) { 134 153 $this->changeIgnoreStrictCheck($node->getNode('node')); 135 154 } -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/Expression/Test/DefinedTest.php
r3318735 r3489939 16 16 use MakeCommercePrefix\Twig\Error\SyntaxError; 17 17 use MakeCommercePrefix\Twig\Node\Expression\AbstractExpression; 18 use MakeCommercePrefix\Twig\Node\Expression\ArrayExpression;19 use MakeCommercePrefix\Twig\Node\Expression\BlockReferenceExpression;20 use MakeCommercePrefix\Twig\Node\Expression\ConstantExpression;21 use MakeCommercePrefix\Twig\Node\Expression\FunctionExpression;22 use MakeCommercePrefix\Twig\Node\Expression\GetAttrExpression;23 use MakeCommercePrefix\Twig\Node\Expression\MacroReferenceExpression;24 use MakeCommercePrefix\Twig\Node\Expression\MethodCallExpression;25 18 use MakeCommercePrefix\Twig\Node\Expression\SupportDefinedTestInterface; 26 19 use MakeCommercePrefix\Twig\Node\Expression\TestExpression; 27 use MakeCommercePrefix\Twig\Node\Expression\Variable\ContextVariable;28 20 use MakeCommercePrefix\Twig\Node\Node; 29 21 use MakeCommercePrefix\Twig\TwigTest; -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Node/TypesNode.php
r3318735 r3489939 1 1 <?php 2 3 /* 4 * This file is part of Twig. 5 * 6 * (c) Fabien Potencier 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 2 11 3 12 namespace MakeCommercePrefix\Twig\Node; -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Parser.php
r3318735 r3489939 77 77 } 78 78 79 /** 80 * @throws SyntaxError 81 */ 79 82 public function parse(TokenStream $stream, $test = null, bool $dropNeedle = false): ModuleNode 80 83 { … … 159 162 } 160 163 164 /** 165 * @throws SyntaxError 166 */ 161 167 public function subparse($test, bool $dropNeedle = false): Node 162 168 { … … 495 501 $name = $name.' '.$this->getCurrentToken()->getValue(); 496 502 497 if ($test = $this->env->getTest($name)) { 498 $this->stream->next(); 499 } 503 try { 504 $test = $this->env->getTest($name); 505 } catch (SyntaxError $e) { 506 if (!$this->shouldIgnoreUnknownTwigCallables()) { 507 throw $e; 508 } 509 510 $test = null; 511 } 512 $this->stream->next(); 500 513 } else { 501 $test = $this->env->getTest($name); 514 try { 515 $test = $this->env->getTest($name); 516 } catch (SyntaxError $e) { 517 if (!$this->shouldIgnoreUnknownTwigCallables()) { 518 throw $e; 519 } 520 521 $test = null; 522 } 502 523 } 503 524 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Resources/debug.php
r3318735 r3489939 2 2 3 3 /* 4 * This file is part of the Symfony package.4 * This file is part of Twig. 5 5 * 6 * (c) Fabien Potencier <fabien@symfony.com>6 * (c) Fabien Potencier 7 7 * 8 8 * For the full copyright and license information, please view the LICENSE -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Resources/string_loader.php
r3318735 r3489939 2 2 3 3 /* 4 * This file is part of the Symfony package.4 * This file is part of Twig. 5 5 * 6 * (c) Fabien Potencier <fabien@symfony.com>6 * (c) Fabien Potencier 7 7 * 8 8 * For the full copyright and license information, please view the LICENSE -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Runtime/EscaperRuntime.php
r3318735 r3489939 18 18 final class EscaperRuntime implements RuntimeExtensionInterface 19 19 { 20 /** @var array<string, callable(string $string, string $charset): string> */20 /** @var array<string, callable(string, string): string> */ 21 21 private $escapers = []; 22 22 … … 140 140 case 'html': 141 141 // see https://www.php.net/htmlspecialchars 142 143 if ('UTF-8' === $charset) { 144 return htmlspecialchars($string, \ENT_QUOTES | \ENT_SUBSTITUTE, 'UTF-8'); 145 } 142 146 143 147 // Using a static variable to avoid initializing the array … … 196 200 * \" is also supported but omitted, because the resulting string is not HTML safe. 197 201 */ 198 static $shortMap = [202 $short = match ($char) { 199 203 '\\' => '\\\\', 200 204 '/' => '\\/', … … 204 208 "\x0D" => '\r', 205 209 "\x09" => '\t', 206 ]; 207 208 if (isset($shortMap[$char])) { 209 return $shortMap[$char]; 210 default => false, 211 }; 212 213 if ($short) { 214 return $short; 210 215 } 211 216 … … 268 273 */ 269 274 $chr = $matches[0]; 270 $ord = \ord($chr );275 $ord = \ord($chr[0]); 271 276 272 277 /* … … 289 294 * XML Parsing Error: undefined entity 290 295 */ 291 static $entityMap = [296 return match ($ord) { 292 297 34 => '"', /* quotation mark */ 293 298 38 => '&', /* ampersand */ 294 299 60 => '<', /* less-than sign */ 295 300 62 => '>', /* greater-than sign */ 296 ]; 297 298 if (isset($entityMap[$ord])) { 299 return $entityMap[$ord]; 300 } 301 302 return \sprintf('&#x%02X;', $ord); 301 default => \sprintf('&#x%02X;', $ord), 302 }; 303 303 } 304 304 -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Template.php
r3318735 r3489939 271 271 * @param string|TemplateWrapper|array<string|TemplateWrapper> $template 272 272 */ 273 protected function load(string|TemplateWrapper|array $template, int $line, int|null$index = null): self273 protected function load(string|TemplateWrapper|array $template, int $line, ?int $index = null): self 274 274 { 275 275 try { … … 316 316 * @deprecated since Twig 3.21 and will be removed in 4.0. Use Template::load() instead. 317 317 */ 318 protected function loadTemplate($template, $templateName = null, int|null $line = null, int|null$index = null): self|TemplateWrapper318 protected function loadTemplate($template, $templateName = null, ?int $line = null, ?int $index = null): self|TemplateWrapper 319 319 { 320 320 makecommerceprefix_trigger_deprecation('twig/twig', '3.21', 'The "%s" method is deprecated.', __METHOD__); -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/Test/IntegrationTestCase.php
r3318735 r3489939 92 92 } 93 93 /** 94 * @return array<callable(string): (TwigTest|false)> 95 */ 96 protected function getUndefinedTestCallbacks(): array 97 { 98 return []; 99 } 100 /** 94 101 * @return array<callable(string): (TokenParserInterface|false)> 95 102 */ … … 219 226 foreach ($this->getUndefinedFunctionCallbacks() as $callback) { 220 227 $twig->registerUndefinedFunctionCallback($callback); 228 } 229 foreach ($this->getUndefinedTestCallbacks() as $callback) { 230 $twig->registerUndefinedTestCallback($callback); 221 231 } 222 232 foreach ($this->getUndefinedTokenParserCallbacks() as $callback) { -
makecommerce/trunk/makecommerce/vendor-prefixed/twig/twig/src/TokenParser/GuardTokenParser.php
r3318735 r3489939 33 33 34 34 $nameToken = $stream->expect(Token::NAME_TYPE); 35 $name = $nameToken->getValue(); 36 if ('test' === $typeToken->getValue() && $stream->test(Token::NAME_TYPE)) { 37 // try 2-words tests 38 $name .= ' '.$stream->getCurrent()->getValue(); 39 $stream->next(); 40 } 35 41 36 42 try { 37 $exists = null !== $this->parser->getEnvironment()->$method($name Token->getValue());43 $exists = null !== $this->parser->getEnvironment()->$method($name); 38 44 } catch (SyntaxError) { 39 45 $exists = false; -
makecommerce/trunk/payment/gateway/woocommerce/woocommerce.php
r3447693 r3489939 12 12 13 13 public $id = MAKECOMMERCE_PLUGIN_ID; 14 public $version = '4.0. 6';14 public $version = '4.0.7'; 15 15 16 16 public $payment_return_url; -
makecommerce/trunk/payment/payment.php
r3208955 r3489939 288 288 } 289 289 290 // Lock processing for this order+status to avoid race conditions between callback and redirect 291 $lock_key = '_makecommerce_payment_lock_status_' . $paymentStatus; 292 $locked = add_post_meta( $orderId, $lock_key, time(), true ); 293 if ( ! $locked ) { 294 return $returnUrl; 295 } 296 290 297 //check if we already processed this status in the past. 291 298 if ( $check_status && $order->get_meta( '_makecommerce_payment_processed_status', true ) == $paymentStatus ) {
Note: See TracChangeset
for help on using the changeset viewer.