View Single Post
  #5  
Old 03-31-2017, 03:10 PM
 
BurtonTech BurtonTech is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 46
 

Default Re: Payment Capture Issues

Quote:
Originally Posted by qualiteam
If the support staff (with the access to the server) can't find the cause easily, I doubt we can do it by discussing the problem in these forums
This is definitely something that should be debugged right on the server.

I'm still hopeful that support will pull through and attempt a solution, but I'd rather see if *anyone* out there might be experiencing similar XC5 frustrations and want to devise a workaround. I've seen this bug occurring for almost two years now, so I'm sure many other people have encountered it.

It appears the source of this problem is that duplicate xpcBackReference values for a particular transaction_id can be inserted into the xc_payment_transaction_data table. Unfortunately the xpcBackReference entries have different xpc_txnid values which prevents the X-Cart from properly communicating with X-Payments. When the X-Cart tries to locate the xpc_txnid, it can only grab a single value and it's not always the correct one:

Code:
/** * Find trannsaction by X-Payments back refernece to X-Cart * * @param string $xpcBackReference X-Payment connector Backend reference * * @return \XLite\Model\Payment\Transaction */ protected function searchTransactionByBackReference($xpcBackReference) { $transactionData = \XLite\Core\Database::getRepo('XLite\Model\Payment\TransactionData') ->findOneBy(array('value' => $xpcBackReference, 'name' => 'xpcBackReference')); return $transactionData ? $transactionData->getTransaction() : null; }

It would be great if that function could be improved to handle issues where duplicate xpcBackReference values exist with conflicting xpc_txnid values, but I suspect the bug allowing for duplicate values is being generated by the XPaymentsClient. It appears the X-Payments server does nothing to manage these ID's and prevent duplication either.

The impact of this bug could easily be tested by simply creating duplicate xpcBackReference's with different xpc_txnid's for the same transaction_id in the relevant X-Cart and X-Payment tables. Then hopefully the maintenance team could write code to overcome these scenarios while they figure out how to prevent the duplication values in the first place.

I'd like to avoid spending more time reverse engineering this code, so if there are any experts out there or documentation that could help ID the problem, that would be extremely helpful.

Thanks.
__________________
X-Cart Gold 4.4.5
X-Cart Ultimate 5.2.22
X-Cart Business 5.3.2.13
X-Payments 3
Reply With Quote