Class PaymentsService
java.lang.Object
edu.suffolk.litlab.efsp.server.services.PaymentsService
Handles communication with Tyler's API regarding Payments and the Tyler Online Gateway Activation
(?), aka TOGA.
- Author:
- brycew
-
Constructor Summary
ConstructorsConstructorDescriptionPaymentsService
(String jurisdiction, String env, String togaKey, String togaUrl, Supplier<LoginDatabase> ldSupplier, Supplier<CodeDatabase> cdSupplier) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
createGlobalWaiverAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountName) Creates a new global waiver account, which can be used for all filers in this EFSP.jakarta.ws.rs.core.Response
createWaiverAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountName) Creates a new waiver account.jakarta.ws.rs.core.Response
getAll()
jakarta.ws.rs.core.Response
getGlobalPaymentAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountId) jakarta.ws.rs.core.Response
getGlobalPaymentList
(jakarta.ws.rs.core.HttpHeaders httpHeaders) jakarta.ws.rs.core.Response
getPaymentAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountId) jakarta.ws.rs.core.Response
getPaymentAccountList
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String courtId) jakarta.ws.rs.core.Response
getPaymentAccountTypeList
(jakarta.ws.rs.core.HttpHeaders httpHeaders) jakarta.ws.rs.core.Response
makeNewPaymentAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String body) The endpoint that Tyler calls when the user enters their payment info into Tyler's system.jakarta.ws.rs.core.Response
redirectToToga
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String name, boolean global, String typeCode, int typeCodeId, String tylerInfo, String originalUrl, String errorUrl) An endpoint that generates HTML+JS in order to send a user to Tyler's site where payment information can be securely entered.jakarta.ws.rs.core.Response
removeGlobalPaymentAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountId) jakarta.ws.rs.core.Response
removePaymentAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountId) jakarta.ws.rs.core.Response
updateGlobalPaymentAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountId, String json) jakarta.ws.rs.core.Response
updatePaymentAccount
(jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountId, String json) Edits payment account information.
-
Constructor Details
-
PaymentsService
public PaymentsService(String jurisdiction, String env, String togaKey, String togaUrl, Supplier<LoginDatabase> ldSupplier, Supplier<CodeDatabase> cdSupplier)
-
-
Method Details
-
getAll
@GET @Path("/") public jakarta.ws.rs.core.Response getAll() -
getGlobalPaymentList
@GET @Path("/global-accounts") public jakarta.ws.rs.core.Response getGlobalPaymentList(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders) -
getGlobalPaymentAccount
@GET @Path("/global-accounts/{account_id}") public jakarta.ws.rs.core.Response getGlobalPaymentAccount(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("account_id") String accountId) -
createGlobalWaiverAccount
@POST @Path("/global-accounts") public jakarta.ws.rs.core.Response createGlobalWaiverAccount(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountName) Creates a new global waiver account, which can be used for all filers in this EFSP.Access to this API should be gated at the client level. (TODO: should be gated here too, but required new server admin features to be tied to a single Tyler account).
- Parameters:
httpHeaders
-accountName
- The body should of this should be the waiver account's name.- Returns:
- The UUID of this new account, to be used as the `tyler_payment_id` attribute when filing.
-
updateGlobalPaymentAccount
-
removeGlobalPaymentAccount
@DELETE @Path("/global-accounts/{account_id}") public jakarta.ws.rs.core.Response removeGlobalPaymentAccount(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("account_id") String accountId) -
getPaymentAccount
@GET @Path("/payment-accounts/{account_id}") public jakarta.ws.rs.core.Response getPaymentAccount(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("account_id") String accountId) -
removePaymentAccount
@DELETE @Path("/payment-accounts/{account_id}") public jakarta.ws.rs.core.Response removePaymentAccount(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("account_id") String accountId) -
getPaymentAccountList
@GET @Path("/payment-accounts") public jakarta.ws.rs.core.Response getPaymentAccountList(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @DefaultValue("") @QueryParam("court_id") String courtId) throws SQLException - Throws:
SQLException
-
createWaiverAccount
@POST @Path("/payment-accounts") public jakarta.ws.rs.core.Response createWaiverAccount(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, String accountName) Creates a new waiver account. To create a non-waiver account, see /new-toga-account.- Parameters:
httpHeaders
-accountName
- The body should of this should be the waiver account's name. If the user is manually creating this account, it should be given by them. If you are automatically creating the waiver account, it's name should be tied to the form the user is submitting with it (as these are linked on the courts side usually).- Returns:
- The UUID of this new account, to be used as the `tyler_payment_id` attribute when filing.
-
updatePaymentAccount
@PATCH @Path("/payment-accounts/{account_id}") public jakarta.ws.rs.core.Response updatePaymentAccount(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @PathParam("account_id") String accountId, String json) throws com.fasterxml.jackson.databind.JsonMappingException, com.fasterxml.jackson.core.JsonProcessingException Edits payment account information.Can only edit the
account_name
and whether it isactive
.To edit information like the card or bank account number, you will need to create a whole new form of payment.
- Throws:
com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.core.JsonProcessingException
-
getPaymentAccountTypeList
@GET @Path("/types") public jakarta.ws.rs.core.Response getPaymentAccountTypeList(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders) -
redirectToToga
@POST @Consumes("application/x-www-form-urlencoded") @Path("/new-toga-account") @Produces("text/html") public jakarta.ws.rs.core.Response redirectToToga(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @FormParam("account_name") String name, @FormParam("global") boolean global, @FormParam("type_code") String typeCode, @Deprecated @FormParam("type_code_id") int typeCodeId, @FormParam("tyler_info") String tylerInfo, @FormParam("original_url") String originalUrl, @FormParam("error_url") String errorUrl) An endpoint that generates HTML+JS in order to send a user to Tyler's site where payment information can be securely entered. Should be visited with a form submission from the user's browser, so they can be securely redirected to Tyler's site.The HTML will generate a form submission from the user's browser targeted to Tyler's payment page, using Javascript.
Tyler will redirect the user to back to
/payments/toga-account
once payment info is entered.- Parameters:
name
- The desired name of the accountglobal
- whether the new payment type should be global or not (should be false in most cases).typeCode
- a valid string code from/types
(getPaymentAccountTypeList).typeCodeId
- (optional, deprecated) the numerical code ID of the payment; used if Tyler responds back with an invalid type.tylerInfo
- the login / token information of an authenticated Tyler user. Include here instead of the headers since this page is reached via a form submission. The info is saved to act as the user on Tyler's redirection response.originalUrl
- If entry on Tyler's site is successful, forwards the user to this URL.errorUrl
- If there's an error from Tyler's side, forwards the user to this URL.- Returns:
- an HTML page that the user should visit directly
-
makeNewPaymentAccount
@POST @Consumes("application/x-www-form-urlencoded") @Path("/toga-account") public jakarta.ws.rs.core.Response makeNewPaymentAccount(@Context jakarta.ws.rs.core.HttpHeaders httpHeaders, @FormParam("ResponseXML") String body) The endpoint that Tyler calls when the user enters their payment info into Tyler's system./payments/new-toga-account
will always be called before this endpoint.- Parameters:
httpHeaders
-body
- XML that adheres to TogaResponseXml.
-