Reputation: 1614
I have to use paypal adaptive account creation Rest api in one of my project. The java library is here https://github.com/paypal/adaptiveaccounts-sdk-java. But when i try to integrate this using the following code
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());
In the log i got an error like
Unable to generate Access Token com.paypal.exception.MissingCredentialException: Account for the username does not exists in the properties file
How can i resolve this issue. i have following the same thing there in the githhub. but i don't know whether i have added the username, password, and signature correctly. How can i overwrite my signature with the default one in the library file? Please help me on this.
Upvotes: 1
Views: 131
Reputation: 887
You have to create (fake) users the for sandbox environment. You can do all at https://developer.paypal.com/
Upvotes: 1