我正在使用master-sdk-php paypal api来为参考交易制定结算协议。
我使用api SetExpressCheckout()获得了令牌,下面是响应:-
PayPal\PayPalAPI\SetExpressCheckoutResponseType Object
(
[Token] => EC-1EG869789X969882G
[Timestamp] => 2014-09-08T05:52:43Z
[Ack] => Success
[CorrelationID] => 84464deca9458
[Errors] =>
[Version] => 104.0
[Build] => 12658619
)
但是当我调用CreateBillingAgreement()api调用时它不起作用。
我使用演示API凭据测试了代码,并且工作正常。但它不能与我的api凭据一起使用。
它给了我内部错误
以下是api调用:-
// Include required library files.
require_once($main_path.'paypal_lib/includes/config.php');
require_once($main_path.'paypal_lib/autoload.php');
// Create PayPal object.
$PayPalConfig = array(
'Sandbox' => $sandbox,
'APIUsername' => 'bharat.maheshwari_api1.dotsquares.com',
'APIPassword' => '********',
'APISignature' => '*******',
'PrintHeaders' => $print_headers,
'LogResults' => $log_results,
'LogPath' => $log_path,
);
$PayPal = new angelleye\PayPal\PayPal($PayPalConfig);
// Pass data into class for processing with PayPal and load the response array into $PayPalResult
$Token = $_REQUEST['token'];
$PayPalResult = $PayPal->CreateBillingAgreement($_REQUEST['token']);
// Write the contents of the response array to the screen for demo purposes.
echo '<pre />';
print_r($PayPalResult);
我已使用以下api凭据进行测试:-
$PayPalConfig = array(
'Sandbox' => $sandbox,
'APIUsername' => 'jb-us-seller_api1.paypal.com',
'APIPassword' => 'WX4WTU3S8MY44S7F',
'APISignature' => 'AFcWxV21C7fd0v3bYYYRCpSSRl31A7yDhhsPUU2XhtMoZXsWHFxu-RWy',
'PrintHeaders' => $print_headers,
'LogResults' => $log_results,
'LogPath' => $log_path,
);
而且代码可以正常工作,但不能使用我的api凭据。我将我的详细信息与其他自适应支付api一起使用也可以正常工作。它也使用我的详细信息生成令牌。
paypal的回复:-
Array
(
[TIMESTAMP] => 2014-09-08T04:54:02Z
[CORRELATIONID] => ec2641e7483b6
[ACK] => Failure
[VERSION] => 112.0
[BUILD] => 12658619
[L_ERRORCODE0] => 10001
[L_SHORTMESSAGE0] => Internal Error
[L_LONGMESSAGE0] => Internal Error
[L_SEVERITYCODE0] => Error
[ERRORS] => Array
(
[0] => Array
(
[L_ERRORCODE] => 10001
[L_SHORTMESSAGE] => Internal Error
[L_LONGMESSAGE] => Internal Error
[L_SEVERITYCODE] => Error
)
)
[REQUESTDATA] => Array
(
[USER] => bharat.maheshwari_business_api1.dotsquares.com
[PWD] => ******
[VERSION] => 112.0
[BUTTONSOURCE] => AngellEYE_PHPClass
[SIGNATURE] => ******
[METHOD] => CreateBillingAgreement
[TOKEN] => EC-28P65999553574317
)
[RAWREQUEST] => USER=bharat.maheshwari_business_api1.dotsquares.com&PWD=******&VERSION=112.0&BUTTONSOURCE=AngellEYE_PHPClass&SIGNATURE=*******2&METHOD=CreateBillingAgreement&TOKEN=EC-28P65999553574317
[RAWRESPONSE] => TIMESTAMP=2014%2d09%2d08T04%3a54%3a02Z&CORRELATIONID=ec2641e7483b6&ACK=Failure&VERSION=112%2e0&BUILD=12658619&L_ERRORCODE0=10001&L_SHORTMESSAGE0=Internal%20Error&L_LONGMESSAGE0=Internal%20Error&L_SEVERITYCODE0=Error
)
问题已解决。这是由于我的帐户未启用参考交易。它由贝宝支持团队启用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句