onPaymentNotification() - Banktransfer get order

  • Posts: 108
  • Thank you received: 2
13 years 4 months ago #21632

Hey!

I am using the banktransfer payment method in my website and I ran into a problem..
Created a onPaymentNotification() for banktransfer that was copied from paypal and i need to get order info to update status if a success note sent. My problem is I copied from paypal so the code work only at the start and then gets out before getting the order params.

i tried changing this:
$elements = $pluginsClass->getMethods('payment','paypal'); to 'banktransfer' but it return false.

i need to change it so i can use the next line to (i think its that line) change status to confirmed after that i got the order parameters:
$order->old_status->order_status=$dbOrder->order_status;

How can i set the element to banktransfer so it wont fail and how do i use the $order to change the order status?

thanks in advance.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #21635

If that method returns false, it means that the payment plugin is not published or has not been configured or is not available for the current access level.

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

  • Posts: 108
  • Thank you received: 2
13 years 4 months ago #21639

Ok so i checked little farther and found out that the false comes from here:

if(!$element->payment_params->notification){
return false;
}


In addition, $order and $element->payment_params->verified_status are empty by that..

What do i do to get values in thoes parameters?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #21641

Those parameters are set by the user in the configuration of the plugin. Since you didn't add them to the bank transfer plugin they won't be available in that function.
You can look at the file plugins/hikashoppayment/paypal_configuration.php and put them in plugins/hikashoppayment/banktransfer_configuration.php

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

  • Posts: 108
  • Thank you received: 2
13 years 4 months ago #21645

I copied the plugins/hikashoppayment/paypal_configuration.php content to plugins/hikashoppayment/banktransfer_configuration.php and checked the $element parameter, but it is still empty..

What may be the problem?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #21646

You should not copy everything, just the notification and statuses part. Also, once you do that, you obviously have to edit the options of your plugin and save them so that the values are added in the database.

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

  • Posts: 108
  • Thank you received: 2
13 years 4 months ago #21653

Great the element parameter now works, but the $order is still empty..

i used :

$orderClass = hikashop_get('class.order');
$dbOrder = $orderClass->get((int)@$vars);
if(empty($dbOrder)){
echo "Could not load any order for your notification ".@$vars;
return false;
}


and elso:

$dbOrder = $orderClass->get((int)@$_GET);


from ePay.

Both cannot give me the order .. what can i do?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 4 months ago #21654

The URL you're using to call the notification should contain the order_id. Then, you will be able to get the order with the code from ePay

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

  • Posts: 108
  • Thank you received: 2
13 years 4 months ago #21668

Ops, you are right, fixed it and working fine.

Thanks again!

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

Time to create page: 0.067 seconds
Powered by Kunena Forum