Page 1 of 1

PayPal Direct Confirm bug on 1.2.9

Posted: Fri Jul 17, 2009 10:34 am
by skyer2000
Just downloaded a fresh copy of OpenCart and ran into a problem when "Confirm Order" is clicked.

It will pop up alerts with the error codes, however if the information is correct, or no error is found, nothing happens, other than the paypal account showing "Payment Received". Here is the code in question, in view/theme/default/template/paypal_direct.tpl

Code: Select all

<script type="text/javascript"><!--
function confirmSubmit() {
	$.ajax({
		type: 'POST',
		url: 'index.php?route=payment/paypal_direct/send',
		data: $('#paypal :input'),
		dataType: 'json',
		success: function(data) {
			if (data.error) {
				alert(data.error);
			}
			
			if (data.success) {
				alert("success2");
				location = 'index.php?route=checkout/success';
			}
		}
	});
}
//--></script>
I put the "success2" in there just to see if it will pop up, but it never does. It should though since the payments are being received on my PayPal test account, as "Payment Received From" with the payment status of "Under Review". What also worries me is that the orders never show up on the admin panel, but I believe this is because I'm using tester accounts in Paypal Sandbox.

To try and fix this I changed the code to the following:

Code: Select all

.........
			if (data.error) {
				alert(data.error);
			}else {
				alert("success2");
				location = 'index.php?route=checkout/success';
			}
..........
Then it shows the alert then redirects, like I would expect it to. Are there any concerns about doing it this way? Or is this a better way to modify this so users will be correctly forwarded to the confirmation page?

Re: PayPal Direct Confirm bug on 1.2.9

Posted: Sat Jul 18, 2009 10:21 am
by Daniel
a few people have reported a problewm with paypal directo but i don;t know why.

what browser are you using?

Re: PayPal Direct Confirm bug on 1.2.9

Posted: Sat Jul 18, 2009 1:30 pm
by skyer2000
Testing on IE8 and Firefox 3.5, same results.

When you fire the success function, are you sure 'data.success' is the correct variable to look for in the if statement?

Re: PayPal Direct Confirm bug on 1.2.9

Posted: Mon Jul 20, 2009 1:53 am
by Daniel
post a link to your site please.

Re: PayPal Direct Confirm bug on 1.2.9

Posted: Mon Jul 20, 2009 8:06 am
by skyer2000
edited

Re: PayPal Direct Confirm bug on 1.2.9

Posted: Mon Jul 20, 2009 8:28 am
by Daniel
can u pm me your admin details?