PayPal Direct Confirm bug on 1.2.9
Posted: Fri Jul 17, 2009 10:34 am
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
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:
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?
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>
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';
}
..........