Created
January 15, 2020 13:51
-
-
Save itfobos/8cbc5b2c9b167f087956e07f8e3b7032 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @Controller | |
| public class ReceiptController { | |
| private final SomeService someService; | |
| private final SignatureService signatureService; | |
| public ReceiptController(SomeService someService, SignatureService signatureService) { | |
| this.someService = someService; | |
| this.signatureService = signatureService; | |
| } | |
| @PostMapping("/receipt") | |
| public String processReceipt(@RequestParam Map<String, String> receiptBody) { | |
| //TODO: Sign data and pass to service | |
| someService.processSignedReceiptData(); | |
| return "receipt"; | |
| } | |
| } | |
| @Service | |
| class SomeService { | |
| //TODO: Signature should be changed | |
| public void processSignedReceiptData(/*Some input data*/) { | |
| //some implementation | |
| } | |
| } | |
| @Service | |
| class SignatureService { | |
| public String makeSignature(Map<String, String> keyToValue) { | |
| //some implementation | |
| return "some signature"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment