我正在嘗試整合貝寶自適應鏈接付款。我對此非常感興趣,所以請耐心等待。我得到了paykey。但是,當我嘗試從PaymentDetails API獲取事務ID時,我收到了帶有消息You+do+not+have+permission+to+get+these+payment+details
的此錯誤代碼。任何人都可以告訴我爲什麼我得到這個錯誤? iOS和其工作中使用相同的憑據。貝寶PaymentDetails API錯誤540031
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
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);
}
}
你可以向MTS申請一張票嗎?這個錯誤非常微妙,並不具體。 MTS可以幫助解決這個問題。在這裏文件https://www.paypal-techsupport.com/app/ask –