The event is dispatched like this: Mage::dispatchEvent(' checkout_onepage_controller_success_action', array('order_ids' ...
You can use sales_order_payment_save_after event for your case. If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
try this code to get order details, you can either use directly in your function or can call interface ( \Magento\Sales\Api\Data\OrderInterface ) ...
for payment and when magento gets redirected to the payment gateway it
checkout_onepage_controller_success_action only dispatches the last order id: ... So you'll have to load the order first in order to get the customer id.
In the following example, we will be observing the event checkout_onepage_controller_success_action . This event is dispatched when the order ...
Method Programmatically · Get Customer Collection · Get Product Collection by Category ID · Get All Order Collection with Filters
How to get Order information from event
Also, this code will link the current order to that customer account.