Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Paypal CreateBillingAgreement API调用无法使用我的API凭据_Php_Api_Paypal_Recurring Billing - Fatal编程技术网

Php Paypal CreateBillingAgreement API调用无法使用我的API凭据

Php Paypal CreateBillingAgreement API调用无法使用我的API凭据,php,api,paypal,recurring-billing,Php,Api,Paypal,Recurring Billing,我正在使用MasterSDK php paypal api为参考交易制定计费协议 我使用api SetExpressCheckout()获取令牌。以下是响应:- PayPal\PayPalAPI\SetExpressCheckoutResponseType Object ( [Token] => EC-1EG869789X969882G [Timestamp] => 2014-09-08T05:52:43Z [Ack] => Success [Correlati

我正在使用MasterSDK 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凭据。我将我的详细信息用于其他自适应支付api,工作正常。它正在生成带有我的详细信息的令牌

贝宝回复:

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
)

这个问题已经解决了。这是因为我的帐户未启用参考交易。它是由paypal支持团队启用的。

因此,您所说的正在工作的部分看起来像是直接在$PayPalConfig数组中设置API凭据,但在不工作的代码上,您使用的是PHP常量。你确定它们是按你认为的方式填充的吗?不,这不是常数的问题。我想说的是,api使用api演示中给出的凭据工作。但不使用我的应用程序的凭据。我正在更新我的问题以消除康斯坦斯的困惑。你能告诉我你从输出中得到了什么吗?整个$PayPalResult的转储?我希望看到以$PayPalResult返回的RAWREQUEST和RAWRESPONSE。(当然,您可以再次屏蔽您的api凭据。)实际上,您知道我认为它可能是什么。为了使用PayPal(计费协议)的参考交易,您必须在live帐户上专门启用该功能。你做到了吗?我更新了我的问题。您现在可以看到响应。我什么也没做。当我以一个新的帐户开始它时,应用程序仍在生产中。我感觉这就是问题所在。
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
)