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
Using any payment method the order confirmation email, in the payment block, has the total displayed as 0.00. The total grand total of the order is correct.
I believe that this happens because the getTotal() in Ebanx_Gateway_Payment uses the ebanx_local_amount field from the payment table before it is defined in the persistPayment() method.
/**
* @return float
*/
public function getTotal()
{
$quote = $this->getInfoInstance()->getQuote();
if (!$quote) {
return $this->getInfoInstance()->getOrder()->getPayment()->getEbanxLocalAmount();
}
return $quote->getGrandTotal();
}
Changing the return line when !$quote to return $this->getInfoInstance()->getOrder()->getGrandTotal() will solve this issue and display the correct order amount.
I've looked into this issue further and the local amount displays correctly in the case of Brazil (the local amount includes de IOF tax) so I've made a little change as a failsafe.
/**
* @return float
*/
public function getTotal()
{
$quote = $this->getInfoInstance()->getQuote();
if (!$quote) {
$order = $this->getInfoInstance()->getOrder();
$amount = $order->getPayment()->getEbanxLocalAmount();
if ($amount == 0) {
$amount = $order->getGrandTotal();
}
return $amount;
}
return $quote->getGrandTotal();
}
Any caveats to this change? Can you please verify if you can replicate the issue?
Best regards,
Ricardo
The text was updated successfully, but these errors were encountered:
Hello Ebanx,
Using any payment method the order confirmation email, in the payment block, has the total displayed as
0.00
. The total grand total of the order is correct.I believe that this happens because the
getTotal()
inEbanx_Gateway_Payment
uses theebanx_local_amount
field from the payment table before it is defined in thepersistPayment()
method.Changing the return line when
!$quote
toreturn $this->getInfoInstance()->getOrder()->getGrandTotal()
will solve this issue and display the correct order amount.I've looked into this issue further and the local amount displays correctly in the case of Brazil (the local amount includes de IOF tax) so I've made a little change as a failsafe.
Any caveats to this change? Can you please verify if you can replicate the issue?
Best regards,
Ricardo
The text was updated successfully, but these errors were encountered: