【发布时间】:2017-09-14 01:29:24
【问题描述】:
我正在尝试集成 Paypal 自适应链式支付。我对此完全陌生,所以请多多包涵。我正在拿到paykey。但是当我尝试从 PaymentDetails API 获取交易 ID 时,我收到了带有消息 You+do+not+have+permission+to+get+these+payment+details 的错误代码。谁能告诉我为什么我会收到这个错误?在 iOS 及其工作中使用了相同的凭据。
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 可以在这方面提供帮助。在此处归档 paypal-techsupport.com/app/ask
标签: android paypal-adaptive-payments