Paypal Payments Pro Causing Random Incomplete Orders

Using Paypal Payments Pro, we are randomly getting Incomplete Orders that state:

The transaction was refused as a result of a duplicate invoice ID supplied. Attempt with a new invoice ID

Any suggestions on what the cause might be and the fix?

David

CS-Cart 4.3.10

app/addons/paypal/payments/paypal_pro.php

Try to replace:

$paypal_order_id = $processor_data['processor_params']['order_prefix'] . (($order_info['repaid']) ? ($order_id . '_' . $order_info['repaid']) : $order_id);

with:

$paypal_order_id = $processor_data['processor_params']['order_prefix'] . (($order_info['repaid']) ? ($order_id . '_' . $order_info['repaid']) : $order_id) . '_' . TIME;

I made your suggested mod, I believe now we are getting:

(10412) Duplicate invoice: Payment has already been made for this InvoiceID.

I made your suggested mod, I believe now we are getting:

(10412) Duplicate invoice: Payment has already been made for this InvoiceID.

Please contact support team. The mentioned code creates unique Invoice ID for each transaction.

Please contact support team. The mentioned code creates unique Invoice ID for each transaction.

hello, can this be solved in paypal express ?

app/addons/paypal/paypal_express.functions.php

Try to replace

$pp_order_id = $processor_data['processor_params']['order_prefix'] . (($order_info['repaid']) ? ($order_info['order_id'] . '_' . $order_info['repaid']) : $order_info['order_id']);

with

$pp_order_id = $processor_data['processor_params']['order_prefix'] . (($order_info['repaid']) ? ($order_info['order_id'] . '_' . $order_info['repaid']) : $order_info['order_id']) ) . '_' . TIME;

(!) Not tested

the solutions to this problem is simple : the solution is simple... the prefix on paypal setting has to be added..its also in cs cart docs

i have also overseen this part where it says to add a prefix to paypal so that the invoices not match

Prefix will be the same for all orders. Our solution makes order_id for each transaction unique