- Posts: 24
- Thank you received: 0
Paypal payment trigger after_end.php
6 years 2 months ago #323543
by fhmanas
Paypal payment trigger after_end.php was created by fhmanas
-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.11.0
Hello I have special code in after_end.php view of Checkout, why is it not being triggered by Paypal plugin. As a test, I have a Cash on Delivery payment setup, and whenever I use the COD, after_end.php is triggered. I have not modified anything with the Paypal plugin except for the settings. I just want it to trigger my modified after_end.php
Attaching my settings in Hikashop for paypal.
-- Joomla version -- : 3.11.0
Hello I have special code in after_end.php view of Checkout, why is it not being triggered by Paypal plugin. As a test, I have a Cash on Delivery payment setup, and whenever I use the COD, after_end.php is triggered. I have not modified anything with the Paypal plugin except for the settings. I just want it to trigger my modified after_end.php
Attaching my settings in Hikashop for paypal.
Please Log in or Create an account to join the conversation.
6 years 2 months ago #323549
by nicolas
Replied by nicolas on topic Paypal payment trigger after_end.php
Hi,
The after_end will only be "triggered" when the customer comes back to the website from the PayPal payment page.
If you close your browser/tab after the payment is done or don't do the payment on PayPal, then after_end is not called as after_end is the view file displaying the default thank you page.
The after_end will only be "triggered" when the customer comes back to the website from the PayPal payment page.
If you close your browser/tab after the payment is done or don't do the payment on PayPal, then after_end is not called as after_end is the view file displaying the default thank you page.
Please Log in or Create an account to join the conversation.
- Tiktaalik Dev
-
- Offline
- Software Developer
5 years 11 months ago #326683
by Tiktaalik Dev
Replied by Tiktaalik Dev on topic Paypal payment trigger after_end.php
Hi Nicolas,
I'm having the same problem as @fhmanas though with a different payment plugin that I developed.
It was working fine up to Joomla 3.18 but after upgrading it, now it simply doesn't trigger the "after_end" view.
What I have been able to trace:
I'm at my wits' end. Please help me out!
In case it may shed some light to the problem, here's a copy of the backtrace output:
Thanks in advance for any feedback you may provide
I'm having the same problem as @fhmanas though with a different payment plugin that I developed.
It was working fine up to Joomla 3.18 but after upgrading it, now it simply doesn't trigger the "after_end" view.
What I have been able to trace:
- First I noticed that the event onHikashopBeforeDisplayView() wasn't triggered, which I need because I use that event to write out the details of the credit card receipt.
- Then I placed a debug_backtrace() call at the begining of my plugin script and I can see that the script is read but another debug_trace() call placed in the event method is never read.
- Now I also placed a debug_backtrace() call in the actual after_end.php view in the component folder (the original, not an override) and that trace is never read.
I'm at my wits' end. Please help me out!
In case it may shed some light to the problem, here's a copy of the backtrace output:
Code:
/home/rigo/Projects/WebPayPlus/Plugins/hikashop/source/tiktaalikwebpay.php:15:
array (size=13)
0 =>
array (size=3)
'file' => string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Plugin/PluginHelper.php' (length=70)
'line' => int 253
'function' => string 'require_once' (length=12)
1 =>
array (size=6)
'file' => string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Plugin/PluginHelper.php' (length=70)
'line' => int 182
'function' => string 'import' (length=6)
'class' => string 'Joomla\CMS\Plugin\PluginHelper' (length=30)
'type' => string '::' (length=2)
'args' =>
array (size=3)
0 =>
object(stdClass)[183]
...
1 => boolean true
2 =>
object(JEventDispatcher)[37]
...
2 =>
array (size=6)
'file' => string '/home/rigo/Projects/tiktaalik/v2/administrator/components/com_hikashop/classes/cart.php' (length=87)
'line' => int 150
'function' => string 'importPlugin' (length=12)
'class' => string 'Joomla\CMS\Plugin\PluginHelper' (length=30)
'type' => string '::' (length=2)
'args' =>
array (size=1)
0 => string 'hikashoppayment' (length=15)
3 =>
array (size=7)
'file' => string '/home/rigo/Projects/tiktaalik/v2/administrator/components/com_hikashop/helpers/checkout.php' (length=91)
'line' => int 47
'function' => string 'get' (length=3)
'class' => string 'hikashopCartClass' (length=17)
'object' =>
object(hikashopCartClass)[1028]
public 'tables' =>
array (size=2)
...
public 'pkeys' =>
array (size=2)
...
protected 'db' =>
object(JDatabaseDriverPdomysql)[24]
...
protected 'app' =>
object(Joomla\CMS\Application\SiteApplication)[19]
...
protected 'config' =>
object(hikashopConfigClass)[524]
...
protected 'user' =>
object(stdClass)[961]
...
public 'namekeys' =>
array (size=0)
...
protected '_errors' =>
array (size=0)
...
public 'database' =>
object(JDatabaseDriverPdomysql)[24]
...
'type' => string '->' (length=2)
'args' =>
array (size=1)
0 => int 45
4 =>
array (size=7)
'file' => string '/home/rigo/Projects/tiktaalik/v2/administrator/components/com_hikashop/helpers/checkout.php' (length=91)
'line' => int 35
'function' => string '__construct' (length=11)
'class' => string 'hikashopCheckoutHelper' (length=22)
'object' =>
object(hikashopCheckoutHelper)[1029]
public 'cart' => boolean false
public 'checkout_workflow' => null
public 'redirectBeforeDisplay' => null
protected 'cart_id' => int 0
protected 'shop_closed' => boolean false
protected 'config' => null
protected 'cartClass' =>
object(hikashopCartClass)[1028]
...
protected 'shippingClass' => null
protected 'paymentClass' => null
protected 'addressClass' => null
protected 'currencyClass' => null
protected 'redirect_url' => null
protected 'events' =>
array (size=0)
...
protected 'messages' =>
array (size=0)
...
protected 'images' =>
array (size=0)
...
'type' => string '->' (length=2)
'args' =>
array (size=1)
0 => int 0
5 =>
array (size=6)
'file' => string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop/controllers/checkout.php' (length=81)
'line' => int 56
'function' => string 'get' (length=3)
'class' => string 'hikashopCheckoutHelper' (length=22)
'type' => string '::' (length=2)
'args' =>
array (size=1)
0 => int 0
6 =>
array (size=7)
'file' => string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop/hikashop.php' (length=69)
'line' => int 88
'function' => string '__construct' (length=11)
'class' => string 'checkoutController' (length=18)
'object' =>
object(checkoutController)[974]
public 'display' =>
array (size=16)
...
public 'modify_views' =>
array (size=0)
...
public 'add' =>
array (size=0)
...
public 'modify' =>
array (size=0)
...
public 'delete' =>
array (size=0)
...
protected 'config' =>
object(hikashopConfigClass)[524]
...
protected 'app' =>
object(Joomla\CMS\Application\SiteApplication)[19]
...
protected 'dispatcher' => null
public 'pkey' =>
array (size=0)
...
public 'table' =>
array (size=0)
...
public 'groupMap' => string '' (length=0)
public 'groupVal' => null
public 'orderingMap' => string '' (length=0)
public 'local_display' =>
array (size=0)
...
public 'publish_return_view' => string 'listing' (length=7)
public 'pluginCtrl' => null
protected 'basePath' => string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop' (length=56)
protected 'default_view' => string 'checkout' (length=8)
protected 'doTask' => null
protected 'message' => null
protected 'messageType' => string 'message' (length=7)
protected 'methods' =>
array (size=35)
...
protected 'name' => string 'checkout' (length=8)
protected 'model_prefix' => string 'CheckoutModel' (length=13)
protected 'paths' =>
array (size=1)
...
protected 'redirect' => null
protected 'task' => null
protected 'taskMap' =>
array (size=36)
...
protected 'input' =>
object(Joomla\CMS\Input\Input)[20]
...
protected '_errors' =>
array (size=0)
...
'type' => string '->' (length=2)
'args' =>
array (size=0)
empty
7 =>
array (size=4)
'file' => string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Component/ComponentHelper.php' (length=76)
'line' => int 402
'args' =>
array (size=1)
0 => string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop/hikashop.php' (length=69)
'function' => string 'require_once' (length=12)
8 =>
array (size=6)
'file' => string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Component/ComponentHelper.php' (length=76)
'line' => int 377
'function' => string 'executeComponent' (length=16)
'class' => string 'Joomla\CMS\Component\ComponentHelper' (length=36)
'type' => string '::' (length=2)
'args' =>
array (size=1)
0 => string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop/hikashop.php' (length=69)
9 =>
array (size=6)
'file' => string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Application/SiteApplication.php' (length=78)
'line' => int 194
'function' => string 'renderComponent' (length=15)
'class' => string 'Joomla\CMS\Component\ComponentHelper' (length=36)
'type' => string '::' (length=2)
'args' =>
array (size=1)
0 => string 'com_hikashop' (length=12)
10 =>
array (size=7)
'file' => string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Application/SiteApplication.php' (length=78)
'line' => int 233
'function' => string 'dispatch' (length=8)
'class' => string 'Joomla\CMS\Application\SiteApplication' (length=38)
'object' =>
object(Joomla\CMS\Application\SiteApplication)[19]
protected '_language_filter' => boolean true
protected '_detect_browser' => boolean false
protected 'docOptions' =>
array (size=0)
...
public 'scope' => string 'com_hikashop' (length=12)
protected '_clientId' => int 0
protected '_messageQueue' =>
array (size=3)
...
protected '_name' => string 'site' (length=4)
protected 'profiler' =>
object(Joomla\CMS\Profiler\Profiler)[15]
...
protected 'template' =>
object(stdClass)[871]
...
public 'charSet' => string 'utf-8' (length=5)
public 'mimeType' => string 'text/html' (length=9)
public 'modifiedDate' => null
public 'client' =>
object(Joomla\Application\Web\WebClient)[30]
...
protected 'document' =>
object(Joomla\CMS\Document\HtmlDocument)[520]
...
protected 'language' =>
object(Joomla\CMS\Language\Language)[28]
...
protected 'session' =>
object(Joomla\CMS\Session\Session)[41]
...
protected 'response' =>
object(stdClass)[32]
...
private 'responseMap' (Joomla\CMS\Application\WebApplication) =>
array (size=61)
...
private 'singleValueResponseHeaders' (Joomla\CMS\Application\WebApplication) =>
array (size=27)
...
protected 'dispatcher' =>
object(JEventDispatcher)[37]
...
protected 'identity' => null
protected 'config' =>
object(Joomla\Registry\Registry)[22]
...
public 'input' =>
object(Joomla\CMS\Input\Input)[20]
...
private 'logger' (Joomla\Application\AbstractApplication) =>
object(Joomla\CMS\Log\DelegatingPsrLogger)[42]
...
public 'item_associations' => int 1
'type' => string '->' (length=2)
'args' =>
array (size=0)
empty
11 =>
array (size=7)
'file' => string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Application/CMSApplication.php' (length=77)
'line' => int 196
'function' => string 'doExecute' (length=9)
'class' => string 'Joomla\CMS\Application\SiteApplication' (length=38)
'object' =>
object(Joomla\CMS\Application\SiteApplication)[19]
protected '_language_filter' => boolean true
protected '_detect_browser' => boolean false
protected 'docOptions' =>
array (size=0)
...
public 'scope' => string 'com_hikashop' (length=12)
protected '_clientId' => int 0
protected '_messageQueue' =>
array (size=3)
...
protected '_name' => string 'site' (length=4)
protected 'profiler' =>
object(Joomla\CMS\Profiler\Profiler)[15]
...
protected 'template' =>
object(stdClass)[871]
...
public 'charSet' => string 'utf-8' (length=5)
public 'mimeType' => string 'text/html' (length=9)
public 'modifiedDate' => null
public 'client' =>
object(Joomla\Application\Web\WebClient)[30]
...
protected 'document' =>
object(Joomla\CMS\Document\HtmlDocument)[520]
...
protected 'language' =>
object(Joomla\CMS\Language\Language)[28]
...
protected 'session' =>
object(Joomla\CMS\Session\Session)[41]
...
protected 'response' =>
object(stdClass)[32]
...
private 'responseMap' (Joomla\CMS\Application\WebApplication) =>
array (size=61)
...
private 'singleValueResponseHeaders' (Joomla\CMS\Application\WebApplication) =>
array (size=27)
...
protected 'dispatcher' =>
object(JEventDispatcher)[37]
...
protected 'identity' => null
protected 'config' =>
object(Joomla\Registry\Registry)[22]
...
public 'input' =>
object(Joomla\CMS\Input\Input)[20]
...
private 'logger' (Joomla\Application\AbstractApplication) =>
object(Joomla\CMS\Log\DelegatingPsrLogger)[42]
...
public 'item_associations' => int 1
'type' => string '->' (length=2)
'args' =>
array (size=0)
empty
12 =>
array (size=7)
'file' => string '/home/rigo/Projects/tiktaalik/v2/index.php' (length=42)
'line' => int 49
'function' => string 'execute' (length=7)
'class' => string 'Joomla\CMS\Application\CMSApplication' (length=37)
'object' =>
object(Joomla\CMS\Application\SiteApplication)[19]
protected '_language_filter' => boolean true
protected '_detect_browser' => boolean false
protected 'docOptions' =>
array (size=0)
...
public 'scope' => string 'com_hikashop' (length=12)
protected '_clientId' => int 0
protected '_messageQueue' =>
array (size=3)
...
protected '_name' => string 'site' (length=4)
protected 'profiler' =>
object(Joomla\CMS\Profiler\Profiler)[15]
...
protected 'template' =>
object(stdClass)[871]
...
public 'charSet' => string 'utf-8' (length=5)
public 'mimeType' => string 'text/html' (length=9)
public 'modifiedDate' => null
public 'client' =>
object(Joomla\Application\Web\WebClient)[30]
...
protected 'document' =>
object(Joomla\CMS\Document\HtmlDocument)[520]
...
protected 'language' =>
object(Joomla\CMS\Language\Language)[28]
...
protected 'session' =>
object(Joomla\CMS\Session\Session)[41]
...
protected 'response' =>
object(stdClass)[32]
...
private 'responseMap' (Joomla\CMS\Application\WebApplication) =>
array (size=61)
...
private 'singleValueResponseHeaders' (Joomla\CMS\Application\WebApplication) =>
array (size=27)
...
protected 'dispatcher' =>
object(JEventDispatcher)[37]
...
protected 'identity' => null
protected 'config' =>
object(Joomla\Registry\Registry)[22]
...
public 'input' =>
object(Joomla\CMS\Input\Input)[20]
...
private 'logger' (Joomla\Application\AbstractApplication) =>
object(Joomla\CMS\Log\DelegatingPsrLogger)[42]
...
public 'item_associations' => int 1
'type' => string '->' (length=2)
'args' =>
array (size=0)
empty
Thanks in advance for any feedback you may provide
Please Log in or Create an account to join the conversation.
5 years 6 months ago #331723
by nicolas
Replied by nicolas on topic Paypal payment trigger after_end.php
Hi,
Sorry for the delay. I only saw your message now.
I would recommend to add some debug in the after_end function in components/com_hikashop/controllers/checkout.php
There, you can see a call to cleanCartFromSession which will:
- clear the cart session data if necessary
- redirect to the "return_url" of the payment method of the order
So It's possible that the after_end is skipped if you have a return url configured in the payment method settings because of that.
Then, you aslo have a check on the user with the code:
So if the order cannot be found in the database, or the current logged in user is different from the user of the order, or if the order_token of the order in the database is different from the order_token passed in the parameters of the URL (for guest checkouts), the system will refuse the display of the after_end view.
These are the two reasons which would make is so that the after_end URL would be called but that the after_end view itself would not be displayed.
Sorry for the delay. I only saw your message now.
I would recommend to add some debug in the after_end function in components/com_hikashop/controllers/checkout.php
There, you can see a call to cleanCartFromSession which will:
- clear the cart session data if necessary
- redirect to the "return_url" of the payment method of the order
So It's possible that the after_end is skipped if you have a return url configured in the payment method settings because of that.
Then, you aslo have a check on the user with the code:
Code:
if(empty($order) || (hikashop_loadUser(false) != $order->order_user_id && $order->order_token != $order_token))
return false;
These are the two reasons which would make is so that the after_end URL would be called but that the after_end view itself would not be displayed.
Please Log in or Create an account to join the conversation.
Time to create page: 0.049 seconds