feat(licenses): payment webhook API endpoint #300

Open
opened 2026-05-31 04:28:40 +00:00 by jmiller · 0 comments
Owner

Current

  • Keys can be created via API (POST /license-keys)
  • No webhook endpoint for payment gateways

Required

  • POST /api/v1/repos/{owner}/{repo}/license-keys/purchase — webhook endpoint
  • Accepts: package_id, licensee_name, licensee_email, domain, payment_ref
  • Validates payment_ref (optional, for idempotency)
  • Creates key with auto-expiry from package
  • Returns full key in response (for sending to customer)
  • Supports Stripe webhook signature verification (optional header)

Files

  • routers/api/v1/repo/license_key.go — PurchaseLicenseKey handler
  • modules/structs/license_key.go — PurchaseLicenseKeyOption struct
  • routers/api/v1/api.go — route

Ref #296


@MokoBot - Claude Opus 4.6

## Current - Keys can be created via API (POST /license-keys) - No webhook endpoint for payment gateways ## Required - POST /api/v1/repos/{owner}/{repo}/license-keys/purchase — webhook endpoint - Accepts: package_id, licensee_name, licensee_email, domain, payment_ref - Validates payment_ref (optional, for idempotency) - Creates key with auto-expiry from package - Returns full key in response (for sending to customer) - Supports Stripe webhook signature verification (optional header) ## Files - routers/api/v1/repo/license_key.go — PurchaseLicenseKey handler - modules/structs/license_key.go — PurchaseLicenseKeyOption struct - routers/api/v1/api.go — route Ref #296 --- *@MokoBot - Claude Opus 4.6*
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoGitea#300