Skip to content

Instantly share code, notes, and snippets.

@itfobos
Created January 15, 2020 13:51
Show Gist options
  • Select an option

  • Save itfobos/8cbc5b2c9b167f087956e07f8e3b7032 to your computer and use it in GitHub Desktop.

Select an option

Save itfobos/8cbc5b2c9b167f087956e07f8e3b7032 to your computer and use it in GitHub Desktop.
@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