我有代码GetRecurringPaymentsProfileDetails。。。哪里错了?//--------------------------------------------------------------------------------------------------------------------------------------------------------
public function callNVP($profileId) {
$api_request = '&USER=' . urlencode('bestlifeXXXXX.gmaill.com')
. '&PWD=' . urlencode('136XXXXXXX')
. '&SIGNATURE=' . urlencode('XXXXXXXXJJJ4qi4-ASVptjmiE8Sqp4tXXXXXXCa')
. '&VERSION=76.0'
. '&METHOD =GetRecurringPaymentsProfileDetails'
. '&PROFILEID=' . urlencode($profileId);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api-3t.sandbox.paypal.com/nvp'); // For live transactions, change to 'https://api-3t.paypal.com/nvp'
curl_setopt($ch, CURLOPT_VERBOSE, 1);
//curl_setopt($ch, CURLOPT_HEADER, FALSE);
// Uncomment these to turn off server and peer verification
//curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
// Set the API parameters for this transaction
//curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $api_request);
// Request response from PayPal
$response = curl_exec($ch);
// If no response was received from PayPal there is no point parsing the response
if (!$response)
die('Calling PayPal to change_subscription_status failed: ' . curl_error($ch) . '(' . curl_errno($ch) . ')');
curl_close($ch);
// An associative array is more usable than a parameter string
parse_str($response, $parsed_response);
return $parsed_response;
}
但它的返回结果:
Array
(
[0] => Array
(
[TIMESTAMP] => 2015-12-10T03:49:09Z
[CORRELATIONID] => cb2489449e84c
[ACK] => Failure
[L_ERRORCODE0] => 10001
[L_SHORTMESSAGE0] => Internal Error
[L_LONGMESSAGE0] => Timeout processing request
)
)
我想要的是:
(
[PROFILEID] => I-CL7Kxxx
[STATUS] => Active
[AUTOBILLOUTAMT] => AddToNextBilling
[DESC] => xxx
[MAXFAILEDPAYMENTS] => 2
[SUBSCRIBERNAME] => Dan
[PROFILESTARTDATE] => 2013-05-15T07:00:00Z
[PROFILEREFERENCE] => 31571
[NEXTBILLINGDATE] => 2013-05-16T10:00:00Z
[NUMCYCLESCOMPLETED] => 1
[NUMCYCLESREMAINING] => 18446744073709551615
[OUTSTANDINGBALANCE] => 0.00
[FAILEDPAYMENTCOUNT] => 0
[LASTPAYMENTDATE] => 2013-05-15T14:52:04Z
[LASTPAYMENTAMT] => 0.10
[TRIALAMTPAID] => 0.00
[REGULARAMTPAID] => 0.10
[AGGREGATEAMT] => 0.10
[AGGREGATEOPTIONALAMT] => 0.00
[FINALPAYMENTDUEDATE] => 1970-01-01T00:00:00Z
[TIMESTAMP] => 2013-05-15T14:55:58Z
[CORRELATIONID] => 225681xxx
[ACK] => Success
[VERSION] => 64
[BUILD] => 5908853
[SHIPTOSTREET] => xxx
[SHIPTOCITY] => xxx
[SHIPTOSTATE] => CA
[SHIPTOZIP] => xxx
[SHIPTOCOUNTRYCODE] => US
[SHIPTOCOUNTRY] => US
[SHIPTOCOUNTRYNAME] => United States
[SHIPADDRESSOWNER] => PayPal
[SHIPADDRESSSTATUS] => Unconfirmed
[BILLINGPERIOD] => Day
[BILLINGFREQUENCY] => 1
[TOTALBILLINGCYCLES] => 0
[CURRENCYCODE] => USD
[AMT] => 0.10
[SHIPPINGAMT] => 0.00
[TAXAMT] => 0.00
[REGULARBILLINGPERIOD] => Day
[REGULARBILLINGFREQUENCY] => 1
[REGULARTOTALBILLINGCYCLES] => 0
[REGULARCURRENCYCODE] => USD
[REGULARAMT] => 0.10
[REGULARSHIPPINGAMT] => 0.00
[REGULARTAXAMT] => 0.00
)
谁能帮我?请
你得到了这个:
'&METHOD =GetRecurringPaymentsProfileDetails'
我认为里面的空间导致了一个无效的请求。试试这个:
'&METHOD=GetRecurringPaymentsProfileDetails'
这肯定是因为您的API请求(我猜是不正确的配置文件ID)
您是否可以尝试(点击)浏览器中的以下链接(替代API凭据,配置文件ID)
https://api-3t.sandbox.paypal.com/nvp?&用户=xxxxxxxxxx&pwd=xxxxxxxxxx&签名=xxxxxxxxxx&版本=109.0&METHOD=GetRecurringPaymentsProfileDetails&PROFILEID=I-XXXXXXXXXXXX
看看你得到了什么回应。
当我使用"I-XXXXXXXXXXXXX"作为配置文件id时,我得到内部错误。