I'm developing a shopping cart that at a certain price reaches a range, it calculates a discount for the customer, I calculate the freight and the freight value is correctly added to the discount value, but I realized that when I finished the order and passed the values for the PagSeguro
the value goes without the discounts, step for them what I am asked, this way:
if ($TPFrete == 3){ $peso = 0; $paymentRequest->addItem($cod_prod, $nome_prod, $quantidade_prod, $vlr, $peso); } else { $paymentRequest->addItem($cod_prod, $nome_prod, $quantidade_prod, $vlr, $peso, $VLRFrete); }
I believe that on the page of PagSeguro
it calculates the quantity x value and there the discount does not appear, is there any way to pass the value of this discount to PagSeguro?
I saw that there is an option in the documentation that makes it possible to calculate discount, here:
$paymentRequest->setExtraAmount
But I already have the calculated value before moving on to them, is there any tip? The service of PagSeguro did not return my questions, so this post here, I believe to be even faster.