mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-07-28 01:57:35 +08:00
WooCommerce allows fractional cart/order quantities (e.g. 0.3, via plugins like Measurement Price Calculator), which ItemFactory truncated via (int) cast to 0. PayPal's API requires quantity >= 1 and rejects 0 with INVALID_PARAMETER_SYNTAX, failing checkout entirely. For quantities between 0 and 1, normalize to a single PayPal unit priced at the full line subtotal (and re-derive unit tax accordingly) instead of truncating the quantity away. Quantities >= 1 are unaffected. |
||
|---|---|---|
| .. | ||
| src | ||
| composer.json | ||
| factories.php | ||
| module.php | ||
| services.php | ||