我试图整合Paypal自适应链式支付。我对此非常陌生,请耐心等待。我拿到了付款钥匙。但是当我尝试从PaymentDetails API获取交易ID时,我收到了带有消息Envelope.timestamp=2017-04-18T01%3A50%3A24.907-07%3A00&responseEnvelope.ack=Failure&responseEnvelope.correlationId=adc36cc2d80b5&responseEnvelope.build=32250686&error(0).errorId=540031&error(0).domain=PLATFORM&error(0).subdomain=Application&error(0).severity=Error&error(0).category=Application&error(0).message=You+do+not+have+permission+to+get+these+payment+details
的错误代码。任何人都可以告诉我为什么我会收到此错误?在iOS及其工作中使用相同的凭据。
private class MyAsyncTask extends AsyncTask<Void, Void, String> {
StringBuffer buffer;
@Override
protected String doInBackground(Void... params) {
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = null;
httppost = new HttpPost("https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails");
httppost.setHeader("Content-Type","application/x-www-form-urlencoded");
httppost.setHeader("X-PAYPAL-SECURITY-USERID","ashishapp.gmail.com");
httppost.setHeader("X-PAYPAL-SECURITY-PASSWORD","P9AGL37BV9TLZ9RD");
httppost.setHeader("X-PAYPAL-SECURITY-SIGNATURE","AyW8vijLhnQYFtANgDxD3mbhZZi8PawPbRFvGFb3sy2TNzaMZcVtvzEZ");
httppost.setHeader("X-PAYPAL-APPLICATION-ID","APP-80W284485P519543T");
httppost.setHeader("X-PAYPAL-REQUEST-DATA-FORMAT", "NV");
httppost.setHeader("X-PAYPAL-RESPONSE-DATA-FORMAT", "NV");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("payKey", "AP-8PA68871T0961962Y"));
nameValuePairs.add(new BasicNameValuePair("requestEnvelope.errorLanguage", "en_US"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
InputStream is = entity.getContent();
byte[] data1;
data1 = new byte[256];
buffer = new StringBuffer();
int len = 0;
while (-1 != (len = is.read(data1))) {
buffer.append(new String(data1, 0, len));
}
System.out.println("sammy--------->" + buffer.toString());
is.close();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
} catch (IOException e) {
// TODO Auto-generated catch block
}
return buffer.toString();
}
protected void onPostExecute(String result){
System.out.println("sammy_onPost "+result);
}
}
&#13;
panoId
&#13;
答案 0 :(得分:0)
错误代码540031表示“您无权获取这些付款选项”。您可以参考以下链接。 https://developer.paypal.com/docs/classic/api/adaptive-payments/GetPaymentOptions_API_Operation/
谢谢。