After payment is confirmed

  • Posts: 10
  • Thank you received: 0
8 years 9 months ago #228448

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.5.29

Hello,

I wish to perform some actions using my own PHP script after the payment is confirmed. I need to get all information about the order : customer (name, address, mail...), products, order id. Where can I call my PHP script ? How do I get the order's information ? Is it in the processPaymentNotification function of hikashoppayment.php ?

Thanks a lot !

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 9 months ago #228454

Hi,

You must use the "onAfterOrderUpdate" trigger and check the "order status" value.
You can also compare it with the $order->old->order_status if you want to check that the order status has changed.
www.hikashop.com/support/support/documen...l#onAfterOrderUpdate

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
8 years 9 months ago #228516

Thank you for your answer, but I need more information : where in the atos.php script should I insert a line "include 'myscript.php';" ? I am NOT trying to write a new plugin, so I do NOT use triggers. Or should I ?

Thanks a lot !

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
8 years 9 months ago #228576

Hi,

It would be better to write a separate plugin. That way, you wouldn't loose all your changes each time you update HikaShop.

But you can also directly write your PHP code in the onPaymentNotification function of the plugins/hikashoppayment/atos/atos.php, just after the line:
$this->modifyOrder($order_id, $order_status, $history, $email);
But again I don't recommend it.

To load all the data of an order, it's explained here:
www.hikashop.com/support/support/documen...umentation.html#code

The following user(s) said Thank You: Tsunoo

Please Log in or Create an account to join the conversation.

Time to create page: 0.057 seconds
Powered by Kunena Forum