gpt4 book ai didi

codeigniter - 支付流错误 52 : Insufficient permissions to perform transaction in test mode

转载 作者:太空宇宙 更新时间:2023-11-03 15:55:51 24 4
gpt4 key购买 nike

我正在尝试在 codeigniter 上以测试模式配置付费流链接应用程序。我正在用 Angell EYE 做这个 PHP CodeIgniter Class Library for PayPal .

我已经设置了我的开发者沙箱帐户并添加了一个 Business-Pro 类型的用户和一个个人类型的用户。

我已经在 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 Controller 中运行该函数:

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” - 都给出相同的响应)。

应该如何配置来处理测试付款?

最佳答案

所以,您在第一段中提到了 PayFlow Link,但这与 Express Checkout 或 Payments Pro 完全不同,而这正是您在这里尝试的。

如果您使用 TENDER=C 并且收到该错误,则可能意味着您没有在您的 PayPal 帐户上启用 Payments Pro。你提到你这样做了,但你能确认它确实被激活并设置为测试模式吗?当您登录 PayPal 管理器网站时,您应该会在概览页面上看到一个包含帐户状态的小表格。

如果您使用 P 尝试设置快速结帐流程,则需要确保从请求中删除信用卡号。

附带说明一下,您在此处粘贴的示例代码在 $PayPalRequestData 数组中的 billtomiddlename 参数后缺少一个逗号。我必须先修复它,然后它才能运行。

修复该问题后,我能够使用 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
)

我也使用 TENDER=P 运行它,我得到了一个预期的错误,即我的帐户未启用投标类型。

所以我会仔细检查您的 API 凭据,甚至可能会尝试将其切换为 FULL_TRANSACTIONS,看看是否有帮助。

关于codeigniter - 支付流错误 52 : Insufficient permissions to perform transaction in test mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23237891/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com