Wrap Up
In this chapter, we investigated the pay-in flow and pay-out flow. We went into great depth about retry, idempotency, and consistency. Payment error handling and security are also covered at the end of the chapter.
A payment system is extremely complex. Even though we have covered many topics, there are still more worth mentioning. The following is a representative but not an exhaustive list of relevant topics.
-
Monitoring. Monitoring key metrics is a critical part of any modern application. With extensive monitoring, we can answer questions like “What is the average acceptance rate for a specific payment method?”, “What is the CPU usage of our servers?”, etc. We can create and display those metrics on a dashboard.
-
Alerting. When something abnormal occurs, it is important to alert on-call developers so they respond promptly.
-
Debugging tools. “Why does a payment fail?” is a common question. To make debugging easier for engineers and for customer support, it is important to develop tools that allow staff to review the transaction status, processing server history, PSP records, etc. of a payment transaction.
-
Currency exchange. Currency exchange is an important consideration when designing a payment system for an international user base.
-
Geography. Different regions might have completely different sets of payment methods.
-
Cash payment. Cash payment is very common in India, Brazil, and some other countries. Uber 28 and Airbnb 29 wrote detailed engineering blogs about how they handled cash-based payment.
-
Google/Apple pay integration. Please read 30 if interested.
Congratulations on getting this far! Now give yourself a pat on the back. Good job!
Chapter Summary
Reference Materials
- Payment system: https://en.wikipedia.org/wiki/Payment_system
- AML/CFT: https://en.wikipedia.org/wiki/Money_laundering
- Card scheme: https://en.wikipedia.org/wiki/Card_scheme
- ISO 4217: https://en.wikipedia.org/wiki/ISO_4217
- Stripe API Reference: https://stripe.com/docs/api
- Double-entry bookkeeping: https://en.wikipedia.org/wiki/Double-entry_bookkeeping
- Books, an immutable double-entry accounting database service: https://developer.squareup.com/blog/books-an-immutable-double-entry-accounting-database-service/
- Payment Card Industry Data Security Standard: https://en.wikipedia.org/wiki/Payment_Card_Industry_Data_Security_Standard
- Tipalti: https://tipalti.com/
- Nonce: https://en.wikipedia.org/wiki/Cryptographic_nonce
- Webhooks: https://stripe.com/docs/webhooks
- Customize your success page: https://stripe.com/docs/payments/checkout/custom-success-page
- 3D Secure: https://en.wikipedia.org/wiki/3-D_Secure
- Kafka Connect Deep Dive – Error Handling and Dead Letter Queues: https://www.confluent.io/blog/kafka-connect-deep-dive-error-handling-dead-letter-queues/
- Reliable Processing in a Streaming Payment System: https://www.youtube.com/watch?v=5TD8m7w1xE0&list=PLLEUtp5eGr7Dz3fWGUpiSiG3d_WgJe-KJ
- Chain Services with Exactly-Once Guarantees: https://www.confluent.io/blog/chain-services-exactly-guarantees/
- Exponential backoff: https://en.wikipedia.org/wiki/Exponential_backoff
- Idempotence: https://en.wikipedia.org/wiki/Idempotence
- Stripe idempotent requests: https://stripe.com/docs/api/idempotent_requests
- Idempotency: https://developer.paypal.com/docs/platforms/develop/idempotency/
- Paxos: https://en.wikipedia.org/wiki/Paxos_(computer_science)
- Raft: https://raft.github.io/
- YugabyteDB: https://www.yugabyte.com/
- Cockroachdb:https://www.cockroachlabs.com/
- What is DDoS attack: https://www.cloudflare.com/learning/ddos/what-is-a-ddos-attack/
- How Payment Gateways Can Detect and Prevent Online Fraud: https://www.chargebee.com/blog/optimize-online-billing-stop-online-fraud/
- Advanced Technologies for Detecting and Preventing Fraud at Uber: https://www.uber.com/en-PK/blog/project-radar-intelligent-early-fraud-detection/
- Re-Architecting Cash and Digital Wallet Payments for India with Uber Engineering: https://eng.uber.com/india-payments/
- Scaling Airbnb’s Payment Platform: https://medium.com/airbnb-engineering/scaling-airbnbs-payment-platform-43ebfc99b324
- Payments Integration at Uber: A Case Study: https://www.youtube.com/watch?v=yooCE5B0SRA
Finished reading?
Mark it complete to track your progress.