簡體   English   中英

嘗試集成 Paypal Payment Pro api,收到錯誤 10002

[英]Trying to integrate Paypal Payment Pro api, receiving error 10002

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 錯誤。

感謝您提供的任何幫助。

要解決 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.

事實證明,PayPal 端存在問題。 他們不得不稍微調整我的帳戶,切換這個,重置那個,等待一個小時讓他們的數據庫更新然后砰! 23個簡單的步驟,問題就解決了!

歸根結底,答案是在這種情況下,如果您已按照此錯誤代碼的所有建議進行操作,但仍然無法正常工作,請致電 PayPal。 他們可以從他們的角度看到正在發生的事情並進行整理。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM