Is it really supposed to be like that with PCP in Joomla?

Phoca Cart - complex e-commerce extension
lpatrick
Phoca Enthusiast
Phoca Enthusiast
Posts: 88
Joined: 13 Feb 2024, 17:00

Is it really supposed to be like that with PCP in Joomla?

Post by lpatrick »

Cart 5 Beta 37

It seems that the Dispatcher dispatches the events to all Publish PCP (in Plugins) one by one.

Then they all need to check if it's them who need to execute it or false if not?
E.g. like it is (only) in the code for PayPal

Code: Select all

	protected $name 	= 'paypal_standard';
...
	function onPCPbeforeProceedToPayment(&$proceed, &$message, $eventData) {

		if (!isset($eventData['pluginname']) || isset($eventData['pluginname']) && $eventData['pluginname'] != $this->name) {
			return false;
		}
So if you have 20 PCP installed and published in Plugins, then they will all be 'executed/checked' until it gets to the one you want (alphabetically if I'm not mistaken).

And if ANY of them uses old code which doesn't have $eventData or don't do the above check, that wrong plugin may try to process it?!

And the fact that you did or did not install them, or unpublished them in Phoca Cart doesn't seem to be relevant?

Seems to me it's a big danger when customers want to update, if the PCP aren't up to do or don't implement that check.

If all that is normal functionality, my next question: if a payment is aborted for whatever reason, the Order stays in Pending ... forever?
There is no way for the customer to try payment again and also the Cart is always emptied even if payment isn't finished (so customer could try again with some other PCP maybe without needing to add all products to the cart again)?

There is also no message indicating that this order will (probably) never be executed? No error message or anything is being stored?
Pending isn't always a dead state, is it? So customer might expect the order will go out of Pending after a while, which in this case it never will?

Not trying to be negative, just trying to understand if it's all 'as expected' or still due to it being a beta and what I should know to create a PCP myself.

Thanks
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47887
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Is it really supposed to be like that with PCP in Joomla?

Post by Jan »

Hi, this is the Joomla feature, the protection is added by Phoca Cart extra and yes, it means that every developer should follow the rules. Unfortunately, there in no way to do this in component (I have explained it in this forum in some post more detailed), so the only way was adding this extra check to each plugin. I am not 100% sure but this should change in newest Joomla event handling. If so, this will be overwritten in future.

Jan
If you find Phoca extensions useful, please support the project
Post Reply