Page 1 of 2

[PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Jun 02, 2011 1:47 am
by asdfowkw
Hello peeps!

Im trying to get the Paypal pro running.
Ive filled in my api details and so and im not running in sandbox.

When i click on confirm on the payment during checkout it just stands "Please wait" and nothing more happens.

If i click again it will just add another line with another "Please Wait"

So is this a curl problem or ?

Anyone know how to fix this ? :P

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Jun 02, 2011 1:48 am
by asdfowkw
I see now that i did post it in the wrong forum section sry. Mod please move if you see.

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Tue Jun 07, 2011 8:10 pm
by asdfowkw
bump ?

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Sun Aug 21, 2011 7:15 am
by colinsyu
I have the same problem I am using v1.5.1.1 and everything seems to work well except when I try to checkout on Paypal pro. I have to hit submit twice for the successful page to appear but I also get double paypal transactions.

Opencart seems to be a wonderful product but I am stuck on this part..

Any solution to this problem? Thank you in advance.

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Aug 25, 2011 6:46 pm
by matt1982
It is usually due to incorrect details being entered in the api area.

I would triple check those details first. I have had a nightmare trying to get paypal pro intergrated but I seem to be winning the battle slowly!

Which API are you using for it?

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Tue Oct 25, 2011 6:42 am
by chrsdlmn
Did any of you figure this out?
Transactions will post in OpenCart and on my paypal account, but on the customer side it just hangs on "Please Wait!".

I also am using 1.5.1

I've tried every single suggestion that's posted on the forums and nothing works, it is something with OpenCart though I'm sure. It looks like this has been an issue since 2010 and corrections are made, but it keeps coming up!

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Tue Oct 25, 2011 9:43 am
by chrsdlmn
I figured it out! under catalog/view/theme/default/template/payment/pp_pro.tpl someone had told me to delete:

Code: Select all

 <tr>
      <td><?php echo $entry_cc_start_date; ?></td>
      <td><select name="cc_start_date_month">
          <?php foreach ($months as $month) { ?>
          <option value="<?php echo $month['value']; ?>"><?php echo $month['text']; ?></option>
          <?php } ?>
        </select>
        /
        <select name="cc_start_date_year">
          <?php foreach ($year_expire as $year) { ?>
          <option value="<?php echo $year['value']; ?>"><?php echo $year['text']; ?></option>
          <?php } ?>
        </select></td>
    </tr>
and:

Code: Select all

<tr>
      <td><?php echo $entry_cc_issue; ?></td>
      <td><input type="text" name="cc_issue" value="" size="3" /></td>
    </tr>
Since we don't use those in the States. I added them back in and hide them instead with

Code: Select all

<tr style="display:none">
and it worked!!

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Tue Oct 25, 2011 10:01 am
by chrsdlmn
Nevermind, once I added the code back in I at least get an error message when the Credit Card is incorrect, but valid cards just sit on the "Please Wait" still... Crap I thought I had this resolved.

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Tue Oct 25, 2011 10:29 am
by chrsdlmn
Sorry to keep posting and re-posting. I downloaded opencart again and copied pp_pro.tpl and pp_pro.php and overwrote and didn't work. Cleared my cookies and Viola! it worked.

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Tue Feb 14, 2012 2:44 pm
by jamilkhan
Previously I was getting "Invalid security header" message. After doing the modification in pp_pro.tpl I am not getting that message any more but "please wait" message is keep loading. I am using OC 1.5.1.3. Any help would be highly appreciated.

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Feb 16, 2012 7:14 am
by rwenve
Has anyone solved this? I have been looking around the files and it looks more like this is using ajax and xhr to authorize? I did take out the issue date for the tpl and also cleared my cache and cookies but nothing. I tried it in every browser as well but it still just spins "please wait"

Its on OC Version 1.5.1.3 and the PayPal Pro - and I have confirmed my API's are correct. I dont want the client to be paying $35/mo for nothing

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Fri Feb 17, 2012 3:59 am
by rwenve
I have been trying to figure out why this keeps spinning "Please wait" and I think I have narrowed it down to this ajax call

<script type="text/javascript"><!--
$('#button-confirm').bind('click', function() {
$.ajax({
type: 'POST',
url: 'index.php?route=payment/pp_pro/send',
data: $('#payment :input'),
dataType: 'json',
beforeSend: function() {
$('#button-confirm').attr('disabled', true);

$('#payment').before('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
},
success: function(json) {
if (json['error']) {
alert(json['error']);

$('#button-confirm').attr('disabled', false);
}


$('.attention').remove();

if (json['success']) {
location = json['success'];
}
}
});
});
//--></script>
I dont really know JSON but does something need to be installed or turned on in a config file somewhere? In order for it to remove the spinning icon its supposed to at least alert me to errors. I thought it would be easy to test so in the form I didn't fill out any of it and there was nothing returned (error message) - so it's like JSON isnt functioning? Anybody think that sounds logical and can help me?
Thanks

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Wed Feb 29, 2012 9:24 pm
by JNeuhoff
rwenve wrote:I have been trying to figure out why this keeps spinning "Please wait" and I think I have narrowed it down to this ajax call

<script type="text/javascript"><!--
$('#button-confirm').bind('click', function() {
$.ajax({
type: 'POST',
url: 'index.php?route=payment/pp_pro/send',
data: $('#payment :input'),
dataType: 'json',
beforeSend: function() {
$('#button-confirm').attr('disabled', true);

$('#payment').before('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
},
success: function(json) {
if (json['error']) {
alert(json['error']);

$('#button-confirm').attr('disabled', false);
}


$('.attention').remove();

if (json['success']) {
location = json['success'];
}
}
});
});
//--></script>
I dont really know JSON but does something need to be installed or turned on in a config file somewhere? In order for it to remove the spinning icon its supposed to at least alert me to errors. I thought it would be easy to test so in the form I didn't fill out any of it and there was nothing returned (error message) - so it's like JSON isnt functioning? Anybody think that sounds logical and can help me?
Thanks
Did you ever find a solution for this? I am having the same issue. It usually happens when the Ajax response is corrupted by PHP error messages which are also logged in system/logs/error.txt.

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Wed Feb 29, 2012 11:19 pm
by JNeuhoff
JNeuhoff wrote:
rwenve wrote:I have been trying to figure out why this keeps spinning "Please wait" and I think I have narrowed it down to this ajax call

<script type="text/javascript"><!--
$('#button-confirm').bind('click', function() {
$.ajax({
type: 'POST',
url: 'index.php?route=payment/pp_pro/send',
data: $('#payment :input'),
dataType: 'json',
beforeSend: function() {
$('#button-confirm').attr('disabled', true);

$('#payment').before('<div class="attention"><img src="catalog/view/theme/default/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>');
},
success: function(json) {
if (json['error']) {
alert(json['error']);

$('#button-confirm').attr('disabled', false);
}


$('.attention').remove();

if (json['success']) {
location = json['success'];
}
}
});
});
//--></script>
I dont really know JSON but does something need to be installed or turned on in a config file somewhere? In order for it to remove the spinning icon its supposed to at least alert me to errors. I thought it would be easy to test so in the form I didn't fill out any of it and there was nothing returned (error message) - so it's like JSON isnt functioning? Anybody think that sounds logical and can help me?
Thanks
Did you ever find a solution for this? I am having the same issue. It usually happens when the Ajax response is corrupted by PHP error messages which are also logged in system/logs/error.txt.
I think I found a solution, by catching all PHP errors (which can corrupt the json array) in an exception handler, ensuring there is always a proper json array in the response to the ajax call. Will write up a VQmod XML script for this bugfix.

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Mar 01, 2012 12:13 am
by rwenve
That would be awesome Neuhoff!

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Mar 01, 2012 1:02 am
by JNeuhoff
rwenve wrote:That would be awesome Neuhoff!
Well, here it is, try the following bugfixes-payment-pp-pro.xml:

Code: Select all

<modification>
	<id>Opencart core file modifications: Bugfixes for Paypal PRO payment</id>
	<version>1.5.1.3</version>
	<vqmver>1.2.3</vqmver>
	<author>mhccorp.com</author>
	
	<file name="catalog/controller/payment/pp_pro.php">
		<operation>
			<search position="before"><![CDATA[class ControllerPaymentPPPro extends Controller {]]></search>
			<add><![CDATA[
class PaymentPPProErrorHandler  
{  
	/** 
	* catches php errors / warnings / notices and throws 
	* an exception instead 
	* 
	* @param int $errNo 
	* @param string $errStr 
	*/  
	public static function handle($errNo, $errStr=NULL)  
	{  
		switch ($errNo) {  
			case E_WARNING:  
				throw new RuntimeException($errStr,$errNo);  
				break;  
			default:  
				throw new Exception($errStr,$errNo);  
				break;  
		}  
	}  
	
	/** 
	* Overwrites the PHP error handler and uses our own 
	* 
	*/  
	public static function set()  
	{  
		set_error_handler(array(__CLASS__ , 'handle'));  
	}      
}  
			]]></add>
		</operation>
		<operation>
			<search position="after"><![CDATA[public function send() {]]></search>
			<add><![CDATA[
		PaymentPPProErrorHandler::set();
		try {
			]]></add>
		</operation>
		<operation>
			<search position="before"><![CDATA[$this->response->setOutput(json_encode($json));]]></search>
			<add><![CDATA[
		}
		catch (Exception $e) {
			$msg = "PHP Exception: ".($e->getMessage())." in ".($e->getFile())." on line ".($e->getLine())."\n";
			$this->log->write( $msg );
			if (!isset($json)) {
				$json = array();
			}
			$json['exception'] = $msg;
			if (!isset($json['success'])) {
				if (!isset($json['error'])) {
					$json['error'] = "Payment could not be processed because of server error:\n".$msg;
				}
			}
		}
		restore_error_handler();
			]]></add>
		</operation>
	</file>
</modification>

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Mar 01, 2012 4:17 am
by rwenve
I uploaded the bugfixes-pp-pro into the xml folder and when I tried a transaction I got this error:

PHP Exception: Undefined index: cc_start_date_month in /homepages/41/d400055205/htdocs/vqmod/vqcache/vq2-catalog_controller_payment_pp_pro.php on line 19

because its in the vqmod folder I'm not sure what I should change first.

I deleted the lines in the tpl file that actually ask for the cc start date. (in above comments) Is that throwing this error?

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Mar 01, 2012 4:59 am
by JNeuhoff
rwenve wrote:I uploaded the bugfixes-pp-pro into the xml folder and when I tried a transaction I got this error:

PHP Exception: Undefined index: cc_start_date_month in /homepages/41/d400055205/htdocs/vqmod/vqcache/vq2-catalog_controller_payment_pp_pro.php on line 19

because its in the vqmod folder I'm not sure what I should change first.

I deleted the lines in the tpl file that actually ask for the cc start date. (in above comments) Is that throwing this error?
Well, at least you don't get the endless 'Please Wait' problem anymore, and the customer won't do double payments :)

One of the following files were modified by you or by one of the other VQMod XML scripts you use:

catalog/controller/payment/pp_pro.php
language/english/payment/pp_pro.php
catalog/view/theme/your-web-theme/payment/pp_pro.tpl

Perhaps your form doesn't submit the 'cc_start_date_month' anymore, yet the controller still tries to use it.

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Thu Mar 01, 2012 5:12 am
by rwenve
thats what I was thinking also (both a new error and about the cc start date) - I'll go in and make up my mind to take it all out (start date) or put it back in the tpl - thanks

Re: [PAYPAL PRO] OpenCart 1.5 - "Please Wait" Issue

Posted: Sat Mar 03, 2012 4:21 am
by rwenve
I am getting passed that step but now I'm receiving a message that says "This transaction cannot be processed due to an invalid merchant configuration." I have seen people having the same problem elsewhere in the forum but they don't have any answers. I have checked my API's for any small typo or white-space and all looks fine there. Anyone have ideas?

Thanks