PayPal Standard + Reward Points - BUG Calculating TOTAL

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
SCENARIO:
1) I'm using Reward Points
2) I have 10 Points left ($1 x point)
3) I'm using PayPal Standard
4) I've set to Pass product names and order totals to PayPal
5) I've purchase 2 bottles of wine for $15 each.
6) On Check Out I use all my points ($10)

When the system gets ready to send me to PayPal I should be seeing 2 products for $30 and $10 Discount.

Line 176 of the procedure "PostProcessingPayment(PostProcessPaymentRequest postProcessPaymentRequest)"
is responsible for preparing the HTML Product Names and Totals to be sent to PayPal.

BUG:
The following block wrongly calculates the Total on the last line.

                 foreach (var item in cartItems)
                {
                    var unitPriceExclTax = item.UnitPriceExclTax;
                    //round
                    var unitPriceExclTaxRounded = Math.Round(unitPriceExclTax, 2);
                    //get the product variant so we can get the name
                    builder.AppendFormat("&item_name_" + x + "={0}", HttpUtility.UrlEncode(item.ProductVariant.FullProductName));
                    builder.AppendFormat("&amount_" + x + "={0}", unitPriceExclTaxRounded.ToString("0.00", CultureInfo.InvariantCulture));
                    builder.AppendFormat("&quantity_" + x + "={0}", item.Quantity);
                    x++;
                    cartTotal += unitPriceExclTax;
                }

BUG FIX:
the last line of the block should be: >> cartTotal += unitPriceExclTax * item.Quantity;

....where we take in consideration the item.Quantity.


===============================================
The wrong info is sent to PayPal ..if this is not fixed !!!

Regards,
Filu
12 years ago
Thanks a lot! Fixed. Really weird that nobody mentioned it before =(((
12 years ago
I hope it didn't create too many inconsistencies with the Accounting dpt :--)

Can you please quickly check this for me?
https://www.nopcommerce.com/boards/t/14465/how-to-use-discounts-.aspx
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.