fix:支付
This commit is contained in:
parent
287ee4db37
commit
6005f20c5e
@ -2,13 +2,14 @@ package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// fs_address 用户地址表
|
||||
type FsAddress struct {
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||
AddressId int64 `gorm:"primary_key;default:0;auto_increment;" json:"address_id"` //
|
||||
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
|
||||
Name *string `gorm:"default:'';" json:"name"` // 地址名称
|
||||
AddressName *string `gorm:"default:'';" json:"address_name"` //
|
||||
FirstName *string `gorm:"default:'';" json:"first_name"` // FirstName
|
||||
LastName *string `gorm:"default:'';" json:"last_name"` // LastName
|
||||
Mobile *string `gorm:"default:'';" json:"mobile"` // 手机号码
|
||||
@ -20,6 +21,9 @@ type FsAddress struct {
|
||||
ZipCode *string `gorm:"default:'';" json:"zip_code"` //
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常
|
||||
IsDefault *int64 `gorm:"index;default:0;" json:"is_default"` // 1默认地址,0非默认地址
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` // 创建时间
|
||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` // 更新时间
|
||||
Ltime *time.Time `gorm:"index;default:'0000-00-00 00:00:00';" json:"ltime"` // 上次被使用的时间
|
||||
}
|
||||
type FsAddressModel struct {
|
||||
db *gorm.DB
|
||||
|
@ -2,6 +2,7 @@ package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// fs_change_code 忘记密码code表
|
||||
@ -9,7 +10,7 @@ type FsChangeCode struct {
|
||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // id
|
||||
Email *string `gorm:"default:'';" json:"email"` //
|
||||
Code *string `gorm:"default:'';" json:"code"` //
|
||||
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||
IsUse *int64 `gorm:"default:0;" json:"is_use"` // 是否使用 1已使用 0未使用
|
||||
Metadata *[]byte `gorm:"default:'';" json:"metadata"` //
|
||||
Module *string `gorm:"default:'logo';" json:"module"` //
|
||||
|
@ -36,6 +36,7 @@ type FsProduct struct {
|
||||
RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` //
|
||||
SceneIds *string `gorm:"default:'';" json:"scene_ids"` //
|
||||
IsCustomization *int64 `gorm:"default:0;" json:"is_customization"` // 是否可定制
|
||||
Unit *string `gorm:"default:'';" json:"unit"` //
|
||||
}
|
||||
type FsProductModel struct {
|
||||
db *gorm.DB
|
||||
|
@ -2,6 +2,7 @@ package gmodel
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// fs_product_model3d 产品模型表
|
||||
@ -20,12 +21,15 @@ type FsProductModel3d struct {
|
||||
PartId *int64 `gorm:"default:0;" json:"part_id"` // 配件选项id(配件就是模型的id)
|
||||
PartList *string `gorm:"default:'';" json:"part_list"` //
|
||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 显示 删除
|
||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||
Ctime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ctime"` //
|
||||
OptionTemplate *int64 `gorm:"default:0;" json:"option_template"` // 配件绑定的公共模板
|
||||
Price *int64 `gorm:"default:0;" json:"price"` // 仅配件用,配件的价格, 单位:美分
|
||||
Price *int64 `gorm:"default:0;" json:"price"` //
|
||||
Sku *string `gorm:"default:'';" json:"sku"` // sku
|
||||
IsHot *int64 `gorm:"default:0;" json:"is_hot"` // 是否热门
|
||||
IsCloudRender *int64 `gorm:"default:0;" json:"is_cloud_render"` // 是否设置为云渲染模型
|
||||
Utime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"utime"` //
|
||||
StepPrice *[]byte `gorm:"default:'';" json:"step_price"` //
|
||||
PackedUnit *int64 `gorm:"default:0;" json:"packed_unit"` //
|
||||
}
|
||||
type FsProductModel3dModel struct {
|
||||
db *gorm.DB
|
||||
|
@ -233,6 +233,7 @@ func (l *StripeWebhookLogic) handlePaymentSessionCompleted(sessionId string, tra
|
||||
|
||||
// 付款成功
|
||||
func (l *StripeWebhookLogic) HandlePaymentIntentSucceeded(paymentIntent *stripe.PaymentIntent, eventId string) error {
|
||||
fmt.Println(paymentIntent)
|
||||
// 支付成功
|
||||
if paymentIntent.Status == "succeeded" {
|
||||
model, ok := paymentIntent.Metadata["model"]
|
||||
|
Loading…
x
Reference in New Issue
Block a user