Last active
September 23, 2016 18:34
-
-
Save philmadden83/9faf66b04ff07685d0851b156d8f62c9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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