PayPal buttons - blank screens

Report issues with Enuuk Auction Platform or Mods here - remember to raise a ticket with phpauction.net as well
Post Reply
RWAP
Site Admin
Posts: 748
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

PayPal buttons - blank screens

Post by RWAP » Fri Jun 23, 2017 7:44 am

I have come across an instance where clicking on the PayPal button was leading to a blank screen due to the paypal button code having two _cmd parameters (albeit the same).

I fixed this on my own site some time ago, but cannot see that I documented it as a bug. It is easy to fix, in class\Gateway\Paypal.php, find:

Code: Select all

                foreach ($this->fields as $key => $value) {
                    $HTMLButton.='<input type="hidden" name="'.$key.'" value="'.$value.'" />'."\n";
                }
	        $HTMLButton.='<input type="hidden" name="cmd" value="_xclick" />';
Replace this with:

Code: Select all

                foreach ($this->fields as $key => $value) {
                    $HTMLButton.='<input type="hidden" name="'.$key.'" value="'.$value.'" />'."\n";
                }
                if(!in_array('cmd',$availableFields)) {
	                $HTMLButton.='<input type="hidden" name="cmd" value="_xclick" />';
                }

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest