File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,6 +210,12 @@ public function createInvoice($order){
210210 $ this ->fixCreditCustomer ();
211211 $ order ->addStatusHistoryComment ($ this ->__ ('Invoice %s created ' , $ invoice ->getIncrementId ()), false );
212212 $ order ->save ();
213+
214+ $ sendinvoice = Mage::getStoreConfig ('payment/redsys/sendinvoice ' , Mage::app ()->getStore ());
215+ if ($ sendinvoice ){
216+ $ invoice ->sendEmail ();
217+ }
218+
213219 }
214220 }
215221
Original file line number Diff line number Diff line change @@ -115,10 +115,10 @@ public function callbackAction()
115115 }
116116
117117 try {
118- $ this ->helper ->createInvoice ($ order );
119118 $ comment = $ this ->__ ('TPV payment accepted. (response: %s, authorization: %s) ' ,$ response ,$ authorisationcode );
120119 $ this ->helper ->stateConfirmTpv ($ order ,$ comment );
121120 $ order ->sendNewOrderEmail ();
121+ $ this ->helper ->createInvoice ($ order );
122122 $ this ->helper ->createTransaction ($ order ,$ decodeData );
123123 } catch (Exception $ e ) {
124124 $ order ->addStatusHistoryComment ($ this ->__ ("TPV Error: %s " ,$ e ->getMessage ()), false );
Original file line number Diff line number Diff line change 115115 <show_in_website >1</show_in_website >
116116 <show_in_store >1</show_in_store >
117117 </autoinvoice >
118+ <sendinvoice translate =" label comment" >
119+ <label >Send Email Customer Invoice</label >
120+ <frontend_type >select</frontend_type >
121+ <source_model >adminhtml/system_config_source_yesno</source_model >
122+ <sort_order >110</sort_order >
123+ <show_in_default >1</show_in_default >
124+ <show_in_website >1</show_in_website >
125+ <show_in_store >1</show_in_store >
126+ <depends ><autoinvoice >1</autoinvoice ></depends >
127+ </sendinvoice >
118128 <order_status translate =" label" module =" payment" >
119129 <label >New order status</label >
120130 <frontend_type >select</frontend_type >
You can’t perform that action at this time.
0 commit comments