The payment service in a small microservices backend, built during Scaler’s backend course.
What it does
- Creates a Stripe payment link for an order, which sends the customer to a configured page once they’ve paid.
- A webhook endpoint checks the signature on every Stripe event, rejecting forged or replayed ones, and logs completed payments.
How it’s built
- A
PaymentGatewayinterface with a Stripe implementation, so the rest of the service doesn’t depend on Stripe directly. - The Stripe secret key, the webhook signing secret and the redirect page come from environment variables, never from the code.