Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding psp business name to CDI PAGOPA-1162 #29

Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/main/java/it/gov/pagopa/afm/utils/entity/CDI.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class CDI {
private String abi;
private Boolean digitalStamp;
private String validityDateFrom;
private String pspBusinessName;
private List<Detail> details;

// internal management field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ public class BundleRequest implements Serializable {
private List<String> transferCategoryList;
private LocalDate validityDateFrom;
private LocalDate validityDateTo;
private String pspBusinessName;
}
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public List<BundleRequest> createBundlesByCDI(CDI cdi) {
bundleRequest.setIdCdi(cdi.getIdCdi());
bundleRequest.setAbi(cdi.getAbi());
bundleRequest.setDigitalStamp(cdi.getDigitalStamp());
bundleRequest.setPspBusinessName(cdi.getPspBusinessName());
bundleRequest.setDigitalStampRestriction(Boolean.FALSE);
bundleRequest.setType(BundleType.GLOBAL);
bundleRequest.setTransferCategoryList(null);
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/it/gov/pagopa/afm/utils/ImportCDIHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@ void executePaymentMethodPO()
assertEquals("PSP", requests.get(0).getTouchpoint());
}

@Test
void verifyPSPBusinessName()
throws IOException,
SecurityException,
IllegalArgumentException {
// precondition
CDI cdi = TestUtil.readModelFromFile("cdi/cdi_ragione_sociale.json", CDI.class);

List<BundleRequest> requests = cdiService.createBundlesByCDI(cdi);

assertEquals(1, requests.size());
assertEquals("PSP_RAGIONE_SOCIALE", requests.get(0).getPspBusinessName());
}

/*
@Test
void executeFailed()
Expand Down
27 changes: 27 additions & 0 deletions src/test/resources/cdi/cdi_ragione_sociale.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"idPsp": "string",
"idCdi": "string",
"abi": "string",
"digitalStamp": true,
"validityDateFrom": "2022-12-14",
"pspBusinessName": "PSP_RAGIONE_SOCIALE",
"details": [
{
"idBrokerPsp": "string",
"idChannel": "string",
"name": "string",
"description": "string",
"paymentType": "PO",
"channelApp": false,
"channelCardsCart": false,
"serviceAmount": [
{
"paymentAmount": 1000,
"minPaymentAmount": 500,
"maxPaymentAmount": 1500
}
]
}
],
"cdiStatus": "NEW"
}
Loading