Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix amount mismatch #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pixelcode-ro
Copy link

No description provided.

@chirag-ontap
Copy link

No description provided.

@ionandreidaniel can you provide steps to replicate the faced scenario precisely?
So we can able to re-create it and accordingly we can review further to validate suggested change from your side.

@pixelcode-ro
Copy link
Author

Let's assume $order->get_total() = 599.80

absint($order->get_total() * 100) returns 59979
(int) round($order->get_total() * 100) returns 59980

In this case, the if statement condition inside the return_handler function above is never met.

If we reach here

$response = parent::process_standard_payments( $order, $cart_token );

then inside process_standard_payments function

$payment_response = $this->do_payment( $order, $order->get_total(), $pass_tokens );

do_payment will be called with the amount of 599.80.

public function do_payment( $order, $amount = 0, $token = array() ) {

Here

if ( (int) $amount !== $this->get_total( $order ) ) {

(int) $amount will be equal to 599, while $this->get_total( $order ) will return (int) round( $order->get_total() * 100 ) which is equal to 59980, so amount mismatch error will be thrown.

@chirag-ontap
Copy link

@ionandreidaniel We have tried to replicate as per provided details. However, not able to.

Can you provide more helpful details to replicate it?

Your WordPress and WooCommerce version?
Simplify Module version?
Step by step details?
Any configuration which has to be in place?
Any custom code change in your environment for price rounding or any other?

@chirag-ontap
Copy link

@ionandreidaniel We have tried to replicate as per provided details. However, not able to.

Can you provide more helpful details to replicate it?

Your WordPress and WooCommerce version? Simplify Module version? Step by step details? Any configuration which has to be in place? Any custom code change in your environment for price rounding or any other?

@ionandreidaniel can you provide the requested details?

@davids123
Copy link

All orders are coming with the pending status

@chirag-ontap
Copy link

All orders are coming with the pending status

@davids123 Thank you for raising your faced issue.

We need more details to review further so we can able to assist you further.

Can you raise a support ticket with following information?

To raised a support ticket. Kindly create an account on https://www.ontapgroup.com/uk/customer/account/login/ and raise support ticket.

(1) What is the Module version installed?

(2) What is your WordPress and WooCommerce Version?

(3) Provide the exact step to reproduce the issue? Along with helpful files, screenshots and videos.

@chirag-ontap
Copy link

All orders are coming with the pending status

@davids123 Thank you for raising your faced issue.

We need more details to review further so we can able to assist you further.

Can you raise a support ticket with following information?

To raised a support ticket. Kindly create an account on https://www.ontapgroup.com/uk/customer/account/login/ and raise support ticket.

(1) What is the Module version installed?

(2) What is your WordPress and WooCommerce Version?

(3) Provide the exact step to reproduce the issue? Along with helpful files, screenshots and videos.

@davids123 we have not heard back on this. Can you provide details so we can take it further for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants