Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8546449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:01:31+00:00 2026-06-11T13:01:31+00:00

I have created my own payment method by taking reference of another method. I

  • 0

I have created my own payment method by taking reference of another method. I wannt to store my payment gateway’s transaction id to order payment details (sales/order_payment) on successful payment action.

How can I store transaction id to this table ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:01:32+00:00Added an answer on June 11, 2026 at 1:01 pm

    1) Add an SQL install script to your module, where we will add a new attribute to the order object

    $installer = new Mage_Sales_Model_Mysql4_Setup;
    $attribute  = array(
            'type'          => 'text',
            'backend_type'  => 'text',
            'frontend_input' => 'text',
            'is_user_defined' => true,
            'label'         => 'Transaction Code',
            'visible'       => true,
            'required'      => false,
            'user_defined'  => false,  
            'searchable'    => false,
            'filterable'    => false,
            'comparable'    => false,
            'default'       => ''
    );
    $installer->addAttribute('order', 'new_transaction_id', $attribute);
    $installer->endSetup();
    

    you could then add a observer to hook the payment event, so you would need to add code to yoru config.xml to enable your observer to hook onto the event:

    <events>
       <sales_order_payment_pay>
          <observers>
            <my_observer>
                <type>singleton</type>
                <class>mymodule/observer</class>
                <method>save_transaction</method>
            </my_observer>
          </observers>
       </sales_order_payment_pay>     
    </events>
    

    You would then add an observer model to your module:

    <?php
    class Company_Mymodule_Model_Observer
    {
        public function save_transaction($event)
        {
            $order = $event->getInvoice()->getOrder(); // Mage_Sales_Model_Order
    
            /**
             * You would need to have your tranaction id from your gateway
             * which would depend on how you have made your module..
             * ....
             */
            try {
                $order->setNewTransactionId($transactionId);
                $order->save();
            }
            catch(Exception $e) {
                // do something nice
            }
    
            return $this;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created my own Perl module. I reference it from file Config.pm. When
I have created my own Attached Property like this: public static class LabelExtension {
I have created my own customized lots of architecture including n-tier layers for different
I have created my own debugger application. It attaches to a process and creates
I have created my own button class called custom_btn. I created it on the
I have created blank Asp.Net-MVC 3 web application and want to write my own
I have created a custom list view, each row has it's own custom selector,
I have my own asp.net cookie created like this: var authTicket = new FormsAuthenticationTicket(
I have created own AMI and registered it on Amazon EC2. But while AMI
I have created my own ExtendedTabControl to totally change it's apperance. It works ok.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.