0

I would like to know that why XCart have public id instead of PayPal transaction id in their order invoices, And is there any way to displays the PayPal transaction id in invoice after successful order completion through PayPal in XCart .

1 Answers1

0

The reason X-Cart displays internal transaction ID is that if a transaction is not through and you provide a merchant with internal ID, they can go to Orders > Payment transactions section in admin area and will find the transaction details. Paypal's transaction ID would not allow that.

If you want to pull Paypal's transaction ID, you can do that like this:

require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'top.inc.php');

$return = \XLite\Core\Database::getRepo('\XLite\Model\Order')->find(ORDER_ID);

foreach ($return->getEvents() as $event) {
    foreach ($event->getDetails() as $detail) {        
        if ($detail->name == 'Unique customer ID') {
            var_dump($detail->value);
        }
    }
}
Tony
  • 149
  • 5