Dotpay payment plugin

  • Posts: 91
  • Thank you received: 5
6 years 1 month ago #299687

-- HikaShop version -- : 4.0.0
-- Joomla version -- : 3.8.13
-- PHP version -- : 7.1
-- Browser(s) name and version -- : Chrome latest

I am using Hikashop dotPay free payment plugin, downloaded from www.dotpay.pl/moduly-i-wtyczki/
(DotPay is one of the biggest payment gateways in Poland).
It's not updated for 3 years, but still works :)

The case is that after successful payment it doesn't update the status of the Order to Confirmed. It only displays the Success Message with Order Link in Hikashop.

The final URL after successful payment is for example:

/index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id=26&order_token=tsZkCtHc&Itemid=248&status=OK

The onPaymentNotification function looks like this:
public function onPaymentNotification(&$statuses)
	{
		$vars = $this->createVarsFromRequest();
		$orderId = (int)@$vars['control'];

		$orderDb = $this->loadOrderRelatedData($orderId);

		if(!$this->isRequestValidated($vars, $orderDb)){
            return $this->processRequest($orderId, $this->payment_params->invalid_status);
		}

        if(!$this->isSignatureMatch($vars)){
            return $this->processRequest($orderId, $this->payment_params->pending_status);
        }

        if($this->isStatusCompleted($vars)){
            return $this->processRequest($orderId, $this->payment_params->verified_status);
		}else{
            $this->statusMessage = $vars['operation_status'];
            return $this->processRequest($orderId, $this->payment_params->pending_status);
        }
	}
Can you give me a hint, what should I change to update the order according to the "status" GET value?

Please Log in or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
6 years 1 month ago #299690

Hi,

This URL is the user return URL where the customer is redirected after the payment.
It doesn't call the onPaymentNotification function.

And you don't want to base yourself only on the status variable in that URL to change the status of the order. Otherwise, the orders would be easily confirmed by customers without any payment, just by accessing that URL with that parameter after creating an order and not paying it.

The onPaymentNotification is called by the notification URL which is given by the plugin to dotPay automatically. Then, dotPay calls it in the background after the payment.
So if the status of the order doesn't change, it's either that the payment notification wasn't sent, or that the plugin didn't receive it, or that there was a problem with it.
But the code I can see in the payment plugin looks correct to be able to handle changing the order status after the payment is made. So I can't give any hint on what to change because the code is already there to do that.

In all the payment plugins we develop, we add a "debug" parameter so that you can enable it and it will write debug data in the HikaShop payment log file using the hikashop_writeToLog function when activated. That way you can more easily understand why the payment notification was refused (for example, the pin number is not correct in the settings of the payment method).
However, I can see that there is no such setting for the dotPay payment plugin.

There are many things that can lead to your issue:
- the website requires an authentification to be accessed
- there is some IP geoblocking
- your hosting has a firewall preventing the notification
- a wrong configuration of the information
- something that has to be activated in the merchant account of your payment gateway
etc

The first thing I would recommend to do is to contact the merchant support of dotPay so that they can look at the situation. As they have access to the logs of the payment gateway and know better than us the code of the payment plugin (since they developed it), they will be better able to help you than us.

Please Log in or Create an account to join the conversation.

Time to create page: 0.048 seconds
Powered by Kunena Forum