- Posts: 108
- Thank you received: 2
onPaymentNotification() - Banktransfer get order
15 years 2 months ago #21632
by bars92
onPaymentNotification() - Banktransfer get order was created by bars92
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.
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.
15 years 2 months ago #21635
by nicolas
Replied by nicolas on topic Re: onPaymentNotification() - Banktransfer get order
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.
15 years 2 months ago #21639
by bars92
Replied by bars92 on topic Re: onPaymentNotification() - Banktransfer get order
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?
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.
15 years 2 months ago #21641
by nicolas
Replied by nicolas on topic Re: onPaymentNotification() - Banktransfer get order
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
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.
15 years 2 months ago #21645
by bars92
Replied by bars92 on topic Re: onPaymentNotification() - Banktransfer get order
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?
What may be the problem?
Please Log in or Create an account to join the conversation.
15 years 2 months ago #21646
by nicolas
Replied by nicolas on topic Re: onPaymentNotification() - Banktransfer get order
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.
15 years 2 months ago #21653
by bars92
Replied by bars92 on topic Re: onPaymentNotification() - Banktransfer get order
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?
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.
15 years 2 months ago #21654
by nicolas
Replied by nicolas on topic Re: onPaymentNotification() - Banktransfer get order
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.
15 years 2 months ago #21668
by bars92
Replied by bars92 on topic Re: onPaymentNotification() - Banktransfer get order
Ops, you are right, fixed it and working fine.
Thanks again!
Thanks again!
Please Log in or Create an account to join the conversation.
Time to create page: 0.288 seconds