How nithin900/paymentsecurityjourney works
Payment Security Journey is a four-service payment system: a user obtains an OAuth2 token, submits a payment through Service A, and Service B validates the token, enforces ownership, persists the payment, and requests an email notification. Service B obtains a separate client-credentials token for the notification call. The README documents these cross-service relationships and the failure guarantees; the source excerpts do not expose the services’ full internal call chains, so the graph stays at documented subsystem boundaries.
Main entry points: Service/PaymentServiceImpl.java Payment processing · SecurityConfig.java Authorization server · NotificationListener.java Notification listener · Service/PaymentServiceImpl.java Service A gateway
Components 20
Identity and access
- Authorization server
payment-authorization-server/src/main/java/com/example/payment_authorization_server/Config/SecurityConfig.java - Ownership checks
payment-service-b/src/main/java/org/example/Service/PaymentServiceImpl.java - Service A security
payment-service-a/src/main/java/com/example/PaymentA/Security/SecurityConfig.java - Service B security
payment-service-b/src/main/java/org/example/Config/SecurityConfig.java - Notification security
NotificationService/src/main/java/com/example/NotificationService/Config/SecurityConfig.java
Payment processing
- Service A gateway
payment-service-a/src/main/java/com/example/PaymentA/Service/PaymentServiceImpl.java - Payment API
payment-service-a/src/main/java/com/example/PaymentA/Controller/PaymentController.java - Service B API
payment-service-b/src/main/java/org/example/Controller/PaymentController.java - Payment processing
payment-service-b/src/main/java/org/example/Service/PaymentServiceImpl.java - Payment record
payment-service-b/src/main/java/org/example/Entity/Payment.java - Payment repository
payment-service-b/src/main/java/org/example/Repository/PaymentRepository.java - H2 database
payment-service-b/src/main/resources/schema.sql
Email notification
- Payment-created event
payment-service-b/src/main/java/org/example/Notification/PaymentCreatedEvent.java - Notification listener
payment-service-b/src/main/java/org/example/Notification/NotificationListener.java - Notification client
payment-service-b/src/main/java/org/example/Config/NotificationClientConfig.java - Notification API
NotificationService/src/main/java/com/example/NotificationService/Controller/NotificationController.java - Email delivery
NotificationService/src/main/java/com/example/NotificationService/Service/EmailNotificationService.java
Errors and resilience
- Error handling
payment-service-b/src/main/java/org/example/Exceptions/GlobalExceptionHandler.java
Other components
- Payment user
- Gmail SMTP
Connections 21
- Payment user → Authorization server: logs in
README.md - Authorization server → Payment user: issues JWT
README.md - Payment user → Payment API: submits payment
README.md - Payment API → Service A gateway: delegates
- Service A gateway → Service B API: forwards JWT
README.md - Service A security → Authorization server: validates JWT
README.md - Service B security → Authorization server: revalidates JWT
README.md - Service B API → Payment processing: processes request
- Payment processing → Ownership checks: checks owner
README.md - Payment processing → Payment repository: persists payment
README.md - Payment repository → H2 database: reads and writes
README.md - Payment processing → Payment record: creates record
- Payment processing → Payment-created event: requests notification
README.md - Notification listener → Payment-created event: handles event
- Notification listener → Authorization server: gets client token
README.md - Notification listener → Notification client: dispatches request
- Notification client → Notification API: sends notification
- Notification security → Authorization server: validates JWT
README.md - Notification API → Email delivery: sends email
- Email delivery → Gmail SMTP: delivers email
README.md - Payment processing → Error handling: maps failures
README.md