domain

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount added in v0.1.0

type Amount struct {
	// 如果要支持国际化,那么这个是不能少的
	Currency string
	// 这里我们遵循微信的做法,就用 int64 来记录分数。
	// 那么对于不同的货币来说,这个字段的含义就不同。
	// 比如说一些货币没有分,只有整数。
	Total int64
}

type ChannelType added in v0.1.0

type ChannelType uint8
const (
	ChannelTypeCredit ChannelType = 1
	ChannelTypeWechat ChannelType = 2
)

func (ChannelType) ToUnit8 added in v0.1.0

func (c ChannelType) ToUnit8() uint8

type Payment

type Payment struct {
	ID      int64
	SN      string
	PayerID int64
	// BizTradeNO, 就是OrderSN
	OrderID int64
	OrderSN string
	// 订单的描述,冗余
	OrderDescription string
	TotalAmount      int64
	PaidAt           int64
	Status           PaymentStatus
	Records          []PaymentRecord
	Ctime            int64
}

type PaymentChannel

type PaymentChannel struct {
	Type ChannelType
	Desc string
}

type PaymentRecord

type PaymentRecord struct {
	PaymentID int64
	// 第三方那边返回的 ID TxnID string
	PaymentNO3rd  string
	Description   string
	Channel       ChannelType
	Amount        int64
	PaidAt        int64
	Status        PaymentStatus
	WechatCodeURL string
}

type PaymentStatus added in v0.1.0

type PaymentStatus uint8
const (
	PaymentStatusUnpaid        PaymentStatus = 1
	PaymentStatusProcessing    PaymentStatus = 2
	PaymentStatusPaidSuccess   PaymentStatus = 3
	PaymentStatusPaidFailed    PaymentStatus = 4
	PaymentStatusRefund        PaymentStatus = 5
	PaymentStatusTimeoutClosed PaymentStatus = 6
)

func (PaymentStatus) ToUint8 added in v0.1.0

func (s PaymentStatus) ToUint8() uint8

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL