Put $order->payment_complete(); in thankyou.php for changing orders status to completed when paypal redirect back to your website