Skip to content

Instantly share code, notes, and snippets.

@philmadden83
Last active September 23, 2016 18:34
Show Gist options
  • Save philmadden83/9faf66b04ff07685d0851b156d8f62c9 to your computer and use it in GitHub Desktop.
Save philmadden83/9faf66b04ff07685d0851b156d8f62c9 to your computer and use it in GitHub Desktop.
private void createOrder(ResponsysTask task, Account account) throws ResponsysException {
try {
Profile profile = getProfile(account, attribtues.get(EMAIL_ADDRESS_FIELD_NAME));
updateProfile(account, attribtues);
} catch (RecordNotFoundException e) {
createProfile(account, attribtues);
}
createSupplementalTableData(account, configuration.getOrdersTable(), ENTITY_FACTORY.getProfileExtensionRecord(task.getAttributes()));
}
private Profile getProfile(Account account, String email) throws ResponsysException {
WebTarget target = getProfileListTarget(account, configuration.getContactsList())
.queryParam("qa", "e")
.queryParam("fs", EMAIL_ADDRESS_FIELD_NAME)
.queryParam("id", email);
return doGet(target, account, Profile.class);
}
private void updateUser(Account account, String email, Map<String, String> attributes) {
Profile profile = getProfile(account, email);
//update data with attributes.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment