Urgent help needed - worldpay business plugin

  • Posts: 14
  • Thank you received: 0
12 years 9 months ago #46425

Hi, sorry to use 'urgent' in the title, but the site is supposed to go live on Monday and at the moment it is really broken.

I am doing a lot of processing to add stuff to custom database tables in a hikashop plugin in the function onAfterOrderUpdate. Using the Check payment method set to confirm payments immediately, everything worked. We started implementing Worldpay Business and found the payment plugin didn't work and you supplied us with a new one called bf_rbsbusinessgateway_2012-03-27. This plugin works fine with Worldpay, unfortunately my custom plugin is now broken:

When an order is confirmed at Worlpay, onAfterOrderUpdate is called but the $order parameter is empty. I added an implementation of onAfterOrderConfirm (which I saw was implemented in the payment plugin) to pass through to onAfterOrderUpdate, and now the $order parameter contains the updated order status and history, but when I call the hikashop helper loadFullOrder($order->order_id) the return value is empty. I absolutely need to access the full order when payment comes back confirmed, and I cannot understand why hikashop cannot retrieve it when given a valid order Id.

Any help you can give us would be much appreciated.

Regards,

Jerry

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

  • Posts: 83103
  • Thank you received: 13418
  • MODERATOR
12 years 9 months ago #46427

The loadFullOrder function will check whether the current user has the right to get the information of the order.
In your plugin, you don't have that right.
Here is the definition of that function:
function loadFullOrder($order_id,$additionalData=false,$checkUser=true)

so instead of : loadFullOrder($order->order_id)

you should do: loadFullOrder($order->order_id,false,false)

The following user(s) said Thank You: Density5

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

  • Posts: 14
  • Thank you received: 0
12 years 9 months ago #46432

Thanks for your quick reply!

That has allowed me to load the full order, unfortunately it somehow destroys the reference to the current user which I have stored as a global property using $this->user = JFactory::getUser(). I had stored both a reference to the user and the user id itself using $this->account_no = (int)$this->user->get('id');,but they both seem to be reset, which is strange as I am casting the user id to an int. I have no idea how the user Id is getting destroyed before loadFullOrder is even called, do you know what's going on? I can't do anything without the user id :(

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

  • Posts: 14
  • Thank you received: 0
12 years 9 months ago #46433

Of course the answer is obvious, the user id is never set, I am confusing myself now. I can get the user id from $order->customer->user_cms_id.

Thanks for your help, I think you have saved my business today!

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

Time to create page: 0.060 seconds
Powered by Kunena Forum