update ipn validation for blue pay payment

if ipn has md5sign value validate it. Otherwise return true (same as old code)
source: http://www.bluepay.com/sites/default/files/documentation/BluePay_bp20post/Bluepay20post.txt
This commit is contained in:
Vaidas Lungis committed 2015-03-03 13:39:30 +02:00
1 parent d9036c0fc0
commit ad978d60a1
2 files changed
+11 -2

No files matched your search

+1
View File
@@ -5,6 +5,7 @@ Release 4.16
* updated translation:
* merged admin.po into messages.po
* added language selector in admin area
* updated blue pay payment adapter ipn validation check function
Release 4.15 (2015-02-19)
------------------------------------------------------------------------------
+10 -2
View File
@@ -297,10 +297,18 @@ To find your ACCOUNT ID and SECRET KEY:
$api_admin->invoice_transaction_update($d);
}
// todo: need validation. use $data['post']['md5sig']. read MBs_gateway_manual pdf, page 18, point IV.
private function _isIpnValid($data)
{
return true;
$md5sign = isset($data['md5sign']) ? $data['md5sign'] : '';
if (empty($md5sign)){
return true;
}
$master_id = isset($data['master_id']) ? $data['master_id'] : '';
$payment_account = isset($data['payment_account']) ? $data['payment_account'] : '';
$hashstr = $this->config['secret'] . $this->config['account_id'] . $data['trans_type'] .
$data['amount'] . $master_id . $data['name1'] . $payment_account;
return $md5sign == bin2hex( md5($hashstr, true) );
}
}