I keep getting the following error when trying to submit a sandbox payment through my PayFlow Gateway:
Error: There was a problem processing your request. Please press the
Back button of your browser and then refresh the page. If you continue
to have an issue, please contact us.
I’m using the following code to generate my PayFlow Gateway, but I just can’t get it to work.
/* PayPal Payments Advanced */
$PF_USER = 'my_user';
$PF_VENDOR = 'my_vendor';
$PF_PARTNER = 'PayPal';
$PF_PWD = 'my_pass';
$PF_MODE = 'TEST';
$PF_HOST_ADDR = 'https://pilot-payflowpro.paypal.com'; // TEST mode
// $PF_HOST_ADDR = 'https://payflowpro.paypal.com' // LIVE mode
$secureTokenId = uniqid('',true);
$postData = "USER=".$PF_USER
."&VENDOR=".$PF_VENDOR
."&PARTNER=".$PF_PARTNER
."&PWD=".$PF_PWD
."&SECURETOKENID=".$secureTokenId
."&CREATESECURETOKEN=Y"
."&TRXTYPE=S"
."&AMT=1.00"
."&BILLTOFIRSTNAME=".$first_name
."&BILLTOLASTNAME=".$last_name
."&BILLTOSTREET=".$address
."&BILLTOCITY=".$city
."&BILLTOSTATE=".$state
."&BILLTOZIP=".$zip
."&BILLTOCOUNTRY=".$country
."&SHIPTOFIRSTNAME=".$first_name
."&SHIPTOLASTNAME=".$last_name
."&SHIPTOSTREET=".$address
."&SHIPTOCITY=".$city
."&SHIPTOSTATE=".$state
."&SHIPTOZIP=".$zip
."&SHIPTTOCOUNTRY=".$country
."&EMAIL=".$email
."&PHONENUM=".$phone;
/* Initialize and Setup Request */
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$PF_HOST_ADDR);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POST,true);
/* Ready the postData to send */
curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
/* Send the data to PayPal and assign response */
$resp = curl_exec($ch);
/* Confirm response and handle */
if(!$resp){
$error = '<p>There was an error processing your order.</p>';
}
/* Parse and assign to array */
parse_str($resp,$arr);
if($arr['RESULT'] != 0) {
// handle error
die($arr['RESULT']);
$error = '<p>There was an error processing your order. '.$arr['RESULT'].'</p>';
}
echo '<iframe src="https://payflowlink.paypal.com?mode='.$PF_MODE.'&SECURETOKEN='.$arr['SECURETOKEN'].'&SECURETOKENID='.$secureTokenId.'" width="550" height="565" scrolling="no" frameborder="0" border="0" allowtransparency="true"></iframe>';
Your help is appreciated!
I had to explicitly set my Firefox privacy settings to “Allow” third-party cookies. Doing this made the error message go away. I didn’t have this problem on Safari.