Jump to content

Edit History

Ress

Ress

In the validatedOrder function of the PaymentModule class, the amount paid (which is received, rounded to 0 decimal places) and the total shopping cart are compared again, and if the amounts are not equal, it goes to that status.

if ($order_status->logable && number_format($cart_total_paid, _PS_PRICE_COMPUTE_PRECISION_) != number_format($amount_paid, _PS_PRICE_COMPUTE_PRECISION_)) {
	$id_order_state = Configuration::get('PS_OS_ERROR');
}

As you can see, here the rounding is done by the variable "_PS_PRICE_COMPUTE_PRECISION_", and in the cash on delivery module, getOrderTotal() function, it is done by $computePrecision = Context::getContext()->getComputingPrecision();

Probably you should adjust the functions slightly so that the same value is used for rounding.

Ress

Ress

In the validatedOrder function of the PaymentModule class, the amount paid (which is received, rounded to 0 decimal places) and the total shopping cart are compared again, and if the amounts are not equal, it goes to that status.

if ($order_status->logable && number_format($cart_total_paid, _PS_PRICE_COMPUTE_PRECISION_) != number_format($amount_paid, _PS_PRICE_COMPUTE_PRECISION_)) {
	$id_order_state = Configuration::get('PS_OS_ERROR');
}

As you can see, here the rounding is done by the variable "_PS_PRICE_COMPUTE_PRECISION_", and in the cash on delivery module, getOrderTotal() function, it is done by $computePrecision = Context::getContext()->getComputingPrecision();

You should adjust the functions slightly so that the same value is used for rounding.

×
×
  • Create New...