-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Changed retrieval logic of PSP configuration from DB to API (#2)
- Loading branch information
Showing
35 changed files
with
11,697 additions
and
567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/main/java/it/gov/pagopa/swclient/mil/paymentnotice/client/MilRestService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package it.gov.pagopa.swclient.mil.paymentnotice.client; | ||
|
||
import io.smallrye.mutiny.Uni; | ||
import it.gov.pagopa.swclient.mil.paymentnotice.client.bean.AcquirerConfiguration; | ||
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
import javax.ws.rs.GET; | ||
import javax.ws.rs.HeaderParam; | ||
import javax.ws.rs.Path; | ||
import javax.ws.rs.PathParam; | ||
|
||
/** | ||
* Reactive rest client for the REST APIs exposed by the MIL APIM | ||
*/ | ||
@RegisterRestClient(configKey = "mil-rest-api") | ||
public interface MilRestService { | ||
|
||
/** | ||
* Retrieves the psp configuration | ||
* @param requestId the id of the request | ||
* @param acquirerId the acquirer id passed in request | ||
* @return the psp configuration for the acquirer id | ||
*/ | ||
@GET | ||
@Path("/mil-acquirer-conf/confs/{acquirerId}/psp") | ||
@ClientHeaderParam(name = "Ocp-Apim-Subscription-Key", value = "${mil-rest-client.apim-subscription-key}", required = false) | ||
@ClientHeaderParam(name = "Version", value = "${mil-rest-client.mil-acquirer-conf.version}", required = false) | ||
Uni<AcquirerConfiguration> getPspConfiguration(@HeaderParam(value = "RequestId") String requestId, @PathParam(value = "acquirerId") String acquirerId); | ||
|
||
} |
63 changes: 63 additions & 0 deletions
63
...main/java/it/gov/pagopa/swclient/mil/paymentnotice/client/bean/AcquirerConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package it.gov.pagopa.swclient.mil.paymentnotice.client.bean; | ||
|
||
/** | ||
* | ||
*/ | ||
public class AcquirerConfiguration { | ||
|
||
/** | ||
* The psp configuration to be used when calling the "verify" and "activate" APIs of the node | ||
*/ | ||
private PspConfiguration pspConfigForVerifyAndActivate; | ||
|
||
/** | ||
* The psp configuration to be used when calling the "close" API of the node and the "getFee" api of GEC | ||
*/ | ||
private PspConfiguration pspConfigForGetFeeAndClosePayment; | ||
|
||
/** | ||
* Gets pspConfigForVerifyAndActivate | ||
* | ||
* @return value of pspConfigForVerifyAndActivate | ||
*/ | ||
public PspConfiguration getPspConfigForVerifyAndActivate() { | ||
return pspConfigForVerifyAndActivate; | ||
} | ||
|
||
/** | ||
* Sets pspConfigForVerifyAndActivate | ||
* | ||
* @param pspConfigForVerifyAndActivate value of pspConfigForVerifyAndActivate | ||
*/ | ||
public void setPspConfigForVerifyAndActivate(PspConfiguration pspConfigForVerifyAndActivate) { | ||
this.pspConfigForVerifyAndActivate = pspConfigForVerifyAndActivate; | ||
} | ||
|
||
/** | ||
* Gets pspConfigForGetFeeAndClosePayment | ||
* | ||
* @return value of pspConfigForGetFeeAndClosePayment | ||
*/ | ||
public PspConfiguration getPspConfigForGetFeeAndClosePayment() { | ||
return pspConfigForGetFeeAndClosePayment; | ||
} | ||
|
||
/** | ||
* Sets pspConfigForGetFeeAndClosePayment | ||
* | ||
* @param pspConfigForGetFeeAndClosePayment value of pspConfigForGetFeeAndClosePayment | ||
*/ | ||
public void setPspConfigForGetFeeAndClosePayment(PspConfiguration pspConfigForGetFeeAndClosePayment) { | ||
this.pspConfigForGetFeeAndClosePayment = pspConfigForGetFeeAndClosePayment; | ||
} | ||
|
||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("PspConfiguration{"); | ||
sb.append("pspConfigForVerifyAndActivate=").append(pspConfigForVerifyAndActivate); | ||
sb.append(", pspConfigForGetFeeAndClosePayment=").append(pspConfigForGetFeeAndClosePayment); | ||
sb.append('}'); | ||
return sb.toString(); | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
src/main/java/it/gov/pagopa/swclient/mil/paymentnotice/client/bean/PspConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
package it.gov.pagopa.swclient.mil.paymentnotice.client.bean; | ||
|
||
/** | ||
* Configuration of a PSP used when connecting to the node | ||
*/ | ||
public class PspConfiguration { | ||
|
||
/** | ||
* Identifier of the PSP, assigned by PagoPA | ||
*/ | ||
private String psp; | ||
|
||
/** | ||
* Identifier of the broker, assigned by PagoPA | ||
*/ | ||
private String broker; | ||
|
||
/** | ||
* Identifier of the channel used for the payment transaction. | ||
* Is assigned by PagoPA and is unique for the psp | ||
*/ | ||
private String channel; | ||
|
||
/** | ||
* Channel's password, assigned by PagoPA | ||
*/ | ||
private String password; | ||
|
||
|
||
/** | ||
* Gets psp | ||
* @return value of psp | ||
*/ | ||
public String getPsp() { | ||
return psp; | ||
} | ||
|
||
/** | ||
* Sets psp | ||
* @param psp value of psp | ||
*/ | ||
public void setPsp(String psp) { | ||
this.psp = psp; | ||
} | ||
|
||
/** | ||
* Gets broker | ||
* @return value of broker | ||
*/ | ||
public String getBroker() { | ||
return broker; | ||
} | ||
|
||
/** | ||
* Sets broker | ||
* @param broker value of broker | ||
*/ | ||
public void setBroker(String broker) { | ||
this.broker = broker; | ||
} | ||
|
||
/** | ||
* Gets channel | ||
* @return value of channel | ||
*/ | ||
public String getChannel() { | ||
return channel; | ||
} | ||
|
||
/** | ||
* Sets channel | ||
* @param channel value of channel | ||
*/ | ||
public void setChannel(String channel) { | ||
this.channel = channel; | ||
} | ||
|
||
/** | ||
* Gets password | ||
* @return value of password | ||
*/ | ||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
/** | ||
* Sets password | ||
* @param password value of password | ||
*/ | ||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
final StringBuilder sb = new StringBuilder("PspConfiguration{"); | ||
sb.append("psp='").append(psp).append('\''); | ||
sb.append(", broker='").append(broker).append('\''); | ||
sb.append(", channel='").append(channel).append('\''); | ||
sb.append(", password='").append(password).append('\''); | ||
sb.append('}'); | ||
return sb.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.