[Skip to main content](#vessel-content)

#   onAfterOrderUpdate custom plugin

##

- **[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")**
- [![mindgem's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49449-mindgem "View mindgem's Profile") Topic Author
- [ Offline](/forum/user/49449-mindgem)

Less More

- Posts: 17
- Thank you received: 0
-
-

9 years 6 months ago -  9 years 6 months ago [\#267474](#267474) by [mindgem](/forum/user/49449-mindgem "View mindgem's Profile")  *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#267474 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")* was created by *[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")*

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 7.0.10

I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.

I took the original points plugin and started modifing it. Trying to use the two events:
Code:

public function onAfterOrderCreate(&amp;$order, &amp;$send_email) { $app = JFactory::getApplication(); if($app-&gt;isAdmin()) { return true; } if(!isset($order-&gt;order_status)) { return true; } if(!empty($order-&gt;order_type) &amp;&amp; $order-&gt;order_type != 'sale') { return true; } $this-&gt;awardDonationRewards($order); unset($this-&gt;fullOrder); return true; }

This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.
Code:

public function onAfterOrderUpdate(&amp;$order, &amp;$send_email) { echo 'success'; jexit(); }

Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com_hikashop&amp;ctrl=checkout&amp;task=after_end&amp;order_id=103&amp;Itemid=580'.

In the administrator I can see the order being changed from 'created' to 'confirmed'.

When I manually edit the order status in the administrator this event gets triggered.

Any ideas how to achieve extra functions after payment and return from PayPal back to my site?

Last edit: 9 years 6 months ago by [mindgem](/forum/user/49449-mindgem "View mindgem's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")**
- [![mindgem's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49449-mindgem "View mindgem's Profile") Topic Author
- [ Offline](/forum/user/49449-mindgem)

Less More

- Posts: 17
- Thank you received: 0
-
-

9 years 6 months ago [\#267497](#267497) by [mindgem](/forum/user/49449-mindgem "View mindgem's Profile")  Replied by *[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#267497 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

Do I understand correct you need to write a custom plugin for manual editing of order status and a custom payment plugin to handle actions after PayPal return status?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

9 years 6 months ago -  9 years 6 months ago [\#267478](#267478) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#267478 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

Hello,

Most of payment methods (Paypal included) is using a server-to-server notification for the order confirmation.
So it is not the customer who confirm the order but Paypal itself.

So if you are displaying something and performing an "exit", you might interact with the paypal notification, not with the customer return. And thus, you won't see anything displayed on the screen as customer. You will only display that back at the PayPal server who contacts HikaShop to provide the payment notification, and he doesn't care about it and just ignores it.

And no, you should only write a plugin of the type "hikashop" and implement the onAfterOrderUpdate trigger.
I would first recommend to test your code with the changing of the order status in the backend of HikaShop in the orders listing.
Once that's working, it should work the same with the PayPal automatic notifications.

Regards,

---

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

Last edit: 9 years 6 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")**
- [![mindgem's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49449-mindgem "View mindgem's Profile") Topic Author
- [ Offline](/forum/user/49449-mindgem)

Less More

- Posts: 17
- Thank you received: 0
-
-

9 years 6 months ago -  9 years 6 months ago [\#267510](#267510) by [mindgem](/forum/user/49449-mindgem "View mindgem's Profile")  Replied by *[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#267510 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

So I created the plugin as attached. I can see it working in the backend (adding the customer to the group and add some points).

According to your answer this should work for reallife payment by PayPal? As according to my tests it doesn't,

Last edit: 9 years 6 months ago by [mindgem](/forum/user/49449-mindgem "View mindgem's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")**
- [![mindgem's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49449-mindgem "View mindgem's Profile") Topic Author
- [ Offline](/forum/user/49449-mindgem)

Less More

- Posts: 17
- Thank you received: 0
-
-

9 years 6 months ago -  9 years 6 months ago [\#267515](#267515) by [mindgem](/forum/user/49449-mindgem "View mindgem's Profile")  Replied by *[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#267515 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

Added

JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');

JFile::append(HKASHOP_ROOT.'mylogfile.txt','onAfterOrderUpdate: started');

to test some more

Last edit: 9 years 6 months ago by [mindgem](/forum/user/49449-mindgem "View mindgem's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")**
- [![mindgem's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49449-mindgem "View mindgem's Profile") Topic Author
- [ Offline](/forum/user/49449-mindgem)

Less More

- Posts: 17
- Thank you received: 0
-
-

9 years 6 months ago [\#267532](#267532) by [mindgem](/forum/user/49449-mindgem "View mindgem's Profile")  Replied by *[mindgem](/forum/user/49449-mindgem "View mindgem's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#267532 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

Got this figured out. Small coding issue from my part. As the event is excecuted not by the user itself I needed to pass the right userID.

Paypal earned many points ![:P](/media/kunena/emoticons/15.png ":P")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

9 years 6 months ago [\#267535](#267535) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#267535 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

Hello,

Good to know that you have fixed your issue.

Do not hesitate to read the user_id from the order object itself ( order_user_id ).

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[NTV](/forum/user/69623-ntv "View NTV's Profile")**
- [![NTV's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/69623-ntv "View NTV's Profile")
- [ Offline](/forum/user/69623-ntv)

Less More

- Posts: 47
- Thank you received: 6
-

3 years 1 month ago [\#354792](#354792) by [NTV](/forum/user/69623-ntv "View NTV's Profile")  Replied by *[NTV](/forum/user/69623-ntv "View NTV's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#354792 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

Hi,

sorry to necropost, but I'm having a similar issue.

I also use the onAfterOrderUpdate($order, $send_email) function - to update some values in a CSV file.

Everything works fine if I manually change the order status in the backend.

But when PayPal confirms payment and an order status is automatically changed to "Confirmed" the function doesn't seem to trigger at all.

Code:

public function onAfterOrderUpdate($order, $send_email) { // Only process PayPal orders if ($order-&gt;order_payment_id != 1) return; $orderFile = $this-&gt;params-&gt;get('path') . '/infounit_export_orders.csv'; // Only run if there are orders waiting to be imported if (!is_file($orderFile)) return; $newRows = []; // Read CSV if (($stream = fopen($orderFile, 'r')) !== false) { $index = 0; $indexZahlungsweg; $indexBestellzeichen; while (($row = fgetcsv($stream, 1000, ';')) !== false) { // Look up which column contains the payment information and which column contains the order number if ($index == 0) { $indexZahlungsweg = array_search('Zahlungsweg', $row); $indexBestellzeichen = array_search('Bestellzeichen', $row); } // Use the order number to find the right order if ($row[$indexBestellzeichen] == $order-&gt;order_number) { // Update the order status switch ($order-&gt;order_status) { case 'confirmed': $row[$indexZahlungsweg] = 'PayPal'; break; case 'cancelled': $row[$indexZahlungsweg] = 'PayPal (storniert!)'; break; case 'created': $row[$indexZahlungsweg] = 'PayPal (nicht bezahlt!)'; break; } } $newRows[] = $row; $index++; } fclose($stream); } // Write back to CSV if (($stream = fopen($orderFile, 'w')) !== false) { foreach($newRows as $row) { fputcsv($stream, $row, ';'); } fclose($stream); } }

Where's the issue?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86283
- Thank you received: 14262
-
-

3 years 1 month ago [\#354801](#354801) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#354801 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

Hi,

The issue is that in an "update" event, only the new data is provided in the main object.
So in onAfterOrderUpdate, the $order variable might not contain all the data of an order.
And with payment plugins changing the status of an order, $order usually only contains the order_id and the order_status.
So the first line Code:

if ($order-&gt;order_payment_id != 1) return;

of your plugin stops the processing since order_payment_id is not set in that case.
You'll want check the data in $order-&gt;old-&gt;order_payment_id
And you'll have the same issue with the order_number in the code after that.

The following user(s) said Thank You: [NTV](/forum/user/69623-ntv "View NTV's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[NTV](/forum/user/69623-ntv "View NTV's Profile")**
- [![NTV's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/69623-ntv "View NTV's Profile")
- [ Offline](/forum/user/69623-ntv)

Less More

- Posts: 47
- Thank you received: 6
-

3 years 1 month ago [\#355074](#355074) by [NTV](/forum/user/69623-ntv "View NTV's Profile")  Replied by *[NTV](/forum/user/69623-ntv "View NTV's Profile")* on topic *[onAfterOrderUpdate custom plugin](/forum/31-development/889826-onafterorderupdate-custom-plugin#355074 "-- HikaShop version -- : 3.0.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.10  I'm trying to write a plugin to perform additional tasks after PayPal payment is recieved. For instance assign points in Jomsocial.  I took the original points plugin and started modifing it. Trying to use the two events:  This event works and the '$this-&gt;awardDonationRewards($order)' gets pharsed before I get javascript redirected to PayPal.  Doesn't work as expected. Offcourse this is test code. Ultimately I go to $this-&gt;awardDonationRewards($order) again. I had the impression to get a blank page with just one word as result when returning from PayPal. Instead it gives me the full thank you page from the link 'index.php?option=com&#95;hikashop&amp;ctrl=checkout&amp;task=after&#95;end&amp;order&#95;id=103&amp;Itemid=580'.  In the administrator I can see the order being changed from 'created' to 'confirmed'.  When I manually edit the order status in the administrator this event gets triggered.  Any ideas how to achieve extra functions after payment and return from PayPal back to my site?")*

Working perfectly now - cheers!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTgyNi1vbmFmdGVyb3JkZXJ1cGRhdGUtY3VzdG9tLXBsdWdpbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.351 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
