2014-04-23 44 views
1

我試圖在codeigniter上以測試模式配置payflow鏈接應用程序。我正在用Angell EYE PHP CodeIgniter Class Library for PayPal這樣做。Payflow錯誤52:權限不足以在測試模式下執行交易

我已經設置了我的開發人員沙箱帳戶,並添加了Business-Pro類型的用戶和Personal類型的用戶。

我在manager.payflow.com上設置了一個帳戶,並添加了一個角色爲'API_FULL_TRANSACTIONS'的用戶。

現在,這裏是我的/application/config/paypal.php文件:

<?php 
    if (! defined('BASEPATH')) exit('No direct script access allowed'); 
    $config['Sandbox'] = TRUE; 
    $config['APIVersion'] = '98.0'; 
    $config['APIUsername'] = $config['Sandbox'] ? '/*here goes Business user username from sandbox*/' : ''; 
    $config['APIPassword'] = $config['Sandbox'] ? '/*here goes Business user password*/' : ''; 
    $config['APISignature'] = $config['Sandbox'] ? '/*here goes Business user API signature*/' : ''; 

    $config['PayFlowUsername'] = $config['Sandbox'] ? '/*here goes username of a user with API_FULL TRANSACTIONS role on manager.paypal.com*/' : ''; 
    $config['PayFlowPassword'] = $config['Sandbox'] ? '/*here goes password of a user with API_FULL TRANSACTIONS role on manager.paypal.com*/' : ''; 
    $config['PayFlowVendor'] = $config['Sandbox'] ? '/*here goes login to manager.paypal.com*/' : ''; 

    $config['PayFlowPartner'] = $config['Sandbox'] ? 'PayPal' : ''; 
    $config['ApplicationID'] = $config['Sandbox'] ? '' : 'PRODUCTION_APP_ID_GOES_HERE'; 
    $config['DeveloperEmailAccount'] = '/*my email at developer.paypal.com*/'; 
    $config['DeviceID'] = ''; 

接下來,我跑在/application/controllers/payflow.php控制器的功能:

function Process_transaction_demo() 
{ 
    $PayPalRequestData = array(
     'tender'=>'P', //also tried this with 'C' 
     'trxtype'=>'S', 
     'acct'=>'/*here goes card number for Personal type sandbox acct*/', 
     'expdate'=>'0419', // as in sandbox Personal acct settings 
     'amt'=>'10.00', 
     'dutyamt'=>'', 
     'freightamt'=>'5.00', 
     'taxamt'=>'2.50', 
     'taxexempt'=>'', 
     'comment1'=>'This is a test!', 
     'comment2'=>'This is only a test!', 
     'cvv2'=>'123', 
     'recurring'=>'', 
     'swipe'=>'', 
     'orderid'=>'', 
     'billtoemail'=>'', // as in sandbox Personal acct settings 
     'billtophonenum'=>'816-555-5555', 
     'billtofirstname'=>'Tester', 
     'billtomiddlename'=>'' 
     'billtolastname'=>'Testerson', 
     'billtostreet'=>'123 Test Ave.', 
     'billtocity'=>'Kansas City', 
     'billtostate'=>'MO', 
     'billtozip'=>'64111', 
     'billtocountry'=>'US', 
     'shiptofirstname'=>'Tester', 
     'shiptomiddlename'=>'', 
     'shiptolastname'=>'Testerson', 
     'shiptostreet'=>'123 Test Ave.', 
     'shiptocity'=>'Kansas City', 
     'shiptostate'=>'MO', 
     'shiptozip'=>'64111', 
     'shiptocountry'=>'US', 
     'origid'=>'', 
     'custref'=>'',    
     'custcode'=>'',    
     'custip'=>'',     
     'invnum'=>'',    
     'ponum'=>'',     
     'starttime'=>'',    
     'endtime'=>'',    
     'securetoken'=>'',   
     'partialauth'=>'',    
     'authcode'=>''   
     ); 

    $PayPalResult = $this->paypal_payflow->ProcessTransaction($PayPalRequestData); 

    if(!$this->paypal_payflow->APICallSuccessful($PayPalResult['RESULT'])) 
    { 
     // Error 
     echo '<pre />'; 
     print_r($PayPalResult); 
    } 
    else 
    { 
     // Successful call. Load view or whatever you need to do here. 
     echo '<pre />'; 
     print_r($PayPalResult); 
    } 
} 

我也得到了respnse是:

Array 
(
    [RESULT] => 52 
    [PNREF] => A7P06B2A9D83 
    [RESPMSG] => Insufficient permissions to perform transaction 
    [RAWREQUEST] => /*request details*/ 
    [RAWRESPONSE] => RESULT=52&PNREF=A7P06B2A9D83&RESPMSG=Insufficient permissions to perform transaction 
) 

爲什麼它的回頭率這個錯誤? manager.paypal.com上的用戶權限設置爲'API_FULL_TRASACTIONS'(也嘗試使用'ADMIN','ADMIN_TRANSACTIONS','FULL_TRASACTIONS' - 都會給出相同的響應)。

應該配置什麼來處理測試支付?

回答

2

因此,您在第一段中說過PayFlow Link,但這與Express Checkout或Payments Pro完全不同,它看起來就像您在這裏嘗試的那樣。

如果您使用TENDER = C並且出現該錯誤,則可能意味着您沒有在PayPal帳戶中啓用Payments Pro。你提到你這樣做,但是你能否確認它是否已經激活並設置爲測試模式?登錄PayPal Manager網站時,您應該在總覽頁面上看到一張帶有帳戶狀態的小表格。

如果您使用P來嘗試設置Express Checkout流程,那麼您需要確保從請求中刪除信用卡號碼。

請注意,您在此粘貼的示例代碼在billtomiddlename參數後缺少$ PayPalRequestData數組中的逗號。我必須在它完全運行之前解決它。

通過這一修正,我能夠成功地運行您的樣品請求與來自PayFlow文檔的測試信用卡號碼。

Array 
(
    [RESULT] => 0 
    [PNREF] => A10M6CE2A65B 
    [RESPMSG] => Approved 
    [AUTHCODE] => 000041 
    [AVSADDR] => Y 
    [AVSZIP] => N 
    [CVV2MATCH] => Y 
    [PROCAVS] => A 
    [PROCCVV2] => M 
    [TRANSTIME] => 2014-04-23 01:43:58 
    [BILLTOFIRSTNAME] => Tester 
    [BILLTOLASTNAME] => Testerson 
    [AMT] => 10.00 
    [ACCT] => 1881 
    [EXPDATE] => 0419 
    [CARDTYPE] => 0 
    [IAVS] => N 
    [RAWREQUEST] => BUTTONSOURCE[18]=AngellEYE_PHPClass&VERBOSITY[4]=HIGH&USER[6]=****&VENDOR[9]=****&PARTNER[6]=PayPal&PWD[8]=****&TENDER[1]=C&TRXTYPE[1]=S&ACCT[16]=4012888888881881&EXPDATE[4]=0419&AMT[5]=10.00&FREIGHTAMT[4]=5.00&TAXAMT[4]=2.50&COMMENT1[15]=This is a test!&COMMENT2[20]=This is only a test!&CVV2[3]=123&BILLTOPHONENUM[12]=816-555-5555&BILLTOFIRSTNAME[6]=Tester&BILLTOLASTNAME[9]=Testerson&BILLTOSTREET[13]=123 Test Ave.&BILLTOCITY[11]=Kansas City&BILLTOSTATE[2]=MO&BILLTOZIP[5]=64111&BILLTOCOUNTRY[2]=US&SHIPTOFIRSTNAME[6]=Tester&SHIPTOLASTNAME[9]=Testerson&SHIPTOSTREET[13]=123 Test Ave.&SHIPTOCITY[11]=Kansas City&SHIPTOSTATE[2]=MO&SHIPTOZIP[5]=64111&SHIPTOCOUNTRY[2]=US 
    [RAWRESPONSE] => RESULT=0&PNREF=A10M6CE2A65B&RESPMSG=Approved&AUTHCODE=000041&AVSADDR=Y&AVSZIP=N&CVV2MATCH=Y&PROCAVS=A&PROCCVV2=M&TRANSTIME=2014-04-23 01:43:58&BILLTOFIRSTNAME=Tester&BILLTOLASTNAME=Testerson&AMT=10.00&ACCT=1881&EXPDATE=0419&CARDTYPE=0&IAVS=N 
) 

我招標跑了= P,也和我預期的錯誤,此次招標類型不是在我的帳戶中啓用。

因此,我會仔細檢查您的API憑據,甚至可能嘗試將其切換到FULL_TRANSACTIONS並查看是否有幫助。

+0

非常感謝您的幫助! 我登錄到沙盒商業帳戶,進入「個人資料」部分,並選擇「請求API憑證」 - >「設置Payflow Pro API訪問權限」。這生成了一組新的憑據(用戶,密碼,供應商,合作伙伴)。憑藉這些新憑據,我收到錯誤26 - 無效的供應商帳戶。 我在manager.paypal.com創建了另一個帳戶,確保我選擇了「Payflow Pro」選項。有了這個,我也得到了錯誤26。 – Vasily802

+0

好的,經過一段時間後,我的新帳戶在manager.paypal上。com我得到的結果12(評論:多個規則觸發審查)。所以現在我必須弄清楚如何解除這些規則。再次感謝您的幫助! – Vasily802

相關問題