-1 down vote favorite I was trying to make the PayPal Adaptive Payments Refund API call, but for some reasons it sends the "Authentication failed. API credentials are incorrect.". I have checked the API credentials in my PayPal Sandbox account and they are correct. I am using the Adaptive Payments Java SDK version 2.7.117. I am wondering using the same credentials the other APIs are working fine such as the PreApproved and Pay APIs. Also, the Refund API is invoked by the third party, so at this point the user has successfully granted the permissions using the Permissions API and the access token and token secret are fetched from PayPal. Please help me if anyone knows the possible solution. <pre lang="java"> // Account Credential Map<String, String> configMap = new HashMap<String, String>(); configMap.put("acct1.UserName", "i***n._130***72_biz_api1.s***f.com"); configMap.put("acct1.Password", "1300056686"); configMap.put("acct1.Signature", "A60FAwU5**********************9.zrNzQxNZMUa81s"); configMap.put("acct1.AppId", "APP-80W284485P519543T"); configMap.put("mode", "sandbox"); AdaptivePaymentsService adaptivePaymentsService = new AdaptivePaymentsService(configMap); ThirdPartyAuthorization thirdPartyAuth = new TokenAuthorization("-ZgmJ6JZi5tUhpMyxkH29I53XB1NYIscNWY1rw-4zW.hZfpQz8MRUQ", "ucMt1.1dz2dfvIDszifwxhvn7Jg");//First parameter is access token, second is token secret SignatureCredential cred = new SignatureCredential("i***n._130***72_biz_api1.s***f.com", "1300056686", "A60FAwU5**********************9.zrNzQxNZMUa81s"); cred.setApplicationId("APP-80W284485P519543T"); cred.setThirdPartyAuthorization(thirdPartyAuth); RequestEnvelope env = new RequestEnvelope(); env.setErrorLanguage("en"); RefundRequest refundRequest = new RefundRequest(); refundRequest.setRequestEnvelope(env); refundRequest.setTransactionId(transactionID); RefundResponse response = adaptivePaymentsService.refund(refundRequest,cred);</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)