← All Learning Paths

Payments Engineer

Build money-safe systems: idempotent payments, exactly-once effects, outbox and saga patterns, monetary arithmetic, and failure-spike response.

roleadvanced8 nodes12.17h total

Path overview

构建资金安全系统:幂等支付、精确一次效果、发件箱与 Saga 模式、金额运算与故障激增响应。

Build money-safe systems: idempotent payments, exactly-once effects, outbox and saga patterns, monetary arithmetic, and failure-spike response.

  1. Execute "Allocate Money in Cents Without Rounding Drift", change one constant, and describe how the output diverges from "Split an integer cent total across weighted shares with the largest remainder method so".

    Completion criteria: Save two runs of "Allocate Money in Cents Without Rounding Drift" side by side — the original input and one changed value — and annotate the line where the output diverges.

    Next step: Idempotency Key Store With Response Replay

    ⏱ 0.75h

  2. Run the payments engineer snippet "Idempotency Key Store With Response Replay", capture stdout, and show which line demonstrates the documented behavior: "Deduplicate retried mutations by idempotency key, share in-flight work, replay stored".

    Prerequisites: Allocate Money in Cents Without Rounding Drift

    Completion criteria: Attach the terminal transcript for "Idempotency Key Store With Response Replay": command, exit code, and the printed result you used to confirm "Deduplicate retried mutations by idempotency key, share in-flight work, replay stored".

    Next step: Split Money Amounts with Decimal Without Loss

    ⏱ 0.75h

  3. Adapt "Split Money Amounts with Decimal Without Loss" to a second input and compare the new output with the behavior described in "Split a Decimal amount across integer weights while keeping cent-level totals exact,".

    Prerequisites: Idempotency Key Store With Response Replay

    Completion criteria: Change one constant in "Split Money Amounts with Decimal Without Loss", rerun, and attach both stdout captures plus a one-line diff explaining what moved.

    Next step: Add Idempotency Keys to a Write Endpoint

    ⏱ 0.75h

  4. Execute "Add Idempotency Keys to a Write Endpoint" end to end, then repeat the last step with one parameter changed and compare "Make a non-idempotent POST endpoint safe to retry by implementing idempotency-key handling.".

    Prerequisites: Split Money Amounts with Decimal Without Loss

    Completion criteria: Deliver a transcript of "Add Idempotency Keys to a Write Endpoint" with each step's command and observed state, ending at "Make a non-idempotent POST endpoint safe to retry by implementing idempotency-key handling.".

    Next step: Payment Failure Spike Response Workflow

    ⏱ 0.5h

  5. Follow "Payment Failure Spike Response Workflow" and record "Stop revenue loss from payment failures by fast isolation of cause, safe queueing of failed" at the step where it should appear, using "A per-minute revenue impact number exists, converting the incident to a financial severity." as the check.

    Prerequisites: Add Idempotency Keys to a Write Endpoint

    Completion criteria: Attach a checklist of "Payment Failure Spike Response Workflow"'s steps with the observed state after each one and the verification result from "A per-minute revenue impact number exists, converting the incident to a financial severity.".

    Next step: Stripe Go Payment Processing

    ⏱ 0.5h

  6. Read "Stripe Go Payment Processing" as an architecture drill: for each Go, postgres, kafka, Redis component, state what it owns and what it delegates.

    Prerequisites: Payment Failure Spike Response Workflow

    Completion criteria: Attach the component-to-responsibility table for Go, postgres, kafka, Redis and annotate one trade-off with evidence from "Idempotent payment operations".

    Next step: Apply Requests Exactly Once by Key

    ⏱ 1.5h

  7. In the "Payments Engineer" path, implement "Apply Requests Exactly Once by Key" so JSON object: { requests: [{ key, amount }] } yields {applied:[{key:k1,amount:100},{key:k2,amount:50}],duplicates:[k1],char, including the second sample's edge case.

    Prerequisites: Stripe Go Payment Processing

    Completion criteria: Submit a solution for "Payments Engineer" that passes both samples ({requests:[{key:k1,amount:100},{key:k2,amount:50},{key:k1,am to {applied:[{key:k1,amount:100},{key:k2,amount:50}],duplicates) and attach the failing case you fixed.

    Next step: Capstone: Payments Engineer

    ⏱ 0.42h

  8. Deliver the "Build an Idempotent Payment Webhook Processor" blueprint with "Raw body capture" working and "Signature verification" recorded as evidence.

    Prerequisites: Stripe Go Payment Processing, Apply Requests Exactly Once by Key

    Completion criteria: Deliver "Raw body capture" and paste the test output where the acceptance test passes; include the test name and command.

    Next step: Run the capstone's tests, publish the repository, and demo it to a reviewer.

    ⏱ 4h