@@ -125,8 +125,8 @@ public Invoice fetch(final String invoiceId) throws Exception {
125125 * These options correspond to our documentation.
126126 * @param searchBy Enum of type Invoice.SearchBy denoting which field you want to search by
127127 * @param paramsList {@code List<String>} Required if 'searchBy' is either of these: 'invoiceId'
128- * 'recipientId', 'invoiceNumber', 'tags'. Set to 'null' otherwise.
129- * @param param String Required if 'searchBy' is either 'invoiceDate' or 'externalId '. Set to null otherwise.
128+ * 'recipientId', 'invoiceNumber', 'tags', or 'externalId' . Set to 'null' otherwise.
129+ * @param param String Required if 'searchBy' is 'invoiceDate'. Set to null otherwise.
130130 * @return {@code List<Invoice>}
131131 * @throws Exception
132132 */
@@ -141,23 +141,23 @@ public List<Invoice> search(final SearchBy searchBy,
141141 case INVOICE_ID :
142142 case RECIPIENT_ID :
143143 case INVOICE_NUMBER :
144+ case EXTERNAL_ID :
144145 case TAGS :
145146 if (null == paramsList ){
146147 throw new InvalidFieldException ("variable paramsList can not be null for the provided searchBy parameter. Refer to method's Javadoc for more details." );
147148 }
148- body = "{\" " +searchBy .name ()+"\" :"
149+ body = "{\" " +searchBy .getKey ()+"\" :"
149150 +new ObjectMapper ()
150151 .setSerializationInclusion (Include .NON_EMPTY )
151152 .writeValueAsString (paramsList )
152153 +"}" ;
153154 break ;
154155
155156 case INVOICE_DATE :
156- case EXTERNAL_ID :
157157 if (null == param ){
158158 throw new InvalidFieldException ("variable param can not be null for the provided searchBy parameter. Refer to method's Javadoc for more details." );
159159 }
160- body = "{\" " +searchBy .name ()+"\" :\" " +param +"\" }" ;
160+ body = "{\" " +searchBy .getKey ()+"\" :\" " +param +"\" }" ;
161161 break ;
162162 }
163163 final String endPoint = "/v1/invoices/search/" ;
@@ -176,8 +176,8 @@ public List<Invoice> search(final SearchBy searchBy,
176176 * These options correspond to our documentation.
177177 * @param searchBy Enum of type Invoice.SearchBy denoting which field you want to search by
178178 * @param paramsList {@code List<String>} Required if 'searchBy' is either of these: 'invoiceId'
179- * 'recipientId', 'invoiceNumber', 'tags'. Set to 'null' otherwise.
180- * @param param String Required if 'searchBy' is either 'invoiceDate' or 'externalId '. Set to null otherwise.
179+ * 'recipientId', 'invoiceNumber', 'tags', or 'externalId' . Set to 'null' otherwise.
180+ * @param param String Required if 'searchBy' is 'invoiceDate'. Set to null otherwise.
181181 * @return Invoices object that contains {@code List<Invoice>} that you can traverse through, and a Meta object with pagination information
182182 * @throws Exception
183183 */
@@ -198,7 +198,7 @@ public Invoices search(final SearchBy searchBy,
198198 if (null == paramsList ){
199199 throw new InvalidFieldException ("variable paramsList can not be null for the provided searchBy parameter. Refer to method's Javadoc for more details." );
200200 }
201- body = "{\" " +searchBy .name ()+"\" :"
201+ body = "{\" " +searchBy .getKey ()+"\" :"
202202 +new ObjectMapper ()
203203 .setSerializationInclusion (Include .NON_EMPTY )
204204 .writeValueAsString (paramsList )
@@ -212,7 +212,7 @@ public Invoices search(final SearchBy searchBy,
212212 if (null == param ){
213213 throw new InvalidFieldException ("variable param can not be null for the provided searchBy parameter. Refer to method's Javadoc for more details." );
214214 }
215- body = "{\" " +searchBy .name ()+"\" :\" " +param +"\" }" ;
215+ body = "{\" " +searchBy .getKey ()+"\" :\" " +param +"\" }" ;
216216 break ;
217217 }
218218 final String endPoint = "/v1/invoices/search/" ;
0 commit comments