Amount Mismatch error
-
Hi,
We have a plugin that allows us to collect partial payment for the order but that is not working with your payment plugin and giving a error of “Amount Mismatch !”
we have identified the cause of the issue see if you can give us some solution for this by adding a filter function in your plugin
Say order total was 100 and we allowed them to make partial payment of 10 and checkout all this works file and the amount goes through your payment plugin well but after words your payment plugin reruns a check for amount match at 2 places that creates the issue
Inside this file of your
phonepe-payment-solutions\PPEX_WC_PG_Client.php
in function handle_callback_response and check_phonepe_response
you are running a check for the order total if you can add a filter function for the
function handle_callback_response
$amount = sanitize_text_field($order->get_total());
to
$amount = apply_filters(‘order_amount_filter’, sanitize_text_field($order->get_total()), $order);
function check_phonepe_response
$amount_in_rupees = sanitize_text_field($order->get_total());
to
$amount_in_rupees = apply_filters(‘order_amount_filter’, sanitize_text_field($order->get_total()), $order);
then we will be able to modify the partial amount that was paid for and let the order go through without error
- The topic ‘Amount Mismatch error’ is closed to new replies.