{"id":1461,"date":"2020-12-14T12:10:58","date_gmt":"2020-12-14T12:10:58","guid":{"rendered":"https:\/\/meetanshi.com\/blog\/get-payment-related-additional-information-from-order-in-magento-2\/"},"modified":"2025-07-17T10:16:37","modified_gmt":"2025-07-17T04:46:37","slug":"get-payment-related-additional-information-from-order-in-magento-2","status":"publish","type":"post","link":"https:\/\/meetanshi.com\/blog\/get-payment-related-additional-information-from-order-in-magento-2\/","title":{"rendered":"How to Get Payment Related Additional Information From Order in Magento 2"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The default\u00a0Magento 2\u00a0offers multiple\u00a0<a href=\"https:\/\/experienceleague.adobe.com\/en\/docs\/commerce-admin\/config\/guide-overview\" target=\"_blank\" rel=\"noreferrer noopener\">payment methods<\/a>\u00a0which can be configured in your store to collect secure online payments from the store customers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Or you can&nbsp;<a href=\"https:\/\/meetanshi.com\/blog\/create-payment-method-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">create payment method in Magento 2<\/a>&nbsp;for satisfying the custom business requirements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">However, when you are using such custom payment methods, sometimes, you may require to get payment-related&nbsp;additional details, for example, transaction ID, from order in Magento 2.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Even if you are using custom&nbsp;<a href=\"https:\/\/meetanshi.com\/magento-2-payments-extensions.html\" target=\"_blank\" rel=\"noreferrer noopener\">Magento 2 payment gateway integration extensions<\/a>, you may require to&nbsp;<em><strong>get payment related additional information from order in Magento 2<\/strong><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In these cases, use the method as shown below:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Method to Get Payment Related Additional Information From Order in Magento 2:<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ load magento order by id using objectManager\n\n    $orderId = 99;\n    $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n    $order = $objectManager->create('\\Magento\\Sales\\Model\\OrderRepository')->get($orderId);\n    \n    \/\/get payment additional information from order\n    $additionalInformation = $order->getPayment()->getAdditionalInformation();\n\n\n\/\/ load magento order by id using block method\n\n    use Magento\\Sales\\Model\\OrderRepository;\n     \n    private $orderRepository;\n     \n    public function __construct(OrderRepository $orderRepository) {\n      $this->orderRepository = $orderRepository;\n    }\n     \n     \n    public function getOrderAdditionalInfo($orderId)\n    {\n        $order = $this->orderRepository->get($orderId);\n        $additionalInformation = $order->getPayment()->getAdditionalInformation();\n        return $additionalInformation;\n    }<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do share the post with Magento Community via social media.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The default\u00a0Magento 2\u00a0offers multiple\u00a0payment methods\u00a0which can be configured in your store to collect secure online payments from the store customers. Or you can&nbsp;create payment method&#8230;<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1461","post","type-post","status-publish","format-standard","hentry","category-magento"],"acf":[],"_links":{"self":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/comments?post=1461"}],"version-history":[{"count":4,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1461\/revisions"}],"predecessor-version":[{"id":14576,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/posts\/1461\/revisions\/14576"}],"wp:attachment":[{"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/media?parent=1461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/categories?post=1461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meetanshi.com\/blog\/wp-json\/wp\/v2\/tags?post=1461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}