Checkout: support saved cards 4f2a91
bobopened this change on Oct 22
Customers can save a card at checkout and use it next time.
- The Stripe customer token is kept in the overlay
secrets, never in shared files. - New table
saved_cardswith a migration. - The payment step lists saved cards first.
Versions
- v3 7d3e9a1c · Oct 23, 18:55
Content: handle expired cards (+24 −6 in 2 files)
- Replayed onto main 9a0c13d7 · Oct 23, 09:10
Base move only. Hidden in the file compare.
- v2 5b20e1f7 · Oct 22, 16:40
Content: move the token to the overlay secrets (+40 −31 in 4 files)
- v1 31d8c0aa · Oct 22, 10:14
First version (+212 −18 in 7 files)
Checks
| Check | State | Result | Duration | Runner | Command | |
|---|---|---|---|---|---|---|
| unit | 7d3e9a1c | ✓ passed | 2m 14s | executor-eu1 | cargo test --workspace | reused from earlier run |
| lint | 7d3e9a1c | ✓ passed | 41s | executor-eu1 | cargo clippy -- -D warnings | |
| e2e | 7d3e9a1c | ⟳ running | 3m 02s | executor-eu1 | npm --prefix web run e2e | |
| e2e | 5b20e1f7 | ✕ failed | 4m 40s | ci-runner-2 | npm --prefix web run e2e | v2 |
| build-image | 7d3e9a1c | ✓ passed | 1m 05s | executor-eu1 | layr build app |
Log of e2e on v2 (failed)
$ npm --prefix web run e2e> web@1.4.2 e2e> playwright testRunning 48 tests using 4 workers ✓ checkout › pays with a new card (2.1s) ✕ checkout › pays with a saved card (30.0s) Error: Timed out 30000ms waiting for locator('[data-test=saved-card]') at tests/checkout.spec.ts:57:22 1 failed, 47 passed (4m 40s)
Conversation
aliceon src/payments/card.rs:88 · v2
Do we delete the token when the customer removes the card?bob· v3
Yes. v3 calls stripe.detach and removes the row.