Package com.skava.payment.web
Class TransactionController
java.lang.Object
com.skava.payment.web.TransactionController
-
Constructor Summary
ConstructorsConstructorDescriptionTransactionController
(CreateTransactionService createTransactionService, ReCreateTransactionService reCreateTransactionService, PatchTransactionService patchTransactionService, FindTransactionService findTransactionService) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Transaction>
createTransaction
(String version, String locale, long collectionId, Transaction transaction) This method is used to create Transaction based on given transactionRequest.org.springframework.http.ResponseEntity<String>
deleteTransaction
(String version, String locale, long collectionId, long transactionId) This method is used to delete a Transaction based on given Transaction id.org.springframework.http.ResponseEntity<String>
deleteTransactionProperty
(String version, String locale, long collectionId, long transactionId, String name) This method is used to delete a Transaction property based on given Transaction id and property name.org.springframework.http.ResponseEntity<Transaction>
getTransactionById
(String version, String locale, long collectionId, long transactionId) This method is used to load single Transaction for the provided transaction id.org.springframework.http.ResponseEntity<Transaction>
getTransactionByRequestId
(String version, String locale, long collectionId, String requestId) This method is used to load single Transaction for the provided request id.org.springframework.http.ResponseEntity<Transaction>
getTransactionProperty
(String version, String locale, long collectionId, String name, String value) This method is used to load a transaction based on given property name and property value.org.springframework.http.ResponseEntity<Transaction>
patchTransactionById
(String version, String locale, long collectionId, Boolean isFromReconciliation, long transactionId, Transaction transaction) This method is used to patch update single Transaction for the provided transaction id.org.springframework.http.ResponseEntity<Transaction>
reCreateTransaction
(String version, String locale, long collectionId, Transaction transaction) void
setDeleteTransactionPropertyService
(DeleteTransactionPropertyService deleteTransactionPropertyService) void
setDeleteTransactionService
(DeleteTransactionService deleteTransactionService) void
setFindTransactionByPropertyService
(FindTransactionByPropertyService findTransactionByPropertyService) void
setFindTransactionByRequestIdService
(FindTransactionByRequestIdService findTransactionByRequestIdService)
-
Constructor Details
-
TransactionController
@Autowired public TransactionController(CreateTransactionService createTransactionService, ReCreateTransactionService reCreateTransactionService, PatchTransactionService patchTransactionService, FindTransactionService findTransactionService)
-
-
Method Details
-
setDeleteTransactionService
@Autowired public void setDeleteTransactionService(DeleteTransactionService deleteTransactionService) -
setDeleteTransactionPropertyService
@Autowired public void setDeleteTransactionPropertyService(DeleteTransactionPropertyService deleteTransactionPropertyService) -
setFindTransactionByRequestIdService
@Autowired public void setFindTransactionByRequestIdService(FindTransactionByRequestIdService findTransactionByRequestIdService) -
setFindTransactionByPropertyService
@Autowired public void setFindTransactionByPropertyService(FindTransactionByPropertyService findTransactionByPropertyService) -
createTransaction
@PostMapping @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_REG_USER\', \'payment\',#collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER_ADMIN\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER\',\'payment\', #collectionId) || hasPrivilegeForServiceAndCollection(\'payment/create/transaction\', \'payment\',#collectionId) ") public org.springframework.http.ResponseEntity<Transaction> createTransaction(@RequestHeader(value="x-version-id",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @RequestHeader(value="x-collection-id",required=true) long collectionId, @RequestBody(required=true) Transaction transaction) This method is used to create Transaction based on given transactionRequest. Transaction is the object which consists of all the payment details. It consists of the list of Transactions. The created payment id will be maintained in the user's profile in which all the saved payments exists.- Parameters:
version
- Indicates the version of the API to be used.locale
- API Response and error messages will be responded in the mentioned locale.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties c an be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.transaction
- It contains the attributes required for the creation of Transaction.- Returns:
- It returns the
TransactionDTO
.
-
reCreateTransaction
@PostMapping("/recreate") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_REG_USER\', \'payment\',#collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER_ADMIN\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER\',\'payment\', #collectionId) || hasPrivilegeForServiceAndCollection(\'payment/recreate/transaction\', \'payment\',#collectionId) ") public org.springframework.http.ResponseEntity<Transaction> reCreateTransaction(@RequestHeader(value="x-version-id",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @RequestHeader(value="x-collection-id",required=true) long collectionId, @RequestBody(required=true) Transaction transaction) -
patchTransactionById
@PatchMapping("/{transactionId}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER_ADMIN\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_GUEST\', \'payment\',#collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER\',\'payment\', #collectionId) || hasPrivilegeForServiceAndCollection(\'payment/create/transaction\',\'payment\', #collectionId) ") public org.springframework.http.ResponseEntity<Transaction> patchTransactionById(@RequestHeader(value="x-version-id",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @RequestHeader(value="x-collection-id",required=true) long collectionId, @RequestHeader(value="x-is-reconciliation",required=false) Boolean isFromReconciliation, @PathVariable(value="transactionId",required=true) long transactionId, @RequestBody(required=true) Transaction transaction) This method is used to patch update single Transaction for the provided transaction id.- Parameters:
version
- Indicates the version of the API to be used.locale
- API Response and error messages will be responded in the mentioned locale.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties c an be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.transactionId
- It refers to the id of the Transaction.transaction
- It contains the attributes required for the creation of Transaction.- Returns:
- It returns the
TransactionDTO
.
-
getTransactionById
@GetMapping("/{transactionId}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER_ADMIN\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_GUEST\', \'payment\',#collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER\',\'payment\', #collectionId) || hasPrivilegeForServiceAndCollection(\'payment/view/transaction\',\'payment\', #collectionId) ") public org.springframework.http.ResponseEntity<Transaction> getTransactionById(@RequestHeader(value="x-version-id",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @RequestHeader(value="x-collection-id",required=true) long collectionId, @PathVariable(value="transactionId",required=true) long transactionId) This method is used to load single Transaction for the provided transaction id.- Parameters:
version
- Indicates the version of the API to be used.locale
- API Response and error messages will be responded in the mentioned locale.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties c an be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.transactionId
- It refers to the id of the Transaction.- Returns:
- It returns the
TransactionDTO
.
-
deleteTransaction
@DeleteMapping("/{transactionId}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER_ADMIN\', \'payment\',#collectionId) || hasRoleForServiceAndCollection(\'ROLE_GUEST\', \'payment\',#collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER\',\'payment\', #collectionId) || hasPrivilegeForServiceAndCollection(\'payment/delete/transaction\', \'payment\',#collectionId) ") public org.springframework.http.ResponseEntity<String> deleteTransaction(@RequestHeader(value="x-version-id",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @RequestHeader(value="x-collection-id",required=true) long collectionId, @PathVariable(value="transactionId",required=true) long transactionId) This method is used to delete a Transaction based on given Transaction id.- Parameters:
version
- Indicates the version of the API to be used.locale
- API Response and error messages will be responded in the mentioned locale.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties c an be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.transactionId
- It refers to the transaction id that need to be loaded.- Returns:
- It returns the
TransactionDTO
.
-
deleteTransactionProperty
@DeleteMapping("/{transactionId}/properties/{name}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'payment\', #collectionId) || hasPrivilegeForServiceAndCollection(\'payment/delete/transaction/property\',\'payment\', #collectionId) ") public org.springframework.http.ResponseEntity<String> deleteTransactionProperty(@RequestHeader(value="x-version-id",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @RequestHeader(value="x-collection-id",required=true) long collectionId, @PathVariable(value="transactionId",required=true) long transactionId, @PathVariable(value="name",required=true) String name) This method is used to delete a Transaction property based on given Transaction id and property name.- Parameters:
version
- Indicates the version of the API to be used.locale
- API Response and error messages will be responded in the mentioned locale.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties c an be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.transactionId
- It refers to the Transaction id that need to be loaded.name
- Indicates the transaction property name for which the request's operation to be performed.- Returns:
- It returns the
TransactionDTO
.
-
getTransactionProperty
@GetMapping("/property/{name}/{value}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER_ADMIN\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_GUEST\', \'payment\',#collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER\',\'payment\', #collectionId) || hasPrivilegeForServiceAndCollection(\'payment/view/transaction\',\'payment\', #collectionId) ") public org.springframework.http.ResponseEntity<Transaction> getTransactionProperty(@RequestHeader(value="x-version-id",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @RequestHeader(value="x-collection-id",required=true) long collectionId, @PathVariable(value="name",required=true) String name, @PathVariable(value="value",required=true) String value) This method is used to load a transaction based on given property name and property value.- Parameters:
version
- Indicates the version of the API to be used.locale
- API Response and error messages will be responded in the mentioned locale.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties c an be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.name
- Indicates the transaction property name for which the request's operation to be performed.value
- Indicates the transaction property value for which the request's operation to be performed.- Returns:
- It returns the
TransactionDTO
.
-
getTransactionByRequestId
@GetMapping("request/{requestId}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER_ADMIN\',\'payment\', #collectionId) || hasRoleForServiceAndCollection(\'ROLE_GUEST\', \'payment\',#collectionId) || hasRoleForServiceAndCollection(\'ROLE_ACCOUNT_BUYER\',\'payment\', #collectionId) || hasPrivilegeForServiceAndCollection(\'payment/view/transaction\',\'payment\', #collectionId) ") public org.springframework.http.ResponseEntity<Transaction> getTransactionByRequestId(@RequestHeader(value="x-version-id",required=false,defaultValue="8.19.7") String version, @RequestHeader(value="locale",required=false,defaultValue="en_US") String locale, @RequestHeader(value="x-collection-id",required=true) long collectionId, @PathVariable(value="requestId",required=true) String requestId) This method is used to load single Transaction for the provided request id.- Parameters:
version
- Indicates the version of the API to be used.locale
- API Response and error messages will be responded in the mentioned locale.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties c an be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.requestId
- It refers to a unique randomly generated id which is mapped to a transaction.- Returns:
- It returns the
TransactionDTO
.
-