Post by osglass » Mon Jul 21, 2008 11:41 am

Hi bruce,

I already update the necessary files with your paypal improve v1 and did the other instruction on the readme file!!! and my site is on the internet.. its not locally based.

But the admin website doesn't show the "order" that was placed??

And this code i found from other thread. Do i need to update the paypal.php(paypal improve v1) to make my customer order appear in the admin? any help from you bruce is appreciated. thanks man.

Code: Select all

               $sql = "select `order_status_id` from `order_status` where `name` = '?' and `language_id` = '?'";
                $parsed = $this->database->parse($sql, $this->language->get('order_status_pending'), $this->language->getId()); 
                $results = $this->database->getRow($parsed);
                if ($results)
                {
                    $pendingStatus = $results['order_status_id'];
                }
                //
                //  Perhaps the IPN from paypal has arrived before the user has returned from
                //  the paypal web site OR the user has not returned at all. 
                //  In response to either case, we should load and process the order.
                //             
		$reference = $this->request->get('invoice', 'post');
                if ($this->order->load($reference))
                {
                    //  IPN is winner or customer never returned and IPN arrived.
                    //  default status should be Pending so the update below will have no
                    //  effect if we process the order here but the end result is still correct.
                    $this->order->process(); 
                }
                
                $sql = "update `order` set `order_status_id` = '?' where `reference` = '?' and `order_status_id` = '?'";
                // bug fix from asif
	            //$parsed = $this->database->parse($sql, $paidUnconfirmedStatus, $reference, $pendingStatus);
                $parsed = $this->database->parse($sql,  $pendingStatus, $reference, $paidUnconfirmedStatus);
                $this->database->query($parsed);
			}
Last edited by osglass on Mon Jul 21, 2008 11:53 am, edited 1 time in total.

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by bruce » Mon Jul 21, 2008 1:55 pm

If that code segment is missing from what you have, then do integrate it. You might like to cut out the bits that "look up" the order_status values using values from the language file and simply drop in the order_status_id values our of your database for each of the order status values represented. ie: "pending" and "payment unconfirmed". This code is problematic and is the main thing I am removing for the next release of this payment extension.

Try this IPN testing tool to check your store response to an IPN from paypal. It is a simulator and much easier than messing around with the paypal sandbox and cheaper than live testing.

cheers

Bruce
Last edited by bruce on Sat Jul 26, 2008 10:26 am, edited 1 time in total.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by osglass » Mon Jul 21, 2008 3:01 pm

:)

http://i36.tinypic.com/15zmixi.png[/img]

Code: Select all

<?php
// Text
$_['text_paypal_title'] = 'PayPal and Credit Card';
$_['order_status_paid_unconfirmed'] = 'Paid Unconfirmed';
$_['order_status_pending'] = 'Pending';
?>
Heres my paypal.php Is there something here that needs to be change? or this one is correct code so customer order will appear in the admin.

Code: Select all

                //
                //  The payment is verified so we try to change the status from Paid Unconfirmed to Pending
                //  but only if the status is currently Paid Unconfirmed. A change to any other value
                //  has probably been made by the store administrator.
                //
                //  Remember also, that we are not relying on this to succeed and that it is being 
                //  executed by a callback from paypal. Hence there is no error recovery required.
                //  
                $paidUnconfirmedStatus = 0;
                $pendingStatus = 0;
                                   
                $sql = "select `order_status_id` from `order_status` where `name` = '?' and `language_id` = '?'";
                $parsed = $this->database->parse($sql, $this->language->get('order_status_paid_unconfirmed'), $this->language->getId()); 
                $results = $this->database->getRow($parsed);
                if ($results)
                {
                    $paidUnconfirmedStatus = $results['order_status_id'];
                }

                $sql = "select `order_status_id` from `order_status` where `name` = '?' and `language_id` = '?'";
                $parsed = $this->database->parse($sql, $this->language->get('order_status_pending'), $this->language->getId()); 
                $results = $this->database->getRow($parsed);
                if ($results)
                {
                    $pendingStatus = $results['order_status_id'];
                }

				$reference = $this->request->get('invoice', 'post');
                $sql = "update `order` set `order_status_id` = '?' where `reference` = '?' and `order_status_id` = '?'";
                // bug fix from asif
                //$parsed = $this->database->parse($sql, $paidUnconfirmedStatus, $reference, $pendingStatus);
                $parsed = $this->database->parse($sql,  $pendingStatus, $reference, $paidUnconfirmedStatus);
                $this->database->query($parsed);
			}
		}
  	}
}
?>
Last edited by osglass on Mon Jul 21, 2008 3:06 pm, edited 1 time in total.

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by osglass » Mon Jul 21, 2008 9:16 pm

ITs working now.....  :) thanks to bruce paypal improved v1.

New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm

Post by osglass » Tue Jul 22, 2008 10:47 am


New member

Posts

Joined
Mon Apr 07, 2008 7:52 pm
Who is online

Users browsing this forum: No registered users and 2 guests