-
-
Save wehub/67d99c9ca529769e3a633f022f62a2b7 to your computer and use it in GitHub Desktop.
Java_SDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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