feat(contract): require consent for auto-renew checkouts #170

Sammanfogat
supernaut sammanfogade 1 incheckning från feat/auto-renew-consent in i main 2026-10-13 08:23:07 +00:00
Ägare

Closes #119

What

StartCheckoutInputSchema now refuses:

  • renewal other than "none" (including omitted, which means "auto") without consent.
  • startImmediatelyRequestedAt more than 5 minutes in the future or more than 1 day old.

Contract version bumped to 0.12.0 (minor). The service version is unchanged.

Compatibility

The current portal already sends consent for every auto-renew checkout and sets startImmediatelyRequestedAt to the request time. It accepts no auto-renew choice without a fresh consent. No portal change is needed to keep checkout working.

Tests

Contract tests cover missing and present consent for auto, omitted and none, and the time bounds at the edges. Existing fixtures use fake timers or the current time. The server test sends renewal: "none" and a current timestamp, since input validation runs before the disabled-payments check.

Notes

  • The time check reads the clock at parse time. A caller with more than 5 minutes of clock skew is refused.
  • Callers should bump @bitborg/payment-contract to 0.12.0 when they next update.
Closes #119 ## What `StartCheckoutInputSchema` now refuses: - `renewal` other than `"none"` (including omitted, which means `"auto"`) without `consent`. - `startImmediatelyRequestedAt` more than 5 minutes in the future or more than 1 day old. Contract version bumped to 0.12.0 (minor). The service version is unchanged. ## Compatibility The current portal already sends `consent` for every auto-renew checkout and sets `startImmediatelyRequestedAt` to the request time. It accepts no auto-renew choice without a fresh consent. No portal change is needed to keep checkout working. ## Tests Contract tests cover missing and present consent for `auto`, omitted and `none`, and the time bounds at the edges. Existing fixtures use fake timers or the current time. The server test sends `renewal: "none"` and a current timestamp, since input validation runs before the disabled-payments check. ## Notes - The time check reads the clock at parse time. A caller with more than 5 minutes of clock skew is refused. - Callers should bump `@bitborg/payment-contract` to 0.12.0 when they next update.
supernaut lade till 1 incheckning 2026-10-13 06:38:20 +00:00
feat(contract): require consent for auto-renew and bound the start-request time
Alla kontroller lyckades
ci / ci (pull_request) Successful in 2m14s
ea5e17f1d3
Closes #119
supernaut tvångsskickade feat/auto-renew-consent från ea5e17f1d3
Alla kontroller lyckades
ci / ci (pull_request) Successful in 2m14s
till f771fb9248
Alla kontroller lyckades
ci / ci (pull_request) Successful in 2m22s
2026-10-13 08:20:15 +00:00
Jämför
supernaut schemalade den här ändringsförfrågan för automatisk sammanfogning när alla kontroller lyckas 2026-10-13 08:20:18 +00:00
supernaut sammanfogade incheckning 105401f63e till main 2026-10-13 08:23:07 +00:00
supernaut tog bort grenen feat/auto-renew-consent 2026-10-13 08:23:07 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-payment!170
Ingen beskrivning angiven.