Code: Select all
public function callback() {
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
$order_id = $encryption->decrypt(@$this->request->get['order_id']);
mail('xxxxxxxxxx@gmail.com', 'po-encrypt', $order_id);
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
mail('xxxxxxxxx@gmail.com', 'po-oder-info', $order_info);
if ($order_info) {
$req = 'cmd=_notify-validate';
foreach ($this->request->post as $key => $value) {
$req .= '&' . $key . '=' . urlencode(stripslashes($value));
}
$header = 'POST /cgi-bin/webscr HTTP/1.0' . "\r\n";
$header .= 'Content-Type: application/x-www-form-urlencoded' . "\r\n";
$header .= 'Content-Length: ' . strlen(utf8_decode($req)) . "\r\n\r\n";
if (!$this->config->get('paypal_test')) {
$fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);
} else {
$fp = fsockopen('www.sandbox.paypal.com', 80, $errno, $errstr, 30);
}
if ($fp) {
fputs($fp, $header . $req);
while (!feof($fp)) {
$res = fgets($fp, 1024);
if (strcmp($res, 'VERIFIED') == 0) {
mail('xxxxxxxxx@gmail.com', 'pries-verify', $order_id);
$this->model_checkout_order->confirm($order_id, $this->config->get('paypal_order_status_id'));
mail('xxxxxx@gmail.com', 'po-verify', $order_id);
}
}
Code: Select all
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
So if it gennot get: $order_info - it will not execute the whole verify function. so everything stops. So the problem maybe is in $order_info -it maybe empty somehow? who can cause this?