我正在尝试在 codeigniter 上以测试模式配置 payflow 链接应用程序。我正在使用适用于 PayPal 的 Angell EYE PHP CodeIgniter 类库来执行此操作。
我已经设置了我的开发人员沙盒帐户并添加了一个 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);
}
}
我得到的回应是:
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” - 都给出相同的响应)。
处理测试付款的配置应该是什么?