Page 1 of 1
Orders changed to Cancelled - Paypal
Posted: Tue Sep 06, 2011 6:04 pm
by dijitul
Hi there;
We've got 2 different customers with the same issue running opencart.
One uses PayPal Payments Pro, the other uses just Standard PayPal.
However on both stores, both running 1.5.1.1 they get new orders with PayPal - the Money comes through etc but the order status gets changed to cancelled.
If anyone aware of this bug?
Orders changed to Cancelled - Paypal
Posted: Wed Sep 07, 2011 6:10 am
by uksitebuilder
What statuses do you have set in the paypal modules?
Re: Orders changed to Cancelled - Paypal
Posted: Sat Sep 17, 2011 11:18 pm
by cdamianou
Hi dijital
Has this been fixed for you. I have the same issue, orders are placed etc but the order is not showing under the customers order history or in admin. It only shows in admin when I search for abandoned orders.
Can anyone help?
Re: Orders changed to Cancelled - Paypal
Posted: Sat Sep 17, 2011 11:23 pm
by i2Paq
This happens if the order gets not finished and thus the status is not updated.
Re: Orders changed to Cancelled - Paypal
Posted: Sat Sep 17, 2011 11:33 pm
by cdamianou
i2Paq that is wrong. the paypal payment is made and the customer is directed back tot he store were it shows the order complete message. Trust me as I have just tried it out myself.
Re: Orders changed to Cancelled - Paypal
Posted: Sat Sep 17, 2011 11:40 pm
by i2Paq
Check the PayPal payment module and what statuses you have set.
Re: Orders changed to Cancelled - Paypal
Posted: Sat Sep 17, 2011 11:50 pm
by cdamianou
Hi i2paq
Please find attached my paypal standard configurations. As you will see everything seems to be setup as normal.
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 12:01 am
by uksitebuilder
Just to throw something up in the air here.
Your store is not in maintenance mode is it ?
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 12:11 am
by cdamianou
Hi UK Sitebuilder
No my store is not in maintenance mode. It is live. I only noticed this problem when I took my first live transaction. All other payment options work and record sales fine.
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 12:30 am
by uksitebuilder
I cant understand how it being set to 'Cancelled Reversal' status
Looking at the controller code for pp_standard.php, the only way it will get this status is if paypal returns the payment status of 'Canceled_Reversal' or if that is the status that is set when the user leaves your site to go pay (and the callback is not happening).
here's the code that deals with the status changes.
Code: Select all
public function callback() {
$this->load->library('encryption');
$encryption = new Encryption($this->config->get('config_encryption'));
if (isset($this->request->post['custom'])) {
$order_id = $encryption->decrypt($this->request->post['custom']);
} 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(html_entity_decode($value, ENT_QUOTES, 'UTF-8'));
}
if (!$this->config->get('pp_standard_test')) {
$curl = curl_init('https://www.paypal.com/cgi-bin/webscr');
} else {
$curl = curl_init('https://www.sandbox.paypal.com/cgi-bin/webscr');
}
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
if (!$response) {
$this->log->write('PP_STANDARD :: CURL failed ' . curl_error($curl) . '(' . curl_errno($curl) . ')');
}
if ($this->config->get('pp_standard_debug')) {
$this->log->write('PP_STANDARD :: IPN REQUEST: ' . $request);
$this->log->write('PP_STANDARD :: IPN RESPONSE: ' . $response);
}
if ((strcmp($response, 'VERIFIED') == 0 || strcmp($response, 'UNVERIFIED') == 0) && isset($this->request->post['payment_status'])) {
$order_status_id = $this->config->get('config_order_status_id');
switch($this->request->post['payment_status']) {
case 'Canceled_Reversal':
$order_status_id = $this->config->get('pp_standard_canceled_reversal_status_id');
break;
case 'Completed':
if ((float)$this->request->post['mc_gross'] == $this->currency->format($order_info['total'], $order_info['currency_code'], $order_info['currency_value'], false)) {
$order_status_id = $this->config->get('pp_standard_completed_status_id');
}
break;
case 'Denied':
$order_status_id = $this->config->get('pp_standard_denied_status_id');
break;
case 'Expired':
$order_status_id = $this->config->get('pp_standard_expired_status_id');
break;
case 'Failed':
$order_status_id = $this->config->get('pp_standard_failed_status_id');
break;
case 'Pending':
$order_status_id = $this->config->get('pp_standard_pending_status_id');
break;
case 'Processed':
$order_status_id = $this->config->get('pp_standard_processed_status_id');
break;
case 'Refunded':
$order_status_id = $this->config->get('pp_standard_refunded_status_id');
break;
case 'Reversed':
$order_status_id = $this->config->get('pp_standard_reversed_status_id');
break;
case 'Voided':
$order_status_id = $this->config->get('pp_standard_voided_status_id');
break;
}
if (!$order_info['order_status_id']) {
$this->model_checkout_order->confirm($order_id, $order_status_id);
} else {
$this->model_checkout_order->update($order_id, $order_status_id);
}
} else {
$this->model_checkout_order->confirm($order_id, $this->config->get('config_order_status_id'));
}
curl_close($curl);
}
}
What status is the order when you leave your site to pay at paypal ?
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 12:44 am
by cdamianou
Hi
I think I understood your question. When I go through checkout and go to log into paypal I can find the order under Abandoned Cart.
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 1:03 am
by uksitebuilder
OK but above you said that when payment is made the order status is set to cancelled ?
Is that correct or is it still remaining in the abandoned orders section ?
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 1:21 am
by cdamianou
The orders are still in the abandoned orders section after the customer is returned back to the store
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 1:32 am
by uksitebuilder
Right, now we are getting somewhere.
So they are not set as cancelled.
Whole different kettle of fish then.
You are not receiving the IPN callback which then updates the status.
This could be due to a problem with curl on your server - Please check with your hosts that curl is installed and working correctly.
Also, please enable debug in the paypal module.
Place an order and go all the way through to payment. Then check your error log to see if any errors occur.
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 1:39 am
by cdamianou
I have just done as requested. I cant see m o see an error for any part of this transaction process
Re: Orders changed to Cancelled - Paypal
Posted: Sun Sep 18, 2011 1:58 am
by uksitebuilder
In your paypal account, add the following address to your IPN section in your profile
Code: Select all
http://www.YOURSITE.COM/index.php?route=payment/pp_standard/callback
Change the domain to suit yours
Then edit catalog/controller/payment/pp_standard.php
find
add after
Code: Select all
mail('YOU@YOURS.COM','pp response', $request);
Change the email to suit yours
process a payment and you should get an email.
Paste contents of email here
Re: Orders changed to Cancelled - Paypal
Posted: Sat Nov 12, 2011 12:16 am
by scpost
just to toss in a question about Paypal standard.
If customer does pay but does not return to the site and
I change the abandaned cart to processed and add invoice number,
the stock does not get removed from inventory.
Is this by design or software limitation? Or am I processing the abandon cart incorrectly?
Also is this true with any modules that a customer is taking off site to make a payment?
Re: Orders changed to Cancelled - Paypal
Posted: Sat Nov 12, 2011 12:26 am
by uksitebuilder
shouldn't make a difference if the customer returns to the store or not because paypal talks invisibly to the store whilst the customer is on the paypal site.
The order status will (or should) be updated as soon as or shortly after payment is made.