Documentation
¶
Index ¶
- Variables
- type APIResult
- type APP
- func (payment *APP) CloseOrder(ctx context.Context, req *CloseOrderRequest) (*APIResult, error)
- func (payment *APP) Prepay(ctx context.Context, req interface{}) (*Response, *APIResult, error)
- func (payment *APP) QueryOrderById(ctx context.Context, req *QueryOrderByIdRequest) (*APIResult, error)
- func (payment *APP) QueryOrderByTradeNo(ctx context.Context, req *QueryOrderByTradeNoRequest) (*APIResult, error)
- type CloseOrderRequest
- type Jsapi
- func (payment *Jsapi) CloseOrder(ctx context.Context, req *CloseOrderRequest) (*APIResult, error)
- func (payment *Jsapi) Prepay(ctx context.Context, req interface{}) (*Response, *APIResult, error)
- func (payment *Jsapi) QueryOrderById(ctx context.Context, req *QueryOrderByIdRequest) (*APIResult, error)
- func (payment *Jsapi) QueryOrderByTradeNo(ctx context.Context, req *QueryOrderByTradeNoRequest) (*APIResult, error)
- type Native
- func (payment *Native) CloseOrder(ctx context.Context, req *CloseOrderRequest) (*APIResult, error)
- func (payment *Native) Prepay(ctx context.Context, req interface{}) (*Response, *APIResult, error)
- func (payment *Native) QueryOrderById(ctx context.Context, req *QueryOrderByIdRequest) (*APIResult, error)
- func (payment *Native) QueryOrderByTradeNo(ctx context.Context, req *QueryOrderByTradeNoRequest) (*APIResult, error)
- type Option
- func WithAppId(appId string) Option
- func WithCertSerialNum(certSerialNum string) Option
- func WithCertificate(cert string) Option
- func WithCertificateFile(certFile string) Option
- func WithKey(key string) Option
- func WithMchId(mchId string) Option
- func WithNotifyUrl(notifyUrl string) Option
- func WithPrivateKey(privateKey string) Option
- func WithPrivateKeyFile(privateKeyFile string) Option
- func WithRefundNotifyUrl(refundNotifyUrl string) Option
- type Options
- type Payment
- type PaymentType
- type PrepayRequest
- type QueryOrderByIdRequest
- type QueryOrderByTradeNoRequest
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NotSupportPayApiType = errors.New("未支持的支付类型") ErrorPrepayConf = errors.New("错误的配置类型") )
Functions ¶
This section is empty.
Types ¶
type APIResult ¶
type APIResult struct { // 本次请求所使用的 HTTPRequest Request *http.Request // 本次请求所获得的 HTTPResponse Response *http.Response }
APIResult 微信支付API v3 请求结果
type APP ¶
type APP struct {
// contains filtered or unexported fields
}
func (*APP) CloseOrder ¶
func (*APP) QueryOrderById ¶
func (*APP) QueryOrderByTradeNo ¶
type CloseOrderRequest ¶
type CloseOrderRequest struct {
OutTradeNo string
}
type Jsapi ¶
type Jsapi struct {
// contains filtered or unexported fields
}
func (*Jsapi) CloseOrder ¶
func (*Jsapi) QueryOrderById ¶
func (*Jsapi) QueryOrderByTradeNo ¶
type Native ¶
type Native struct {
// contains filtered or unexported fields
}
func (*Native) CloseOrder ¶
func (*Native) QueryOrderById ¶
func (*Native) QueryOrderByTradeNo ¶
type Option ¶
type Option func(*Options)
func WithCertSerialNum ¶
func WithCertificate ¶
func WithCertificateFile ¶
func WithNotifyUrl ¶
func WithPrivateKey ¶
func WithPrivateKeyFile ¶
func WithRefundNotifyUrl ¶
type Payment ¶
type Payment interface { CloseOrder(context.Context, *CloseOrderRequest) (*APIResult, error) Prepay(context.Context, interface{}) (*Response, *APIResult, error) QueryOrderById(context.Context, *QueryOrderByIdRequest) (*APIResult, error) QueryOrderByTradeNo(context.Context, *QueryOrderByTradeNoRequest) (*APIResult, error) }
type PaymentType ¶
type PaymentType string
const ( PaymentTypeAPP PaymentType = "APP" // app 支付 PaymentTypeJSAPI PaymentType = "JSAPI" // jsapi 支付 或 小程序支付 PaymentTypeH5 PaymentType = "H5" // h5 支付 PaymentTypeNative PaymentType = "NATIVE" // native 网页支付 )
type PrepayRequest ¶
type PrepayRequest struct { Description *string // 商品描述 OutTradeNo *string // 商户订单号 TimeExpire *time.Time // 订单失效时间 Attach *string // 附加数据 GoodsTag *string // 回调 URL 地址 LimitPay []string // 商品标记 SupportFapiao *bool // 传入true时,支付成功消息和支付详情页将出现开票入口。需要在微信支付商户平台或微信公众平台开通电子发票功能,传此字段才可生效。 Total *int64 // 订单总金额 Currency *string // 支付币种 CostPrice *int64 // 1.商户侧一张小票订单可能被分多次支付,订单原价用于记录整张小票的交易金额。 2.当订单原价与支付金额不相等,则不享受优惠。 3.该字段主要用于防止同一张小票分多次支付,以享受多次优惠的情况,正常支付订单不必上传此参数。 InvoiceId *string // 商家小票ID。 GoodsName *string // 商品的实际名称。 MerchantGoodsId *string // 由半角的大小写字母、数字、中划线、下划线中的一种或几种组成。 Quantity *int64 // 用户购买的数量。 UnitPrice *int64 // 商品单价,单位为分。 WechatpayGoodsId *string // 微信支付定义的统一商品编号(没有可不传)。 ProfitSharing *bool // 是否指定分账 DeviceId *string // 商户端设备号 ClientIp *string // 用户终端IP StoreAddress *string // 详细的商户门店地址 StoreAreaCode *string // 地区编码,详细请见微信支付提供的文档 StoreId *string // 商户侧门店编号 StoreName *string // 商户侧门店名称 NotifyUrl *string // 支付回调地址 }
type QueryOrderByIdRequest ¶
type QueryOrderByIdRequest struct {
TransactionId string
}
type QueryOrderByTradeNoRequest ¶ added in v1.1.6
type QueryOrderByTradeNoRequest struct {
TradNo string
}
Click to show internal directories.
Click to hide internal directories.