Skip to content

Instantly share code, notes, and snippets.

@wehub
Last active July 14, 2021 01:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wehub/ca3ee6057e0412e723a2031b162736be to your computer and use it in GitHub Desktop.
Save wehub/ca3ee6057e0412e723a2031b162736be to your computer and use it in GitHub Desktop.
Java_SDK
package com.wepay;
import com.wepay.endpoints.LegalEntitiesApi;
import com.wepay.model.data.*;
import com.wepay.model.data.ControllerReq;
import com.wepay.model.enums.CountryEnum;
import com.wepay.model.resource.LegalEntity;
import com.wepay.network.Configuration;
import com.wepay.network.Configuration.Environment;
import com.wepay.network.WePayRequest;
import java.util.logging.Level;
import java.util.logging.Logger;
public class WePay {
private final static Logger LOGGER =
Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
public WePay() {
}
public static void main(String[] args) {
Configuration configuration = new Configuration();
configuration.setAppId(<APP ID>);
configuration.setAppToken(<APP TOKEN>);
configuration.setEnvironment(Environment.STAGE);
WePayRequest.initializeRequest();
try {
LegalEntitiesCreateData createData = new LegalEntitiesCreateData();
createData.setCountryCode(CountryEnum.US);
ControllerReq controllerReq = new ControllerReq();
controllerReq.setEmailNullable("test@test.com");
createData.setControllerReq(controllerReq);
LegalEntity createResult = LegalEntitiesApi.create(createData);
LOGGER.log(Level.INFO, String.format("Successfully created a legal entity."));
}
catch (Exception e) {
LOGGER.log(Level.WARNING, e.getMessage());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment