http://www.valscutlery.com << now running 1.3.0Daniel wrote:what is your site url?
[edit] I found a post where you mention the apostrophe could be an issue in the site name, so I removed that as well (It used to be "Val's Cutlery")
In two hours I will be available for any testing you might need if you still need any help.
Edit: I have an apostrophe in my site name, is that a problem? The grammar seems very wrong without it.
Edit: I have an apostrophe in my site name, is that a problem? The grammar seems very wrong without it.
Just got this error:
2009-08-06 16:26:53 - PHP Warning: fsockopen(): unable to connect to www.sandbox.paypal.com:80 (Connection refused) in /hsphere/local/home/tahnee/tahnee.org/emporium/catalog/controller/payment/pp_standard.php on line 87
2009-08-06 16:26:53 - PHP Warning: fsockopen(): unable to connect to www.sandbox.paypal.com:80 (Connection refused) in /hsphere/local/home/tahnee/tahnee.org/emporium/catalog/controller/payment/pp_standard.php on line 87
OpenCart®
Project Owner & Developer.
Hmm, well have you seen anything with the live paypal? I still wonder if it is something with the site itself, because even incomplete orders are not being shown on the system. The status is 0 in all of the orders in the database. Sorry if I am just missing something, but I think that is part of the problem too.
order statuses are 0 until they have been confirmed.
I have been looking around and prestashop has had this problem to.
they fixed it by having fsockopen and curl running. If one method failed it would try another.
This is definity a server problem and not the opencart script.
I have been looking around and prestashop has had this problem to.
they fixed it by having fsockopen and curl running. If one method failed it would try another.
This is definity a server problem and not the opencart script.
OpenCart®
Project Owner & Developer.
Ah okay! So you are saying the incomplete orders are not listed then and it is a Paypal communication/Server communication error? Well then... should we enable fsockopen and curl? Thanks for your continued help!
Also, I noticed when I confirmed a PayPal payment after changing its status in the database and then completing the order the quantity did not go down. Is that tied to this whole problem?
Also, I noticed when I confirmed a PayPal payment after changing its status in the database and then completing the order the quantity did not go down. Is that tied to this whole problem?
I tried the above script and get the following error.<?php
class ControllerPaymentPPStandard extends Controller {
protected function index() {
$this->data['button_confirm'] = $this->language->get('button_confirm');
$this->data['button_back'] = $this->language->get('button_back');
if (!$this->config->get('pp_standard_test')) {
$this->data['action'] = 'https://www.paypal.com/cgi-bin/webscr';
} else {
$this->data['action'] = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$this->data['business'] = $this->config->get('pp_standard_email');
$this->data['item_name'] = html_entity_decode($this->config->get('config_store'));
$this->data['currency_code'] = $order_info['currency'];
$this->data['amount'] = $this->currency->format($order_info['total'], $order_info['currency'], $order_info['value'], FALSE);
$this->data['first_name'] = $order_info['payment_firstname'];
$this->data['last_name'] = $order_info['payment_lastname'];
$this->data['address1'] = $order_info['payment_address_1'];
$this->data['address2'] = $order_info['payment_address_2'];
$this->data['city'] = $order_info['payment_city'];
$this->data['zip'] = $order_info['payment_postcode'];
$payment_address = $this->customer->getAddress($this->session->data['payment_address_id']);
$this->data['country'] = $payment_address['iso_code_2'];
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
$this->data['notify_url'] = $this->url->http('payment/pp_standard/callback&order_id=' . $encryption->encrypt(urlencode($this->session->data['order_id'])));
$this->data['email'] = $order_info['email'];
$this->data['invoice'] = $this->session->data['order_id'] . ' - ' . $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname'];
$this->data['lc'] = $this->language->getCode();
if (!$this->config->get('pp_standard_transaction')) {
$this->data['paymentaction'] = 'authorization';
} else {
$this->data['paymentaction'] = 'sale';
}
$this->data['return'] = $this->url->https('checkout/success');
$this->data['cancel_return'] = $this->url->https('checkout/payment');
$this->data['back'] = $this->url->https('checkout/payment');
$this->id = 'payment';
$this->template = $this->config->get('config_template') . 'payment/pp_standard.tpl';
$this->render();
}
public function callback() {
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
if (isset($this->request->get['order_id'])) {
$order_id = $encryption->decrypt(urldecode($this->request->get['order_id']));
} else {
$order_id = 0;
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
$request = 'cmd=_notify-validate';
foreach ($this->request->post as $key => $value) {
$request .= '&' . $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($request)) . "\r\n\r\n";
if (!$this->config->get('pp_standard_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 . $request);
while (!feof($fp)) {
$response = fgets($fp, 1024);
if (strcmp($response, 'VERIFIED') == 0) {
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
switch($this->request->post['payment_status']){
case 'Completed':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_id'), '', TRUE);
break;
case 'Canceled_Reversal':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_canceled_reversal_id'), '', TRUE);
break;
case 'Denied':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_denied_id'), '', TRUE);
break;
case 'Failed':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_failed_id'), '', TRUE);
break;
case 'Pending':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_pending_id'), '', TRUE);
break;
case 'Refunded':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_refunded_id'), '', TRUE);
break;
case 'Reversed':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_reversed_id'), '', TRUE);
break;
default:
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_unspecified_id'), '', TRUE);
break;
}
}
}
fclose($fp);
}
}
}
}
?>
Fatal error: Class 'Controllerpaymentpaypal' not found in /home/lioness/public_html/cart1/system/engine/controller.php on line 35
Regards
Chris Fardon
Fardon Webhosting & Design
https://www.stoneconceptsoz.com/ocart
this shoudl fix peoples problems.
only use it if you are using 1.3.0
only use it if you are using 1.3.0
Code: Select all
<?php
class ControllerPaymentPPStandard extends Controller {
protected function index() {
$this->data['button_confirm'] = $this->language->get('button_confirm');
$this->data['button_back'] = $this->language->get('button_back');
if (!$this->config->get('pp_standard_test')) {
$this->data['action'] = 'https://www.paypal.com/cgi-bin/webscr';
} else {
$this->data['action'] = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$this->data['business'] = $this->config->get('pp_standard_email');
$this->data['item_name'] = html_entity_decode($this->config->get('config_store'));
$this->data['currency_code'] = $order_info['currency'];
$this->data['amount'] = $this->currency->format($order_info['total'], $order_info['currency'], $order_info['value'], FALSE);
$this->data['first_name'] = $order_info['payment_firstname'];
$this->data['last_name'] = $order_info['payment_lastname'];
$this->data['address1'] = $order_info['payment_address_1'];
$this->data['address2'] = $order_info['payment_address_2'];
$this->data['city'] = $order_info['payment_city'];
$this->data['zip'] = $order_info['payment_postcode'];
$payment_address = $this->customer->getAddress($this->session->data['payment_address_id']);
$this->data['country'] = $payment_address['iso_code_2'];
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
$this->data['notify_url'] = $this->url->http('payment/pp_standard/callback&order_id=' . $encryption->encrypt(urlencode($this->session->data['order_id'])));
$this->data['email'] = $order_info['email'];
$this->data['invoice'] = $this->session->data['order_id'] . ' - ' . $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname'];
$this->data['lc'] = $this->language->getCode();
if (!$this->config->get('pp_standard_transaction')) {
$this->data['paymentaction'] = 'authorization';
} else {
$this->data['paymentaction'] = 'sale';
}
$this->data['return'] = $this->url->https('checkout/success');
$this->data['cancel_return'] = $this->url->https('checkout/payment');
$this->data['back'] = $this->url->https('checkout/payment');
$this->id = 'payment';
$this->template = $this->config->get('config_template') . 'payment/pp_standard.tpl';
$this->render();
}
public function callback() {
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
if (isset($this->request->get['order_id'])) {
$order_id = $encryption->decrypt(urldecode($this->request->get['order_id']));
} else {
$order_id = 0;
}
$this->load->model('checkout/order');
$order_info = $this->model_checkout_order->getOrder($order_id);
if ($order_info) {
$request = 'cmd=_notify-validate';
foreach ($this->request->post as $key => $value) {
$request .= '&' . $key . '=' . urlencode(stripslashes($value));
}
if (function_exists('curl_exec')) {
if (!$this->config->get('pp_standard_test')) {
$ch = curl_init('https://www.paypal.com/cgi-bin/webscr');
} else {
$ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
}
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);
if (strcmp($response, 'VERIFIED') == 0) {
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
}
curl_close($ch);
} else {
$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($request)) . "\r\n\r\n";
$header .= 'Connection: close' ."\r\n\r\n";
if (!$this->config->get('pp_standard_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 . $request);
while (!feof($fp)) {
$response = fgets($fp, 1024);
if (strcmp($response, 'VERIFIED') == 0) {
$this->model_checkout_order->confirm($order_id, $this->config->get('pp_standard_order_status_id'));
switch($this->request->post['payment_status']){
case 'Completed':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_id'), '', TRUE);
break;
case 'Canceled_Reversal':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_canceled_reversal_id'), '', TRUE);
break;
case 'Denied':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_denied_id'), '', TRUE);
break;
case 'Failed':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_failed_id'), '', TRUE);
break;
case 'Pending':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_pending_id'), '', TRUE);
break;
case 'Refunded':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_refunded_id'), '', TRUE);
break;
case 'Reversed':
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_reversed_id'), '', TRUE);
break;
default:
$this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_unspecified_id'), '', TRUE);
break;
}
}
}
fclose($fp);
}
}
}
}
}
?>
OpenCart®
Project Owner & Developer.
I can never get version 1.30 to install onto my server.....i get it all happening but cannot get it to create the database.Daniel wrote:you are not usign the correct version it must be 1.3.0.
In version 1.2.8 what do i have to set the ipn in paypal to return back to? i.e. the address....
Also none of the emails seem to be sent out from the systen, is there something i have to set to make this happen?
Also sorry one more thing, there is an order status in the settings and also under tha payment gateway, which one is the one that it will take notice of?
Thanks in advance.
Regards
Chris Fardon
Fardon Webhosting & Design
https://www.stoneconceptsoz.com/ocart
Thanks Daniel. I've tested it, and it at least works. I don't know if it'll fix the bug, because i never seemed to get the bug when tested the old version. Seemed strange that other people using my store made it bug.Daniel wrote:this shoudl fix peoples problems.
only use it if you are using 1.3.0
Code: Select all
<?php class ControllerPaymentPPStandard extends Controller { protected function index() { $this->data['button_confirm'] = $this->language->get('button_confirm'); $this->data['button_back'] = $this->language->get('button_back'); if (!$this->config->get('pp_standard_test')) { $this->data['action'] = 'https://www.paypal.com/cgi-bin/webscr'; } else { $this->data['action'] = 'https://www.sandbox.paypal.com/cgi-bin/webscr'; } $this->load->model('checkout/order'); $order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']); $this->data['business'] = $this->config->get('pp_standard_email'); $this->data['item_name'] = html_entity_decode($this->config->get('config_store')); $this->data['currency_code'] = $order_info['currency']; $this->data['amount'] = $this->currency->format($order_info['total'], $order_info['currency'], $order_info['value'], FALSE); $this->data['first_name'] = $order_info['payment_firstname']; $this->data['last_name'] = $order_info['payment_lastname']; $this->data['address1'] = $order_info['payment_address_1']; $this->data['address2'] = $order_info['payment_address_2']; $this->data['city'] = $order_info['payment_city']; $this->data['zip'] = $order_info['payment_postcode']; $payment_address = $this->customer->getAddress($this->session->data['payment_address_id']); $this->data['country'] = $payment_address['iso_code_2']; $this->load->library('encryption'); $encryption = new Encryption($this->config->get('config_encryption')); $this->data['notify_url'] = $this->url->http('payment/pp_standard/callback&order_id=' . $encryption->encrypt(urlencode($this->session->data['order_id']))); $this->data['email'] = $order_info['email']; $this->data['invoice'] = $this->session->data['order_id'] . ' - ' . $order_info['payment_firstname'] . ' ' . $order_info['payment_lastname']; $this->data['lc'] = $this->language->getCode(); if (!$this->config->get('pp_standard_transaction')) { $this->data['paymentaction'] = 'authorization'; } else { $this->data['paymentaction'] = 'sale'; } $this->data['return'] = $this->url->https('checkout/success'); $this->data['cancel_return'] = $this->url->https('checkout/payment'); $this->data['back'] = $this->url->https('checkout/payment'); $this->id = 'payment'; $this->template = $this->config->get('config_template') . 'payment/pp_standard.tpl'; $this->render(); } public function callback() { $this->load->library('encryption'); $encryption = new Encryption($this->config->get('config_encryption')); if (isset($this->request->get['order_id'])) { $order_id = $encryption->decrypt(urldecode($this->request->get['order_id'])); } else { $order_id = 0; } $this->load->model('checkout/order'); $order_info = $this->model_checkout_order->getOrder($order_id); if ($order_info) { $request = 'cmd=_notify-validate'; foreach ($this->request->post as $key => $value) { $request .= '&' . $key . '=' . urlencode(stripslashes($value)); } if (function_exists('curl_exec')) { if (!$this->config->get('pp_standard_test')) { $ch = curl_init('https://www.paypal.com/cgi-bin/webscr'); } else { $ch = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr'); } curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); $response = curl_exec($ch); if (strcmp($response, 'VERIFIED') == 0) { $this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id')); } curl_close($ch); } else { $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($request)) . "\r\n\r\n"; $header .= 'Connection: close' ."\r\n\r\n"; if (!$this->config->get('pp_standard_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 . $request); while (!feof($fp)) { $response = fgets($fp, 1024); if (strcmp($response, 'VERIFIED') == 0) { $this->model_checkout_order->confirm($order_id, $this->config->get('pp_standard_order_status_id')); switch($this->request->post['payment_status']){ case 'Completed': $this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_id'), '', TRUE); break; case 'Canceled_Reversal': $this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_canceled_reversal_id'), '', TRUE); break; case 'Denied': $this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_denied_id'), '', TRUE); break; case 'Failed': $this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_failed_id'), '', TRUE); break; case 'Pending': $this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_pending_id'), '', TRUE); break; case 'Refunded': $this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_refunded_id'), '', TRUE); break; case 'Reversed': $this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_reversed_id'), '', TRUE); break; default: $this->model_checkout_order->update($order_id, $this->config->get('pp_standard_order_status_unspecified_id'), '', TRUE); break; } } } fclose($fp); } } } } } ?>
I have implemented the 1.3.0 bug fix code, and went through an entire order on my site. I paid with Paypal's Sandbox, and then clicked return to merchant after finishing the order. When I checked the admin side of the system, there was no notification of a new order, the product quantities did not go down, even though they ARE set to in the settings, and the Status remained No Status Orders. I have double-checked all my Paypal settings and I do believe they are all in working order, but maybe I have made some mistake? Has anyone else gotten different or similar results? I'd like to get it working asap. The site is going live. Thanks!
Ray
Ray
you don't need to explain about no email or product quanitiy. just say the order is not there.
Check if your server has curl enabled.
CURL is the first method that is tried to contact PayPals server. fsocket is the second method.
if both are blocked then you are stuffed.
please post a link to your site.
Check if your server has curl enabled.
CURL is the first method that is tried to contact PayPals server. fsocket is the second method.
if both are blocked then you are stuffed.
please post a link to your site.
OpenCart®
Project Owner & Developer.
My site is http://jennysgems.comDaniel wrote:you don't need to explain about no email or product quanitiy. just say the order is not there.
Check if your server has curl enabled.
CURL is the first method that is tried to contact PayPals server. fsocket is the second method.
if both are blocked then you are stuffed.
please post a link to your site.
I have checked and curl is enabled. Did a second test just to make sure, same issue.
Who is online
Users browsing this forum: Baidu [Spider] and 69 guests