OIDC discovery vs trust: pin the token issuer in your API gateway
You deploy Keycloak and an API gateway into the same Kubernetes cluster, point the gateway at Keycloak’s internal address, and every valid token is rejected with “Invalid issuer”. Or worse: everything works, but the decision about which tokens your platform trusts is quietly being made by whatever answers a network request.
A timeout is not a failed payment: PSP error state policy
A customer’s order is worth 149 euros. Your system asks the payment provider to capture the money, and the request times out. Did the money move? You do not know. If you mark the payment FAILED anyway and the capture actually went through, the customer has been charged and told it failed. That means an angry support ticket, and a double charge if they simply try again.
Currency precision in payment APIs: why JPY 3000 is not 30.00 at PayPal
Your payment integration passes its tests for US dollars (3000 cents become “30.00”), for euros, even for Tunisian dinars with their three decimals (1234 becomes “1.234”). Then the first Japanese customer buys a 3000-yen item, and you send PayPal “30.00”. PayPal answers with an error, because yen has no decimals at all.
Service-to-service auth in Kubernetes: dropping the OAuth hop
When one service calls another inside the same cluster, how should the callee know who is calling? The textbook answer is OAuth2: the caller fetches a token from the identity provider and sends it along. It works, but for two services sitting next to each other it means an extra token request, client secrets to manage and often a detour through the public gateway, for every single call.
Payment idempotency keys in Redis: two Lua scripts
A client retry, a network blip or a load balancer timeout must never charge a customer twice. The client cannot know whether its first “pay” request reached the server before the connection dropped, so it sends it again. Whether that second request becomes a second charge is entirely up to the server.