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

#   Display a nottification alert after order has been made successfully

##

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

Less More

- Posts: 12
- Thank you received: 0
-
-

5 years 8 months ago [\#330201](#330201) by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")  *[Display a nottification alert after order has been made successfully](/forum/4-how-to/902065-display-a-nottification-alert-after-order-has-been-made-successfully#330201 "-- Joomla version -- : 3.9  Hi,  I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.  In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.  My question is how to display a success nottification or alert that notify user that order has been made successfully.  Regards.")* was created by *[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")*

-- Joomla version -- : 3.9

Hi,

I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.

In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.

My question is how to display a success nottification or alert that notify user that order has been made successfully.

Regards.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwMjA2NS1kaXNwbGF5LWEtbm90dGlmaWNhdGlvbi1hbGVydC1hZnRlci1vcmRlci1oYXMtYmVlbi1tYWRlLXN1Y2Nlc3NmdWxseT90bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

5 years 8 months ago [\#330202](#330202) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display a nottification alert after order has been made successfully](/forum/4-how-to/902065-display-a-nottification-alert-after-order-has-been-made-successfully#330202 "-- Joomla version -- : 3.9  Hi,  I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.  In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.  My question is how to display a success nottification or alert that notify user that order has been made successfully.  Regards.")*

Hi,

There are two scenarios:
- after the payment, the payment gateway sends a server to server request to your website to confirm the payment.
In that case, you can directly redirect back the user to the "after_end" URL of HikaShop. HikaShop will display its thank you page automatically. And you can provide the payment notification URL to your payment gateway for the server to server request so that ht will reach the onPaymentNotification function of your plugin to confirm the order.
- after the payment, the payment gateway doesn't send a server to server request to your website but directly includes the data of the payment when redirecting the customer back to your website.
In that case, you want to give the payment notification URL to the payment gateway so that the customer will be redirected back to it after the payment. Then, in the onPaymentNotification you can confirm the order, and after that redirect the customer to the "after_end" URL of HikaShop.

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

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

Less More

- Posts: 12
- Thank you received: 0
-
-

5 years 8 months ago -  5 years 8 months ago [\#330234](#330234) by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")  Replied by *[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")* on topic *[Display a nottification alert after order has been made successfully](/forum/4-how-to/902065-display-a-nottification-alert-after-order-has-been-made-successfully#330234 "-- Joomla version -- : 3.9  Hi,  I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.  In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.  My question is how to display a success nottification or alert that notify user that order has been made successfully.  Regards.")*

Hi,

In my case, i should send URLs to server via http using curl. The URLs I should send are: ApproveURL, CancelURL, DeclineURL.

What Url should I send to server (to the payment endpoint) to notify user if everything is OK.

*Worth mentioning that the requests to payment server I am making inside onAfterOrderConfirmFunction.

Last edit: 5 years 8 months ago by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwMjA2NS1kaXNwbGF5LWEtbm90dGlmaWNhdGlvbi1hbGVydC1hZnRlci1vcmRlci1oYXMtYmVlbi1tYWRlLXN1Y2Nlc3NmdWxseT90bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

5 years 8 months ago [\#330235](#330235) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display a nottification alert after order has been made successfully](/forum/4-how-to/902065-display-a-nottification-alert-after-order-has-been-made-successfully#330235 "-- Joomla version -- : 3.9  Hi,  I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.  In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.  My question is how to display a success nottification or alert that notify user that order has been made successfully.  Regards.")*

Hi,

You should give the payment notification URL for the approveURL: Code:

$notify_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&amp;ctrl=checkout&amp;task=notify&amp;notif_payment='.$this-&gt;name.'&amp;tmpl=component';

That way, when the user comes back to your website after the payment, your plugin onPaymentNotification function will be called.
There, you can confirm the order with a call to the modifyOrder function (as per the example payment plugin on our developer documentation) and then you can redirect the customer to the thank you page with the after_end URL: Code:

$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&amp;ctrl=checkout&amp;task=after_end&amp;order_id='.$order_id.$this-&gt;url_itemid;

For the CancelURL and the DeclineURL, you can provide the cancel URL: Code:

$cancel_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&amp;ctrl=order&amp;task=cancel_order&amp;order_id='.$order_id.$this-&gt;url_itemid;

That way, when the payment fails, the customer will be redirected back to the checkout with an error message and he will be able to try again, select another payment method, etc.

Just in case you didn't see it yet, I would recommend to check on the example payment plugin that we provide there:
[ www.hikashop.com/support/documentation/6...on.html#howtopayment](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#howtopayment)
It's heavily commented and explains the different parts of the code including the pieces I'm talking about here.

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

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

Less More

- Posts: 12
- Thank you received: 0
-
-

5 years 8 months ago [\#330272](#330272) by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")  Replied by *[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")* on topic *[Display a nottification alert after order has been made successfully](/forum/4-how-to/902065-display-a-nottification-alert-after-order-has-been-made-successfully#330272 "-- Joomla version -- : 3.9  Hi,  I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.  In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.  My question is how to display a success nottification or alert that notify user that order has been made successfully.  Regards.")*

Hi.

I have downloaded the example plugin and I'm expanding it for my purposes.

Those links doesn't work as expected for me. The first one, redirecting me from payment page back to shop, shows me a blank white page, others redirect me back in the shop, but doesn't show any error message.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwMjA2NS1kaXNwbGF5LWEtbm90dGlmaWNhdGlvbi1hbGVydC1hZnRlci1vcmRlci1oYXMtYmVlbi1tYWRlLXN1Y2Nlc3NmdWxseT90bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

5 years 8 months ago [\#330289](#330289) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display a nottification alert after order has been made successfully](/forum/4-how-to/902065-display-a-nottification-alert-after-order-has-been-made-successfully#330289 "-- Joomla version -- : 3.9  Hi,  I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.  In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.  My question is how to display a success nottification or alert that notify user that order has been made successfully.  Regards.")*

Hi,

It's normal that the first link displays a blank page.
As I said, it will call the onPaymentNotification function of your plugin.
And then, as I said, in that function, after you confirm the order, you need to redirect the customer to the thank you page.

If you check the example plugin's code in the onPaymentNotification, when everything is OK, you can see two lines of code: Code:

$this-&gt;modifyOrder($order_id, $this-&gt;payment_params-&gt;verified_status, true, true); //$this-&gt;app-&gt;redirect($return_url);

The first one is to confirm the order.
The second one is to redirect the customer to the thank you page. It is commented out in the example plugin because we wrote the code as if the onPaymentNotification function would be called in a server to server request. And in that case, you don't want a redirect.
Bu if it is called by a redirect of the customer, you want to have that line uncommented.

Regarding the other links, if you don't get any message, it could be that your template is not displaying the messages. That's a common issue:
[ www.hikashop.com/support/documentation/6...tibility-issues.html](https://www.hikashop.com/support/documentation/61-hikashop-compatibility-issues.html)
But it could also be that it's because you need to display the message yourself with such code: Code:

$app = JFactory::getApplication(); $app-&gt;enqueueMessage('My message');

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

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

Less More

- Posts: 12
- Thank you received: 0
-
-

5 years 8 months ago [\#330296](#330296) by [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")  Replied by *[lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")* on topic *[Display a nottification alert after order has been made successfully](/forum/4-how-to/902065-display-a-nottification-alert-after-order-has-been-made-successfully#330296 "-- Joomla version -- : 3.9  Hi,  I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.  In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.  My question is how to display a success nottification or alert that notify user that order has been made successfully.  Regards.")*

Hi.

If I understood correctly, I should also make any simple thank you page, as I saw it in another payment plugin.

I have another issue right now, $this-&gt;payment_params is always null in onPaymentNotification.

Thank you in advance.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwMjA2NS1kaXNwbGF5LWEtbm90dGlmaWNhdGlvbi1hbGVydC1hZnRlci1vcmRlci1oYXMtYmVlbi1tYWRlLXN1Y2Nlc3NmdWxseT90bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

5 years 8 months ago [\#330298](#330298) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display a nottification alert after order has been made successfully](/forum/4-how-to/902065-display-a-nottification-alert-after-order-has-been-made-successfully#330298 "-- Joomla version -- : 3.9  Hi,  I am developing a payment plugin for Hikashop, based in example plugin provided by Hika.  In my case, in onAfterOrderConfirm function some curl request will be made, if everything is fine, the user will be redirected in a page for writing his card credentials. If everything is fine, The user will be redirected back in the shop, where a nottification success alert should appear.  My question is how to display a success nottification or alert that notify user that order has been made successfully.  Regards.")*

Hi,

No, you don't need to have your own thank you page (although you could).
you can simply redirect to the thank you page of HikaShop with such code: Code:

$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&amp;ctrl=checkout&amp;task=after_end&amp;order_id='.$order_id.$this-&gt;url_itemid; $this-&gt;app-&gt;redirect($return_url);

HikaShop will display a thank you message for you, with a link to the order details page.

Regarding your question about $this&gt;payment_params, it is initialized by the line:
$this-&gt;loadPaymentParams($dbOrder);
So before that line, $this&gt;payment_params is indeed null. After that, if that variable is still null it's either that the payment method of the order doesn't correspond to the current payment plugin, or that the variable $dbOrder is empty so make sure that $dbOrder contains the information about the order.

The following user(s) said Thank You: [lirimimeri](/forum/user/60924-lirimimeri "View lirimimeri's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzkwMjA2NS1kaXNwbGF5LWEtbm90dGlmaWNhdGlvbi1hbGVydC1hZnRlci1vcmRlci1oYXMtYmVlbi1tYWRlLXN1Y2Nlc3NmdWxseT90bXBsPW1hcmtkb3du) 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.065 seconds

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