0

i have only one payment method with CB (paybox) and i want to automatically make some actions if payment return succeed :

  • change the order's status to paid for example
  • generate the invoice associate and send it by mail

What is the best way to achieve that?

1
  • EDIT : i find the solution myself. I made an observer which listen to checkout_onepage_controller_success_action , this way i can have my order ID. Then i made an helper which update my order, generate and send my invoice. Regards,
    – lchabrand
    Commented Nov 16, 2017 at 22:33

1 Answer 1

0

For automatic invoice you can write below code in system.xml:

<payment_action translate="label">
    <label>Payment Action</label>
    <frontend_type>select</frontend_type>
    <source_model>paygate/authorizenet_source_paymentAction</source_model>
    <sort_order>20</sort_order>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>0</show_in_store>
</payment_action>

and then in config.xml you can add below line:

<payment_action>authorize_capture</payment_action>

For order status you need to add below code in system.xml:

<order_status translate="label">
<label>New Order Status</label>
<frontend_type>select</frontend_type>
<source_model>adminhtml/system_config_source_order_status_new</source_model>
<sort_order>30</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>0</show_in_store>

and in config.xml you need to write:

<order_status>processing</order_status>

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.