- Posts: 98
- Thank you received: 7
Payment plugin write to log is not working
- Markus Schnier
-
Topic Author
- Offline
Less
More
3 years 1 month ago #354483
by Markus Schnier
Payment plugin write to log is not working was created by Markus Schnier
-- HikaShop version -- : 4.7.5
-- Joomla version -- : latest 4
-- PHP version -- : 8.1
Hi
I developed a payment plugin for payever based on your example. Since moving to J4 the Payment Log will not updated anymore based on your example
I checked the paypal plugins and saw that you worked now with
but just this statement in my plugin is not working.
hikashop_writeToLog("test");
Anything additonally needed to instantiate this function ?
Thanks and best regards
Markus
-- Joomla version -- : latest 4
-- PHP version -- : 8.1
Hi
I developed a payment plugin for payever based on your example. Since moving to J4 the Payment Log will not updated anymore based on your example
Code:
if($this->payment_params->debug) //Debug mode activated or not
{
//Here we display debug information which will be catched by HikaShop and stored in the payment log file available in the configuration's Files section.
echo print_r($vars,true)."\n\n\n";
echo print_r($dbOrder,true)."\n\n\n";
echo print_r($hash,true)."\n\n\n";
}
I checked the paypal plugins and saw that you worked now with
Code:
hikashop_writeToLog('paypal_id missing !');
but just this statement in my plugin is not working.
hikashop_writeToLog("test");
Anything additonally needed to instantiate this function ?
Thanks and best regards
Markus
Please Log in or Create an account to join the conversation.
3 years 1 month ago #354489
by nicolas
Replied by nicolas on topic Payment plugin write to log is not working
Hi,
print_r will still work fine. However, the problem with that is that the process needs to go successfully to the end so that the data displayed in the output is stored in the log by HikaShop. If you have something like this:
you won't get anything in the payment log file, because PHP will generate a fatal error when trying to call call_function_which_does_not_exists, before HikaShop can log the output.
That's why we now usually use hikashop_writeToLog. This function will directly log the data provided, without waiting for anything.
If you have the line hikashop_writeToLog('test'); somewhere and you don't see anything in the payment log file, it means that your code is not being processed. The most probable is that the notification URL is not being called by the payment gateway for some reason.
print_r will still work fine. However, the problem with that is that the process needs to go successfully to the end so that the data displayed in the output is stored in the log by HikaShop. If you have something like this:
Code:
echo print_r($vars,true);
call_function_which_does_not_exists();
return;
That's why we now usually use hikashop_writeToLog. This function will directly log the data provided, without waiting for anything.
If you have the line hikashop_writeToLog('test'); somewhere and you don't see anything in the payment log file, it means that your code is not being processed. The most probable is that the notification URL is not being called by the payment gateway for some reason.
Please Log in or Create an account to join the conversation.
- Markus Schnier
-
Topic Author
- Offline
Less
More
- Posts: 98
- Thank you received: 7
3 years 1 month ago #354609
by Markus Schnier
Replied by Markus Schnier on topic Payment plugin write to log is not working
Hi Nicolas,
thanks. Let me test it with hikashop_writeToLog('test'); . A first test in the beginning of onPaymentNotification(&$statuses) worked. Thanks for your help
Related question. To activate the php log my hosting provider requires that I put the php.ini into the related folders. But neither in the Plugins folders nor in the hikahsop folders this triggered a proper logging. The php-logs remains empty. Any idea ?
thanks and best regards
Markus
thanks. Let me test it with hikashop_writeToLog('test'); . A first test in the beginning of onPaymentNotification(&$statuses) worked. Thanks for your help
Related question. To activate the php log my hosting provider requires that I put the php.ini into the related folders. But neither in the Plugins folders nor in the hikahsop folders this triggered a proper logging. The php-logs remains empty. Any idea ?
thanks and best regards
Markus
Please Log in or Create an account to join the conversation.
3 years 1 month ago #354612
by nicolas
Replied by nicolas on topic Payment plugin write to log is not working
Hi,
I'm not sure. What does "related folders" means for your hosting ?
If it's "the folder where the main PHP file being called is located", then you should put the php.ini file at the root of the website since the main PHP file being called is the index.php of Joomla for the frontend.
I'm not sure. What does "related folders" means for your hosting ?
If it's "the folder where the main PHP file being called is located", then you should put the php.ini file at the root of the website since the main PHP file being called is the index.php of Joomla for the frontend.
Please Log in or Create an account to join the conversation.
- Markus Schnier
-
Topic Author
- Offline
Less
More
- Posts: 98
- Thank you received: 7
3 years 4 weeks ago #354722
by Markus Schnier
Replied by Markus Schnier on topic Payment plugin write to log is not working
Hi Nicolas,
that worked. I tried the Plugins and also the error is fixed.
Thanks and best regards
Markus
that worked. I tried the Plugins and also the error is fixed.
Thanks and best regards
Markus
The following user(s) said Thank You: nicolas
Please Log in or Create an account to join the conversation.
Time to create page: 0.330 seconds