0

I have problem in show Transaction ID to admin ( refer the image ), how can we store the transaction table in database. I'm new to magento.

I have searched for solution but haven't got success.

Please give me right solution for this problem.

Thanks in advance.

enter image description here

1 Answer 1

0

You can use below code to add trasaction:

$transaction = Mage::getModel('sales/order_payment_transaction');
$transaction->setParentId($parentId); // this is parent trasaction Id if any
$transaction->setOrderId(1); // this is order Id
$transaction->setTxntId($txnId); // this is trasaction Id
$transaction->setTxnType($txnType); // authorise or capture or both
$transaction->setIsClosed(true);
$transaction->setAdditionalInformation($arrayofdata);
try {
        $transaction->save();
    } 
catch (Exception $e) {
}
3
  • Thank you for your response Prasanta.. is this is the correct path to insert the your suggested code? '/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php'. kindly guide me.
    – user52830
    Commented May 2, 2018 at 9:24
  • You can add from anywhere by providing the specified values. Better to create a singleton model and write a method by passing the required data and call that model from success action. Commented May 2, 2018 at 9:32
  • Can you please accept the answer Commented May 3, 2018 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.