1
我必须使用paypal自适应账户创建Rest api在我的一个项目中。 java库在这里https://github.com/paypal/adaptiveaccounts-sdk-java。但是当我尝试这个使用下面的代码paypal自适应账户创建
RequestEnvelope env = new RequestEnvelope();
env.setErrorLanguage("en_US");
NameType name = new NameType("John", "Lui");
AddressType address = new AddressType("Main St", "US");
String preferredLanguageCode ="en_US";
CreateAccountRequest createAccountRequest = new CreateAccountRequest(env,name, address, preferredLanguageCode);
Map<String, String> customConfigurationMap = new HashMap<String, String>();
customConfigurationMap.put("mode", "sandbox");
customConfigurationMap.put("acct1.UserName", "protest348_api1.gmail.com");
customConfigurationMap.put("acct1.Password", "HD6X2RX38WE78NUW");
customConfigurationMap.put("acct1.Signature", "AOKE31.o6thw-ButmC4-x.YFN6U-AuGNMBPR0Dbd9hkDMfzgJ1Zcm7yo");
customConfigurationMap.put("acct1.AppId", "APP-80W284485P519543T");
customConfigurationMap.put("sandbox.EmailAddress", "[email protected]");
AdaptiveAccountsService adaptiveAccountsService = new AdaptiveAccountsService(customConfigurationMap);
CreateAccountResponse createAccountResponse = adaptiveAccountsService.createAccount(createAccountRequest,"[email protected]");
log.info(createAccountResponse.getAccountId());
在日志整合我得到了这样的错误
Unable to generate Access Token com.paypal.exception.MissingCredentialException: Account for the username does not exists in the properties file
我怎样才能解决这个问题。我在githhub中也有同样的事情。但我不知道我是否正确添加了用户名,密码和签名。我如何使用库文件中的默认密码覆盖我的签名?请帮助我。
我所做的一切。我的疑问是如何在代码中添加此配置。 – anoop
好。应该有一个地方应该复制买方的所有凭证信息(用户名,密码,签名)。 不在这里? - > customConfigurationMap.put(“acct1.UserName”,“XXXXXXXXXXXXX”); – CCamilo
我相信是在这个Configuration.java文件中,不是? – CCamilo