【问题标题】:Trying to integrate Paypal Payment Pro api, receiving error 10002尝试集成 Paypal Payment Pro api,收到错误 10002
【发布时间】:2015-09-23 19:32:51
【问题描述】:

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

[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 = "apiusername";
$PF_VENDOR = "merchantname";
$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 错误。

感谢您提供的任何帮助。

【问题讨论】:

    标签: php paypal


    【解决方案1】:

    原来 PayPal 端出现了问题。他们不得不稍微调整我的帐户,切换这个,重置那个,等待一个小时让他们的数据库更新然后砰! 23个简单的步骤,问题就解决了!

    归根结底,答案是在这种情况下,如果您已按照此错误代码的所有建议进行操作,但仍然无法解决您的问题,请致电 PayPal。他们可以从头到尾看到发生了什么并解决问题。

    【讨论】:

      【解决方案2】:

      要解决 Paypal Pro 集成的错误 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.
      

      【讨论】:

      • 我该去哪里做这个?我正在浏览 manager.paypal.com 和 paypal.com,但找不到设置。
      猜你喜欢
      • 2015-07-01
      • 2014-11-13
      • 1970-01-01
      • 2015-04-06
      • 2013-06-27
      • 2014-12-19
      • 2011-05-01
      • 2012-07-02
      • 2013-06-22
      相关资源
      最近更新 更多