Documentation ¶
Index ¶
- Constants
- func BalanceQuery(ctx context.Context, client *sdk.Client, merchantId string) (*BalanceQueryResp, *ErrorResp, error)
- func OrderCreate(ctx context.Context, client *sdk.Client, merchantId string, ...) (*OrderCreateResp, *ErrorResp, error)
- func OrderQuery(ctx context.Context, client *sdk.Client, merchantId string, req *OrderQueryReq) (*OrderQueryResp, *ErrorResp, error)
- func OrderResend(ctx context.Context, client *sdk.Client, merchantId string, ...) (*OrderResendResp, *ErrorResp, error)
- func ProductQuery(ctx context.Context, client *sdk.Client, merchantId string) (*ProductQueryResp, *ErrorResp, error)
- type BalanceQueryResp
- type Cards
- type ErrorResp
- type OrderCreateReq
- type OrderCreateResp
- type OrderQueryReq
- type OrderQueryResp
- type OrderResendReq
- type OrderResendResp
- type Product
- type ProductQueryResp
Constants ¶
View Source
const ( OrderCreateUrl = "/openapi/v2/order/create" OrderQueryUrl = "/openapi/v2/order/query" OrderResendUrl = "/openapi/v2/order/resend" ProductQueryUrl = "/openapi/v2/product/query" BalanceQueryUrl = "/openapi/v2/balance/query" )
View Source
const ( BaseUrlProd = "openapi.1688sup.com" // 正式 URL BaseUrlSandbox = "test.openapi.1688sup.cn" // 沙箱 URL )
Variables ¶
This section is empty.
Functions ¶
func BalanceQuery ¶
func BalanceQuery(ctx context.Context, client *sdk.Client, merchantId string) (*BalanceQueryResp, *ErrorResp, error)
BalanceQuery 获取余额
func OrderCreate ¶
func OrderCreate(ctx context.Context, client *sdk.Client, merchantId string, req *OrderCreateReq) (*OrderCreateResp, *ErrorResp, error)
OrderCreate 下单接口
func OrderQuery ¶
func OrderQuery(ctx context.Context, client *sdk.Client, merchantId string, req *OrderQueryReq) (*OrderQueryResp, *ErrorResp, error)
OrderQuery 查询接口
func OrderResend ¶
func OrderResend(ctx context.Context, client *sdk.Client, merchantId string, req *OrderResendReq) (*OrderResendResp, *ErrorResp, error)
OrderResend 重新发送卡密短信
func ProductQuery ¶
func ProductQuery(ctx context.Context, client *sdk.Client, merchantId string) (*ProductQueryResp, *ErrorResp, error)
ProductQuery 获取商品
Types ¶
type BalanceQueryResp ¶
type BalanceQueryResp struct {
Balance float64 `json:"balance"`
}
type OrderCreateReq ¶
type OrderCreateReq struct { OutTradeNo string `json:"outTradeNo"` // 合作商系统内部订单号,同一商户下不可重复, 同微信、支付宝的out_trade_no类似 ProductId string `json:"productId"` // 商品编码 Number int `json:"number"` // 购买数量,目前只能固定是1 NotifyUrl string `json:"notifyUrl"` // 异步通知地址 RechargeAccount string `json:"rechargeAccount"` // 充值账号 Extends string `json:"extends"` // 部分特殊商品需要,具体可联系商务 Attach string `json:"attach"` //透传参数,当传了此参数时,查询和回调接口中将原样携带此参数 UnitPrice int64 `json:"unitPrice"` //交易商品单价,单位:毫(1元等于10000亳) 0或不传表示不限制 当此价格小于采购价时,下单失败 AccountType int64 `json:"accountType"` //账号类型:极少数特殊类型商品需要传此参数 }
type OrderCreateResp ¶
type OrderQueryReq ¶
type OrderQueryReq struct {
OutTradeNo string `json:"outTradeNo"` // 合作商系统内部订单号,同一商户下不可重复, 同微信、支付宝的out_trade_no类似
}
type OrderQueryResp ¶
type OrderQueryResp struct { TradeStatus string `json:"tradeStatus"` OrderNo string `json:"orderNo"` TradeStateDesc string `json:"tradeStateDesc"` Cards []Cards `json:"cards"` MchId int `json:"mchId"` OutTradeNo string `json:"outTradeNo"` UnitPrice float64 `json:"unitPrice"` Attach string `json:"attach"` Extra string `json:"extra"` RechargeAccount string `json:"rechargeAccount"` // 充值账号 }
func (*OrderQueryResp) DecodeCard ¶
func (c *OrderQueryResp) DecodeCard(secretKey string) (result map[string]string, err error)
DecodeCard 解密卡密
type OrderResendReq ¶
type OrderResendResp ¶
type OrderResendResp struct {
IsSuccess bool `json:"isSuccess"`
}
type ProductQueryResp ¶
type ProductQueryResp struct {
Products []Product `json:"products"`
}
Click to show internal directories.
Click to hide internal directories.