I have a custom payment gateway that pass additional payment information back upon the return to Magento store that I would like to store on the associated order, so that it can be displayed on the admin page, similarly to what Paypal Express Checkout offer as shown below. What would be the best practice to do this (I prefer have it done within a controller action that handle the return).

enter image description here

2 Answers 2


A quick reference:

Take a look the sales order view xml:


<block class="Magento\Sales\Block\Adminhtml\Order\Payment" name="order_payment"/>

As we can see, Magento\Sales\Block\Adminhtml\Order\Payment block will handle the payment output. It will get the payment info block:


$paymentInfoBlock = $this->_paymentData->getInfoBlock($payment, $this->getLayout());

In Paypal case, the block info is vendor/magento/module-paypal/Block/Payment/Info.php. Paypal module built the model info to collect and provide access to PayPal-specific payment data: vendor/magento/module-paypal/Model/Info.php


--Create the model info.
--Create the block info to get the info from the model info.

  • Thank you for the replying. My 2nd part of question is how do we create the object equivalent of vendor/magento/module-paypal/Model/Info.php and then store it into the order? Let's say if I have Info.php for my custom module. Is there a function from Order, Quote, or Transaction object that I need to call to attach this info model for display later?
    – frostshoxx
    Sep 16, 2016 at 16:29
  • @frostshoxx we create your own info block and info model, and then inject the info model on the constructor of info block. You should see more here: vendor/magento/module-paypal/Block/Payment/Info.php. Sep 20, 2016 at 14:48
  • It seems to me that the class Info is an extension of \Magento\Payment\Block\Info\Cc. Is it still applicable if the payment gateway I'm using does not use credit card?
    – frostshoxx
    Sep 20, 2016 at 17:41
  • I'm not test yet, however, I think it is ok. Sep 21, 2016 at 2:37

Just put your key from additional info to your config.xml node like


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.