anoop
anoop

Reputation: 1614

paypal adaptive account creation

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

Answers (1)

CCamilo
CCamilo

Reputation: 887

You have to create (fake) users the for sandbox environment. You can do all at https://developer.paypal.com/

  • Please go to PayPal developer and log in.
  • Then click on "Dashboard"
  • Under "Sandbox" click on "Accounts" (or click here).
  • In that page you can create users. Create some for buyers and some for sellers. There you can get the credentials for those users as well.

Upvotes: 1

Related Questions