我試圖在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' - 都會給出相同的響應)。
應該配置什麼來處理測試支付?
非常感謝您的幫助! 我登錄到沙盒商業帳戶,進入「個人資料」部分,並選擇「請求API憑證」 - >「設置Payflow Pro API訪問權限」。這生成了一組新的憑據(用戶,密碼,供應商,合作伙伴)。憑藉這些新憑據,我收到錯誤26 - 無效的供應商帳戶。 我在manager.paypal.com創建了另一個帳戶,確保我選擇了「Payflow Pro」選項。有了這個,我也得到了錯誤26。 – Vasily802
好的,經過一段時間後,我的新帳戶在manager.paypal上。com我得到的結果12(評論:多個規則觸發審查)。所以現在我必須弄清楚如何解除這些規則。再次感謝您的幫助! – Vasily802