Open jakemumu opened 1 year ago
This patch has fixed it:
# frozen_string_literal: true
module Decorators
module SolidusPaypalCommercePlatform
module PaypalOrder
def breakdown
breakdown = super
breakdown[:discount] = price(@order.promo_total.abs)
breakdown
end
::SolidusPaypalCommercePlatform::PaypalOrder.prepend(self)
end
end
end
Looks legit. Can you please open a PR?
Sure, should I do it against master?
The PayPal Order Breakdown is Incorrect:
Solidus Version: 3.1.8
To Reproduce
Step 1 - create an order. Step 2 - add promotions on the order, ensure that one of the promotions is:
eligible: false
-- ours looks like:Current behavior The order totals will be incorrect and PayPal will reject and not process the order. This is because all non eligible promotions will also be included inside of:
discount: price(@order.all_adjustments.promotion.sum(&:amount).abs)
Expected behavior The order totals should always be perfect
Screenshots
Desktop (please complete the following information): NA
Smartphone (please complete the following information): NA
Additional context NA