尝试集成Paypal Payment Pro api,收到错误10002

时间:2015-07-06 15:15:18

标签: php paypal

Paypal Payment Pro新手,不使用现成的购物车。我已设置了自己的帐户,并希望使用PayPal的托管结帐页面之一。出于测试目的,我刚刚生成了一个“立即购买”按钮,收费为1.00美元,它将我带到Paypal Checkout页面。但是,当尝试处理付款时,我在错误日志中收到以下内容,这是我发送返回数组的地方:

[06-Jul-2015 11:22:57 America/Halifax] Array
(
[TYPE] => S
[RESPMSG] => Invalid merchant information: 10002-You do not have permissions to make this API call
[ACCT] => 1111
[COUNTRY] => CA
[TAX] => 0.00
[CARDTYPE] => 0
[LASTNAME] => NotProvided
[PNREF] => B70P7DC0A255
[TENDER] => CC
[AVSDATA] => XXN
[METHOD] => CC
[SECURETOKEN] => 9f50xjlryKE2myw4aDnjM3wsJ
[SHIPTOCOUNTRY] => CA
[AMT] => 1.00
[SECURETOKENID] => 559a8f2cdb4034.19928099
[TRANSTIME] => 2015-07-06 07:22:55
[HOSTCODE] => 10002
[COUNTRYTOSHIP] => CA
[RESULT] => 5
[BILLTOCOUNTRY] => CA
[EXPDATE] => 0620
[TRXTYPE] => S
)

无效商家信息的RESPMSG:10002 - 您无权进行此API调用,这让我感到沮丧。我不明白为什么它不起作用。到目前为止,我已经从PayPal获得了解决方案,并且还没有能够与知道如何帮助的人交谈。

这是我的代码......

function makeBuyButton($amt, $txt = "Buy Now!")
{
$PF_USER = "phoeteocart";
$PF_VENDOR = "Phoeteo";
$PF_PARTNER = "paypalca";
$PF_PWD = "xxxxxxxx"; // <--modified for forum
$PF_MODE = "TEST";
$PF_HOST_ADDR = "https://pilot-payflowpro.paypal.com";
//  $PF_HOST_ADDR = "https://payflowpro.paypal.com;

$secureTokenID = uniqid('', true);
$postData = "USER=" . $PF_USER
        .   "&VENDOR=" . $PF_VENDOR
        .   "&PARTNER=" . $PF_PARTNER
        .   "&PWD=" . $PF_PWD
        .   "&CREATESECURETOKEN=Y"
        .   "&SECURETOKENID=" . $secureTokenID
        .   "&TRXTYPE=S"
        .   "&AMT=" . $amt;

//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 the response
$resp = curl_exec($ch);

//Confirm that a response was received and handle the error
if(!$resp)
{
    return "<p>To order, please contact us</p>";
}

//Parse and assign to array
parse_str($resp, $arr);

if($arr['RESULT'] != 0)
{
    return "<p>To order, please contact us</p>";
}

return "<form method='post' action='https://pilot-payflowlink.paypal.com/'>
<input type='hidden' name='SECURETOKEN' value='" . $arr['SECURETOKEN'] . "' />
<input type='hidden' name='SECURETOKENID' value='" . $secureTokenID . "' />
<input type='hidden' name='MODE' value='" . $PF_MODE . "' />
<input type='submit' value='" . $txt . "' />
</form>";
}

我用

调用该函数
<?=makeBuyButton(1.00); ?>

按钮有效,我到达结帐页面,但不幸的是它没有处理并且上面给出了10002错误。

感谢您给予的任何帮助。

2 个答案:

答案 0 :(得分:0)

要解决Paypal Pro Integration的错误10002,请按照以下步骤操作。

1. Go to Settings › Store Setup › Payments, and click the PayPal Standard Payments tab.

2. Remove your credentials, then re-enter them. If you copied and pasted the data, make sure there are no spaces before or after the information. We recommend first pasting them into a text editing program such as Notepad or TextEdit to ensure this.

3. Make sure that you are not in test mode either on this page or within your PayPal account.

答案 1 :(得分:0)

原来PayPal结束时出现了问题。他们不得不调整我的帐户,切换这个,重置,等待一个小时,他们的数据库更新然后bam!通过23个简单的步骤,问题解决了!

答案是,在这种情况下,如果您已经遵循了此错误代码的所有建议并且它仍然无法为您工作,请给PayPal打电话。他们可以从他们的结果中看出发生了什么并将其整理出来。