metric f ton

This commit is contained in:
KS Jannette
2026-03-29 07:46:56 -04:00
parent 0920985a74
commit 0412ea3e99
20 changed files with 553 additions and 206 deletions

View File

@@ -145,6 +145,10 @@ func (h *StripeHandler) VerifyCheckoutSession(w http.ResponseWriter, r *http.Req
return
}
if fullJSON, marshalErr := json.MarshalIndent(s, "", " "); marshalErr == nil {
log.Printf("STRIPE VERIFY CHECKOUT — FULL SESSION:\n%s", string(fullJSON))
}
if s.ClientReferenceID != "" && s.ClientReferenceID != userID {
writeError(w, http.StatusForbidden, "FORBIDDEN", "Session does not belong to this user")
return
@@ -260,6 +264,10 @@ func (h *StripeHandler) CreateOnboardingCheckout(w http.ResponseWriter, r *http.
return
}
if fullJSON, marshalErr := json.MarshalIndent(s, "", " "); marshalErr == nil {
log.Printf("STRIPE ONBOARDING CHECKOUT CREATED — FULL SESSION:\n%s", string(fullJSON))
}
writeJSON(w, http.StatusOK, map[string]string{"url": s.URL})
}
@@ -327,6 +335,8 @@ func (h *StripeHandler) HandleWebhook(w http.ResponseWriter, r *http.Request) {
}
func (h *StripeHandler) handleCheckoutCompleted(r *http.Request, event stripe.Event) {
log.Printf("STRIPE CHECKOUT COMPLETED — FULL RAW PAYLOAD:\n%s", string(event.Data.Raw))
var session stripe.CheckoutSession
if err := json.Unmarshal(event.Data.Raw, &session); err != nil {
log.Printf("Error parsing checkout session: %v", err)