Documentation ¶
Index ¶
- Constants
- func GetOpenAuthTokenAppUrlBatch(isProd bool, appId string, applicationTypes []string, redirectUri string) (result string)
- func GetOpenAuthTokenAppUrlSingle(isProd bool, appId string, redirectUri string) (result string)
- func IsValidAuthCode(authcode string) (ok bool)
- type BodyMap
- type BusinessParam
- type Client
- func (Client) ConvertToBodyMap(params interface{}) (body BodyMap)
- func (c Client) DataBillSellQuery(body DataBillSellQueryBody) (aliRsp DataBillSellQueryResponse, err error)
- func (c Client) FormatPrivateKey(privateKey string) string
- func (c Client) FormatPublicKey(publicKey string) string
- func (Client) FormatURLParam(body BodyMap) string
- func (Client) GenerateBizContent(body interface{}) string
- func (c Client) NotifyPay(bodyStr string) (params NotifyPayParams, origin map[string]interface{}, err error)
- func (c Client) OpenAuthTokenApp(body OpenAuthTokenAppBody) (aliRsp OpenAuthTokenAppResponse, err error)
- func (c Client) OpenAuthTokenAppQuery(body OpenAuthTokenAppQueryBody) (aliRsp OpenAuthTokenAppQueryResponse, err error)
- func (c Client) SystemOauthToken(body SystemOauthTokenBody) (aliRsp SystemOauthTokenResponse, err error)
- func (c Client) TradeCancel(body TradeCancelBody) (aliRsp TradeCancelResponse, err error)
- func (c Client) TradeClose(body TradeCloseBody) (aliRsp TradeCloseResponse, err error)
- func (c Client) TradeCreate(body TradeCreateBody, notifyUrl string) (aliRsp TradeCreateResponse, err error)
- func (c Client) TradeFastpayRefundQuery(body TradeFastpayRefundQueryBody) (aliRsp TradeFastpayRefundQueryResponse, err error)
- func (c Client) TradeOrderSettle(body TradeOrderSettleBody) (aliRsp TradeOrderSettleResponse, err error)
- func (c Client) TradeOrderinfoSync(body TradeOrderinfoSyncBody) (aliRsp TradeOrderinfoSyncResponse, err error)
- func (c Client) TradePay(body TradePayBody) (aliRsp TradePayResponse, err error)
- func (c Client) TradePrecreate(body TradePrecreateBody, notifyUrl string) (aliRsp TradePrecreateResponse, err error)
- func (c Client) TradeQuery(body TradeQueryBody) (aliRsp TradeQueryResponse, err error)
- func (c Client) TradeRefund(body TradeRefundBody) (aliRsp TradeRefundResponse, err error)
- type Config
- type DataBillSellQueryBody
- type DataBillSellQueryResponse
- type DataBillSellQueryResponseDetailItem
- type DataBillSellQueryResponseModel
- type ExtendParam
- type FundBillListInfo
- type Goods
- type Logistics
- type NotifyPayParams
- type OpenAuthTokenAppBody
- type OpenAuthTokenAppQueryBody
- type OpenAuthTokenAppQueryResponse
- type OpenAuthTokenAppQueryResponseModel
- type OpenAuthTokenAppResponse
- type OpenAuthTokenAppResponseItem
- type OpenAuthTokenAppResponseModel
- type PresetPayToolInfo
- type PromoParam
- type ReceiverAddress
- type RefundRoyaltyInfo
- type ResponseModel
- type RoyaltyParameter
- type Settle
- type SettleDetail
- type SystemOauthTokenBody
- type SystemOauthTokenData
- type SystemOauthTokenResponse
- type SystemOauthTokenResponseModel
- type TradeCancelBody
- type TradeCancelResponse
- type TradeCancelResponseModel
- type TradeCloseBody
- type TradeCloseResponse
- type TradeCloseResponseModel
- type TradeCreateBody
- type TradeCreateResponse
- type TradeCreateResponseModel
- type TradeFastpayRefundQueryBody
- type TradeFastpayRefundQueryResponse
- type TradeFastpayRefundQueryResponseModel
- type TradeOrderSettleBody
- type TradeOrderSettleResponse
- type TradeOrderSettleResponseModel
- type TradeOrderinfoSyncBody
- type TradeOrderinfoSyncResponse
- type TradeOrderinfoSyncResponseModel
- type TradePayBody
- type TradePayResponse
- type TradePayResponseModel
- type TradePrecreateBody
- type TradePrecreateResponse
- type TradePrecreateResponseModel
- type TradeQueryBody
- type TradeQueryResponse
- type TradeQueryResponseModel
- type TradeRefundBody
- type TradeRefundResponse
- type TradeRefundResponseModel
- type TradeSettleDetail
- type TradeSettleInfo
- type VoucherDetail
Constants ¶
const ( // 请求格式 FormatJson = "JSON" // Json格式 // 编码格式 CharSetUTF8 = "UTF-8" // UTF8 // 签名算法类型 SignTypeRSA = "RSA" // RSA签名 SignTypeRSA2 = "RSA2" // RSA2签名 // 版本号 Version1 = "1.0" // 1.0版本 // 授权类型 GrantTypeAuthorizationCode = "authorization_code" // 用code获取 GrantTypeRefreshToken = "refresh_token" // 用refresh_token获取 // 货币类型 FeeTypeCNY = "CNY" // 人民币 // 回调通知类型 NotifyTypeTradeStatusSync = "trade_status_sync" // 交易状态通知 // 回调中的交易状态 TradeStatusClosed = "TRADE_CLOSED" // 交易关闭 TradeStatusFinished = "TRADE_FINISHED" // 交易完结 TradeStatusSuccess = "TRADE_SUCCESS" // 支付成功 TradeStatusWaitBuyerPay = "WAIT_BUYER_PAY" // 交易创建 TransInTypeCard = "cardAliasNo" // 结算收款方的银行卡编号 TransInTypeUser = "userId" // 表示是支付宝账号对应的支付宝唯一用户号 TransInTypeLogin = "loginName" // 表示是支付宝登录号 TransOutTypeUser = "userId" // 表示是支付宝账号对应的支付宝唯一用户号 TransOutTypeLogin = "loginName" // 表示是支付宝登录号 LogisticsTypePost = "POST" // 平邮 LogisticsTypeExpress = "EXPRESS" // 其他快递 LogisticsTypeVirtual = "VIRTUAL" // 虚拟物品 LogisticsTypeEms = "EMS" // EMS LogisticsTypeDirect = "DIRECT" // 无需物流 SceneByBar = "bar_code" // 条码支付 SceneByWave = "wave_code" // 声波支付 AuthConfirmModeComplete = "COMPLETE" // 转交易支付完成结束预授权,解冻剩余金额 AuthConfirmModeNotComplete = "NOT_COMPLETE" // 转交易支付完成不结束预授权,不解冻剩余金额 RoyaltyTypeTransfer = "transfer" // 普通分账 RoyaltyTypeReplenish = "replenish" // 补差 BizTypeCreditAuth = "CREDIT_AUTH" // 信用授权场景下传 BizTypeCreditDeduct = "CREDIT_DEDUCT" // 信用代扣场景下传 OrderBizStatusComplete = "COMPLETE" // 同步用户已履约 OrderBizStatusClosed = "CLOSED" // 同步履约已取消 OrderBizStatusViolated = "VIOLATED" // 用户已违约 ResponseCodeSuccess = "10000" // 调用成功 ResponseCodeServiceNotAvaliable = "20000" // 服务不可用 ResponseCodeNotAuthrise = "20001" // 授权权限不足 ResponseCodeLessParameters = "40001" // 缺少必选参数 ResponseCodeInvalidParameters = "40002" // 非法的参数 ResponseCodeFailure = "40004" // 业务处理失败 ResponseCodePermissionDeny = "40006" // 权限不足 // 授权Token状态 OpenAuthTokenAppStatusValid = "valid" // 有效 OpenAuthTokenAppStatusInvalid = "invalid" // 无效 )
Variables ¶
This section is empty.
Functions ¶
func GetOpenAuthTokenAppUrlBatch ¶
func GetOpenAuthTokenAppUrlBatch( isProd bool, appId string, applicationTypes []string, redirectUri string, ) (result string)
第三方应用授权URL,批量授权 https://opendocs.alipay.com/open/20160728150111277227/intro
func GetOpenAuthTokenAppUrlSingle ¶
第三方应用授权URL,单个授权 https://opendocs.alipay.com/open/20160728150111277227/intro
func IsValidAuthCode ¶
25~30开头的长度为16~24位的数字,实际字符串长度以开发者获取的付款码长度为准
Types ¶
type BusinessParam ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) ConvertToBodyMap ¶
生成到BodyMap中
func (Client) DataBillSellQuery ¶
func (c Client) DataBillSellQuery(body DataBillSellQueryBody) (aliRsp DataBillSellQueryResponse, err error)
支付宝商家账户卖出交易查询
func (Client) FormatPrivateKey ¶
将私钥字符串转换为RSA私钥格式
func (Client) FormatPublicKey ¶
将公钥字符串转换为RSA公钥格式
func (Client) NotifyPay ¶
func (c Client) NotifyPay(bodyStr string) (params NotifyPayParams, origin map[string]interface{}, err error)
支付通知的处理
func (Client) OpenAuthTokenApp ¶
func (c Client) OpenAuthTokenApp(body OpenAuthTokenAppBody) (aliRsp OpenAuthTokenAppResponse, err error)
换取应用授权令牌 https://opendocs.alipay.com/apis/api_9/alipay.open.auth.token.app
func (Client) OpenAuthTokenAppQuery ¶
func (c Client) OpenAuthTokenAppQuery(body OpenAuthTokenAppQueryBody) (aliRsp OpenAuthTokenAppQueryResponse, err error)
查询授权信息,请求头不能包含app_auth_token公共参数 https://opendocs.alipay.com/apis/api_9/alipay.open.auth.token.app.query
func (Client) SystemOauthToken ¶
func (c Client) SystemOauthToken(body SystemOauthTokenBody) (aliRsp SystemOauthTokenResponse, err error)
换取授权访问令牌接口 https://docs.open.alipay.com/api_9/alipay.system.oauth.token
func (Client) TradeCancel ¶
func (c Client) TradeCancel(body TradeCancelBody) (aliRsp TradeCancelResponse, err error)
统一收单交易撤销接口
func (Client) TradeClose ¶
func (c Client) TradeClose(body TradeCloseBody) (aliRsp TradeCloseResponse, err error)
统一收单交易关闭接口
func (Client) TradeCreate ¶
func (c Client) TradeCreate(body TradeCreateBody, notifyUrl string) (aliRsp TradeCreateResponse, err error)
统一收单交易创建接口,对应pay接口支付
func (Client) TradeFastpayRefundQuery ¶
func (c Client) TradeFastpayRefundQuery(body TradeFastpayRefundQueryBody) (aliRsp TradeFastpayRefundQueryResponse, err error)
统一收单交易退款查询接口
func (Client) TradeOrderSettle ¶
func (c Client) TradeOrderSettle(body TradeOrderSettleBody) (aliRsp TradeOrderSettleResponse, err error)
统一收单交易结算接口
func (Client) TradeOrderinfoSync ¶
func (c Client) TradeOrderinfoSync(body TradeOrderinfoSyncBody) (aliRsp TradeOrderinfoSyncResponse, err error)
支付宝订单信息同步接口
func (Client) TradePay ¶
func (c Client) TradePay(body TradePayBody) (aliRsp TradePayResponse, err error)
统一收单交易支付接口
func (Client) TradePrecreate ¶
func (c Client) TradePrecreate(body TradePrecreateBody, notifyUrl string) (aliRsp TradePrecreateResponse, err error)
统一收单交易预创接口,支付动作在支付宝内完成,根据传入的通知地址异步通知服务商(推荐),
func (Client) TradeQuery ¶
func (c Client) TradeQuery(body TradeQueryBody) (aliRsp TradeQueryResponse, err error)
统一收单线下交易查询接口
func (Client) TradeRefund ¶
func (c Client) TradeRefund(body TradeRefundBody) (aliRsp TradeRefundResponse, err error)
统一收单交易退款接口
type Config ¶
type Config struct { AppId string `json:"app_id"` // 支付宝分配给开发者的应用ID Format string `json:"format"` // (可不设置) 仅支持JSON Charset string `json:"charset"` // 请求使用的编码格式,如utf-8,gbk,gb2312等 SignType string `json:"sign_type"` // 商户生成签名字符串所使用的签名算法类型,目前支持RSA2和RSA,推荐使用RSA2 Version string `json:"version"` // (可不设置) 调用的接口版本,固定为:1.0 AppAuthToken string `json:"app_auth_token"` // 应用授权,参见https://docs.open.alipay.com/common/105193 }
公共参数配置
type DataBillSellQueryBody ¶
type DataBillSellQueryBody struct { StartTime string `json:"start_time"` // 卖出交易流水创建时间的起始范围,2019-01-01 00:00:00 EndTime string `json:"end_time"` // 卖出交易流水创建时间的结束范围。与起始时间间隔不超过31天。查询结果为起始时间至结束时间的左闭右开区间 AlipayOrderNo string `json:"alipay_order_no,omitempty"` // 支付宝交易流水号。如果查询参数中指定流水号,则只查询流水号相关的记录 MerchantOrderNo string `json:"merchant_order_no,omitempty"` // 商户交易号。如果查询参数中指定交易号,则只查询相关的记录 StoreNo string `json:"store_no,omitempty"` // 门店编号,模糊搜索 PageNo string `json:"page_no,omitempty"` // 分页号,从1开始 PageSize string `json:"page_size,omitempty"` // 分页大小1000-2000,默认2000 }
type DataBillSellQueryResponse ¶
type DataBillSellQueryResponse struct { ResponseModel PageNo string `json:"page_no"` // 分页号,从1开始 PageSize string `json:"page_size"` // 分页大小1000-2000 TotalSize string `json:"total_size"` // 账务明细总数。返回满足查询条件的明细的数量 DetailList []DataBillSellQueryResponseDetailItem `json:"detail_list"` // 交易流水详情 }
type DataBillSellQueryResponseDetailItem ¶
type DataBillSellQueryResponseDetailItem struct { GmtCreate string `json:"gmt_create"` // 交易创建时间,2019-01-01 00:00:00 GmtPay string `json:"gmt_pay"` // 交易支付时间 GmtRefund string `json:"gmt_refund,omitempty"` // 交易退款时间 AlipayOrderNo string `json:"alipay_order_no"` // 支付宝订单号。对账使用,不脱敏,20190101*** MerchantOrderNo string `json:"merchant_order_no"` // 商户订单号,创建支付宝交易时传入的信息。对账使用,不脱敏,TX*** OtherAccount string `json:"other_account"` // 对方账户,张*(a*@alipay.com) GoodsTitle string `json:"goods_title"` // 商品名称 TotalAmount string `json:"total_amount"` // 订单金额 NetMdiscount string `json:"net_mdiscount,omitempty"` // 商家优惠金额 RefundAmount string `json:"refund_amount,omitempty"` // 订单退款金额 ServiceFee string `json:"service_fee,omitempty"` // 服务费金额 TradeStatus string `json:"trade_status"` // 订单状态(待付款,成功,关闭,待发货,待确认收货,已预付,进行中) TradeType string `json:"trade_type"` // 业务类型,帮助商户作为对账参考 StoreNo string `json:"store_no,omitempty"` // 门店编号 StoreName string `json:"store_name,omitempty"` // 门店名称 GoodsMemo string `json:"goods_memo,omitempty"` // 商品备注信息 }
type DataBillSellQueryResponseModel ¶
type DataBillSellQueryResponseModel struct { Data DataBillSellQueryResponse `json:"alipay_data_bill_sell_query_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type ExtendParam ¶
type FundBillListInfo ¶
type FundBillListInfo struct { FundChannel string `json:"fund_channel"` // 交易使用的资金渠道 BankCode string `json:"bank_code,omitempty"` // 银行卡支付时的银行代码 Amount string `json:"amount"` // 该支付工具类型所使用的金额 RealAmount string `json:"real_amount,omitempty"` // 渠道实际付款金额 FundType string `json:"fund_type,omitempty"` // 渠道所使用的资金类型 }
type Goods ¶
type Goods struct { GoodsId string `json:"goods_id"` // 商品的编号 GoodsName string `json:"goods_name"` // 商品名称 Quantity int `json:"quantity"` // 商品数量 Price float32 `json:"price"` // 商品单价,单位为元 GoodsCategory string `json:"goods_category,omitempty"` // 商品类目 CategoriesTree string `json:"categories_tree,omitempty"` // 商品类目树 Body string `json:"body,omitempty"` // 商品描述信息 ShowUrl string `json:"show_url,omitempty"` // 商品的展示地址 }
type Logistics ¶
type Logistics struct {
LogisticsType string `json:"logistics_type,omitempty"` // 物流类型(见constant定义)
}
type NotifyPayParams ¶
type NotifyPayParams struct { // 通知参数 NotifyType string `json:"notify_type"` // 通知类型,参见constant.go NotifyId string `json:"notify_id"` // 91722adff935e8cfa58b3aabf4dead6ibe NotifyTime string `json:"notify_time"` // 2017-02-16 21:46:15 // 公共参数 AppId string `json:"app_id"` // 应用ID AuthAppId string `json:"auth_app_id"` // 授权商户应用ID Chatset string `json:"charset"` // 字符集,参见constant.go Version string `json:"version"` // 接口版本,参见constant.go // 业务参数 TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 商户订单号 BuyerLogonId string `json:"buyer_logon_id"` // 买家支付宝账号 TradeStatus string `json:"trade_status"` // 交易状态 TotalAmount string `json:"total_amount"` // 订单总金额 }
支付结果通知的参数
type OpenAuthTokenAppBody ¶
type OpenAuthTokenAppBody struct { GrantType string `json:"grant_type"` // 参见constant.go。值为authorization_code时,代表用code换取;值为refresh_token时,代表用refresh_token换取 Code string `json:"code,omitempty"` // 授权码,如果grant_type的值为authorization_code,该值必须填写 RefreshToken string `json:"refresh_token,omitempty"` // 刷新令牌,如果grant_type值为refresh_token,该值不能为空 }
type OpenAuthTokenAppQueryBody ¶
type OpenAuthTokenAppQueryBody struct {
AppAuthToken string `json:"app_auth_token"` // 应用授权令牌
}
type OpenAuthTokenAppQueryResponse ¶
type OpenAuthTokenAppQueryResponse struct { ResponseModel UserId string `json:"user_id"` // 授权商户的user_id AuthAppId string `json:"auth_app_id"` // 授权商户的appid ExpiresIn int64 `json:"expires_in"` // 应用授权令牌失效时间,单位到秒 AuthMethods []string `json:"auth_methods"` // 当前app_auth_token的授权接口列表,["\"alipay.open.auth.token.app.query\"","\"alipay.system.oauth.token\"","\"alipay.open.auth.token.app\""] AuthStart string `json:"auth_start"` // 授权生效时间,2015-11-03 01:59:57 AuthEnd string `json:"auth_end"` // 授权失效时间,2016-11-03 01:59:57 Status string `json:"status"` // valid:有效状态;invalid:无效状态,参见constant.go }
type OpenAuthTokenAppQueryResponseModel ¶
type OpenAuthTokenAppQueryResponseModel struct { Data OpenAuthTokenAppQueryResponse `json:"alipay_open_auth_token_app_query_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type OpenAuthTokenAppResponse ¶
type OpenAuthTokenAppResponse struct { ResponseModel Tokens []OpenAuthTokenAppResponseItem `json:"tokens"` // 令牌列表 }
type OpenAuthTokenAppResponseItem ¶
type OpenAuthTokenAppResponseItem struct { UserId string `json:"user_id"` // 授权商户的user_id AuthAppId string `json:"auth_app_id"` // 授权商户的appid AppAuthToken string `json:"app_auth_token"` // 应用授权令牌 AppRefreshToken string `json:"app_refresh_token"` // 刷新令牌 ExpiresIn int64 `json:"expires_in"` // 应用授权令牌的有效时间(从接口调用时间作为起始时间),单位到秒 ReExpiresIn int64 `json:"re_expires_in"` // 刷新令牌的有效时间(从接口调用时间作为起始时间),单位到秒 }
type OpenAuthTokenAppResponseModel ¶
type OpenAuthTokenAppResponseModel struct { Data OpenAuthTokenAppResponse `json:"alipay_open_auth_token_app_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type PresetPayToolInfo ¶
type PromoParam ¶
type PromoParam struct {
ActualOrderTime string `json:"actual_order_time,omitempty"` // 存在延迟扣款这一类的场景,用这个时间表明用户发生交易的时间
}
type ReceiverAddress ¶
type RefundRoyaltyInfo ¶
type RefundRoyaltyInfo struct { RefundAmount string `json:"refund_amount"` // 退分账金额 RoyaltyType string `json:"royalty_type,omitempty"` // 分账类型 ResultCode string `json:"result_code"` // 退分账结果码 TransOut string `json:"trans_out,omitempty"` // 转出人支付宝账号对应用户ID TransOutType string `json:"trans_out_email,omitempty"` // 转出人支付宝账号 TransIn string `json:"trans_in,omitempty"` // 转入人支付宝账号对应用户ID TransInType string `json:"trans_in_email,omitempty"` // 转入人支付宝账号 }
type ResponseModel ¶
type ResponseModel struct { Code string `json:"code"` // 网关返回码,参见https://docs.open.alipay.com/common/105806 Msg string `json:"msg"` // 网关返回码描述,参见https://docs.open.alipay.com/common/105806 SubCode string `json:"sub_code,omitempty"` // 业务返回码,参见具体的API接口文档 SubMsg string `json:"sub_msg,omitempty"` // 业务返回码描述,参见具体的API接口文档 }
公共响应参数
type RoyaltyParameter ¶
type RoyaltyParameter struct { RoyaltyType string `json:"royalty_type,omitempty"` // 分账类型 TransOut string `json:"trans_out,omitempty"` // 支出方账户 TransOutType string `json:"trans_out_type,omitempty"` // 支出方账户类型 TransInType string `json:"trans_in_type,omitempty"` // 收入方账户类型 TransIn string `json:"trans_in"` // 分账类型 Amount float32 `json:"amount,omitempty"` // 分账的金额 AmountPercentage int `json:"amount_percentage,omitempty"` // 分账信息中分账百分比,取值范围为大于0,少于或等于100的整数。 Desc string `json:"desc,omitempty"` // 分账描述 }
type Settle ¶
type Settle struct { SettleDetailInfos []SettleDetail `json:"settle_detail_infos"` // 结算详细信息 MerchantType string `json:"merchant_type,omitempty"` // 商户id类型 }
type SettleDetail ¶
type SettleDetail struct { TransInType string `json:"trans_in_type"` // 结算收款方的账户类型(见constant定义) TransIn string `json:"trans_in"` // 结算收款方 SummaryDimension string `json:"summary_dimension,omitempty"` // 结算汇总维度 SettleEntityId string `json:"settle_entity_id,omitempty"` // 结算主体标识 SettleEntityType string `json:"settle_entity_type,omitempty"` // 结算主体类型 Amount float32 `json:"amount"` // 结算的金额,单位为元。目前必须和交易金额相同 }
type SystemOauthTokenBody ¶
type SystemOauthTokenBody struct { GrantType string `json:"grant_type"` // 参见constant.go。值为authorization_code时,代表用code换取;值为refresh_token时,代表用refresh_token换取 Code string `json:"code,omitempty"` // 授权码,用户对应用授权后得到。 RefreshToken string `json:"refresh_token,omitempty"` // 刷新令牌,上次换取访问令牌时得到。见出参的refresh_token字段 }
type SystemOauthTokenData ¶
type SystemOauthTokenData struct { UserId string `json:"user_id"` // 支付宝用户的唯一userId,2088102150477652 AccessToken string `json:"access_token"` // 访问令牌。通过该令牌调用需要授权类接口,20120823ac6ffaa4d2d84e7384bf983531473993 ExpiresIn int64 `json:"expires_in"` // 访问令牌的有效时间,单位是秒。3600 RefreshToken string `json:"refresh_token"` // 刷新令牌。通过该令牌可以刷新access_token,20120823ac6ffdsdf2d84e7384bf983531473993 ReExpiresIn int64 `json:"re_expires_in"` // 刷新令牌的有效时间,单位是秒。3600 }
type SystemOauthTokenResponse ¶
type SystemOauthTokenResponse struct { Error ResponseModel `json:"error_response,omitempty"` Data SystemOauthTokenData `json:"alipay_system_oauth_token_response"` // 返回值信息 }
type SystemOauthTokenResponseModel ¶
type SystemOauthTokenResponseModel struct { SystemOauthTokenResponse Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeCancelBody ¶
type TradeCancelResponse ¶
type TradeCancelResponse struct { ResponseModel // 响应参数 TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 商户订单号 RetryFlag string `json:"retry_flag"` // 是否需要重试 Action string `json:"action"` // 本次撤销触发的交易动作 GmtRefundPay string `json:"gmt_refund_pay,omitempty"` // 返回的退款时间 RefundSettlementId string `json:"refund_settlement_id,omitempty"` // 返回的退款清算编号 }
type TradeCancelResponseModel ¶
type TradeCancelResponseModel struct { Data TradeCancelResponse `json:"alipay_trade_cancel_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeCloseBody ¶
type TradeCloseResponse ¶
type TradeCloseResponse struct { ResponseModel // 响应参数 TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 商户订单号 }
type TradeCloseResponseModel ¶
type TradeCloseResponseModel struct { Data TradeCloseResponse `json:"alipay_trade_close_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeCreateBody ¶
type TradeCreateBody struct { OutTradeNo string `json:"out_trade_no"` // 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复 SellerId string `json:"seller_id,omitempty"` // 卖家支付宝用户ID。如果该值为空,则默认为商户签约账号对应的支付宝用户ID TotalAmount float32 `json:"total_amount"` // 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] DiscountAmount float32 `json:"discountable_amount,omitempty"` // 可打折金额 Subject string `json:"subject"` // 订单标题 Body string `json:"body,omitempty"` // 对交易或商品的描述 BuyerId string `json:"buyer_id,omitempty"` // 买家的支付宝唯一用户号 GoodsDetail []Goods `json:"goods_detail,omitempty"` // 订单包含的商品列表信息 ProductCode string `json:"product_code,omitempty"` // 销售产品码 OperatorId string `json:"operator_id,omitempty"` // 商户操作员编号 StoreId string `json:"store_id,omitempty"` // 商户门店编号 TerminalId string `json:"terminal_id,omitempty"` // 商户机具终端编号 ExtendParams *ExtendParam `json:"extend_params,omitempty"` // 业务扩展参数 TimeoutExpress string `json:"timeout_express,omitempty"` // 该笔订单允许的最晚付款时间,逾期将关闭交易 SettleInfo *Settle `json:"settle_info,omitempty"` // 描述结算信息 LogisticsDetail *Logistics `json:"logistics_detail,omitempty"` // 物流信息 BusinessParams *BusinessParam `json:"business_params,omitempty"` // 商户传入业务信息 ReceiverAddressInfo *ReceiverAddress `json:"receiver_address_info,omitempty"` // 收货人及地址信息 }
type TradeCreateResponse ¶
type TradeCreateResponse struct { ResponseModel // 响应参数 OutTradeNo string `json:"out_trade_no"` // 商户订单号 TradeNo string `json:"trade_no"` // 支付宝交易号 }
type TradeCreateResponseModel ¶
type TradeCreateResponseModel struct { Data TradeCreateResponse `json:"alipay_trade_create_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeFastpayRefundQueryBody ¶
type TradeFastpayRefundQueryBody struct { TradeNo string `json:"trade_no,omitempty"` // 支付宝订单号 OutTradeNo string `json:"out_trade_no,omitempty"` // 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复 OutRequestNo string `json:"out_request_no"` // 标识一次退款请求,同一笔交易多次退款需要保证唯一,如需部分退款,则此参数必传 OrgPId string `json:"org_pid,omitempty"` // 退款的交易所属收单机构的pid }
type TradeFastpayRefundQueryResponse ¶
type TradeFastpayRefundQueryResponse struct { ResponseModel // 响应参数 TradeNo string `json:"trade_no,omitempty"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no,omitempty"` // 商户订单号 OutRequestNo string `json:"out_request_no,omitempty"` // 标识一次退款请求,同一笔交易多次退款需要保证唯一,如需部分退款,则此参数必传 RefundReason string `json:"refund_reason,omitempty"` // 退款的原因说明 TotalAmount string `json:"total_amount,omitempty"` // 订单总金额 RefundAmount string `json:"refund_amount,omitempty"` // 退款总金额 RefundRoyaltys []RefundRoyaltyInfo `json:"refund_royaltys,omitempty"` // 退分账明细信息 GmtRefundPay string `json:"gmt_refund_pay,omitempty"` // 退款支付时间 FundBillList []FundBillListInfo `json:"refund_detail_item_list,omitempty"` // 退款使用的资金渠道 SendbackFee string `json:"send_back_fee,omitempty"` // 本次商户实际退回金额 RefundSettlementId string `json:"refund_settlement_id,omitempty"` // 支付清算编号 RefundBuyerAmount string `json:"present_refund_buyer_amount,omitempty"` // 本次退款金额中买家退款金额 RefundDiscountAmount string `json:"present_refund_discount_amount,omitempty"` // 本次退款金额中平台优惠退款金额 RefundMdiscountAmount string `json:"present_refund_mdiscount_amount,omitempty"` // 本次退款金额中商家优惠退款金额 }
type TradeFastpayRefundQueryResponseModel ¶
type TradeFastpayRefundQueryResponseModel struct { Data TradeFastpayRefundQueryResponse `json:"alipay_trade_fastpay_refund_query_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeOrderSettleBody ¶
type TradeOrderSettleBody struct { OutRequestNo string `json:"out_request_no"` // 结算请求流水号 TradeNo string `json:"trade_no"` // 支付宝订单号 RoyaltyParameters []RoyaltyParameter `json:"royalty_parameters"` // 分账明细信息 OperatorId string `json:"operator_id,omitempty"` // 商户操作员编号 }
type TradeOrderSettleResponse ¶
type TradeOrderSettleResponse struct { ResponseModel // 响应参数 TradeNo string `json:"trade_no"` // 支付宝交易号 }
type TradeOrderSettleResponseModel ¶
type TradeOrderSettleResponseModel struct { Data TradeOrderSettleResponse `json:"alipay_trade_order_settle_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeOrderinfoSyncBody ¶
type TradeOrderinfoSyncBody struct { TradeNo string `json:"trade_no"` // 支付宝订单号 OrigRequestNo string `json:"orig_request_no,omitempty"` // 原始业务请求单号 OutRequestNo string `json:"out_request_no"` // 标识一笔交易多次请求,同一笔交易多次信息同步时需要保证唯一 BizType string `json:"biz_type"` // 交易信息同步对应的业务类型 OrderBizInfo string `json:"order_biz_info,omitempty"` // 商户传入同步信息 }
type TradeOrderinfoSyncResponse ¶
type TradeOrderinfoSyncResponse struct { ResponseModel // 响应参数 TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no,omitempty"` // 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复 BuyerUserId string `json:"buyer_user_id"` // 买家在支付宝的用户id }
type TradeOrderinfoSyncResponseModel ¶
type TradeOrderinfoSyncResponseModel struct { Data TradeOrderinfoSyncResponse `json:"alipay_trade_orderinfo_sync_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradePayBody ¶
type TradePayBody struct { OutTradeNo string `json:"out_trade_no"` // 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复 Scene string `json:"scene"` // 支付场景 AuthCode string `json:"auth_code"` // 支付授权码 ProductCode string `json:"product_code,omitempty"` // 销售产品码 Subject string `json:"subject"` // 订单标题 BuyerId string `json:"buyer_id,omitempty"` // 买家的支付宝唯一用户号 SellerId string `json:"seller_id,omitempty"` // 卖家支付宝用户ID。如果该值为空,则默认为商户签约账号对应的支付宝用户ID TotalAmount float32 `json:"total_amount,omitempty"` // 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] TransCurrency string `json:"trans_currency,omitempty"` // 标价币种 SettleCurrency string `json:"settle_currency,omitempty"` // 订单结算币种 DiscountAmount float32 `json:"discountable_amount,omitempty"` // 可打折金额 Body string `json:"body,omitempty"` // 对交易或商品的描述 GoodsDetail *[]Goods `json:"goods_detail,omitempty"` // 订单包含的商品列表信息 OperatorId string `json:"operator_id,omitempty"` // 商户操作员编号 StoreId string `json:"store_id,omitempty"` // 商户门店编号 TerminalId string `json:"terminal_id,omitempty"` // 商户机具终端编号 ExtendParams *ExtendParam `json:"extend_params,omitempty"` // 业务扩展参数 TimeoutExpress string `json:"timeout_express,omitempty"` // 该笔订单允许的最晚付款时间,逾期将关闭交易 AuthConfirmMode string `json:"auth_confirm_mode,omitempty"` // 预授权确认模式 TerminalParams string `json:"terminal_params,omitempty"` // 商户传入终端设备相关信息 PromoParams *PromoParam `json:"promo_params,omitempty"` // 优惠明细参数 AdvancePaymentType string `json:"advance_payment_type,omitempty"` // 支付模式类型 }
type TradePayResponse ¶
type TradePayResponse struct { ResponseModel // 响应参数 TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 商户订单号 BuyerLogonId string `json:"buyer_logon_id"` // 买家支付宝账号 SettleAmount string `json:"settle_amount,omitempty"` // 结算币种订单金额 PayCurrency string `json:"pay_currency,omitempty"` // 订单支付币种 PayAmount string `json:"pay_amount,omitempty"` // 支付币种订单金额 SettleTransRate string `json:"settle_trans_rate,omitempty"` // 结算币种兑换标价币种汇率 TransPayRate string `json:"trans_pay_rate,omitempty"` // 标价币种兑换支付币种汇率 TotalAmount string `json:"total_amount"` // 订单总金额 TransCurrency string `json:"trans_currency,omitempty"` // 标价币种 SettleCurrency string `json:"settle_currency,omitempty"` // 订单结算币种 ReceiptAmount string `json:"receipt_amount"` // 实收金额 BuyerPayAmount string `json:"buyer_pay_amount,omitempty"` // 买家实付金额 PointAmount string `json:"point_amount,omitempty"` // 积分支付的金额 InvoiceAmount string `json:"invoice_amount,omitempty"` // 可开具发票的金额 GmtPayment string `json:"gmt_payment"` // 交易支付时间 FundBillList *[]FundBillListInfo `json:"fund_bill_list"` // 交易支付使用的资金渠道 CardBalance string `json:"card_balance,omitempty"` // 支付宝卡余额 StoreName string `json:"store_name,omitempty"` // 请求交易支付中的商户店铺的名称 BuyerUserId string `json:"buyer_user_id"` // 买家在支付宝的用户id DiscountGoodsDetail string `json:"discount_goods_detail,omitempty"` // 本次交易支付所使用的单品券优惠的商品优惠信息 VoucherDetailList *[]VoucherDetail `json:"voucher_detail_list,omitempty"` // 本交易支付时使用的所有优惠券信息 AdvanceAmount string `json:"advance_amount,omitempty"` // 先享后付2.0垫资金额 AuthTradePayMode string `json:"auth_trade_pay_mode,omitempty"` // 预授权支付模式 ChargeAmount string `json:"charge_amount,omitempty"` // 该笔交易针对收款方的收费金额 ChargeFlags string `json:"charge_flags,omitempty"` // 费率活动标识 SettlementId string `json:"settlement_id,omitempty"` // 支付清算编号 BusinessParams string `json:"business_params,omitempty"` // 商户传入业务信息 BuyerUserType string `json:"buyer_user_type,omitempty"` // 买家用户类型 MdiscountAmount string `json:"mdiscount_amount,omitempty"` // 商家优惠金额 DiscountAmount string `json:"discount_amount,omitempty"` // 平台优惠金额 BuyerUserName string `json:"buyer_user_name,omitempty"` // 买家为个人用户时为买家姓名,买家为企业用户时为企业名称 }
type TradePayResponseModel ¶
type TradePayResponseModel struct { Data TradePayResponse `json:"alipay_trade_pay_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradePrecreateBody ¶
type TradePrecreateBody struct { OutTradeNo string `json:"out_trade_no"` // 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复 SellerId string `json:"seller_id,omitempty"` // 卖家支付宝用户ID。如果该值为空,则默认为商户签约账号对应的支付宝用户ID TotalAmount float32 `json:"total_amount"` // 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] DiscountAmount float32 `json:"discountable_amount,omitempty"` // 可打折金额 Subject string `json:"subject"` // 订单标题 GoodsDetail []Goods `json:"goods_detail,omitempty"` // 订单包含的商品列表信息 Body string `json:"body,omitempty"` // 对交易或商品的描述 ProductCode string `json:"product_code,omitempty"` // 销售产品码 OperatorId string `json:"operator_id,omitempty"` // 商户操作员编号 StoreId string `json:"store_id,omitempty"` // 商户门店编号 DisablePayChannels string `json:"disable_pay_channels,omitempty"` // 禁用渠道 EnablePayChannels string `json:"enable_pay_channels,omitempty"` // 可用渠道 TerminalId string `json:"terminal_id,omitempty"` // 商户机具终端编号 ExtendParams *ExtendParam `json:"extend_params,omitempty"` // 业务扩展参数 TimeoutExpress string `json:"timeout_express,omitempty"` // 该笔订单允许的最晚付款时间,逾期将关闭交易 SettleInfo *Settle `json:"settle_info,omitempty"` // 描述结算信息 MerchantOrderNo string `json:"merchant_order_no,omitempty"` // 商户原始订单号 BusinessParams *BusinessParam `json:"business_params,omitempty"` // 商户传入业务信息 QrCodeTimeoutExpress string `json:"qr_code_timeout_express,omitempty"` // 该笔订单允许的最晚付款时间 }
type TradePrecreateResponse ¶
type TradePrecreateResponse struct { ResponseModel // 响应参数 OutTradeNo string `json:"out_trade_no"` // 商户订单号 QrCode string `json:"qr_code"` // 当前预下单请求生成的二维码码串 }
type TradePrecreateResponseModel ¶
type TradePrecreateResponseModel struct { Data TradePrecreateResponse `json:"alipay_trade_precreate_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeQueryBody ¶
type TradeQueryResponse ¶
type TradeQueryResponse struct { ResponseModel // 响应参数 TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 商户订单号 BuyerLogonId string `json:"buyer_logon_id"` // 买家支付宝账号 TradeStatus string `json:"trade_status"` // 交易状态 TotalAmount string `json:"total_amount"` // 订单总金额 TransCurrency string `json:"trans_currency,omitempty"` // 标价币种 SettleCurrency string `json:"settle_currency,omitempty"` // 订单结算币种 SettleAmount string `json:"settle_amount,omitempty"` // 结算币种订单金额 PayCurrency string `json:"pay_currency,omitempty"` // 订单支付币种 PayAmount string `json:"pay_amount,omitempty"` // 支付币种订单金额 SettleTransRate string `json:"settle_trans_rate,omitempty"` // 结算币种兑换标价币种汇率 TransPayRate string `json:"trans_pay_rate,omitempty"` // 标价币种兑换支付币种汇率 BuyerPayAmount string `json:"buyer_pay_amount,omitempty"` // 买家实付金额 PointAmount string `json:"point_amount,omitempty"` // 积分支付的金额 InvoiceAmount string `json:"invoice_amount,omitempty"` // 可开具发票的金额 SendPayDate string `json:"send_pay_date,omitempty"` // 本次交易打款给卖家的时间 ReceiptAmount string `json:"receipt_amount,omitempty"` // 实收金额 StoreId string `json:"store_id,omitempty"` // 商户门店编号 TerminalId string `json:"terminal_id,omitempty"` // 商户机具终端编号 FundBillList *[]FundBillListInfo `json:"fund_bill_list"` // 交易支付使用的资金渠道 StoreName string `json:"store_name,omitempty"` // 请求交易支付中的商户店铺的名称 BuyerUserId string `json:"buyer_user_id"` // 买家在支付宝的用户id ChargeAmount string `json:"charge_amount,omitempty"` // 该笔交易针对收款方的收费金额 ChargeFlags string `json:"charge_flags,omitempty"` // 费率活动标识 SettlementId string `json:"settlement_id,omitempty"` // 支付清算编号 TradeSettle *TradeSettleInfo `json:"trade_settle_info,omitempty"` // 返回的交易结算信息 AuthTradePayMode string `json:"auth_trade_pay_mode,omitempty"` // 预授权支付模式 BuyerUserType string `json:"buyer_user_type,omitempty"` // 买家用户类型 MdiscountAmount string `json:"mdiscount_amount,omitempty"` // 商家优惠金额 DiscountAmount string `json:"discount_amount,omitempty"` // 平台优惠金额 BuyerUserName string `json:"buyer_user_name,omitempty"` // 买家为个人用户时为买家姓名,买家为企业用户时为企业名称 Subject string `json:"subject,omitempty"` // 订单标题 Body string `json:"body,omitempty"` // 订单描述 SubMerchantId string `json:"alipay_sub_merchant_id,omitempty"` // 间连商户在支付宝端的商户编号 ExtInfos string `json:"ext_infos,omitempty"` // 交易额外信息 }
type TradeQueryResponseModel ¶
type TradeQueryResponseModel struct { Data TradeQueryResponse `json:"alipay_trade_query_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeRefundBody ¶
type TradeRefundBody struct { OutTradeNo string `json:"out_trade_no,omitempty"` // 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复 TradeNo string `json:"trade_no,omitempty"` // 支付宝订单号 RefundAmount float32 `json:"refund_amount"` // 退款金额 RefundCurrency string `json:"refund_currency,omitempty"` // 退款币种 RefundReason string `json:"refund_reason,omitempty"` // 退款的原因说明 OutRequestNo string `json:"out_request_no,omitempty"` // 标识一次退款请求,同一笔交易多次退款需要保证唯一,如需部分退款,则此参数必传 OperatorId string `json:"operator_id,omitempty"` // 商户操作员编号 StoreId string `json:"store_id,omitempty"` // 商户门店编号 TerminalId string `json:"terminal_id,omitempty"` // 商户机具终端编号 GoodsDetail []Goods `json:"goods_detail,omitempty"` // 退款包含的商品列表信息 RefundRoyaltyParameters []RoyaltyParameter `json:"refund_royalty_parameters,omitempty"` // 退分账明细信息 OrgPId string `json:"org_pid,omitempty"` // 退款的交易所属收单机构的pid }
type TradeRefundResponse ¶
type TradeRefundResponse struct { ResponseModel // 响应参数 TradeNo string `json:"trade_no"` // 支付宝交易号 OutTradeNo string `json:"out_trade_no"` // 商户订单号 BuyerLogonId string `json:"buyer_logon_id"` // 买家支付宝账号 FundChange string `json:"fund_change"` // 本次退款是否发生了资金变化 RefundFee string `json:"refund_fee"` // 退款总金额 RefundCurrency string `json:"refund_currency,omitempty"` // 退款币种信息 GmtRefundPay string `json:"gmt_refund_pay"` // 退款支付时间 FundBillList []FundBillListInfo `json:"refund_detail_item_list,omitempty"` // 退款使用的资金渠道 StoreName string `json:"store_name,omitempty"` // 请求交易支付中的商户店铺的名称 BuyerUserId string `json:"buyer_user_id"` // 买家在支付宝的用户id RefundPaytoolList *PresetPayToolInfo `json:"refund_preset_paytool_list,omitempty"` // 退回的前置资产列表 RefundSettlementId string `json:"refund_settlement_id,omitempty"` // 支付清算编号 RefundBuyerAmount string `json:"present_refund_buyer_amount,omitempty"` // 本次退款金额中买家退款金额 RefundDiscountAmount string `json:"present_refund_discount_amount,omitempty"` // 本次退款金额中平台优惠退款金额 RefundMdiscountAmount string `json:"present_refund_mdiscount_amount,omitempty"` // 本次退款金额中商家优惠退款金额 }
type TradeRefundResponseModel ¶
type TradeRefundResponseModel struct { Data TradeRefundResponse `json:"alipay_trade_refund_response"` // 返回值信息 Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074 }
type TradeSettleDetail ¶
type TradeSettleDetail struct { OperationType string `json:"operation_type"` // 结算操作类型 OperationSerialNo string `json:"operation_serial_no,omitempty"` // 商户操作序列号 OperationDate string `json:"operation_dt"` // 操作日期 TransOut string `json:"trans_out,omitempty"` // 转出账号 TransIn string `json:"trans_in,omitempty"` // 转入账号 Amount float32 `json:"amount"` // 实际操作金额 }
type TradeSettleInfo ¶
type TradeSettleInfo struct {
TradeSettleDetailList []TradeSettleDetail `json:"trade_settle_detail_list,omitempty"` // 交易结算明细信息
}
type VoucherDetail ¶
type VoucherDetail struct { Id string `json:"id"` // 券id Name string `json:"name"` // 券名称 Type string `json:"type"` // 券类型 Amount string `json:"amount"` // 优惠券面额 MerchantContribute string `json:"merchant_contribute,omitempty"` // 商家出资金额 OtherContribute string `json:"other_contribute,omitempty"` // 其他出资方出资金额 Memo string `json:"memo,omitempty"` // 优惠券备注信息 TemplateId string `json:"template_id,omitempty"` // 券模板id PurchaseBuyerContribute string `json:"purchase_buyer_contribute,omitempty"` // 用户实际付款的金额 PurchaseMerchantContribute string `json:"purchase_merchant_contribute,omitempty"` // 商户优惠的金额 PurchaseMAntContribute string `json:"purchase_ant_contribute,omitempty"` // 平台优惠的金额 }
Source Files ¶
- ap_data_bill_sell_query.go
- ap_notify_pay.go
- ap_open_auth_token_app.go
- ap_open_auth_token_app_query.go
- ap_system_oauth_token.go
- ap_trade_cancel.go
- ap_trade_close.go
- ap_trade_create.go
- ap_trade_fastpay_refund_query.go
- ap_trade_order_settle.go
- ap_trade_order_sync.go
- ap_trade_pay.go
- ap_trade_precreate.go
- ap_trade_query.go
- ap_trade_refund.go
- client.go
- client_format_key.go
- client_request.go
- client_sign.go
- config.go
- constant.go
- model.go
- open_auth_token_app_url.go
- util.go