Fix $0 PaymentIntent: remove setup_future_usage (invalid with amount=0)
Dev — Build & local smoke test / build-smoke (pull_request) Successful in 1m32s

This commit is contained in:
2026-05-11 19:55:44 -05:00
parent 73c435eb90
commit 37c7dca30d
+2 -2
View File
@@ -698,12 +698,12 @@ fn handle_request_inner(method: String, path: String, headers: Map, body: String
}
// Free tier: $0 PaymentIntent for age verification (18+ requirement).
// Card is verified and saved (setup_future_usage=off_session). No charge.
// Verifies card is valid. No charge, no capture.
// Note: setup_future_usage cannot be used with amount=0.
if str_eq(plan, "free") {
let free_pi_body: String = "amount=0"
+ "&currency=usd"
+ "&payment_method_types[]=card"
+ "&setup_future_usage=off_session"
+ "&metadata[plan]=free"
+ "&metadata[purpose]=age_verification"
let free_pi_body = if !str_eq(pi_cus_id, "") { free_pi_body + "&customer=" + pi_cus_id } else { free_pi_body }