Documentation ¶
Index ¶
- Constants
- func NewRequest(method, url string, params url.Values) (*http.Request, error)
- func VerifySign(data url.Values, key []byte, hasSignType ...bool) (ok bool, err error)
- type AliBizContent
- type AliForm
- type AliPay
- func (this *AliPay) AloneSign(values url.Values) (url.Values, error)
- func (this *AliPay) BillDownloadURLQuery(param BillDownloadURLQuery) (results *BillDownloadURLQueryResponse, err error)
- func (this *AliPay) DoRequest(method string, param AliPayParam, results interface{}) (err error)
- func (this *AliPay) FundAuthOperationCancel(param AliPayFundAuthOperationCancel) (results *AliPayFundAuthOperationCancelResponse, err error)
- func (this *AliPay) FundAuthOperationDetailQuery(param AliPayFundAuthOperationDetailQuery) (results *AliPayFundAuthOperationDetailQueryResponse, err error)
- func (this *AliPay) FundAuthOrderAppFreeze(param AliPayFundAuthOrderAppFreeze) (results string, err error)
- func (this *AliPay) FundAuthOrderFreeze(param AliPayFundAuthOrderFreeze) (results *AliPayFundAuthOrderFreezeResponse, err error)
- func (this *AliPay) FundAuthOrderUnfreeze(param AliPayFundAuthOrderUnfreeze) (results *AliPayFundAuthOrderUnfreezeResponse, err error)
- func (this *AliPay) FundAuthOrderVoucherCreate(param AliPayFundAuthOrderVoucherCreate) (results *AliPayFundAuthOrderVoucherCreateResponse, err error)
- func (this *AliPay) FundTransOrderQuery(param AliPayFundTransOrderQuery) (results *AliPayFundTransOrderQueryResponse, err error)
- func (this *AliPay) FundTransToAccountTransfer(param AliPayFundTransToAccountTransfer) (results *AliPayFundTransToAccountTransferResponse, err error)
- func (this *AliPay) GetAppID() string
- func (c *AliPay) GetAppInfo(infoReq *InfoReq) (*InfoResp, error)
- func (c *AliPay) GetTemplate(req *GetTemplateReq) (*GetTemplateResp, error)
- func (this *AliPay) GetTradeNotification(req *http.Request) (*TradeNotification, error)
- func (c *AliPay) GroupMessageSend(req *GroupMessageReq) (*GroupMessageResp, error)
- func (c *AliPay) Menu(menu *Menu) (MenuResp, error)
- func (c *AliPay) ModifyIndustry(req *IndustryReq) (*IndustryResp, error)
- func (this *AliPay) NotifyVerify(notifyId string) bool
- func (c *AliPay) QRCodeSet(req *QRCodeSetReq) (*QRCodeSetResp, error)
- func (c *AliPay) QueryIndustry(req *IndustryQueryReq) (*IndustryQueryResp, error)
- func (c *AliPay) QueryMenu(queryMenu *QueryMenuReq) (*QueryMenuResp, error)
- func (c *AliPay) SendMessage(req *SendMessageReq) (*SendMessageResp, error)
- func (this *AliPay) TradeAppPay(param AliPayTradeAppPay) (results string, err error)
- func (this *AliPay) TradeCancel(param AliPayTradeCancel) (results *AliPayTradeCancelResponse, err error)
- func (this *AliPay) TradeClose(param AliPayTradeClose) (results *AliPayTradeCloseResponse, err error)
- func (this *AliPay) TradeCreate(param AliPayTradeCreate) (results *AliPayTradeCreateResponse, err error)
- func (this *AliPay) TradeFastpayRefundQuery(param AliPayFastpayTradeRefundQuery) (results *AliPayFastpayTradeRefundQueryResponse, err error)
- func (this *AliPay) TradeOrderInfoSync(param AliPayTradeOrderInfoSync) (results *AliPayTradeOrderInfoSyncResponse, err error)
- func (this *AliPay) TradeOrderSettle(param AliPayTradeOrderSettle) (results *AliPayTradeOrderSettleResponse, err error)
- func (this *AliPay) TradePagePay(param AliPayTradePagePay) (results *url.URL, err error)
- func (this *AliPay) TradePay(param AliPayTradePay) (results *AliPayTradePayResponse, err error)
- func (this *AliPay) TradePreCreate(param AliPayTradePreCreate) (results *AliPayTradePreCreateResponse, err error)
- func (this *AliPay) TradeQuery(param AliPayTradeQuery) (results *AliPayTradeQueryResponse, err error)
- func (this *AliPay) TradeRefund(param AliPayTradeRefund) (results *AliPayTradeRefundResponse, err error)
- func (c *AliPay) TradeWapPay(param TradeWapPay) (result *url.URL, err error)
- func (this *AliPay) URLValues(param AliPayParam) (value url.Values, err error)
- func (c *AliPay) User(param UserReq) (results *UserResp, err error)
- func (c *AliPay) UserInfo(param UserInfoReq) (results *UserInfoResp, err error)
- func (c *AliPay) VerifyCBMsg(values url.Values) error
- func (c *AliPay) VerifyGateWay(values url.Values) (string, error)
- func (c *AliPay) VerifyRespXML(bizContent string, signType string, charset string, result bool) (string, error)
- func (this *AliPay) VerifySign(data url.Values, hasSignType ...bool) (ok bool, err error)
- type AliPayFastpayTradeRefundQuery
- type AliPayFastpayTradeRefundQueryResponse
- type AliPayFundAuthOperationCancel
- type AliPayFundAuthOperationCancelResponse
- type AliPayFundAuthOperationDetailQuery
- type AliPayFundAuthOperationDetailQueryResponse
- type AliPayFundAuthOrderAppFreeze
- type AliPayFundAuthOrderAppFreezeResponse
- type AliPayFundAuthOrderFreeze
- type AliPayFundAuthOrderFreezeResponse
- type AliPayFundAuthOrderUnfreeze
- type AliPayFundAuthOrderUnfreezeResponse
- type AliPayFundAuthOrderVoucherCreate
- type AliPayFundAuthOrderVoucherCreateResponse
- type AliPayFundTransOrderQuery
- type AliPayFundTransOrderQueryResponse
- type AliPayFundTransToAccountTransfer
- type AliPayFundTransToAccountTransferResponse
- type AliPayParam
- type AliPayTradeAppPay
- type AliPayTradeCancel
- type AliPayTradeCancelResponse
- type AliPayTradeClose
- type AliPayTradeCloseResponse
- type AliPayTradeCreate
- type AliPayTradeCreateResponse
- type AliPayTradeOrderInfoSync
- type AliPayTradeOrderInfoSyncResponse
- type AliPayTradeOrderSettle
- type AliPayTradeOrderSettleResponse
- type AliPayTradePagePay
- type AliPayTradePay
- type AliPayTradePayResponse
- type AliPayTradePreCreate
- type AliPayTradePreCreateResponse
- type AliPayTradeQuery
- type AliPayTradeQueryResponse
- type AliPayTradeRefund
- type AliPayTradeRefundResponse
- type AliVerifyResp
- type Article
- type BillDownloadURLQuery
- type BillDownloadURLQueryResponse
- type Button
- type Context
- type DataItem
- type ExtendParamsItem
- type FundBill
- type GetTemplateReq
- type GetTemplateResp
- type GoodsDetailItem
- type GroupMessageReq
- type GroupMessageResp
- type IndustryQueryReq
- type IndustryQueryResp
- type IndustryReq
- type IndustryResp
- type InfoReq
- type InfoResp
- type Menu
- type MenuCreateResp
- type MenuModifyResp
- type MenuResp
- type QRCodeSetReq
- type QRCodeSetResp
- type QueryMenuReq
- type QueryMenuResp
- type RefundDetailItem
- type RoyaltyDetailInfoItem
- type RoyaltyInfo
- type RoyaltyParameter
- type SendMessageReq
- type SendMessageResp
- type SubMerchantItem
- type Template
- type Text
- type TradeNotification
- type TradePay
- type TradeWapPay
- type UserInfoReq
- type UserInfoResp
- type UserReq
- type UserResp
- type VoucherDetail
Constants ¶
const ( K_TIME_FORMAT = "2006-01-02 15:04:05" K_ALI_PAY_TRADE_STATUS_WAIT_BUYER_PAY = "WAIT_BUYER_PAY" // 交易创建,等待买家付款 K_ALI_PAY_TRADE_STATUS_TRADE_CLOSED = "TRADE_CLOSED" // 未付款交易超时关闭,或支付完成后全额退款 K_ALI_PAY_TRADE_STATUS_TRADE_SUCCESS = "TRADE_SUCCESS" // 交易支付成功 K_ALI_PAY_TRADE_STATUS_TRADE_FINISHED = "TRADE_FINISHED" // 交易结束,不可退款 K_ALI_PAY_SANDBOX_API_URL = "https://openapi.alipaydev.com/gateway.do" K_ALI_PAY_PRODUCTION_API_URL = "https://openapi.alipay.com/gateway.do" K_ALI_PAY_PRODUCTION_MAPI_URL = "https://mapi.alipay.com/gateway.do" K_FORMAT = "JSON" K_CHARSET = "utf-8" K_VERSION = "1.0" // https://doc.open.alipay.com/docs/doc.htm?treeId=291&articleId=105806&docType=1 K_SUCCESS_CODE = "10000" )
const ( K_SIGN_TYPE_RSA2 = "RSA2" K_SIGN_TYPE_RSA = "RSA" )
const ( K_TRADE_STATUS_WAIT_BUYER_PAY = "WAIT_BUYER_PAY" //(交易创建,等待买家付款) K_TRADE_STATUS_TRADE_CLOSED = "TRADE_CLOSED" //(未付款交易超时关闭,或支付完成后全额退款) K_TRADE_STATUS_TRADE_SUCCESS = "TRADE_SUCCESS" //(交易支付成功) K_TRADE_STATUS_TRADE_FINISHED = "TRADE_FINISHED" //(交易结束,不可退款) )
//////////////////////////////////////////////////////////////////////////////
const (
K_CONTENT_TYPE_FORM = "application/x-www-form-urlencoded;charset=utf-8"
)
const (
K_NOTIFY_TYPE_TRADE_STATUS_SYNC = "trade_status_sync"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AliBizContent ¶
type AliBizContent struct { XMLName xml.Name `xml:"XML"` AppID string `xml:"AppId"` FromUserID string `xml:"FromUserId"` FromAlipayUserID string `xml:"FromAlipayUserId"` CreateTime string `xml:"CreateTime"` MsgType string `xml:"MsgType"` EventType string `xml:"EventTpye"` ActionParam string `xml:"ActionParam"` AgreementID string `xml:"AgreementId"` AccountNo string `xml:"AccountNo"` }
AliBizContent 验证网关
type AliForm ¶
type AliForm struct { Sign string `param:"sign"` Charset string `param:"charset"` BizContent string `param:"biz_content"` SignType string `param:"sign_type"` Service string `param:"service"` }
AliForm 阿里返回
type AliPay ¶
type AliPay struct { Client *http.Client SignType string // contains filtered or unexported fields }
func (*AliPay) BillDownloadURLQuery ¶
func (this *AliPay) BillDownloadURLQuery(param BillDownloadURLQuery) (results *BillDownloadURLQueryResponse, err error)
BillDownloadURLQuery https://docs.open.alipay.com/api_15/alipay.data.dataservice.bill.downloadurl.query
func (*AliPay) DoRequest ¶
func (this *AliPay) DoRequest(method string, param AliPayParam, results interface{}) (err error)
func (*AliPay) FundAuthOperationCancel ¶
func (this *AliPay) FundAuthOperationCancel(param AliPayFundAuthOperationCancel) (results *AliPayFundAuthOperationCancelResponse, err error)
FundAuthOperationCancel https://docs.open.alipay.com/api_28/alipay.fund.auth.operation.cancel/ 资金授权撤销接口
func (*AliPay) FundAuthOperationDetailQuery ¶
func (this *AliPay) FundAuthOperationDetailQuery(param AliPayFundAuthOperationDetailQuery) (results *AliPayFundAuthOperationDetailQueryResponse, err error)
FundAuthOperationDetailQuery https://docs.open.alipay.com/api_28/alipay.fund.auth.operation.detail.query/ 资金授权操作查询接口
func (*AliPay) FundAuthOrderAppFreeze ¶
func (this *AliPay) FundAuthOrderAppFreeze(param AliPayFundAuthOrderAppFreeze) (results string, err error)
FundTransOrderQuery https://docs.open.alipay.com/api_28/alipay.fund.auth.order.app.freeze 线上资金授权冻结接口
func (*AliPay) FundAuthOrderFreeze ¶
func (this *AliPay) FundAuthOrderFreeze(param AliPayFundAuthOrderFreeze) (results *AliPayFundAuthOrderFreezeResponse, err error)
FundAuthOrderFreeze https://docs.open.alipay.com/api_28/alipay.fund.auth.order.freeze/ 资金授权冻结接口
func (*AliPay) FundAuthOrderUnfreeze ¶
func (this *AliPay) FundAuthOrderUnfreeze(param AliPayFundAuthOrderUnfreeze) (results *AliPayFundAuthOrderUnfreezeResponse, err error)
FundAuthOrderUnfreeze https://docs.open.alipay.com/api_28/alipay.fund.auth.order.unfreeze/ 资金授权解冻接口
func (*AliPay) FundAuthOrderVoucherCreate ¶
func (this *AliPay) FundAuthOrderVoucherCreate(param AliPayFundAuthOrderVoucherCreate) (results *AliPayFundAuthOrderVoucherCreateResponse, err error)
FundAuthOrderVoucherCreate https://docs.open.alipay.com/api_28/alipay.fund.auth.order.voucher.create/ 资金授权发码接口
func (*AliPay) FundTransOrderQuery ¶
func (this *AliPay) FundTransOrderQuery(param AliPayFundTransOrderQuery) (results *AliPayFundTransOrderQueryResponse, err error)
FundTransOrderQuery https://docs.open.alipay.com/api_28/alipay.fund.trans.order.query/ 查询转账订单接口
func (*AliPay) FundTransToAccountTransfer ¶
func (this *AliPay) FundTransToAccountTransfer(param AliPayFundTransToAccountTransfer) (results *AliPayFundTransToAccountTransferResponse, err error)
FundTransToAccountTransfer https://docs.open.alipay.com/api_28/alipay.fund.trans.toaccount.transfer 单笔转账到支付宝账户接口
func (*AliPay) GetAppInfo ¶
GetAppInfo 获取App基本信息
func (*AliPay) GetTemplate ¶
func (c *AliPay) GetTemplate(req *GetTemplateReq) (*GetTemplateResp, error)
GetTemplate 领取模版
func (*AliPay) GetTradeNotification ¶
func (this *AliPay) GetTradeNotification(req *http.Request) (*TradeNotification, error)
func (*AliPay) GroupMessageSend ¶
func (c *AliPay) GroupMessageSend(req *GroupMessageReq) (*GroupMessageResp, error)
GroupMessageSend 群发消息
func (*AliPay) ModifyIndustry ¶
func (c *AliPay) ModifyIndustry(req *IndustryReq) (*IndustryResp, error)
ModifyIndustry 更改行业
func (*AliPay) NotifyVerify ¶
func (*AliPay) QRCodeSet ¶
func (c *AliPay) QRCodeSet(req *QRCodeSetReq) (*QRCodeSetResp, error)
QRCodeSet 设置推广码
func (*AliPay) QueryIndustry ¶
func (c *AliPay) QueryIndustry(req *IndustryQueryReq) (*IndustryQueryResp, error)
QueryIndustry 查询行业
func (*AliPay) QueryMenu ¶
func (c *AliPay) QueryMenu(queryMenu *QueryMenuReq) (*QueryMenuResp, error)
QueryMenu 查询菜单
func (*AliPay) SendMessage ¶
func (c *AliPay) SendMessage(req *SendMessageReq) (*SendMessageResp, error)
SendMessage 发消息
func (*AliPay) TradeAppPay ¶
func (this *AliPay) TradeAppPay(param AliPayTradeAppPay) (results string, err error)
TradeAppPay https://docs.open.alipay.com/api_1/alipay.trade.app.pay
func (*AliPay) TradeCancel ¶
func (this *AliPay) TradeCancel(param AliPayTradeCancel) (results *AliPayTradeCancelResponse, err error)
TradeCancel https://docs.open.alipay.com/api_1/alipay.trade.cancel/
func (*AliPay) TradeClose ¶
func (this *AliPay) TradeClose(param AliPayTradeClose) (results *AliPayTradeCloseResponse, err error)
TradeClose https://docs.open.alipay.com/api_1/alipay.trade.close/
func (*AliPay) TradeCreate ¶
func (this *AliPay) TradeCreate(param AliPayTradeCreate) (results *AliPayTradeCreateResponse, err error)
TradeCreate https://docs.open.alipay.com/api_1/alipay.trade.create/
func (*AliPay) TradeFastpayRefundQuery ¶
func (this *AliPay) TradeFastpayRefundQuery(param AliPayFastpayTradeRefundQuery) (results *AliPayFastpayTradeRefundQueryResponse, err error)
TradeFastpayRefundQuery https://docs.open.alipay.com/api_1/alipay.trade.fastpay.refund.query
func (*AliPay) TradeOrderInfoSync ¶
func (this *AliPay) TradeOrderInfoSync(param AliPayTradeOrderInfoSync) (results *AliPayTradeOrderInfoSyncResponse, err error)
TradeOrderInfoSync https://docs.open.alipay.com/api_1/alipay.trade.orderinfo.sync/
func (*AliPay) TradeOrderSettle ¶
func (this *AliPay) TradeOrderSettle(param AliPayTradeOrderSettle) (results *AliPayTradeOrderSettleResponse, err error)
TradeOrderSettle https://docs.open.alipay.com/api_1/alipay.trade.order.settle
func (*AliPay) TradePagePay ¶
func (this *AliPay) TradePagePay(param AliPayTradePagePay) (results *url.URL, err error)
TradePagePay https://docs.open.alipay.com/270/alipay.trade.page.pay
func (*AliPay) TradePay ¶
func (this *AliPay) TradePay(param AliPayTradePay) (results *AliPayTradePayResponse, err error)
TradePay https://docs.open.alipay.com/api_1/alipay.trade.pay/
func (*AliPay) TradePreCreate ¶
func (this *AliPay) TradePreCreate(param AliPayTradePreCreate) (results *AliPayTradePreCreateResponse, err error)
TradePreCreate https://docs.open.alipay.com/api_1/alipay.trade.precreate/
func (*AliPay) TradeQuery ¶
func (this *AliPay) TradeQuery(param AliPayTradeQuery) (results *AliPayTradeQueryResponse, err error)
TradeQuery https://docs.open.alipay.com/api_1/alipay.trade.query/
func (*AliPay) TradeRefund ¶
func (this *AliPay) TradeRefund(param AliPayTradeRefund) (results *AliPayTradeRefundResponse, err error)
TradeRefund https://docs.open.alipay.com/api_1/alipay.trade.refund/
func (*AliPay) TradeWapPay ¶
func (c *AliPay) TradeWapPay(param TradeWapPay) (result *url.URL, err error)
TradeWapPay 手机网站支付接口 https://docs.open.alipay.com/api_1/alipay.trade.wap.pay/
func (*AliPay) URLValues ¶
func (this *AliPay) URLValues(param AliPayParam) (value url.Values, err error)
func (*AliPay) UserInfo ¶
func (c *AliPay) UserInfo(param UserInfoReq) (results *UserInfoResp, err error)
UserInfo 获取用户详细信息
func (*AliPay) VerifyCBMsg ¶
VerifyCBMsg 验证回调消息签名
func (*AliPay) VerifyGateWay ¶
VerifyGateWay 网关验证
type AliPayFastpayTradeRefundQuery ¶
type AliPayFastpayTradeRefundQuery struct { AppAuthToken string `json:"-"` // 可选 OutTradeNo string `json:"out_trade_no,omitempty"` // 与 TradeNo 二选一 TradeNo string `json:"trade_no,omitempty"` // 与 OutTradeNo 二选一 OutRequestNo string `json:"out_request_no"` // 必须 请求退款接口时,传入的退款请求号,如果在退款请求时未传入,则该值为创建交易时的外部交易号 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.fastpay.refund.query
func (AliPayFastpayTradeRefundQuery) APIName ¶
func (this AliPayFastpayTradeRefundQuery) APIName() string
func (AliPayFastpayTradeRefundQuery) ExtJSONParamName ¶
func (this AliPayFastpayTradeRefundQuery) ExtJSONParamName() string
func (AliPayFastpayTradeRefundQuery) ExtJSONParamValue ¶
func (this AliPayFastpayTradeRefundQuery) ExtJSONParamValue() string
func (AliPayFastpayTradeRefundQuery) Params ¶
func (this AliPayFastpayTradeRefundQuery) Params() map[string]string
type AliPayFastpayTradeRefundQueryResponse ¶
type AliPayFastpayTradeRefundQueryResponse struct { AliPayTradeFastpayRefundQueryResponse struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` OutRequestNo string `json:"out_request_no"` // 本笔退款对应的退款请求号 OutTradeNo string `json:"out_trade_no"` // 创建交易传入的商户订单号 RefundReason string `json:"refund_reason"` // 发起退款时,传入的退款原因 TotalAmount string `json:"total_amount"` // 发该笔退款所对应的交易的订单金额 RefundAmount string `json:"refund_amount"` // 本次退款请求,对应的退款金额 TradeNo string `json:"trade_no"` // 支付宝交易号 } `json:"alipay_trade_fastpay_refund_query_response"` Sign string `json:"sign"` }
func (*AliPayFastpayTradeRefundQueryResponse) IsSuccess ¶
func (this *AliPayFastpayTradeRefundQueryResponse) IsSuccess() bool
type AliPayFundAuthOperationCancel ¶
type AliPayFundAuthOperationCancel struct { NotifyURL string `json:"-"` AppAuthToken string `json:"-"` // 可选 AuthNo string `json:"auth_no,omitempty"` // 特殊可选, 支付宝授权资金订单号,与商户的授权资金订单号不能同时为空,二者都存在时,以支付宝资金授权订单号为准,该参数与支付宝授权资金操作流水号配对使用。 OutOrderNo string `json:"out_order_no,omitempty"` // 特殊可选, 商户的授权资金订单号,与支付宝的授权资金订单号不能同时为空,二者都存在时,以支付宝的授权资金订单号为准,该参数与商户的授权资金操作流水号配对使用。 OperationId string `json:"operation_id,omitempty"` // 特殊可选, 支付宝的授权资金操作流水号,与商户的授权资金操作流水号不能同时为空,二者都存在时,以支付宝的授权资金操作流水号为准,该参数与支付宝授权资金订单号配对使用。 OutRequestNo string `json:"out_request_no,omitempty"` // 特殊可选, 商户的授权资金操作流水号,与支付宝的授权资金操作流水号不能同时为空,二者都存在时,以支付宝的授权资金操作流水号为准,该参数与商户的授权资金订单号配对使用。 Remark string `json:"remark"` // 必选, 商户对本次撤销操作的附言描述,长度不超过100个字母或50个汉字 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_28/alipay.fund.auth.operation.cancel/ 资金授权撤销接口
func (AliPayFundAuthOperationCancel) APIName ¶
func (this AliPayFundAuthOperationCancel) APIName() string
func (AliPayFundAuthOperationCancel) ExtJSONParamName ¶
func (this AliPayFundAuthOperationCancel) ExtJSONParamName() string
func (AliPayFundAuthOperationCancel) ExtJSONParamValue ¶
func (this AliPayFundAuthOperationCancel) ExtJSONParamValue() string
func (AliPayFundAuthOperationCancel) Params ¶
func (this AliPayFundAuthOperationCancel) Params() map[string]string
type AliPayFundAuthOperationCancelResponse ¶
type AliPayFundAuthOperationCancelResponse struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` AuthNo string `json:"auth_no"` OutOrderNo string `json:"out_order_no"` OperationId string `json:"operation_id"` OutRequestNo string `json:"out_request_no"` Action string `json:"action"` } `json:"alipay_fund_auth_operation_cancel_response"` Sign string `json:"sign"` }
type AliPayFundAuthOperationDetailQuery ¶
type AliPayFundAuthOperationDetailQuery struct { AppAuthToken string `json:"-"` // 可选 AuthNo string `json:"auth_no"` // 特殊可选, 支付宝授权资金订单号,与商户的授权资金订单号不能同时为空,二者都存在时,以支付宝资金授权订单号为准,该参数与支付宝授权资金操作流水号配对使用。 OutOrderNo string `json:"out_order_no"` // 特殊可选, 商户的授权资金订单号,与支付宝的授权资金订单号不能同时为空,二者都存在时,以支付宝的授权资金订单号为准,该参数与商户的授权资金操作流水号配对使用。 OperationId string `json:"operation_id"` // 特殊可选, 支付宝的授权资金操作流水号,与商户的授权资金操作流水号不能同时为空,二者都存在时,以支付宝的授权资金操作流水号为准,该参数与支付宝授权资金订单号配对使用。 OutRequestNo string `json:"out_request_no"` // 特殊可选, 商户的授权资金操作流水号,与支付宝的授权资金操作流水号不能同时为空,二者都存在时,以支付宝的授权资金操作流水号为准,该参数与商户的授权资金订单号配对使用。 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_28/alipay.fund.auth.operation.detail.query/ 资金授权操作查询接口
func (AliPayFundAuthOperationDetailQuery) APIName ¶
func (this AliPayFundAuthOperationDetailQuery) APIName() string
func (AliPayFundAuthOperationDetailQuery) ExtJSONParamName ¶
func (this AliPayFundAuthOperationDetailQuery) ExtJSONParamName() string
func (AliPayFundAuthOperationDetailQuery) ExtJSONParamValue ¶
func (this AliPayFundAuthOperationDetailQuery) ExtJSONParamValue() string
func (AliPayFundAuthOperationDetailQuery) Params ¶
func (this AliPayFundAuthOperationDetailQuery) Params() map[string]string
type AliPayFundAuthOperationDetailQueryResponse ¶
type AliPayFundAuthOperationDetailQueryResponse struct { Body struct { AuthNo string `json:"auth_no"` OutOrderNo string `json:"out_order_no"` TotalFreezeAmount string `json:"total_freeze_amount"` RestAmount string `json:"rest_amount"` TotalPayAmount string `json:"total_pay_amount"` OrderTitle string `json:"order_title"` PayerLogonId string `json:"payer_logon_id"` PayerUserId string `json:"payer_user_id"` ExtraParam string `json:"extra_param"` OperationId string `json:"operation_id"` OutRequestNo string `json:"out_request_no"` Amount string `json:"amount"` OperationType string `json:"operation_type"` Status string `json:"status"` Remark string `json:"remark"` GMTCreate string `json:"gmt_create"` GMTTrans string `json:"gmt_trans"` PreAuthType string `json:"pre_auth_type"` TransCurrency string `json:"trans_currency"` TotalFreezeCreditAmount string `json:"total_freeze_credit_amount"` TotalFreezeFundAmount string `json:"total_freeze_fund_amount"` TotalPayCreditAmount string `json:"total_pay_credit_amount"` TotalPayFundAmount string `json:"total_pay_fund_amount"` RestCreditAmount string `json:"rest_credit_amount"` RestFundAmount string `json:"rest_fund_amount"` CreditAmount string `json:"credit_amount"` FundAmount string `json:"fund_amount"` } `json:"alipay_fund_auth_operation_detail_query_response"` Sign string `json:"sign"` }
type AliPayFundAuthOrderAppFreeze ¶
type AliPayFundAuthOrderAppFreeze struct { NotifyURL string `json:"-"` AppAuthToken string `json:"-"` // 可选 OutOrderNo string `json:"out_order_no"` // 必选, 商户授权资金订单号 ,不能包含除中文、英文、数字以外的字符,创建后不能修改,需要保证在商户端不重复。 OutRequestNo string `json:"out_request_no"` // 必选, 商户本次资金操作的请求流水号,用于标示请求流水的唯一性,不能包含除中文、英文、数字以外的字符,需要保证在商户端不重复。 OrderTitle string `json:"order_title"` // 必选, 业务订单的简单描述,如商品名称等 长度不超过100个字母或50个汉字 Amount string `json:"amount"` // 必选, 需要冻结的金额,单位为:元(人民币),精确到小数点后两位 取值范围:[0.01,100000000.00] ProductCode string `json:"product_code"` // 必选, 销售产品码,新接入线上预授权的业务,本字段取值固定为PRE_AUTH_ONLINE 。 PayeeLogonId string `json:"payee_logon_id,omitempty"` // 收款方支付宝账号(Email或手机号),如果收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)同时传递,则以用户号(payee_user_id)为准,如果商户有勾选花呗渠道,收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)不能同时为空。 PayeeUserId string `json:"payee_user_id,omitempty"` // 收款方的支付宝唯一用户号,以2088开头的16位纯数字组成,如果非空则会在支付时校验交易的的收款方与此是否一致,如果商户有勾选花呗渠道,收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)不能同时为空。 PayTimeout string `json:"pay_timeout,omitempty"` // 该笔订单允许的最晚付款时间,逾期将关闭该笔订单 取值范围:1m~15d。m-分钟,h-小时,d-天。 该参数数值不接受小数点, 如 1.5h,可转换为90m 如果为空,默认15m ExtraParam string `json:"extra_param,omitempty"` // 业务扩展参数,用于商户的特定业务信息的传递,json格式。 1.授权业务对应的类目,key为category,value由支付宝分配,比如充电桩业务传 "CHARGE_PILE_CAR"; 2. 外部商户的门店编号,key为outStoreCode,可选; 3. 外部商户的门店简称,key为outStoreAlias,可选。 EnablePayChannels string `json:"enable_pay_channels,omitempty"` // 商户可用该参数指定用户可使用的支付渠道,本期支持商户可支持三种支付渠道,余额宝(MONEY_FUND)、花呗(PCREDIT_PAY)以及芝麻信用(CREDITZHIMA)。商户可设置一种支付渠道,也可设置多种支付渠道。 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_28/alipay.fund.auth.order.app.freeze 线上资金授权冻结接口请求参数
func (AliPayFundAuthOrderAppFreeze) APIName ¶
func (this AliPayFundAuthOrderAppFreeze) APIName() string
func (AliPayFundAuthOrderAppFreeze) ExtJSONParamName ¶
func (this AliPayFundAuthOrderAppFreeze) ExtJSONParamName() string
func (AliPayFundAuthOrderAppFreeze) ExtJSONParamValue ¶
func (this AliPayFundAuthOrderAppFreeze) ExtJSONParamValue() string
func (AliPayFundAuthOrderAppFreeze) Params ¶
func (this AliPayFundAuthOrderAppFreeze) Params() map[string]string
type AliPayFundAuthOrderAppFreezeResponse ¶
type AliPayFundAuthOrderAppFreezeResponse struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` AuthNo string `json:"auth_no"` OutOrderNo string `json:"out_order_no"` OperationId string `json:"operation_id"` OutRequestNo string `json:"out_request_no"` Amount string `json:"amount"` Status string `json:"status"` PayerUserId string `json:"payer_user_id"` GMTTrans string `json:"gmt_trans"` PreAuthType string `json:"pre_auth_type"` CreditAmount string `json:"credit_amount"` FundAmount string `json:"fund_amount"` } `json:"alipay_fund_auth_order_app_freeze_response"` Sign string `json:"sign"` }
type AliPayFundAuthOrderFreeze ¶
type AliPayFundAuthOrderFreeze struct { NotifyURL string `json:"-"` AppAuthToken string `json:"-"` // 可选 AuthCode string `json:"auth_code"` // 必选, 支付授权码,25~30开头的长度为16~24位的数字,实际字符串长度以开发者获取的付款码长度为准 AuthCodeType string `json:"auth_code_type"` // 必选, 授权码类型 目前仅支持"bar_code" OutOrderNo string `json:"out_order_no"` // 必选, 商户授权资金订单号 ,不能包含除中文、英文、数字以外的字符,创建后不能修改,需要保证在商户端不重复。 OutRequestNo string `json:"out_request_no"` // 必选, 商户本次资金操作的请求流水号,用于标示请求流水的唯一性,不能包含除中文、英文、数字以外的字符,需要保证在商户端不重复。 OrderTitle string `json:"order_title"` // 必选, 业务订单的简单描述,如商品名称等 长度不超过100个字母或50个汉字 Amount string `json:"amount"` // 必选, 需要冻结的金额,单位为:元(人民币),精确到小数点后两位 取值范围:[0.01,100000000.00] PayeeLogonId string `json:"payee_logon_id,omitempty"` // 可选, 收款方支付宝账号(Email或手机号),如果收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)同时传递,则以用户号(payee_user_id)为准,如果商户有勾选花呗渠道,收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)不能同时为空。 PayeeUserId string `json:"payee_user_id,omitempty"` // 可选, 收款方的支付宝唯一用户号,以2088开头的16位纯数字组成,如果非空则会在支付时校验交易的的收款方与此是否一致,如果商户有勾选花呗渠道,收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)不能同时为空。 PayTimeout string `json:"pay_timeout,omitempty"` // 可选, 该笔订单允许的最晚付款时间,逾期将关闭该笔订单 取值范围:1m~15d。m-分钟,h-小时,d-天。 该参数数值不接受小数点, 如 1.5h,可转换为90m 如果为空,默认15m ExtraParam string `json:"extra_param,omitempty"` // 可选, 业务扩展参数,用于商户的特定业务信息的传递,json格式。 1.授权业务对应的类目,key为category,value由支付宝分配,比如充电桩业务传 "CHARGE_PILE_CAR"; 2. 外部商户的门店编号,key为outStoreCode,可选; 3. 外部商户的门店简称,key为outStoreAlias,可选。 ProductCode string `json:"product_code,omitempty"` // 可选, 销售产品码,后续新接入预授权当面付的业务,本字段取值固定为PRE_AUTH。 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_28/alipay.fund.auth.order.freeze/ 资金授权冻结接口
func (AliPayFundAuthOrderFreeze) APIName ¶
func (this AliPayFundAuthOrderFreeze) APIName() string
func (AliPayFundAuthOrderFreeze) ExtJSONParamName ¶
func (this AliPayFundAuthOrderFreeze) ExtJSONParamName() string
func (AliPayFundAuthOrderFreeze) ExtJSONParamValue ¶
func (this AliPayFundAuthOrderFreeze) ExtJSONParamValue() string
func (AliPayFundAuthOrderFreeze) Params ¶
func (this AliPayFundAuthOrderFreeze) Params() map[string]string
type AliPayFundAuthOrderFreezeResponse ¶
type AliPayFundAuthOrderFreezeResponse struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` AuthNo string `json:"auth_no"` OutOrderNo string `json:"out_order_no"` OperationId string `json:"operation_id"` OutRequestNo string `json:"out_request_no"` Amount string `json:"amount"` Status string `json:"status"` PayerUserId string `json:"payer_user_id"` GMTTrans string `json:"gmt_trans"` } `json:"alipay_fund_auth_order_freeze_response"` Sign string `json:"sign"` }
type AliPayFundAuthOrderUnfreeze ¶
type AliPayFundAuthOrderUnfreeze struct { NotifyURL string `json:"-"` AppAuthToken string `json:"-"` // 可选 OutRequestNo string `json:"out_request_no"` // 必选, 商户本次资金操作的请求流水号,用于标示请求流水的唯一性,不能包含除中文、英文、数字以外的字符,需要保证在商户端不重复。 Amount string `json:"amount"` // 必选, 本次操作解冻的金额,单位为:元(人民币),精确到小数点后两位,取值范围:[0.01,100000000.00] Remark string `json:"remark"` // 必选, 商户对本次解冻操作的附言描述,长度不超过100个字母或50个汉字 ExtraParam string `json:"extra_param,omitempty"` // 可选, 解冻扩展信息,json格式;unfreezeBizInfo 目前为芝麻消费字段,支持Key值如下: "bizComplete":"true" -- 选填:标识本次解冻用户是否履约,如果true信用单会完结为COMPLETE }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_28/alipay.fund.auth.order.unfreeze/ 资金授权解冻接口
func (AliPayFundAuthOrderUnfreeze) APIName ¶
func (this AliPayFundAuthOrderUnfreeze) APIName() string
func (AliPayFundAuthOrderUnfreeze) ExtJSONParamName ¶
func (this AliPayFundAuthOrderUnfreeze) ExtJSONParamName() string
func (AliPayFundAuthOrderUnfreeze) ExtJSONParamValue ¶
func (this AliPayFundAuthOrderUnfreeze) ExtJSONParamValue() string
func (AliPayFundAuthOrderUnfreeze) Params ¶
func (this AliPayFundAuthOrderUnfreeze) Params() map[string]string
type AliPayFundAuthOrderUnfreezeResponse ¶
type AliPayFundAuthOrderUnfreezeResponse struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` AuthNo string `json:"auth_no"` OutOrderNo string `json:"out_order_no"` OperationId string `json:"operation_id"` OutRequestNo string `json:"out_request_no"` Amount string `json:"amount"` Status string `json:"status"` GMTTrans string `json:"gmt_trans"` CreditAmount string `json:"credit_amount"` FundAmount string `json:"fund_amount"` } `json:"alipay_fund_auth_order_unfreeze_response"` Sign string `json:"sign"` }
type AliPayFundAuthOrderVoucherCreate ¶
type AliPayFundAuthOrderVoucherCreate struct { NotifyURL string `json:"-"` AppAuthToken string `json:"-"` // 可选 OutOrderNo string `json:"out_order_no"` // 必选, 商户授权资金订单号,创建后不能修改,需要保证在商户端不重复。 OutRequestNo string `json:"out_request_no"` // 必选, 商户本次资金操作的请求流水号,用于标示请求流水的唯一性,需要保证在商户端不重复。 ProductCode string `json:"product_code,omitempty"` // 必选, 销售产品码,后续新接入预授权当面付的业务,本字段取值固定为PRE_AUTH。 OrderTitle string `json:"order_title"` // 必选, 业务订单的简单描述,如商品名称等 长度不超过100个字母或50个汉字 Amount string `json:"amount"` // 必选, 需要冻结的金额,单位为:元(人民币),精确到小数点后两位 取值范围:[0.01,100000000.00] PayeeUserId string `json:"payee_user_id,omitempty"` // 可选, 收款方的支付宝唯一用户号,以2088开头的16位纯数字组成,如果非空则会在支付时校验交易的的收款方与此是否一致,如果商户有勾选花呗渠道,收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)不能同时为空。 PayeeLogonId string `json:"payee_logon_id,omitempty"` // 可选, 收款方支付宝账号(Email或手机号),如果收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)同时传递,则以用户号(payee_user_id)为准,如果商户有勾选花呗渠道,收款方支付宝登录号(payee_logon_id)和用户号(payee_user_id)不能同时为空。 PayTimeout string `json:"pay_timeout,omitempty"` // 可选, 该笔订单允许的最晚付款时间,逾期将关闭该笔订单 取值范围:1m~15d。m-分钟,h-小时,d-天。 该参数数值不接受小数点, 如 1.5h,可转换为90m 如果为空,默认15m ExtraParam string `json:"extra_param,omitempty"` // 可选, 业务扩展参数,用于商户的特定业务信息的传递,json格式。 1.授权业务对应的类目,key为category,value由支付宝分配,比如充电桩业务传 "CHARGE_PILE_CAR"; 2. 外部商户的门店编号,key为outStoreCode,可选; 3. 外部商户的门店简称,key为outStoreAlias,可选。 TransCurrency string `json:"trans_currency,omitempty"` // 可选, 标价币种, amount 对应的币种单位。支持澳元:AUD, 新西兰元:NZD, 台币:TWD, 美元:USD, 欧元:EUR, 英镑:GBP SettleCurrency string `json:"settle_currency,omitempty"` // 可选, 商户指定的结算币种。支持澳元:AUD, 新西兰元:NZD, 台币:TWD, 美元:USD, 欧元:EUR, 英镑:GBP EnablePayChannels string `json:"enable_pay_channels,omitempty"` // 可选, 商户可用该参数指定用户可使用的支付渠道,本期支持商户可支持三种支付渠道,余额宝(MONEY_FUND)、花呗(PCREDIT_PAY)以及芝麻信用(CREDITZHIMA)。商户可设置一种支付渠道,也可设置多种支付渠道。 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_28/alipay.fund.auth.order.voucher.create/ 资金授权发码接口
func (AliPayFundAuthOrderVoucherCreate) APIName ¶
func (this AliPayFundAuthOrderVoucherCreate) APIName() string
func (AliPayFundAuthOrderVoucherCreate) ExtJSONParamName ¶
func (this AliPayFundAuthOrderVoucherCreate) ExtJSONParamName() string
func (AliPayFundAuthOrderVoucherCreate) ExtJSONParamValue ¶
func (this AliPayFundAuthOrderVoucherCreate) ExtJSONParamValue() string
func (AliPayFundAuthOrderVoucherCreate) Params ¶
func (this AliPayFundAuthOrderVoucherCreate) Params() map[string]string
type AliPayFundAuthOrderVoucherCreateResponse ¶
type AliPayFundAuthOrderVoucherCreateResponse struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` OutOrderNo string `json:"out_order_no"` OutRequestNo string `json:"out_request_no"` CodeType string `json:"code_type"` CodeValue string `json:"code_value"` CodeURL string `json:"code_url"` } `json:"alipay_fund_auth_order_voucher_create_response"` Sign string `json:"sign"` }
type AliPayFundTransOrderQuery ¶
type AliPayFundTransOrderQuery struct { AppAuthToken string `json:"-"` // 可选 OutBizNo string `json:"out_biz_no,omitempty"` // 与 OrderId 二选一 OrderId string `json:"order_id,omitempty"` // 与 OutBizNo 二选一 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_28/alipay.fund.trans.order.query/ 查询转账订单接口请求参数
func (AliPayFundTransOrderQuery) APIName ¶
func (this AliPayFundTransOrderQuery) APIName() string
func (AliPayFundTransOrderQuery) ExtJSONParamName ¶
func (this AliPayFundTransOrderQuery) ExtJSONParamName() string
func (AliPayFundTransOrderQuery) ExtJSONParamValue ¶
func (this AliPayFundTransOrderQuery) ExtJSONParamValue() string
func (AliPayFundTransOrderQuery) Params ¶
func (this AliPayFundTransOrderQuery) Params() map[string]string
type AliPayFundTransOrderQueryResponse ¶
type AliPayFundTransOrderQueryResponse struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` OutBizNo string `json:"out_biz_no"` // 发起转账来源方定义的转账单据号。 该参数的赋值均以查询结果中 的 out_biz_no 为准。 如果查询失败,不返回该参数 OrderId string `json:"order_id"` // 支付宝转账单据号,查询失败不返回。 Status string `json:"status"` // 转账单据状态 PayDate string `json:"pay_date"` // 支付时间 ArrivalTimeEnd string `json:"arrival_time_end"` // 预计到账时间,转账到银行卡专用 OrderFree string `json:"order_fee"` // 预计收费金额(元),转账到银行卡专用 FailReason string `json:"fail_reason"` // 查询到的订单状态为FAIL失败或REFUND退票时,返回具体的原因。 ErrorCode string `json:"error_code"` // 查询失败时,本参数为错误代 码。 查询成功不返回。 对于退票订单,不返回该参数。 } `json:"alipay_fund_trans_order_query_response"` Sign string `json:"sign"` }
查询转账订单接口响应参数
func (*AliPayFundTransOrderQueryResponse) IsSuccess ¶
func (this *AliPayFundTransOrderQueryResponse) IsSuccess() bool
type AliPayFundTransToAccountTransfer ¶
type AliPayFundTransToAccountTransfer struct { AppAuthToken string `json:"-"` // 可选 OutBizNo string `json:"out_biz_no"` // 必选 商户转账唯一订单号 PayeeType string `json:"payee_type"` // 必选 收款方账户类型,"ALIPAY_LOGONID":支付宝帐号 PayeeAccount string `json:"payee_account"` // 必选 收款方账户。与payee_type配合使用 Amount string `json:"amount"` // 必选 转账金额,元 PayerShowName string `json:"payer_show_name"` // 可选 付款方显示姓名 PayeeRealName string `json:"payee_real_name"` // 可选 收款方真实姓名,如果本参数不为空,则会校验该账户在支付宝登记的实名是否与收款方真实姓名一致。 Remark string `json:"remark"` // 可选 转账备注,金额大于50000时必填 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_28/alipay.fund.trans.toaccount.transfer 单笔转账到支付宝账户接口请求结构
func (AliPayFundTransToAccountTransfer) APIName ¶
func (this AliPayFundTransToAccountTransfer) APIName() string
func (AliPayFundTransToAccountTransfer) ExtJSONParamName ¶
func (this AliPayFundTransToAccountTransfer) ExtJSONParamName() string
func (AliPayFundTransToAccountTransfer) ExtJSONParamValue ¶
func (this AliPayFundTransToAccountTransfer) ExtJSONParamValue() string
func (AliPayFundTransToAccountTransfer) Params ¶
func (this AliPayFundTransToAccountTransfer) Params() map[string]string
type AliPayFundTransToAccountTransferResponse ¶
type AliPayFundTransToAccountTransferResponse struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` OutBizNo string `json:"out_biz_no"` // 商户转账唯一订单号:发起转账来源方定义的转账单据号。请求时对应的参数,原样返回 OrderId string `json:"order_id"` // 支付宝转账单据号,成功一定返回,失败可能不返回也可能返回 PayDate string `json:"pay_date"` // 支付时间:格式为yyyy-MM-dd HH:mm:ss,仅转账成功返回 } `json:"alipay_fund_trans_toaccount_transfer_response"` Sign string `json:"sign"` }
单笔转账到支付宝账户接口响应参数
func (*AliPayFundTransToAccountTransferResponse) IsSuccess ¶
func (this *AliPayFundTransToAccountTransferResponse) IsSuccess() bool
type AliPayParam ¶
type AliPayParam interface { // 用于提供访问的 method APIName() string // 返回参数列表 Params() map[string]string // 返回扩展 JSON 参数的字段名称 ExtJSONParamName() string // 返回扩展 JSON 参数的字段值 ExtJSONParamValue() string }
AliPayParam 构造参数接口
type AliPayTradeAppPay ¶
type AliPayTradeAppPay struct { TradePay TimeExpire string `json:"time_expire,omitempty"` // 绝对超时时间,格式为yyyy-MM-dd HH:mm。 }
//////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.app.pay/
func (AliPayTradeAppPay) APIName ¶
func (this AliPayTradeAppPay) APIName() string
func (AliPayTradeAppPay) ExtJSONParamName ¶
func (this AliPayTradeAppPay) ExtJSONParamName() string
func (AliPayTradeAppPay) ExtJSONParamValue ¶
func (this AliPayTradeAppPay) ExtJSONParamValue() string
func (AliPayTradeAppPay) Params ¶
func (this AliPayTradeAppPay) Params() map[string]string
type AliPayTradeCancel ¶
type AliPayTradeCancel struct { AppAuthToken string `json:"-"` // 可选 NotifyURL string `json:"-"` // 可选 OutTradeNo string `json:"out_trade_no"` // 原支付请求的商户订单号,和支付宝交易号不能同时为空 TradeNo string `json:"trade_no"` // 支付宝交易号,和商户订单号不能同时为空 }
//////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.cancel/
func (AliPayTradeCancel) APIName ¶
func (this AliPayTradeCancel) APIName() string
func (AliPayTradeCancel) ExtJSONParamName ¶
func (this AliPayTradeCancel) ExtJSONParamName() string
func (AliPayTradeCancel) ExtJSONParamValue ¶
func (this AliPayTradeCancel) ExtJSONParamValue() string
func (AliPayTradeCancel) Params ¶
func (this AliPayTradeCancel) Params() map[string]string
type AliPayTradeCancelResponse ¶
type AliPayTradeCancelResponse struct { AliPayTradeCancelResponse struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 创建交易传入的商户订单号 RetryFlag string `json:"retry_flag"` // 是否需要重试 Action string `json:"action"` // 本次撤销触发的交易动作 close:关闭交易,无退款 refund:产生了退款 } `json:"alipay_trade_cancel_response"` Sign string `json:"sign"` }
func (*AliPayTradeCancelResponse) IsSuccess ¶
func (this *AliPayTradeCancelResponse) IsSuccess() bool
type AliPayTradeClose ¶
type AliPayTradeClose struct { AppAuthToken string `json:"-"` // 可选 NotifyURL string `json:"-"` // 可选 OutTradeNo string `json:"out_trade_no,omitempty"` // 与 TradeNo 二选一 TradeNo string `json:"trade_no,omitempty"` // 与 OutTradeNo 二选一 OperatorId string `json:"operator_id,omitempty"` // 可选 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.close/
func (AliPayTradeClose) APIName ¶
func (this AliPayTradeClose) APIName() string
func (AliPayTradeClose) ExtJSONParamName ¶
func (this AliPayTradeClose) ExtJSONParamName() string
func (AliPayTradeClose) ExtJSONParamValue ¶
func (this AliPayTradeClose) ExtJSONParamValue() string
func (AliPayTradeClose) Params ¶
func (this AliPayTradeClose) Params() map[string]string
type AliPayTradeCloseResponse ¶
type AliPayTradeCloseResponse struct { AliPayTradeClose struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` OutTradeNo string `json:"out_trade_no"` TradeNo string `json:"trade_no"` } `json:"alipay_trade_close_response"` Sign string `json:"sign"` }
func (*AliPayTradeCloseResponse) IsSuccess ¶
func (this *AliPayTradeCloseResponse) IsSuccess() bool
type AliPayTradeCreate ¶
type AliPayTradeCreate struct { TradePay AppAuthToken string `json:"-"` // 可选 DiscountableAmount string `json:"discountable_amount"` // 可打折金额. 参与优惠计算的金额,单位为元,精确到小数点后两位 BuyerId string `json:"buyer_id"` GoodsDetail []*GoodsDetailItem `json:"goods_detail,omitempty"` OperatorId string `json:"operator_id"` TerminalId string `json:"terminal_id"` }
//////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.create/
func (AliPayTradeCreate) APIName ¶
func (this AliPayTradeCreate) APIName() string
func (AliPayTradeCreate) ExtJSONParamName ¶
func (this AliPayTradeCreate) ExtJSONParamName() string
func (AliPayTradeCreate) ExtJSONParamValue ¶
func (this AliPayTradeCreate) ExtJSONParamValue() string
func (AliPayTradeCreate) Params ¶
func (this AliPayTradeCreate) Params() map[string]string
type AliPayTradeCreateResponse ¶
type AliPayTradeCreateResponse struct { AliPayTradeCreateResponse struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` } `json:"alipay_trade_create_response"` Sign string `json:"sign"` }
func (AliPayTradeCreateResponse) IsSuccess ¶
func (c AliPayTradeCreateResponse) IsSuccess() bool
IsSuccess 返回成功
type AliPayTradeOrderInfoSync ¶
type AliPayTradeOrderInfoSync struct { AppAuthToken string `json:"-"` // 可选 OutRequestNo string `json:"out_request_no"` // 必选 标识一笔交易多次请求,同一笔交易多次信息同步时需要保证唯一 BizType string `json:"biz_type"` // 必选 交易信息同步对应的业务类型,具体值与支付宝约定;信用授权场景下传CREDIT_AUTH TradeNo string `json:"trade_no"` // 可选 支付宝交易号,和商户订单号不能同时为空 OrderBizInfo string `json:"order_biz_info"` // 可选 商户传入同步信息,具体值要和支付宝约定;用于芝麻信用租车、单次授权等信息同步场景,格式为json格式 }
//////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.orderinfo.sync/
func (AliPayTradeOrderInfoSync) APIName ¶
func (this AliPayTradeOrderInfoSync) APIName() string
func (AliPayTradeOrderInfoSync) ExtJSONParamName ¶
func (this AliPayTradeOrderInfoSync) ExtJSONParamName() string
func (AliPayTradeOrderInfoSync) ExtJSONParamValue ¶
func (this AliPayTradeOrderInfoSync) ExtJSONParamValue() string
func (AliPayTradeOrderInfoSync) Params ¶
func (this AliPayTradeOrderInfoSync) Params() map[string]string
type AliPayTradeOrderInfoSyncResponse ¶
type AliPayTradeOrderInfoSyncResponse struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` TradeNo string `json:"trade_no"` OutTradeNo string `json:"out_trade_no"` BuyerUserId string `json:"buyer_user_id"` } `json:"alipay_trade_orderinfo_sync_response"` Sign string `json:"sign"` }
type AliPayTradeOrderSettle ¶
type AliPayTradeOrderSettle struct { AppAuthToken string `json:"-"` // 可选 OutRequestNo string `json:"out_request_no"` // 必须 结算请求流水号 开发者自行生成并保证唯一性 TradeNo string `json:"trade_no"` // 必须 支付宝订单号 RoyaltyParameters []*RoyaltyParameter `json:"royalty_parameters"` // 必须 分账明细信息 OperatorId string `json:"operator_id"` //可选 操作员id }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.order.settle
func (AliPayTradeOrderSettle) APIName ¶
func (this AliPayTradeOrderSettle) APIName() string
func (AliPayTradeOrderSettle) ExtJSONParamName ¶
func (this AliPayTradeOrderSettle) ExtJSONParamName() string
func (AliPayTradeOrderSettle) ExtJSONParamValue ¶
func (this AliPayTradeOrderSettle) ExtJSONParamValue() string
func (AliPayTradeOrderSettle) Params ¶
func (this AliPayTradeOrderSettle) Params() map[string]string
type AliPayTradePagePay ¶
type AliPayTradePagePay struct { TradePay AuthToken string `json:"auth_token,omitempty"` // 针对用户授权接口,获取用户相关数据时,用于标识用户授权关系 GoodsDetail string `json:"goods_detail,omitempty"` // 订单包含的商品列表信息,Json格式,详见商品明细说明 QRPayMode string `json:"qr_pay_mode,omitempty"` // PC扫码支付的方式,支持前置模式和跳转模式。 QRCodeWidth string `json:"qrcode_width,omitempty"` // 商户自定义二维码宽度 注:qr_pay_mode=4时该参数生效 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/270/alipay.trade.page.pay
func (AliPayTradePagePay) APIName ¶
func (this AliPayTradePagePay) APIName() string
func (AliPayTradePagePay) ExtJSONParamName ¶
func (this AliPayTradePagePay) ExtJSONParamName() string
func (AliPayTradePagePay) ExtJSONParamValue ¶
func (this AliPayTradePagePay) ExtJSONParamValue() string
func (AliPayTradePagePay) Params ¶
func (this AliPayTradePagePay) Params() map[string]string
type AliPayTradePay ¶
type AliPayTradePay struct { TradePay AppAuthToken string `json:"-"` // 可选 Scene string `json:"scene"` // 必须 支付场景 条码支付,取值:bar_code 声波支付,取值:wave_code bar_code,wave_code AuthCode string `json:"auth_code"` // 必须 支付授权码 BuyerId string `json:"buyer_id"` // 可选 家的支付宝用户id,如果为空,会从传入了码值信息中获取买家ID TransCurrency string `json:"trans_currency,omitempty"` SettleCurrency string `json:"settle_currency,omitempty"` DiscountableAmount string `json:"discountable_amount,omitempty"` // 可选 参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。 如果该值未传入,但传入了【订单总金额】和【不可打折金额】,则该值默认为【订单总金额】-【不可打折金额】 GoodsDetail []*GoodsDetailItem `json:"goods_detail,omitempty"` // 可选 订单包含的商品列表信息,Json格式,其它说明详见商品明细说明 OperatorId string `json:"operator_id,omitempty"` // 可选 商户操作员编号 TerminalId string `json:"terminal_id,omitempty"` // 可选 商户机具终端编号 AuthConfirmMode string `json:"auth_confirm_mode,omitempty"` TerminalParams string `json:"terminal_params,omitempty"` }
//////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.pay/
func (AliPayTradePay) APIName ¶
func (this AliPayTradePay) APIName() string
func (AliPayTradePay) ExtJSONParamName ¶
func (this AliPayTradePay) ExtJSONParamName() string
func (AliPayTradePay) ExtJSONParamValue ¶
func (this AliPayTradePay) ExtJSONParamValue() string
func (AliPayTradePay) Params ¶
func (this AliPayTradePay) Params() map[string]string
type AliPayTradePayResponse ¶
type AliPayTradePayResponse struct { AliPayTradePay struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` BuyerLogonId string `json:"buyer_logon_id"` // 买家支付宝账号 BuyerPayAmount string `json:"buyer_pay_amount"` // 买家实付金额,单位为元,两位小数。 BuyerUserId string `json:"buyer_user_id"` // 买家在支付宝的用户id CardBalance string `json:"card_balance"` // 支付宝卡余额 DiscountGoodsDetail string `json:"discount_goods_detail"` // 本次交易支付所使用的单品券优惠的商品优惠信息 FundBillList []*FundBill `json:"fund_bill_list,omitempty"` // 交易支付使用的资金渠道 GmtPayment string `json:"gmt_payment"` InvoiceAmount string `json:"invoice_amount"` // 交易中用户支付的可开具发票的金额,单位为元,两位小数。 OutTradeNo string `json:"out_trade_no"` // 创建交易传入的商户订单号 TradeNo string `json:"trade_no"` // 支付宝交易号 PointAmount string `json:"point_amount"` // 积分支付的金额,单位为元,两位小数。 ReceiptAmount string `json:"receipt_amount"` // 实收金额,单位为元,两位小数 StoreName string `json:"store_name"` // 发生支付交易的商户门店名称 TotalAmount string `json:"total_amount"` // 发该笔退款所对应的交易的订单金额 VoucherDetailList []*VoucherDetail `json:"voucher_detail_list,omitempty"` // 本交易支付时使用的所有优惠券信息 } `json:"alipay_trade_pay_response"` Sign string `json:"sign"` }
func (*AliPayTradePayResponse) IsSuccess ¶
func (this *AliPayTradePayResponse) IsSuccess() bool
type AliPayTradePreCreate ¶
type AliPayTradePreCreate struct { TradePay AppAuthToken string `json:"-"` // 可选 DiscountableAmount string `json:"discountable_amount"` // 可选 可打折金额. 参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 如果该值未传入,但传入了【订单总金额】,【不可打折金额】则该值默认为【订单总金额】-【不可打折金额】 GoodsDetail []*GoodsDetailItem `json:"goods_detail,omitempty"` // 可选 订单包含的商品列表信息.Json格式. 其它说明详见:“商品明细说明” OperatorId string `json:"operator_id"` // 可选 商户操作员编号 TerminalId string `json:"terminal_id"` // 可选 商户机具终端编号 }
//////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.precreate/
func (AliPayTradePreCreate) APIName ¶
func (this AliPayTradePreCreate) APIName() string
func (AliPayTradePreCreate) ExtJSONParamName ¶
func (this AliPayTradePreCreate) ExtJSONParamName() string
func (AliPayTradePreCreate) ExtJSONParamValue ¶
func (this AliPayTradePreCreate) ExtJSONParamValue() string
func (AliPayTradePreCreate) Params ¶
func (this AliPayTradePreCreate) Params() map[string]string
type AliPayTradePreCreateResponse ¶
type AliPayTradePreCreateResponse struct { AliPayPreCreateResponse struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` OutTradeNo string `json:"out_trade_no"` // 创建交易传入的商户订单号 QRCode string `json:"qr_code"` // 当前预下单请求生成的二维码码串,可以用二维码生成工具根据该码串值生成对应的二维码 } `json:"alipay_trade_precreate_response"` Sign string `json:"sign"` }
func (*AliPayTradePreCreateResponse) IsSuccess ¶
func (this *AliPayTradePreCreateResponse) IsSuccess() bool
type AliPayTradeQuery ¶
type AliPayTradeQuery struct { AppAuthToken string `json:"-"` // 可选 OutTradeNo string `json:"out_trade_no,omitempty"` // 订单支付时传入的商户订单号, 与 TradeNo 二选一 TradeNo string `json:"trade_no,omitempty"` // 支付宝交易号 }
AliPayTradeQuery 交易查询 https://docs.open.alipay.com/api_1/alipay.trade.query/
func (AliPayTradeQuery) APIName ¶
func (this AliPayTradeQuery) APIName() string
func (AliPayTradeQuery) ExtJSONParamName ¶
func (this AliPayTradeQuery) ExtJSONParamName() string
func (AliPayTradeQuery) ExtJSONParamValue ¶
func (this AliPayTradeQuery) ExtJSONParamValue() string
func (AliPayTradeQuery) Params ¶
func (this AliPayTradeQuery) Params() map[string]string
type AliPayTradeQueryResponse ¶
type AliPayTradeQueryResponse struct { AliPayTradeQuery struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` AuthTradePayMode string `json:"auth_trade_pay_mode"` // 预授权支付模式,该参数仅在信用预授权支付场景下返回。信用预授权支付:CREDIT_PREAUTH_PAY BuyerLogonId string `json:"buyer_logon_id"` // 买家支付宝账号 BuyerPayAmount string `json:"buyer_pay_amount"` // 买家实付金额,单位为元,两位小数。 BuyerUserId string `json:"buyer_user_id"` // 买家在支付宝的用户id BuyerUserType string `json:"buyer_user_type"` // 买家用户类型。CORPORATE:企业用户;PRIVATE:个人用户。 InvoiceAmount string `json:"invoice_amount"` // 交易中用户支付的可开具发票的金额,单位为元,两位小数。 OutTradeNo string `json:"out_trade_no"` // 商家订单号 PointAmount string `json:"point_amount"` // 积分支付的金额,单位为元,两位小数。 ReceiptAmount string `json:"receipt_amount"` // 实收金额,单位为元,两位小数 SendPayDate string `json:"send_pay_date"` // 本次交易打款给卖家的时间 TotalAmount string `json:"total_amount"` // 交易的订单金额 TradeNo string `json:"trade_no"` // 支付宝交易号 TradeStatus string `json:"trade_status"` // 交易状态 DiscountAmount string `json:"discount_amount"` // 平台优惠金额 FundBillList []*FundBill `json:"fund_bill_list,omitempty"` // 交易支付使用的资金渠道 MdiscountAmount string `json:"mdiscount_amount"` // 商家优惠金额 PayAmount string `json:"pay_amount"` // 支付币种订单金额 PayCurrency string `json:"pay_currency"` // 订单支付币种 SettleAmount string `json:"settle_amount"` // 结算币种订单金额 SettleCurrency string `json:"settle_currency"` // 订单结算币种 SettleTransRate string `json:"settle_trans_rate"` // 结算币种兑换标价币种汇率 StoreId string `json:"store_id"` // 商户门店编号 StoreName string `json:"store_name"` // 请求交易支付中的商户店铺的名称 TerminalId string `json:"terminal_id"` // 商户机具终端编号 TransCurrency string `json:"trans_currency"` // 标价币种 TransPayRate string `json:"trans_pay_rate"` // 标价币种兑换支付币种汇率 DiscountGoodsDetail string `json:"discount_goods_detail"` // 本次交易支付所使用的单品券优惠的商品优惠信息 IndustrySepcDetail string `json:"industry_sepc_detail"` // 行业特殊信息(例如在医保卡支付业务中,向用户返回医疗信息)。 VoucherDetailList []*VoucherDetail `json:"voucher_detail_list,omitempty"` // 本交易支付时使用的所有优惠券信息 } `json:"alipay_trade_query_response"` Sign string `json:"sign"` }
func (*AliPayTradeQueryResponse) IsSuccess ¶
func (this *AliPayTradeQueryResponse) IsSuccess() bool
type AliPayTradeRefund ¶
type AliPayTradeRefund struct { AppAuthToken string `json:"-"` // 可选 OutTradeNo string `json:"out_trade_no,omitempty"` // 与 TradeNo 二选一 TradeNo string `json:"trade_no,omitempty"` // 与 OutTradeNo 二选一 RefundAmount string `json:"refund_amount"` // 必须 需要退款的金额,该金额不能大于订单金额,单位为元,支持两位小数 RefundReason string `json:"refund_reason"` // 可选 退款的原因说明 RefundCurrency string `json:"refund_currency"` // 可选 退款单位:人民币,USD OutRequestNo string `json:"out_request_no"` // 可选 标识一次退款请求,同一笔交易多次退款需要保证唯一,如需部分退款,则此参数必传。 OperatorId string `json:"operator_id"` // 可选 商户的操作员编号 StoreId string `json:"store_id"` // 可选 商户的门店编号 TerminalId string `json:"terminal_id"` // 可选 商户的终端编号 }
////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.refund/
func (AliPayTradeRefund) APIName ¶
func (this AliPayTradeRefund) APIName() string
func (AliPayTradeRefund) ExtJSONParamName ¶
func (this AliPayTradeRefund) ExtJSONParamName() string
func (AliPayTradeRefund) ExtJSONParamValue ¶
func (this AliPayTradeRefund) ExtJSONParamValue() string
func (AliPayTradeRefund) Params ¶
func (this AliPayTradeRefund) Params() map[string]string
type AliPayTradeRefundResponse ¶
type AliPayTradeRefundResponse struct { AliPayTradeRefund struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 商户订单号 BuyerLogonId string `json:"buyer_logon_id"` // 用户的登录id BuyerUserId string `json:"buyer_user_id"` // 买家在支付宝的用户id FundChange string `json:"fund_change"` // 本次退款是否发生了资金变化 RefundFee string `json:"refund_fee"` // 退款总金额 GmtRefundPay string `json:"gmt_refund_pay"` // 退款支付时间 StoreName string `json:"store_name"` // 交易在支付时候的门店名称 RefundDetailItemList []*RefundDetailItem `json:"refund_detail_item_list,omitempty"` // 退款使用的资金渠道 } `json:"alipay_trade_refund_response"` Sign string `json:"sign"` }
func (*AliPayTradeRefundResponse) IsSuccess ¶
func (this *AliPayTradeRefundResponse) IsSuccess() bool
type AliVerifyResp ¶
type AliVerifyResp struct { XMLName xml.Name `xml:"alipay"` Response struct { BizContent string `xml:"biz_content"` Success string `xml:"success"` } `xml:"response"` Sign string `xml:"sign"` SignType string `xml:"sign_type"` }
AliVerifyResp 返回给阿里
type Article ¶
type Article struct { Title string `json:"title,omitemtpy"` Desc string `json:"desc"` ImageURL string `json:"image_url"` URL string `json:"url"` ActionName string `json:"action_name,omitempty"` //链接文字 }
Article 图文
type BillDownloadURLQuery ¶
type BillDownloadURLQuery struct { AppAuthToken string `json:"-"` // 可选 BillType string `json:"bill_type"` BillDate string `json:"bill_date"` }
https://docs.open.alipay.com/api_15/alipay.data.dataservice.bill.downloadurl.query
func (BillDownloadURLQuery) APIName ¶
func (this BillDownloadURLQuery) APIName() string
func (BillDownloadURLQuery) ExtJSONParamName ¶
func (this BillDownloadURLQuery) ExtJSONParamName() string
func (BillDownloadURLQuery) ExtJSONParamValue ¶
func (this BillDownloadURLQuery) ExtJSONParamValue() string
func (BillDownloadURLQuery) Params ¶
func (this BillDownloadURLQuery) Params() map[string]string
type BillDownloadURLQueryResponse ¶
type BillDownloadURLQueryResponse struct { AliPayDataServiceBillDownloadURLQueryResponse struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` BillDownloadUrl string `json:"bill_download_url"` } `json:"alipay_data_dataservice_bill_downloadurl_query_response"` Sign string `json:"sign"` }
type Button ¶
type Button struct { Name string `json:"name,omitempty"` ActionType string `json:"action_type,omitempty"` ActionParam string `json:"action_param,omitempty"` Icon string `json:"icon,omitempty"` SubButtons []*Button `json:"sub_button,omitempty"` }
Button 菜单按钮
type Context ¶
type Context struct { HeadColor string `json:"head_color"` //顶部色条的色值 URL string `json:"url"` // 可选, 用户点击后跳转的URL, 该URL必须处于开发者在公众平台网站中设置的域中 ActionName string `json:"action_name"` //底部链接描述文字,如“查看详情” Keyword1 DataItem `json:"keyword1,omitempty"` Keyword2 DataItem `json:"keyword2,omitempty"` Keyword3 DataItem `json:"keyword3,omitempty"` Keyword4 DataItem `json:"keyword4,omitempty"` Keyword5 DataItem `json:"keyword5,omitempty"` Keyword6 DataItem `json:"keyword6,omitempty"` Keyword7 DataItem `json:"keyword7,omitempty"` First DataItem `json:"first,omitempty"` Remark DataItem `json:"remark,omitempty"` }
Context 消息上下文
type ExtendParamsItem ¶
type GetTemplateReq ¶
type GetTemplateReq struct { TemplateID string `json:"template_id"` //公用模版ID:TM000000223 AppAuthToken string `json:"-"` //授权凭证 }
GetTemplateReq 领取模版 https://docs.open.alipay.com/api_6/alipay.open.public.template.message.get/
func (GetTemplateReq) ExtJSONParamName ¶
func (c GetTemplateReq) ExtJSONParamName() string
ExtJSONParamName ext字段名字
func (GetTemplateReq) ExtJSONParamValue ¶
func (c GetTemplateReq) ExtJSONParamValue() string
ExtJSONParamValue ext字段内容
type GetTemplateResp ¶
type GetTemplateResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` Template string `json:"template"` MsgTemplateID string `json:"msg_template_id"` } `json:"alipay_open_public_template_message_get_response"` Sign string `json:"sign"` }
GetTemplateResp 消息响应
type GoodsDetailItem ¶
type GoodsDetailItem struct { GoodsId string `json:"goods_id"` AliPayGoodsId string `json:"alipay_goods_id"` GoodsName string `json:"goods_name"` Quantity string `json:"quantity"` Price string `json:"price"` GoodsCategory string `json:"goods_category"` Body string `json:"body"` ShowUrl string `json:"show_url"` }
type GroupMessageReq ¶
type GroupMessageReq struct { AppAuthToken string `json:"-"` //授权凭证 MsgType string `json:"msg_type"` //消息类型,text:文本消息,image-text:图文消息 Articles []*Article `json:"articles,omitempty"` Text *Text `json:"text,omitempty"` }
GroupMessageReq 群发消息 https://docs.open.alipay.com/api_6/alipay.open.public.message.total.send/
func (GroupMessageReq) ExtJSONParamName ¶
func (c GroupMessageReq) ExtJSONParamName() string
ExtJSONParamName ext字段名字
func (GroupMessageReq) ExtJSONParamValue ¶
func (c GroupMessageReq) ExtJSONParamValue() string
ExtJSONParamValue ext字段内容
type GroupMessageResp ¶
type GroupMessageResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` } `json:"alipay_open_public_message_total_send_response"` Sign string `json:"sign"` }
GroupMessageResp 响应
type IndustryQueryReq ¶
type IndustryQueryReq struct {
AppAuthToken string `json:"-"` //授权凭证
}
IndustryQueryReq 查看是否设置行业 https://docs.open.alipay.com/api_6/alipay.open.public.setting.category.query/
func (IndustryQueryReq) ExtJSONParamName ¶
func (c IndustryQueryReq) ExtJSONParamName() string
ExtJSONParamName ext字段名字
func (IndustryQueryReq) ExtJSONParamValue ¶
func (c IndustryQueryReq) ExtJSONParamValue() string
ExtJSONParamValue ext字段内容
type IndustryQueryResp ¶
type IndustryQueryResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` PrimaryCategory string `json:"primary_category"` SecondaryCategory string `json:"secondary_category"` } `json:"alipay_open_public_setting_category_query_response"` Sign string `json:"sign"` }
IndustryQueryResp 响应
type IndustryReq ¶
type IndustryReq struct { AppAuthToken string `json:"-"` //授权凭证 PrimaryIndustryName string `json:"primary_industry_name"` PrimaryIndustryCode string `json:"primary_industry_code"` SecondaryIndustryCode string `json:"secondary_industry_code"` SecondaryIndustryName string `json:"secondary_industry_name"` }
IndustryReq 设置行业 https://docs.open.alipay.com/api_6/alipay.open.public.template.message.industry.modify
func (IndustryReq) ExtJSONParamName ¶
func (c IndustryReq) ExtJSONParamName() string
ExtJSONParamName ext字段名字
func (IndustryReq) ExtJSONParamValue ¶
func (c IndustryReq) ExtJSONParamValue() string
ExtJSONParamValue ext字段内容
type IndustryResp ¶
type IndustryResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` } `json:"alipay_open_public_template_message_industry_modify_response"` Sign string `json:"sign"` }
IndustryResp 响应
type InfoReq ¶
type InfoReq struct {
AppAuthToken string `json:"-"`
}
InfoReq 基本信息
func (InfoReq) ExtJSONParamName ¶
ExtJSONParamName ext字段名字
func (InfoReq) ExtJSONParamValue ¶
ExtJSONParamValue ext字段内容
type InfoResp ¶
type InfoResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` AppName string `json:"app_name"` LogoURL string `json:"logo_url"` } `json:"alipay_open_public_info_query_response"` Sign string `json:"sign"` }
InfoResp 请求响应
type Menu ¶
Menu https://docs.open.alipay.com/api_6/alipay.open.public.menu.modify 或 https://docs.open.alipay.com/api_6/alipay.open.public.menu.create/
func (Menu) ExtJSONParamName ¶
ExtJSONParamName biz_content内容
type MenuCreateResp ¶
type MenuCreateResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` MenuKey string `json:"menu_key"` } `json:"alipay_open_public_menu_create_response"` Sign string `json:"sign"` }
MenuCreateResp 响应
type MenuModifyResp ¶
type MenuModifyResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` MenuKey string `json:"menu_key"` } `json:"alipay_open_public_menu_modify_response"` Sign string `json:"sign"` }
MenuModifyResp 响应
type QRCodeSetReq ¶
type QRCodeSetReq struct { AppAuthToken string `json:"-"` CodeInfo struct { Scene struct { SceneID string `json:"scene_id,omitempty"` } `json:"scene,omitempty"` GotoURL string `json:"goto_url,omitempty"` } `json:"code_info,omitempty"` CodeType string `json:"code_type,omitempty"` ExpireSecond string `json:"expire_second,omitempty"` ShowLogo string `json:"show_logo,omitempty"` // 是否显示logo:Y / N }
QRCodeSetReq 设置推广码 https://docs.open.alipay.com/api_6/alipay.open.public.qrcode.create/
func (QRCodeSetReq) ExtJSONParamName ¶
func (c QRCodeSetReq) ExtJSONParamName() string
ExtJSONParamName ext字段名字
func (QRCodeSetReq) ExtJSONParamValue ¶
func (c QRCodeSetReq) ExtJSONParamValue() string
ExtJSONParamValue ext字段内容
type QRCodeSetResp ¶
type QRCodeSetResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` CodeImg string `json:"code_img"` } `json:"alipay_open_public_qrcode_create_response"` Sign string `json:"sign"` }
QRCodeSetResp 设置推广码
type QueryMenuReq ¶
type QueryMenuReq struct { }
QueryMenuReq 查询菜单
func (QueryMenuReq) ExtJSONParamName ¶
func (c QueryMenuReq) ExtJSONParamName() string
ExtJSONParamName biz_content内容
func (QueryMenuReq) ExtJSONParamValue ¶
func (c QueryMenuReq) ExtJSONParamValue() string
ExtJSONParamValue 内容
type QueryMenuResp ¶
type QueryMenuResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` Menus []*Menu `json:"menus"` } `json:"alipay_open_public_menu_batchquery_response"` Sign string `json:"sign"` }
QueryMenuResp 查询返回内容
type RefundDetailItem ¶
type RoyaltyDetailInfoItem ¶
type RoyaltyDetailInfoItem struct { SerialNo string `json:"serial_no"` TransInType string `json:"trans_in_type"` BatchNo string `json:"batch_no"` OutRelationId string `json:"out_relation_id"` TransOutType string `json:"trans_out_type"` TransOut string `json:"trans_out"` TransIn string `json:"trans_in"` Amount string `json:"amount"` Desc string `json:"desc"` AmountPercentage string `json:"amount_percentage"` AliPayStoreId string `json:"alipay_store_id"` }
type RoyaltyInfo ¶
type RoyaltyInfo struct { RoyaltyType string `json:"royalty_type"` RoyaltyDetailInfo []*RoyaltyDetailInfoItem `json:"royalty_detail_infos,omitempty"` }
type RoyaltyParameter ¶
type RoyaltyParameter struct { TransOut string `json:"trans_out"` // 可选 分账支出方账户,类型为userId,本参数为要分账的支付宝账号对应的支付宝唯一用户号。以2088开头的纯16位数字。 TransIn string `json:"trans_in"` // 可选 分账收入方账户,类型为userId,本参数为要分账的支付宝账号对应的支付宝唯一用户号。以2088开头的纯16位数字。 Amount float64 `json:"amount"` // 可选 分账的金额,单位为元 AmountPercentage float64 `json:"amount_percentage"` // 可选 分账信息中分账百分比。取值范围为大于0,少于或等于100的整数。 Desc string `json:"desc"` // 可选 分账描述 }
type SendMessageReq ¶
type SendMessageReq struct { AppAuthToken string `json:"-"` //授权凭证 ToUserID string `json:"to_user_id"` // 必须, ali_user_id Template Template `json:"template"` //必填,消息内容 }
SendMessageReq 发送的模板消息内容 https://docs.open.alipay.com/api_6/alipay.open.public.message.single.send/
func (SendMessageReq) ExtJSONParamName ¶
func (c SendMessageReq) ExtJSONParamName() string
ExtJSONParamName ext字段名字
func (SendMessageReq) ExtJSONParamValue ¶
func (c SendMessageReq) ExtJSONParamValue() string
ExtJSONParamValue ext字段内容
type SendMessageResp ¶
type SendMessageResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"sub_code"` SubMsg string `json:"sub_msg"` } `json:"alipay_open_public_message_single_send_response"` Sign string `json:"sign"` }
SendMessageResp 消息响应
type SubMerchantItem ¶
type SubMerchantItem struct {
MerchantId string `json:"merchant_id"`
}
type TradeNotification ¶
type TradeNotification struct { AuthAppId string `json:"auth_app_id"` // App Id NotifyTime string `json:"notify_time"` // 通知时间 NotifyType string `json:"notify_type"` // 通知类型 NotifyId string `json:"notify_id"` // 通知校验ID AppId string `json:"app_id"` // 开发者的app_id Charset string `json:"charset"` // 编码格式 Version string `json:"version"` // 接口版本 SignType string `json:"sign_type"` // 签名类型 Sign string `json:"sign"` // 签名 TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 商户订单号 OutBizNo string `json:"out_biz_no"` // 商户业务号 BuyerId string `json:"buyer_id"` // 买家支付宝用户号 BuyerLogonId string `json:"buyer_logon_id"` // 买家支付宝账号 SellerId string `json:"seller_id"` // 卖家支付宝用户号 SellerEmail string `json:"seller_email"` // 卖家支付宝账号 TradeStatus string `json:"trade_status"` // 交易状态 TotalAmount string `json:"total_amount"` // 订单金额 ReceiptAmount string `json:"receipt_amount"` // 实收金额 InvoiceAmount string `json:"invoice_amount"` // 开票金额 BuyerPayAmount string `json:"buyer_pay_amount"` // 付款金额 PointAmount string `json:"point_amount"` // 集分宝金额 RefundFee string `json:"refund_fee"` // 总退款金额 Subject string `json:"subject"` // 总退款金额 Body string `json:"body"` // 商品描述 GmtCreate string `json:"gmt_create"` // 交易创建时间 GmtPayment string `json:"gmt_payment"` // 交易付款时间 GmtRefund string `json:"gmt_refund"` // 交易退款时间 GmtClose string `json:"gmt_close"` // 交易结束时间 FundBillList string `json:"fund_bill_list"` // 支付金额信息 PassbackParams string `json:"passback_params"` // 回传参数 VoucherDetailList string `json:"voucher_detail_list"` // 优惠券信息 }
func GetTradeNotification ¶
func GetTradeNotification(req *http.Request, aliPayPublicKey []byte) (noti *TradeNotification, err error)
type TradePay ¶
type TradePay struct { NotifyURL string `json:"-"` ReturnURL string `json:"-"` // biz content,这四个参数是必须的 Subject string `json:"subject"` // 订单标题 OutTradeNo string `json:"out_trade_no"` // 商户订单号,64个字符以内、可包含字母、数字、下划线;需保证在商户端不重复 TotalAmount string `json:"total_amount"` // 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] ProductCode string `json:"product_code"` // 销售产品码,与支付宝签约的产品码名称。 注:目前仅支持FAST_INSTANT_TRADE_PAY Body string `json:"body,omitempty"` // 订单描述 BusinessParams string `json:"business_params,omitempty"` // 商户传入业务信息,具体值要和支付宝约定,应用于安全,营销等参数直传场景,格式为json格式 DisablePayChannels string `json:"disable_pay_channels,omitempty"` // 禁用渠道,用户不可用指定渠道支付 当有多个渠道时用“,”分隔 注,与enable_pay_channels互斥 EnablePayChannels string `json:"enable_pay_channels,omitempty"` // 可用渠道,用户只能在指定渠道范围内支付 当有多个渠道时用“,”分隔 注,与disable_pay_channels互斥 //ExtUserInfo string `json:"ext_user_info,omitempty"` // 外部指定买家 ExtendParams string `json:"extend_params,omitempty"` // 业务扩展参数,详见下面的“业务扩展参数说明” GoodsType string `json:"goods_type,omitempty"` // 商品主类型:0—虚拟类商品,1—实物类商品 注:虚拟类商品不支持使用花呗渠道 InvoiceInfo string `json:"invoice_info,omitempty"` // 开票信息 PassbackParams string `json:"passback_params,omitempty"` // 公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付宝会在异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付宝 PromoParams string `json:"promo_params,omitempty"` // 优惠参数 注:仅与支付宝协商后可用 RoyaltyInfo string `json:"royalty_info,omitempty"` // 描述分账信息,json格式,详见分账参数说明 SellerId string `json:"seller_id,omitempty"` // 收款支付宝用户ID。 如果该值为空,则默认为商户签约账号对应的支付宝用户ID SettleInfo string `json:"settle_info,omitempty"` // 描述结算信息,json格式,详见结算参数说明 SpecifiedChannel string `json:"specified_channel,omitempty"` // 指定渠道,目前仅支持传入pcredit 若由于用户原因渠道不可用,用户可选择是否用其他渠道支付。 注:该参数不可与花呗分期参数同时传入 StoreId string `json:"store_id,omitempty"` // 商户门店编号。该参数用于请求参数中以区分各门店,非必传项。 SubMerchant string `json:"sub_merchant,omitempty"` // 间连受理商户信息体,当前只对特殊银行机构特定场景下使用此字段 TimeoutExpress string `json:"timeout_express,omitempty"` // 该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。 }
TradePay 支付
type TradeWapPay ¶
type TradeWapPay struct { TradePay QuitURL string `json:"quit_url,omitempty"` AuthToken string `json:"auth_token,omitempty"` // 针对用户授权接口,获取用户相关数据时,用于标识用户授权关系 TimeExpire string `json:"time_expire,omitempty"` // 绝对超时时间,格式为yyyy-MM-dd HH:mm。 }
TradeWapPay h5支付 https://docs.open.alipay.com/api_1/alipay.trade.wap.pay/
func (TradeWapPay) ExtJSONParamName ¶
func (c TradeWapPay) ExtJSONParamName() string
ExtJSONParamName json
func (TradeWapPay) ExtJSONParamValue ¶
func (c TradeWapPay) ExtJSONParamValue() string
ExtJSONParamValue biz_content内容
type UserInfoReq ¶
type UserInfoReq struct {
AuthToken string `json:"auth_token"` //对应到access_token
}
UserInfoReq 用户详情请求
func (UserInfoReq) ExtJSONParamName ¶
func (c UserInfoReq) ExtJSONParamName() string
ExtJSONParamName 返回名称
func (UserInfoReq) ExtJSONParamValue ¶
func (c UserInfoReq) ExtJSONParamValue() string
ExtJSONParamValue 返回内容
type UserInfoResp ¶
type UserInfoResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` UserID string `json:"user_id"` Avatar string `json:"avatar"` Province string `json:"province"` City string `json:"city"` IsCertified string `json:"is_certified"` Nickname string `json:"nick_name"` UserStatus string `json:"user_status"` UserType string `json:"user_type"` IsStudentCertified string `json:"is_student_certified"` Gender string `json:"gender"` // 性别 } `json:"alipay_user_info_share_response"` Sign string `json:"sign"` }
UserInfoResp 返回
type UserReq ¶
type UserReq struct { GrantType string `json:"grant_type"` //authorization_code或refresh_token Code string `json:"code,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` }
UserReq 获取access_token及UserID
func (UserReq) ExtJSONParamValue ¶
ExtJSONParamValue 返回内容
type UserResp ¶
type UserResp struct { Body struct { Code string `json:"code"` Msg string `json:"msg"` AccessToken string `json:"access_token"` UserID string `json:"user_id"` AlipayUserID string `json:"alipay_user_id"` //用户的open_id(已废弃,请勿使用) ExpiresIn int `json:"expires_in"` //令牌有效期:300秒 ReExpiresIn int `json:"re_expires_in"` // 刷新令牌有效期:300秒 RefreshToken string `json:"refresh_token"` // 刷新令牌 } `json:"alipay_system_oauth_token_response"` Sign string `json:"sign"` }
UserResp 返回值
type VoucherDetail ¶
type VoucherDetail struct { Id string `json:"id"` // 券id Name string `json:"name"` // 券名称 Type string `json:"type"` // 当前有三种类型: ALIPAY_FIX_VOUCHER - 全场代金券, ALIPAY_DISCOUNT_VOUCHER - 折扣券, ALIPAY_ITEM_VOUCHER - 单品优惠 Amount string `json:"amount"` // 优惠券面额,它应该会等于商家出资加上其他出资方出资 MerchantContribute string `json:"merchant_contribute"` // 商家出资(特指发起交易的商家出资金额) OtherContribute string `json:"other_contribute"` // 其他出资方出资金额,可能是支付宝,可能是品牌商,或者其他方,也可能是他们的一起出资 Memo string `json:"memo"` // 优惠券备注信息 }