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

#   return after iDeal payment url

##

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

Less More

- Posts: 424
- Thank you received: 11
-
-

4 years 10 months ago [\#337801](#337801) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  *[return after iDeal payment url](/forum/2-general-talk-about-hikashop/903634-return-after-ideal-payment-url#337801 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.26 -- PHP version -- : 7.4.x  Hi,  We have a problem were notification emails won't be send if a customer never reaches the &quot;Payment success page&quot;. this happens when a customer closes the payment provider website before being returned to the &quot;Payment success page&quot; on our own website. They payment provider always sends a webhook telling us the payment status changed, even when the users never gets back to our website. So instead of sending the emails on the thank you page &#96;header('Location: ' . $this-&gt;oRecord);&#96;. We would like to send the email on the webhook page. We could redirect the webhook call to the transaction&#95;success&#95;url. But that would cause double emails to be send if the user does make it to the transaction&#95;success&#95;url. What is the best way to solve this problem. What part of the plugin could we modify to fix this?  Regards,  Mark")* was created by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")*

-- HikaShop version -- : 4.4.1
-- Joomla version -- : 3.9.26
-- PHP version -- : 7.4.x

Hi,

We have a problem were notification emails won't be send if a customer never reaches the "Payment success page". this happens when a customer closes the payment provider website before being returned to the "Payment success page" on our own website.
They payment provider always sends a webhook telling us the payment status changed, even when the users never gets back to our website.
So instead of sending the emails on the thank you page &#96;header('Location: ' . $this-&gt;oRecord);&#96;.
We would like to send the email on the webhook page.
We could redirect the webhook call to the transaction_success_url. But that would cause double emails to be send if the user does make it to the transaction_success_url. What is the best way to solve this problem. What part of the plugin could we modify to fix this?

Regards,

Mark

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzkwMzYzNC1yZXR1cm4tYWZ0ZXItaWRlYWwtcGF5bWVudC11cmw/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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: 86322
- Thank you received: 14280
-
-

4 years 10 months ago [\#337807](#337807) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return after iDeal payment url](/forum/2-general-talk-about-hikashop/903634-return-after-ideal-payment-url#337807 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.26 -- PHP version -- : 7.4.x  Hi,  We have a problem were notification emails won't be send if a customer never reaches the &quot;Payment success page&quot;. this happens when a customer closes the payment provider website before being returned to the &quot;Payment success page&quot; on our own website. They payment provider always sends a webhook telling us the payment status changed, even when the users never gets back to our website. So instead of sending the emails on the thank you page &#96;header('Location: ' . $this-&gt;oRecord);&#96;. We would like to send the email on the webhook page. We could redirect the webhook call to the transaction&#95;success&#95;url. But that would cause double emails to be send if the user does make it to the transaction&#95;success&#95;url. What is the best way to solve this problem. What part of the plugin could we modify to fix this?  Regards,  Mark")*

Hi,

The webhook should call the onPaymentNotification function of the payment plugin.
There, there should be the changing of the order status to cancelled when the payment is cancelled, I suppose.
This normally uses the modifyOrder function call.
Before that call, you should add a parameter history_notified to the order object being passed to the modifyOrder function to ask HikaShop to send the "order status notification" email to the customer.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzkwMzYzNC1yZXR1cm4tYWZ0ZXItaWRlYWwtcGF5bWVudC11cmw/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 424
- Thank you received: 11
-
-

4 years 10 months ago -  4 years 10 months ago [\#338015](#338015) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[return after iDeal payment url](/forum/2-general-talk-about-hikashop/903634-return-after-ideal-payment-url#338015 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.26 -- PHP version -- : 7.4.x  Hi,  We have a problem were notification emails won't be send if a customer never reaches the &quot;Payment success page&quot;. this happens when a customer closes the payment provider website before being returned to the &quot;Payment success page&quot; on our own website. They payment provider always sends a webhook telling us the payment status changed, even when the users never gets back to our website. So instead of sending the emails on the thank you page &#96;header('Location: ' . $this-&gt;oRecord);&#96;. We would like to send the email on the webhook page. We could redirect the webhook call to the transaction&#95;success&#95;url. But that would cause double emails to be send if the user does make it to the transaction&#95;success&#95;url. What is the best way to solve this problem. What part of the plugin could we modify to fix this?  Regards,  Mark")*

Thanks for the response.
Just to make it clear, we use Idealcheckout. How am I supposed to call the onPaymentNotification. Currently what happens is that the return page after payment redirects to to following url:
[ 06.bluepoint-concept.nl/index.php?option...pl=component&amp;lang=nl](https://06.bluepoint-concept.nl/index.php?option=com_hikashop&ctrl=checkout&task=notify&order_id=832&order_code=OdcsWqJ2sfu53iDsRQfB8x4US21WsXbL%C2%ACif_payment=idealcheckoutideal&tmpl=component&lang=nl)
When I prevent the redirect to go to this url and copy it to manually go to that page I just get a blank page. Which part of the code will actually be called when going to this url.

The current the webhook method of the gateway does the following:
Code:

if(isset($jsonBody-&gt;data-&gt;financial_status) &amp;&amp; $jsonBody-&gt;data-&gt;financial_status == "completed"){ $this-&gt;oRecord['transaction_status'] = 'SUCCESS'; }else{ $this-&gt;oRecord['transaction_status'] = 'CANCELLED'; } if (empty($this-&gt;oRecord['transaction_log']) == false) { $this-&gt;oRecord['transaction_log'] .= "\n\n"; } $this-&gt;oRecord['transaction_log'] .= 'Executing StatusRequest on ' . date('Y-m-d, H:i:s') . ' for #' . $sTransactionId . '. Recieved: ' . $this-&gt;oRecord['transaction_status']; $this-&gt;save();

So it adds the status to the record in table: pa8ju_idealcheckout_transactions and after that it will add a record to the transaction_log. So now we have the new transaction status in our database. So next I would to redirect to the onPaymentNotification page right? How would I do that?
Kind regards,
Mark

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzkwMzYzNC1yZXR1cm4tYWZ0ZXItaWRlYWwtcGF5bWVudC11cmw/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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: 86322
- Thank you received: 14280
-
-

4 years 10 months ago -  4 years 10 months ago [\#338032](#338032) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return after iDeal payment url](/forum/2-general-talk-about-hikashop/903634-return-after-ideal-payment-url#338032 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.26 -- PHP version -- : 7.4.x  Hi,  We have a problem were notification emails won't be send if a customer never reaches the &quot;Payment success page&quot;. this happens when a customer closes the payment provider website before being returned to the &quot;Payment success page&quot; on our own website. They payment provider always sends a webhook telling us the payment status changed, even when the users never gets back to our website. So instead of sending the emails on the thank you page &#96;header('Location: ' . $this-&gt;oRecord);&#96;. We would like to send the email on the webhook page. We could redirect the webhook call to the transaction&#95;success&#95;url. But that would cause double emails to be send if the user does make it to the transaction&#95;success&#95;url. What is the best way to solve this problem. What part of the plugin could we modify to fix this?  Regards,  Mark")*

Hi,

If you want to redirect to the onPaymentNotification function, you could:
1. redirect to the [ 06.bluepoint-concept.nl/index.php?option...pl=component&amp;lang=nl](https://06.bluepoint-concept.nl/index.php?option=com_hikashop&ctrl=checkout&task=notify&order_id=832&order_code=OdcsWqJ2sfu53iDsRQfB8x4US21WsXbL%C2%ACif_payment=idealcheckoutideal&tmpl=component&lang=nl) notification URL. This will automatically call onPaymentNotification
This can be done in PHP with [ stackoverflow.com/questions/768431/how-d...ke-a-redirect-in-php](https://stackoverflow.com/questions/768431/how-do-i-make-a-redirect-in-php)
2. to manually call the onPaymentNotification, you need to :
- load Joomla if that's not already done [ stackoverflow.com/questions/23937651/loa...in-external-php-file](https://stackoverflow.com/questions/23937651/load-joomla-3-x-framework-and-modules-in-external-php-file)
- load HikaShop with Code:

if(!include_once(rtrim(JPATH_ADMINISTRATOR,DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'components'.DIRECTORY_SEPARATOR.'com_hikashop'.DIRECTORY_SEPARATOR.'helpers'.DIRECTORY_SEPARATOR.'helper.php')) return;

- load the plugin with Code:

$data = hikashop_import('hikashoppayment', 'idealcheckoutideal');

- call onPaymentNotification with : Code:

$trans = hikashop_get('helper.translation'); $cleaned_statuses = $trans-&gt;getStatusTrans(); $data-&gt;onPaymentNotification($cleaned_statuses);

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzkwMzYzNC1yZXR1cm4tYWZ0ZXItaWRlYWwtcGF5bWVudC11cmw/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 424
- Thank you received: 11
-
-

4 years 10 months ago -  4 years 10 months ago [\#338095](#338095) by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")  Replied by *[BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile")* on topic *[return after iDeal payment url](/forum/2-general-talk-about-hikashop/903634-return-after-ideal-payment-url#338095 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.26 -- PHP version -- : 7.4.x  Hi,  We have a problem were notification emails won't be send if a customer never reaches the &quot;Payment success page&quot;. this happens when a customer closes the payment provider website before being returned to the &quot;Payment success page&quot; on our own website. They payment provider always sends a webhook telling us the payment status changed, even when the users never gets back to our website. So instead of sending the emails on the thank you page &#96;header('Location: ' . $this-&gt;oRecord);&#96;. We would like to send the email on the webhook page. We could redirect the webhook call to the transaction&#95;success&#95;url. But that would cause double emails to be send if the user does make it to the transaction&#95;success&#95;url. What is the best way to solve this problem. What part of the plugin could we modify to fix this?  Regards,  Mark")*

Hi,

Thanks for the reply! Unfortunately it's not completely working yet.

As you suggested I imported Joomla and the plugins and called onPaymentNotification. Now when I finish the payment it will set the order from 'created' to 'new order' which is good. I also get the popup in my Joomla backend saying a new order has been placed. But the emails are still not being send. Also when I return to the vendor the product I just ordered is still in my shopping cart. So the session is not begin emptyed aswell.

Is there anything else I need to call to send the emails and empty the shopping card?

Last edit: 4 years 10 months ago by [BluepointWebdesign](/forum/user/34929-bluepointwebdesign "View BluepointWebdesign's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzkwMzYzNC1yZXR1cm4tYWZ0ZXItaWRlYWwtcGF5bWVudC11cmw/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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: 86322
- Thank you received: 14280
-
-

4 years 10 months ago [\#338097](#338097) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[return after iDeal payment url](/forum/2-general-talk-about-hikashop/903634-return-after-ideal-payment-url#338097 "-- HikaShop version -- : 4.4.1 -- Joomla version -- : 3.9.26 -- PHP version -- : 7.4.x  Hi,  We have a problem were notification emails won't be send if a customer never reaches the &quot;Payment success page&quot;. this happens when a customer closes the payment provider website before being returned to the &quot;Payment success page&quot; on our own website. They payment provider always sends a webhook telling us the payment status changed, even when the users never gets back to our website. So instead of sending the emails on the thank you page &#96;header('Location: ' . $this-&gt;oRecord);&#96;. We would like to send the email on the webhook page. We could redirect the webhook call to the transaction&#95;success&#95;url. But that would cause double emails to be send if the user does make it to the transaction&#95;success&#95;url. What is the best way to solve this problem. What part of the plugin could we modify to fix this?  Regards,  Mark")*

Hi,

For the shopping cart to be emptied, either it has to be done manually by the payment plugin, or the payment plugin needs to redirect the customer to the after_end URL of HikaShop will will empty the cart automatically.
For example, in the "example" payment plugin we provide on our developer documentation, we have this piece of 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);

in the onPaymentNotification function which does that.

Regarding the notification email to the customer, it depends on the code in the onPaymentNotification function.
If you look again at the example payment plugin's code, you can see this call before the redirect: Code:

$this-&gt;modifyOrder($order_id, $this-&gt;payment_params-&gt;verified_status, true, true);

This modifyOrder function is the function we recommend payment plugin developers to use in order to change the status of the order.
If the third parameter is set to true, HikaShop will notify the user with an "order status notification" email.
If the fourth parameter is set to true, HikaShop will notify the admin with a "payment notification" email.
If your customers don't get the email notification, then it means that either this function is called with wrong parameters, or that the order status is changed without using that function.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzkwMzYzNC1yZXR1cm4tYWZ0ZXItaWRlYWwtcGF5bWVudC11cmw/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) 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.080 seconds

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