You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.3 KiB
Go
37 lines
1.3 KiB
Go
package payment
|
|
|
|
import (
|
|
"cls/pkg/util/page"
|
|
"xorm.io/builder"
|
|
)
|
|
|
|
// PaymentProvider 支付服务提供者接口
|
|
type PaymentProvider interface {
|
|
// CreatePayment 创建支付订单
|
|
CreatePayment(order *Payment) (map[string]interface{}, error)
|
|
// VerifyNotify 验证支付回调通知
|
|
VerifyNotify(notifyData string) (map[string]string, error)
|
|
}
|
|
|
|
// PaymentService 支付服务接口
|
|
type PaymentService interface {
|
|
// CreateOrder 创建支付订单
|
|
CreateOrder(userID, targetID uint64, paymentType PaymentType, amount int64, description string) (*Payment, error)
|
|
// GetOrder 获取支付订单
|
|
GetOrder(orderNo string) (*Payment, error)
|
|
// GetUserOrders 获取用户支付订单列表
|
|
GetUserOrders(userID uint64, page *page.Page) error
|
|
// GetOrderList 获取支付订单列表
|
|
GetOrderList(page *page.Page, conds []builder.Cond) error
|
|
// UpdateOrderStatus 更新订单状态
|
|
UpdateOrderStatus(orderNo string, status PaymentStatus, transactionID string, notifyData string) error
|
|
// CancelOrder 取消支付订单
|
|
CancelOrder(orderNo string) error
|
|
// DeleteOrder 删除支付订单
|
|
DeleteOrder(id uint64) error
|
|
// GetPaymentURL 获取支付链接
|
|
GetPaymentURL(order *Payment) (map[string]interface{}, error)
|
|
// HandleNotify 处理支付回调通知
|
|
HandleNotify(notifyData string) error
|
|
}
|