You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(amount-factory): derive total from breakdown components to prevent PayPal PATCH rejection
WC_Cart::get_total() can diverge from the arithmetic sum of its component
getters (get_subtotal, get_shipping_total, get_total_tax) by ±$0.01 due to
per-item tax rounding. PayPal's PATCH order API requires amount.value to
exactly equal item_total + shipping + tax_total - discount, so when the
two values differ the PATCH is rejected and the buyer cannot change their
shipping address in the one-time pay (Fastlane guest) flow.
Fix from_wc_cart(): compute total in integer cents from the same component
floats used to build the breakdown, so the formatted values are always
internally consistent.
Fix from_store_api_cart(): use integer minor-unit arithmetic on Store API
values (already in cents) and include total_fees in item_total to match
from_wc_cart() and cover carts with WooCommerce fees.
0 commit comments