Documentation ¶
Index ¶
- type ApiBuyResponse
- type ApiBuyResult
- type ApiCustomerResponse
- type ApiCustomerResult
- type ApiOrderResponse
- type ApiOrderResult
- type ApiOuterOrderResponse
- type ApiOuterOrderResult
- type ApiProductRechargeParamsResponse
- type ApiProductRechargeParamsResult
- type ApiProductResponse
- type ApiProductResult
- type App
- func (app *App) ApiBuy(notMustParams ...Params) *ApiBuyResult
- func (app *App) ApiCustomer() *ApiCustomerResult
- func (app App) ApiOrder(orderId string) *ApiOrderResult
- func (app App) ApiOuterOrder(orderId string) *ApiOuterOrderResult
- func (app App) ApiProduct(productId int64) *ApiProductResult
- func (app App) ApiProductRechargeParams(notMustParams ...Params) *ApiProductRechargeParamsResult
- func (app *App) NewParamsWith(params ...Params) Params
- type Params
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiBuyResponse ¶ added in v1.0.44
type ApiBuyResponse struct { Code string `json:"code"` Message string `json:"message"` Data struct { OrderID int64 `json:"order_id"` // 订单号 ProductPrice string `json:"product_price"` // 商品价格 TotalPrice string `json:"total_price"` // 总支付价格 RechargeUrl string `json:"recharge_url"` // 卡密充值网址 State int `json:"state"` // 订单状态(100:等待发货,101:正在充值,200:交易成功,500:交易失败,501:未知状态) Cards []struct { CardNo string `json:"card_no"` CardPassword string `json:"card_password"` } `json:"cards,omitempty"` // 卡密(仅当订单成功并且商品类型为卡密时返回此数据) Tickets []struct { No string `json:"no"` Ticket string `json:"ticket"` } `json:"tickets,omitempty"` // 卡券(仅当订单成功并且商品类型为卡券时返回此数据) } `json:"data"` }
type ApiBuyResult ¶ added in v1.0.37
type ApiBuyResult struct { Result ApiBuyResponse // 结果 Body []byte // 内容 Err error // 错误 }
func NewApiBuyResult ¶ added in v1.0.44
func NewApiBuyResult(result ApiBuyResponse, body []byte, err error) *ApiBuyResult
type ApiCustomerResponse ¶ added in v1.0.44
type ApiCustomerResult ¶ added in v1.0.44
type ApiCustomerResult struct { Result ApiCustomerResponse // 结果 Body []byte // 内容 Err error // 错误 }
func NewApiCustomerResult ¶ added in v1.0.44
func NewApiCustomerResult(result ApiCustomerResponse, body []byte, err error) *ApiCustomerResult
type ApiOrderResponse ¶ added in v1.0.44
type ApiOrderResponse struct { Code string `json:"code"` Message string `json:"message"` Data struct { ID int64 `json:"id"` // 订单号 ProductID int `json:"product_id"` // 商品编号 ProductName string `json:"product_name"` // 商品名称 ProductType int `json:"product_type"` // 商品类型(1:充值,2:卡密,3:卡券,4:人工) ProductPrice string `json:"product_price"` // 售价 Quantity int `json:"quantity"` // 购买数量 TotalPrice string `json:"total_price"` // 总支付价格 RefundedAmount float64 `json:"refunded_amount"` // 已退款金额 BuyerCustomerID int `json:"buyer_customer_id"` // 买家编号 BuyerCustomerName string `json:"buyer_customer_name"` // 买家名称 SellerCustomerID int `json:"seller_customer_id"` // 卖家编号 SellerCustomerName string `json:"seller_customer_name"` // 卖家名称 State int `json:"state"` // 订单状态(100:等待发货,101:正在充值,200:交易成功,500:交易失败,501:未知状态) CreatedAt string `json:"created_at"` // 下单时间 RechargeAccount string `json:"recharge_account"` // 充值账号 ProgressInit int `json:"progress_init"` // 充值进度:初始值 ProgressNow int `json:"progress_now"` // 充值进度:现在值 ProgressTarget int `json:"progress_target"` // 充值进度:目标值 RechargeInfo string `json:"recharge_info"` // 返回信息 RechargeUrl string `json:"recharge_url"` // 卡密充值网址 Cards []struct { No string `json:"no"` Password string `json:"password"` } `json:"cards"` //【卡密类订单】卡密 RechargeParams string `json:"recharge_params"` //【充值类订单】 OuterApiOrderID string `json:"outer_ApiOrder_id,omitempty"` // 外部订单号 } `json:"data"` }
type ApiOrderResult ¶ added in v1.0.37
type ApiOrderResult struct { Result ApiOrderResponse // 结果 Body []byte // 内容 Err error // 错误 }
func NewApiOrderResult ¶ added in v1.0.44
func NewApiOrderResult(result ApiOrderResponse, body []byte, err error) *ApiOrderResult
type ApiOuterOrderResponse ¶ added in v1.0.44
type ApiOuterOrderResponse struct { Code string `json:"code"` Message string `json:"message"` Data struct { ID int64 `json:"id"` // 订单号 ProductID int `json:"product_id"` // 商品编号 ProductName string `json:"product_name"` // 商品名称 ProductType int `json:"product_type"` // 商品类型(1:充值,2:卡密,3:卡券,4:人工) ProductPrice string `json:"product_price"` // 售价 Quantity int `json:"quantity"` // 购买数量 TotalPrice string `json:"total_price"` // 总支付价格 RefundedAmount float64 `json:"refunded_amount"` // 已退款金额 BuyerCustomerID int `json:"buyer_customer_id"` // 买家编号 BuyerCustomerName string `json:"buyer_customer_name"` // 买家名称 SellerCustomerID int `json:"seller_customer_id"` // 卖家编号 SellerCustomerName string `json:"seller_customer_name"` // 卖家名称 State int `json:"state"` // 订单状态(100:等待发货,101:正在充值,200:交易成功,500:交易失败,501:未知状态) CreatedAt string `json:"created_at"` // 下单时间 RechargeAccount string `json:"recharge_account"` // 充值账号 ProgressInit int `json:"progress_init"` // 充值进度:初始值 ProgressNow int `json:"progress_now"` // 充值进度:现在值 ProgressTarget int `json:"progress_target"` // 充值进度:目标值 RechargeInfo string `json:"recharge_info"` // 返回信息 RechargeUrl string `json:"recharge_url"` // 卡密充值网址 Cards []struct { No string `json:"no"` Password string `json:"password"` } `json:"cards"` //【卡密类订单】卡密 RechargeParams string `json:"recharge_params"` //【充值类订单】 OuterOrderID string `json:"outer_order_id,omitempty"` // 外部订单号 } `json:"data"` }
type ApiOuterOrderResult ¶ added in v1.0.44
type ApiOuterOrderResult struct { Result ApiOuterOrderResponse // 结果 Body []byte // 内容 Err error // 错误 }
func NewApiOuterOrderResult ¶ added in v1.0.44
func NewApiOuterOrderResult(result ApiOuterOrderResponse, body []byte, err error) *ApiOuterOrderResult
type ApiProductRechargeParamsResponse ¶ added in v1.0.44
type ApiProductRechargeParamsResponse struct { Code string `json:"code"` Message string `json:"message"` Data struct { RechargeAccountLabel string `json:"recharge_account_label"` RechargeParams []struct { Name string `json:"name"` Type string `json:"type"` Options string `json:"options"` } `json:"recharge_params"` } `json:"data"` }
type ApiProductRechargeParamsResult ¶ added in v1.0.44
type ApiProductRechargeParamsResult struct { Result ApiProductRechargeParamsResponse // 结果 Body []byte // 内容 Err error // 错误 }
func NewApiProductRechargeParamsResult ¶ added in v1.0.44
func NewApiProductRechargeParamsResult(result ApiProductRechargeParamsResponse, body []byte, err error) *ApiProductRechargeParamsResult
type ApiProductResponse ¶ added in v1.0.44
type ApiProductResponse struct { Code string `json:"code"` Message string `json:"message"` Data struct { Id int `json:"id"` ProductName string `json:"product_name"` Name string `json:"name"` Price float64 `json:"price"` ValidPurchasingQuantity string `json:"valid_purchasing_quantity"` SuperiorCommissionsRate int `json:"superior_commissions_rate"` Type int `json:"type"` SupplyState int `json:"supply_state"` StockState int `json:"stock_state"` BanStartAt string `json:"ban_start_at"` BanEndAt string `json:"ban_end_at"` } `json:"data"` }
type ApiProductResult ¶ added in v1.0.44
type ApiProductResult struct { Result ApiProductResponse // 结果 Body []byte // 内容 Err error // 错误 }
func NewApiProductResult ¶ added in v1.0.44
func NewApiProductResult(result ApiProductResponse, body []byte, err error) *ApiProductResult
type App ¶ added in v1.0.37
App 卡商网服务
func (*App) ApiBuy ¶ added in v1.0.37
func (app *App) ApiBuy(notMustParams ...Params) *ApiBuyResult
ApiBuy 购买商品 http://doc.cqmeihu.cn/sales/buy.html
func (*App) ApiCustomer ¶ added in v1.0.44
func (app *App) ApiCustomer() *ApiCustomerResult
ApiCustomer 获取商家信息 http://doc.cqmeihu.cn/sales/merchant-info.html
func (App) ApiOrder ¶ added in v1.0.37
func (app App) ApiOrder(orderId string) *ApiOrderResult
ApiOrder 获取单个订单信息。 仅能获取自己购买的订单。 http://doc.cqmeihu.cn/sales/order-info.html
func (App) ApiOuterOrder ¶ added in v1.0.44
func (app App) ApiOuterOrder(orderId string) *ApiOuterOrderResult
ApiOuterOrder 使用外部订单号获取单个订单信息 仅能获取自己购买的订单 http://doc.cqmeihu.cn/sales/outer-order-info.html
func (App) ApiProduct ¶ added in v1.0.44
func (app App) ApiProduct(productId int64) *ApiProductResult
ApiProduct 获取单个商品信息 http://doc.cqmeihu.cn/sales/product-info.html
func (App) ApiProductRechargeParams ¶ added in v1.0.44
func (app App) ApiProductRechargeParams(notMustParams ...Params) *ApiProductRechargeParamsResult
ApiProductRechargeParams 接口说明 获取商品的充值参数(仅支持充值类商品) http://doc.cqmeihu.cn/sales/ProductParams.html
func (*App) NewParamsWith ¶ added in v1.0.37
Click to show internal directories.
Click to hide internal directories.