I am building an application that will need to create some database records in an external database when an order is purchased/completed.
So when the customer makes the purchase from our One Page Checkout cart page, I am hoping to use an Event Observer on
checkout_type_onepage_save_order_after and then connect to my external database and make an order database entry as well as a separate entry for each order item in my other database.
So my question is, how can I test my observer that should be triggered or caught when the order process is completed without you know, using my own credit card!?
Is there some sort of way to trigger or tesdt my code with PHP in a test file? Or some other way to make a test purchase on the live site?
Credit card (saved)payment option in Magento Admin panel and then you can run a test card using the CC number4111111111111111with any name and a future exp date. I really like your answer for being able to refresh the page and have the order re-submit, that will help a lot in my case as it already appears my Event Observer code is not working! The site is usingOne Page Checkoutso I am trying to hook into the Event:checkout_type_onepage_save_order_after– JasonDavis May 25 '15 at 00:51checkout_type_onepage_save_order_afterthat it is only fired when One Page Checkout is used. My boss does use one page checkout but I am not 100% sure if it is a different one or the same one. I did look at the Magento source code where therecheckout_type_onepage_save_order_afterevent is fired and see that it is in the core Magento code though. I have more testing to do though just in case it is an error on my end..... – JasonDavis May 25 '15 at 00:54sales_order_place_afterdoes the trick, thanks again – JasonDavis May 25 '15 at 01:32