mirror of
https://gh.wpcy.net/https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2026-06-13 12:20:48 +08:00
Use WooCommerce's get_total() as the authoritative order amount instead of deriving it from breakdown components. When the two values differ by a rounding delta (typically ±1 cent from inclusive-tax calculations), absorb the difference into the tax breakdown component so PayPal's invariant — amount.value === sum(breakdown) — continues to hold. Without this fix, PayPal would capture a component-derived total that could differ from the WooCommerce order total by one cent, causing full refunds to be rejected with REFUND_AMOUNT_EXCEEDED. Add regression tests covering: - Zero delta (components already match get_total) - ±1 cent delta (the inclusive-tax rounding case) - Parametrised invariant suite across discounts and fees |
||
|---|---|---|
| .. | ||
| Authentication | ||
| Endpoint | ||
| Entity | ||
| Exception | ||
| Factory | ||
| Helper | ||
| Repository | ||