Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,21 @@ public final Profile lookup(final Profile profile, final boolean includeAddresse
* @throws PaysafeException the paysafe exception
*/
public final Profile lookup(final Profile profile) throws IOException, PaysafeException {
return lookup(profile, false, false);
if (profile.getMerchantCustomerId() != null && profile.getId() == null) {
HashMap<String, String> queryStr = new HashMap<>();
queryStr.put("merchantCustomerId", profile.getMerchantCustomerId());

final Request request = Request.builder()
.uri(prepareUri(PROFILE_PATH))
.method(Request.RequestType.GET)
.queryStr(queryStr)
.build();

Profile returnVal = client.processRequest(request, Profile.class);
return returnVal;
} else {
return lookup(profile, false, false);
}
}

/**
Expand Down