Help us shape the future of Go! Take the 2026 Go Developer Survey

order

package
v2.1.14 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeliveryMode

type DeliveryMode uint8

DeliveryMode 发货模式

const (
	// DeliveryModeUnifiedDelivery 统一发货
	DeliveryModeUnifiedDelivery DeliveryMode = 1
	// DeliveryModeSplitDelivery 分拆发货
	DeliveryModeSplitDelivery DeliveryMode = 2
)

type GetShippingOrderListRequest

type GetShippingOrderListRequest struct {
	PayTimeRange *TimeRange `json:"pay_time_range"`        // 支付时间范围
	OrderState   State      `json:"order_state,omitempty"` // 订单状态
	Openid       string     `json:"openid,omitempty"`      // 支付者openid
	LastIndex    string     `json:"last_index,omitempty"`  // 	翻页时使用,获取第一页时不用传入,如果查询结果中 has_more 字段为 true,则传入该次查询结果中返回的 last_index 字段可获取下一页
	PageSize     int64      `json:"page_size"`             // 每页数量,最多50条
}

GetShippingOrderListRequest 查询订单列表请求参数

type GetShippingOrderListResponse

type GetShippingOrderListResponse struct {
	util.CommonError
	OrderList []*ShippingOrder `json:"order_list"`
	LastIndex string           `json:"last_index"`
	HasMore   bool             `json:"has_more"`
}

GetShippingOrderListResponse 查询订单列表返回参数

type GetShippingOrderRequest

type GetShippingOrderRequest struct {
	TransactionID   string `json:"transaction_id"`    // 原支付交易对应的微信订单号
	MerchantID      string `json:"merchant_id"`       // 支付下单商户的商户号,由微信支付生成并下发
	SubMerchantID   string `json:"sub_merchant_id"`   //二级商户号
	MerchantTradeNo string `json:"merchant_trade_no"` //商户系统内部订单号,只能是数字、大小写字母`_-*`且在同一个商户号下唯一。
}

GetShippingOrderRequest 查询订单发货状态参数

type LogisticsType

type LogisticsType uint8

LogisticsType 物流模式

const (
	// LogisticsTypeExpress 实体物流配送采用快递公司进行实体物流配送形式
	LogisticsTypeExpress LogisticsType = 1
	// LogisticsTypeSameCity 同城配送
	LogisticsTypeSameCity LogisticsType = 2
	// LogisticsTypeVirtual 虚拟商品,虚拟商品,例如话费充值,点卡等,无实体配送形式
	LogisticsTypeVirtual LogisticsType = 3
	// LogisticsTypeSelfPickup 用户自提
	LogisticsTypeSelfPickup LogisticsType = 4
)

type NotifyConfirmReceiveRequest

type NotifyConfirmReceiveRequest struct {
	TransactionID   string `json:"transaction_id"`    // 原支付交易对应的微信订单号
	MerchantID      string `json:"merchant_id"`       // 支付下单商户的商户号,由微信支付生成并下发
	SubMerchantID   string `json:"sub_merchant_id"`   // 二级商户号
	MerchantTradeNo string `json:"merchant_trade_no"` // 商户系统内部订单号,只能是数字、大小写字母`_-*`且在同一个商户号下唯一
	ReceivedTime    int64  `json:"received_time"`     // 收货时间,时间戳形式
}

NotifyConfirmReceiveRequest 确认收货提醒接口请求参数

type NumberType

type NumberType uint8

NumberType 订单单号类型

const (
	// NumberTypeOutTradeNo 使用下单商户号和商户侧单号
	NumberTypeOutTradeNo NumberType = 1
	// NumberTypeTransactionID 使用微信支付单号
	NumberTypeTransactionID NumberType = 2
)

type Shipping

type Shipping struct {
	*context.Context
}

Shipping 发货信息管理

func NewShipping

func NewShipping(ctx *context.Context) *Shipping

NewShipping init

func (*Shipping) GetShippingOrder

func (shipping *Shipping) GetShippingOrder(in *GetShippingOrderRequest) (res ShippingOrderResponse, err error)

GetShippingOrder 查询订单发货状态

func (*Shipping) GetShippingOrderList

func (shipping *Shipping) GetShippingOrderList(in *GetShippingOrderListRequest) (res GetShippingOrderListResponse, err error)

GetShippingOrderList 查询订单列表

func (*Shipping) NotifyConfirmReceive

func (shipping *Shipping) NotifyConfirmReceive(in *NotifyConfirmReceiveRequest) (err error)

NotifyConfirmReceive 确认收货提醒接口

type ShippingContact

type ShippingContact struct {
	ConsignorContact string `json:"consignor_contact"` // 寄件人联系方式,寄件人联系方式,采用掩码传输,最后4位数字不能打掩码
	ReceiverContact  string `json:"receiver_contact"`  // 收件人联系方式,收件人联系方式,采用掩码传输,最后4位数字不能打掩码
}

ShippingContact 联系方式

type ShippingDetail

type ShippingDetail struct {
	DeliveryMode        DeliveryMode    `json:"delivery_mode"`         // 发货模式
	LogisticsType       LogisticsType   `json:"logistics_type"`        // 物流模式
	FinishShipping      bool            `json:"finish_shipping"`       // 是否已全部发货
	FinishShippingCount int             `json:"finish_shipping_count"` // 已完成全部发货的次数
	GoodsDesc           string          `json:"goods_desc"`            // 在小程序后台发货信息录入页录入的商品描述
	ShippingList        []*ShippingItem `json:"shipping_list"`         // 物流信息列表
}

ShippingDetail 发货信息

type ShippingInfo

type ShippingInfo struct {
	TrackingNo     string          `json:"tracking_no"`     // 物流单号,物流快递发货时必填
	ExpressCompany string          `json:"express_company"` // 物流公司编码,快递公司ID,物流快递发货时必填;参见「查询物流公司编码列表」
	ItemDesc       string          `json:"item_desc"`       // 商品信息,例如:微信红包抱枕*1个,限120个字以内
	Contact        ShippingContact `json:"contact"`         // 联系方式,当发货的物流公司为顺丰时,联系方式为必填,收件人或寄件人联系方式二选一
}

ShippingInfo 物流信息

type ShippingItem

type ShippingItem struct {
	TrackingNo     string `json:"tracking_no"`     // 物流单号,示例值: "323244567777
	ExpressCompany string `json:"express_company"` // 物流公司编码,快递公司ID,物流快递发货时必填;参见「查询物流公司编码列表」
	UploadTime     int64  `json:"upload_time"`     // 上传物流信息时间,时间戳形式
}

ShippingItem 物流信息

type ShippingOrder

type ShippingOrder struct {
	TransactionID   string          `json:"transaction_id"`    // 原支付交易对应的微信订单号
	MerchantTradeNo string          `json:"merchant_trade_no"` // 商户系统内部订单号,只能是数字、大小写字母`_-*`且在同一个商户号下唯一
	MerchantID      string          `json:"merchant_id"`       // 支付下单商户的商户号,由微信支付生成并下发
	SubMerchantID   string          `json:"sub_merchant_id"`   // 二级商户号
	Description     string          `json:"description"`       // 以分号连接的该支付单的所有商品描述,当超过120字时自动截断并以 “...” 结尾
	PaidAmount      int64           `json:"paid_amount"`       // 支付单实际支付金额,整型,单位:分钱
	Openid          string          `json:"openid"`            // 支付者openid
	TradeCreateTime int64           `json:"trade_create_time"` // 交易创建时间,时间戳形式
	PayTime         int64           `json:"pay_time"`          // 支付时间,时间戳形式
	InComplaint     bool            `json:"in_complaint"`      // 是否处在交易纠纷中
	OrderState      State           `json:"order_state"`       // 订单状态枚举:(1) 待发货;(2) 已发货;(3) 确认收货;(4) 交易完成;(5) 已退款
	Shipping        *ShippingDetail `json:"shipping"`          // 订单发货信息
}

ShippingOrder 订单发货状态

type ShippingOrderKey

type ShippingOrderKey struct {
	OrderNumberType NumberType `json:"order_number_type"` // 订单单号类型,用于确认需要上传详情的订单。枚举值1,使用下单商户号和商户侧单号;枚举值2,使用微信支付单号。
	TransactionID   string     `json:"transaction_id"`    // 原支付交易对应的微信订单号
	Mchid           string     `json:"mchid"`             // 支付下单商户的商户号,由微信支付生成并下发
	OutTradeNo      string     `json:"out_trade_no"`      // 商户系统内部订单号,只能是数字、大小写字母`_-*`且在同一个商户号下唯一
}

ShippingOrderKey 订单

type ShippingOrderResponse

type ShippingOrderResponse struct {
	util.CommonError
	Order ShippingOrder `json:"order"` // 订单发货信息
}

ShippingOrderResponse 查询订单发货状态返回参数

type ShippingPayer

type ShippingPayer struct {
	Openid string `json:"openid"` // 用户标识,用户在小程序appid下的唯一标识
}

ShippingPayer 支付者信息

type State

type State uint8

State 订单状态

const (
	// StateWaitShipment 待发货
	StateWaitShipment State = 1
	// StateShipped 已发货
	StateShipped State = 2
	// StateConfirm 确认收货
	StateConfirm State = 3
	// StateComplete 交易完成
	StateComplete State = 4
	// StateRefund 已退款
	StateRefund State = 5
)

type TimeRange

type TimeRange struct {
	BeginTime int64 `json:"begin_time,omitempty"` // 查询开始时间,时间戳形式
	EndTime   int64 `json:"end_time,omitempty"`   // 查询结束时间,时间戳形式
}

TimeRange 时间范围

type UploadShippingInfoRequest

type UploadShippingInfoRequest struct {
	OrderKey       *ShippingOrderKey `json:"order_key"`        // 订单,需要上传物流信息的订单
	LogisticsType  LogisticsType     `json:"logistics_type"`   // 物流模式
	DeliveryMode   DeliveryMode      `json:"delivery_mode"`    // 发货模式
	IsAllDelivered bool              `json:"is_all_delivered"` // 分拆发货模式时必填,用于标识分拆发货模式下是否已全部发货完成
	ShippingList   []*ShippingInfo   `json:"shipping_list"`    // 物流信息列表,发货物流单列表,支持统一发货(单个物流单)和分拆发货(多个物流单)两种模式
	UploadTime     *time.Time        `json:"upload_time"`      // 上传时间,用于标识请求的先后顺序
	Payer          *ShippingPayer    `json:"payer"`            // 支付人信息
}

UploadShippingInfoRequest 发货信息录入请求参数

Jump to

Keyboard shortcuts

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