1

尝试通过我的 PayFlow 网关提交沙盒付款时,我不断收到以下错误:

错误:处理您的请求时出现问题。请按浏览器的返回按钮,然后刷新页面。如果您仍有问题,请与我们联系。

我正在使用以下代码生成我的 PayFlow 网关,但我无法让它工作。

/* 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.'&amp;SECURETOKEN='.$arr['SECURETOKEN'].'&amp;SECURETOKENID='.$secureTokenId.'" width="550" height="565" scrolling="no" frameborder="0" border="0" allowtransparency="true"></iframe>';

感谢您的帮助!

4

1 回答 1

1

我必须将我的 Firefox 隐私设置明确设置为“允许”第三方 cookie。这样做会使错误消息消失。我在 Safari 上没有这个问题。

于 2012-05-02T23:21:48.283 回答