- Posts: 2
- Thank you received: 0
Calling onPaymentNotification() with $_POST
12 years 6 months ago #149554
by Urbanski
Calling onPaymentNotification() with $_POST was created by Urbanski
-- url of the page with the problem -- : http://http://www.qwerty.webion.pl/Joomla323/
-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.2
-- PHP version -- : 5.3
-- Browser(s) name and version -- : Chrome 33.0.1750.154
Hi,
I would like to ask is there a chance to call onPaymentNotification() with params in $_POST. My payment gateway sends CSV params by POST. This is my code:
Thank you in advance,
JU
-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.2
-- PHP version -- : 5.3
-- Browser(s) name and version -- : Chrome 33.0.1750.154
Hi,
I would like to ask is there a chance to call onPaymentNotification() with params in $_POST. My payment gateway sends CSV params by POST. This is my code:
Code:
function onPaymentNotification(&$statuses)
{
if (!empty($_POST)) {
if(empty($_POST['json']) || !$this->check_ip()){
exit;
}
$data = json_decode(stripcslashes($_POST['json']), true);
$ret = array();
foreach($data as $entry)
{
if(isset($entry['account']))
{
$ret[] = array(
'account' => $entry['account'],
'transfer' => $entry['transfer'],
'return' => 1
);
//`account` `control` `transfer` `time` `amount` `guarantee` `title` `status`
if($entry['status'] != '2'){
$this->modifyOrder($order_id, $this->payment_params->verified_status, true, true);
return true;
}
else{
$this->modifyOrder($order_id, $this->payment_params->invalid_status, true, true);
return false;
}
}
echo json_encode($ret);
}
}
exit;
}
Thank you in advance,
JU
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 6 months ago #149559
by Mohamed Thelji
Replied by Mohamed Thelji on topic Calling onPaymentNotification() with $_POST
Hello,
Sure
.
Sure
Please Log in or Create an account to join the conversation.
12 years 6 months ago #149674
by Urbanski
Replied by Urbanski on topic Calling onPaymentNotification() with $_POST
Could you tell me what's wrong with my code then? If I'm using direct link to call onPaymentNotification() without POST it works (before first if I print simple echo and i can see this), but when i do it with POST params it returns page name. Link i'm using is:
MY_PAGE/index.php?notif_payment=NAME&option=com_hikashop&ctrl=checkout&task=notify&tmpl=component&lang=LANGUAGE
MY_PAGE/index.php?notif_payment=NAME&option=com_hikashop&ctrl=checkout&task=notify&tmpl=component&lang=LANGUAGE
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 6 months ago #149677
by Mohamed Thelji
Replied by Mohamed Thelji on topic Calling onPaymentNotification() with $_POST
You should debug your code using the php var_dump function, also note that it won't be displayed on the "onPaymentNotification()" link but through your payment log.
You'll be able to check your payment log file through "Hikashop->System->Configuration->Main" by using the "See the report" button of your Payment log file option.
You'll be able to check your payment log file through "Hikashop->System->Configuration->Main" by using the "See the report" button of your Payment log file option.
Please Log in or Create an account to join the conversation.
Time to create page: 0.202 seconds