Post by dijitul » Tue Sep 06, 2011 6:04 pm

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?

New member

Posts

Joined
Mon Jun 13, 2011 9:21 pm

Post by uksitebuilder » Wed Sep 07, 2011 6:10 am

What statuses do you have set in the paypal modules?

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by cdamianou » Sat Sep 17, 2011 11:18 pm

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?

http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm

Post by i2Paq » Sat Sep 17, 2011 11:23 pm

This happens if the order gets not finished and thus the status is not updated.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by cdamianou » Sat Sep 17, 2011 11:33 pm

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.

http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm

Post by i2Paq » Sat Sep 17, 2011 11:40 pm

Check the PayPal payment module and what statuses you have set.

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by cdamianou » Sat Sep 17, 2011 11:50 pm

Hi i2paq

Please find attached my paypal standard configurations. As you will see everything seems to be setup as normal.

Attachments

Paypal Setup.jpg

Paypal Standard Setup - Paypal Setup.jpg (31.89 KiB) Viewed 3135 times


http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm

Post by uksitebuilder » Sun Sep 18, 2011 12:01 am

Just to throw something up in the air here.

Your store is not in maintenance mode is it ?

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by cdamianou » Sun Sep 18, 2011 12:11 am

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.

http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm

Post by uksitebuilder » Sun Sep 18, 2011 12:30 am

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 ?

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by cdamianou » Sun Sep 18, 2011 12:44 am

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.

http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm

Post by uksitebuilder » Sun Sep 18, 2011 1:03 am

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 ?

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by cdamianou » Sun Sep 18, 2011 1:21 am

The orders are still in the abandoned orders section after the customer is returned back to the store

http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm

Post by uksitebuilder » Sun Sep 18, 2011 1:32 am

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.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by cdamianou » Sun Sep 18, 2011 1:39 am

I have just done as requested. I cant see m o see an error for any part of this transaction process

http://www.magictao.co.uk


Active Member

Posts

Joined
Tue Aug 09, 2011 2:13 pm

Post by uksitebuilder » Sun Sep 18, 2011 1:58 am

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

Code: Select all

$response = curl_exec($curl);
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

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by scpost » Sat Nov 12, 2011 12:16 am

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?

New member

Posts

Joined
Thu Nov 10, 2011 12:51 am

Post by uksitebuilder » Sat Nov 12, 2011 12:26 am

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.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom
Who is online

Users browsing this forum: No registered users and 22 guests