use of com.mirakl.client.mmp.operator.request.payment.invoice.MiraklGetInvoicesRequest in project mirakl-hyperwallet-connector by paypal.
the class AbstractAccountingDocumentsExtractServiceImpl method getInvoicesForDateAndType.
protected List<HMCMiraklInvoice> getInvoicesForDateAndType(final Date delta, final InvoiceTypeEnum invoiceType) {
final List<HMCMiraklInvoice> invoices = new ArrayList<>();
int offset = 0;
final MiraklGetInvoicesRequest accountingDocumentRequest = createAccountingDocumentRequest(delta, invoiceType);
while (true) {
accountingDocumentRequest.setOffset(offset);
final HMCMiraklInvoices receivedInvoices = miraklMarketplacePlatformOperatorApiClient.getInvoices(accountingDocumentRequest);
invoices.addAll(receivedInvoices.getHmcInvoices());
if (receivedInvoices.getTotalCount() <= invoices.size()) {
break;
}
offset += MIRAKL_MAX_RESULTS_PER_PAGE;
}
return invoices;
}
Aggregations