feat: 对齐 Waffo 包年/永久结账与客户端席位 API
同步 OpsXShell 档位定价与 Waffo 商品映射,补齐 checkout/webhook/设备列表契约,便于桌面端购买与满席释放。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
4ae318335c
commit
95405de119
14 files changed
+958
-155
No files matched your search
@@ -64,8 +64,10 @@ type OrderResponse struct {
|
||||
type CreateOrderRequest struct {
|
||||
CustomerEmail string `json:"customer_email" binding:"required,email"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
ProductID uint `json:"product_id" binding:"required"`
|
||||
PlanID uint `json:"plan_id" binding:"required"`
|
||||
ProductID uint `json:"product_id"`
|
||||
PlanID uint `json:"plan_id"`
|
||||
ProductCode string `json:"product_code"` // preferred by desktop clients
|
||||
PlanType string `json:"plan_type"` // e.g. perpetual
|
||||
DeviceID string `json:"device_id"`
|
||||
ReturnURL string `json:"return_url"`
|
||||
CancelURL string `json:"cancel_url"`
|
||||
@@ -82,6 +84,39 @@ type CreateOrderResponse struct {
|
||||
ExpiresAt string `json:"expires_at"`
|
||||
}
|
||||
|
||||
// CheckoutRequest desktop-friendly checkout (product_code + email). // Logan.Li
|
||||
type CheckoutRequest struct {
|
||||
CustomerEmail string `json:"customer_email" binding:"required,email"`
|
||||
CustomerName string `json:"customer_name"`
|
||||
ProductCode string `json:"product_code"`
|
||||
PlanType string `json:"plan_type"`
|
||||
DeviceID string `json:"device_id"`
|
||||
ReturnURL string `json:"return_url"`
|
||||
CancelURL string `json:"cancel_url"`
|
||||
}
|
||||
|
||||
// ClaimPurchaseRequest fetch license after payment. // Logan.Li
|
||||
type ClaimPurchaseRequest struct {
|
||||
CustomerEmail string `json:"customer_email"`
|
||||
OrderNo string `json:"order_no"`
|
||||
ProductCode string `json:"product_code"`
|
||||
DeviceID string `json:"device_id"`
|
||||
}
|
||||
|
||||
// ClaimPurchaseResponse returned after successful payment. // Logan.Li
|
||||
type ClaimPurchaseResponse struct {
|
||||
LicenseKey string `json:"license_key"`
|
||||
OrderNo string `json:"order_no,omitempty"`
|
||||
Status string `json:"status"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// ProductWithPlansResponse for GET /v1/products/code/:code // Logan.Li
|
||||
type ProductWithPlansResponse struct {
|
||||
Product ProductResponse `json:"product"`
|
||||
Plans []PlanResponse `json:"plans"`
|
||||
}
|
||||
|
||||
// PaymentWebhookRequest 支付回调请求 // Logan.Li
|
||||
type PaymentWebhookRequest struct {
|
||||
EventType string `json:"event_type" binding:"required"`
|
||||
|
||||
Reference in new issue
Block a user