diff --git a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java index b5b9193..39d8253 100644 --- a/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java +++ b/src/main/java/org/folio/ncip/FolioRemoteServiceManager.java @@ -613,6 +613,10 @@ protected JsonObject addDefaultPatronFee(FiscalTransactionInformation fiscalTran charge.put("feeFineOwner", ownersArray.getJsonObject(0).getString("owner")); charge.put("userId", userId); charge.put("id", UUID.randomUUID().toString()); + if (fiscalTransactionInformation.getItemDetails() != null && fiscalTransactionInformation.getItemDetails().getItemId() != null && + fiscalTransactionInformation.getItemDetails().getItemId().getItemIdentifierValue() != null) { + charge.put("barcode", fiscalTransactionInformation.getItemDetails().getItemId().getItemIdentifierValue()); + } return new JsonObject(callApiPost(baseUrl + Constants.ACCOUNT_URL, charge)); } catch (Exception e) { logger.error("Failed to add default patron fee", e); diff --git a/src/test/resources/mockdata/ncip-createUserFiscalTransaction.xml b/src/test/resources/mockdata/ncip-createUserFiscalTransaction.xml index 5f47074..f9b209b 100644 --- a/src/test/resources/mockdata/ncip-createUserFiscalTransaction.xml +++ b/src/test/resources/mockdata/ncip-createUserFiscalTransaction.xml @@ -19,6 +19,12 @@ 0 + + + i-123 + + + \ No newline at end of file