Post by tommix » Tue May 12, 2009 6:02 am

I amde test. here code:

Code: Select all

public function callback() {
		$this->load->library('encryption');
		
		$encryption = new Encryption($this->config->get('config_encryption'));
		$order_id = $encryption->decrypt(@$this->request->get['order_id']);
		
		mail('xxxxxxxxxx@gmail.com', 'po-encrypt', $order_id);
		
		$this->load->model('checkout/order');
				
		$order_info = $this->model_checkout_order->getOrder($order_id);
		
		mail('xxxxxxxxx@gmail.com', 'po-oder-info', $order_info);
		
		if ($order_info) {
			$req = 'cmd=_notify-validate';
		
			foreach ($this->request->post as $key => $value) {
				$req .= '&' . $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($req)) . "\r\n\r\n";
		
			if (!$this->config->get('paypal_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 . $req);
			
				while (!feof($fp)) {
					$res = fgets($fp, 1024);
				
					if (strcmp($res, 'VERIFIED') == 0) {
					mail('xxxxxxxxx@gmail.com', 'pries-verify', $order_id);
						$this->model_checkout_order->confirm($order_id, $this->config->get('paypal_order_status_id'));
						mail('xxxxxx@gmail.com', 'po-verify', $order_id);
					}
				}
			
as you see i added MAIL function after the some functions... i made a payment and guess how much mails i've got? 1. - the first one rigth after the ENCRYPT. So it is not server error. And by the way-it send me rigth ID number so it's not bad id.. so it stops working somewhere here

Code: Select all

	$this->load->model('checkout/order');
				
		$order_info = $this->model_checkout_order->getOrder($order_id);
maybe you know why it can be so?

So if it gennot get: $order_info - it will not execute the whole verify function. so everything stops. So the problem maybe is in $order_info -it maybe empty somehow? who can cause this?

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Tue May 12, 2009 6:58 am

have you altered the code anywhere?

It might be that the order_status_id has changed.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Tue May 12, 2009 7:09 am

no i didnd't only in product -added new field and customer added two fields.
product id-returns good i've tested it.

b.t.w - this is the files not changed - stops working but before they was working.. this is the strangest part -it was working for some time and no changes exept DB was changed-imported orders, and other data-products.
what can be in DB so important to stop something ? i looked at the getOrder function-it's so simple..it's just a sql query..so it seems that cannot be fault there..

anyway- let's say-it cannot get order_info but why it stops executing rest of the code? why it don't send mail?? so maybe there is some php error and system don't show? cause of error it stops executing rest of the script.

maybe i can put some code to show if is there errors? Maybe Load->Model causes some error?

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Tue May 12, 2009 7:19 am

It would stop the code if there was a mysql error.

can u set it to mail you if a mysql comes up on the callback?

your using v1.2.8 right?

also when you are importing the data it should have only insert's and no create tables. Is that correct?

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Tue May 12, 2009 8:01 am

Daniel wrote:It would stop the code if there was a mysql error.

can u set it to mail you if a mysql comes up on the callback?

your using v1.2.8 right?

also when you are importing the data it should have only insert's and no create tables. Is that correct?
sorry, but what you mean? comes up? you tell me where to put-i'll do it :)

yes i'm using 1.2.8, and i import with the import/export tool in admin- i just delete some tables -like zones, countries to not import..but it should not effect anything.

it' worked today-i imported all needed data-it worked..but don't know why-it stopped -so upgrade is good at this point cause it was working after it.

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Tue May 12, 2009 8:07 am

Open:

system > database > mysql.php

Before:

exit('Error: ' . mysql_error() . '<br />Error No: ' . mysql_errno() . '<br />' . $sql);

Put:

mail('xxxxxxxxxx@gmail.com', 'po-encrypt', mysql_error());

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Tue May 12, 2009 8:08 am

ok i'll do it btw i made new test and

$this->load->model('checkout/order'); <-- WORKS after it i put mail-i've got mail
$order_info = $this->model_checkout_order->getOrder($order_id); <-- after that- i do not got.


i put where you said- i didn'd got an email...so its maybe not db ..god damn so what? :D i'm feel like stupid..but it's not me! :)

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by tommix » Thu May 14, 2009 4:14 am

So Daniel do you have any suggestions? :)
maybe would help direct query to db not using controller?

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Thu May 14, 2009 4:36 am

i still think its a db error.

i have asked you before if you look in the backup data if you have any create tables. You did not anwser me proplerly.

the only thing i can think of is if the order table was droped by the backup you tried.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Thu May 14, 2009 5:26 am

Daniel wrote:i still think its a db error.

i have asked you before if you look in the backup data if you have any create tables. You did not anwser me proplerly.

the only thing i can think of is if the order table was droped by the backup you tried.
i can 100% garantee that upgrade was well i'm not stupid i can from mind tell how much and what's the manes of OpenCart tables :)

you know what-i thin 1.2.8 paypal works...it may be that the paypal was the bad link not the cart script :)
i tets it and if it's good-you can delete all my s*** i've wrote about it :)

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Thu May 14, 2009 5:35 am

how can it be the link when you are getting mails?

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by tommix » Sat May 16, 2009 12:49 am

Daniel wrote:how can it be the link when you are getting mails?
it can't but it can :D

i used my brothers Personal paypal eccount..at first it worked then no..but after 1day he accepted all payments-and i've got emails from script..again..but not those as i said..after the Order_info..those don't work and No it was not the "paypal fault.."... so the it still exists..today i've got payment and IPN didn't work.

so..the case is still open :)but strange is that-it worked with THE SAME DB the same settings all the same..but now it is not.

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Sat May 16, 2009 4:55 am

if you do a freash install and it works great!

if you upgrade and it does not wok its the db fault!

As i've said onyl you have this problem.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by pee » Sun May 17, 2009 11:03 am

Hi,

I've activated the paypal-module in the admin menu. But when I want to do a test-buy, so I cannot choose paypal.

I've a OpenCart v1.28 System with german language-files. I was only copying the english language-files for paypal from the english payment-folder to the german. Can be the language-files the problem?

Professionelles Onlineshop-Design & -Programmierung: http://netzor.de


User avatar
pee
New member

Posts

Joined
Fri May 08, 2009 4:48 pm
Location - Germany

Post by tommix » Sun May 17, 2009 6:57 pm

Daniel wrote:if you do a freash install and it works great!

if you upgrade and it does not wok its the db fault!

As i've said onyl you have this problem.
But ..if i do Upgrade and it works, but after few test payments -it stops working? then what? :)

Ok let say it just me..but..there must be something who is fault..how it can be DB tables if all tabales is in their places? And after upgrade it works fine but after few payments stops.. And if there was DB error in upgrade-it would display error message in upgrade process.

i understand that it stops working after trying to do query but..why? that's what is the interesting part..if there is error why db controller don't send me email after else statement?


PEE -try to delete cache from cache folder.

Active Member

Posts

Joined
Mon Apr 20, 2009 5:21 am

Post by Daniel » Sun May 17, 2009 8:30 pm

pee wrote:Hi,

I've activated the paypal-module in the admin menu. But when I want to do a test-buy, so I cannot choose paypal.

I've a OpenCart v1.28 System with german language-files. I was only copying the english language-files for paypal from the english payment-folder to the german. Can be the language-files the problem?
is the status set to enabled?

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Daniel » Sun May 17, 2009 8:34 pm

tommix wrote:
Daniel wrote:if you do a freash install and it works great!

if you upgrade and it does not wok its the db fault!

As i've said onyl you have this problem.
But ..if i do Upgrade and it works, but after few test payments -it stops working? then what? :)

Ok let say it just me..but..there must be something who is fault..how it can be DB tables if all tabales is in their places? And after upgrade it works fine but after few payments stops.. And if there was DB error in upgrade-it would display error message in upgrade process.

i understand that it stops working after trying to do query but..why? that's what is the interesting part..if there is error why db controller don't send me email after else statement?


PEE -try to delete cache from cache folder.
There might be another possiblity. Some servers block any url that has the words paypal in them. The hosting for opencart does this. Look at the admin demo. the images for paypal will not show because this is how stupied my hosting service provider is.

are you sure it stopped workign after so long? or did you do your up[grade and it stop[ped working?

ok i've had enough of this. what is your ftp username and password. please pm me the details for your site. I also want the the db access!

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by pee » Sun May 17, 2009 10:43 pm

Daniel wrote:
pee wrote:Hi,

I've activated the paypal-module in the admin menu. But when I want to do a test-buy, so I cannot choose paypal.

I've a OpenCart v1.28 System with german language-files. I was only copying the english language-files for paypal from the english payment-folder to the german. Can be the language-files the problem?
is the status set to enabled?
Yes, it's enabled.

Professionelles Onlineshop-Design & -Programmierung: http://netzor.de


User avatar
pee
New member

Posts

Joined
Fri May 08, 2009 4:48 pm
Location - Germany

Post by Daniel » Sun May 17, 2009 11:38 pm

close the browser down and start again. are you sure you transalted the paypal files.

if fact pee if you can't get it working yourself please don't ask for help. after some of the other posts you have made i think it will be pretty impossible to talk you though to getting it working propperly.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by pee » Mon May 18, 2009 2:17 am

Which paypal-files I have to translate? In the payment-folder of the language is only one file which is named paypal.php and contains the following text:

Code: Select all

<?php

// Text

$_['text_title'] = 'PayPal';

?>
After closing the browser paypal is ready to choose, but then I get on the paypal-website and I get the message, that the »pmtaction-value« is unknown. I've got a working paypal account and I've configured my e-mail adress by the paypal-module in the admin area.

I've written an e-mail to paypal. May they will help.

Professionelles Onlineshop-Design & -Programmierung: http://netzor.de


User avatar
pee
New member

Posts

Joined
Fri May 08, 2009 4:48 pm
Location - Germany
Who is online

Users browsing this forum: No registered users and 14 guests