Magento get PayPal Transaction Id


Magento get PayPal Transaction Id : You can get the paypal transaction id generated from the order payment object or if you can get it from the invoice generated directly. Here we are going to explain the method to get the paypal transaction id.


Magento get PayPal Transaction Id

You can get Paypal Transaction Id as Below :

Magento get PayPal Transaction Id from Order Payment Object

//suppose you have order object as $order.
$order = Mage::getModel("sales/order")->load($id);
$transactionId = $order->getPayment()->getLastTransId();

Magento get PayPal Transaction Id From Invoice

You can get detailed Paypal Transaction Id as Below :

Magento get PayPal Transaction from Invoice

$invoice = Mage::getModel("sales/order_invoice")->load($invoiceId);
$transaction_id  = $invoice->getTransactionId();

Advertisements

Add Comment

📖 Read More