Documentation
¶
Index ¶
- Constants
- func IsValidAuthCode(authcode string) (ok bool)
- type BodyMap
- type BusinessParam
- type CancelTradeBody
- type CancelTradeResponse
- type CancelTradeResponseModel
- type Client
- func (c *Client) CancelTrade(body CancelTradeBody) (aliRsp CancelTradeResponse, err error)
- func (c *Client) CloseTrade(body CloseTradeBody) (aliRsp CloseTradeResponse, err error)
- func (c *Client) ConvertToBodyMap(params interface{}) (body BodyMap)
- func (c *Client) CreateTrade(body CreateTradeBody, notifyUrl string) (aliRsp CreateTradeResponse, err error)
- func (c *Client) FormatPrivateKey(privateKey string) string
- func (c *Client) FormatPublicKey(publicKey string) string
- func (c *Client) FormatURLParam(body BodyMap) string
- func (c *Client) GenerateBizContent(body interface{}) string
- func (c *Client) OrderSettleTrade(body OrderSettleTradeBody) (aliRsp OrderSettleTradeResponse, err error)
- func (c *Client) OrderSyncTrade(body OrderSyncTradeBody) (aliRsp OrderSyncTradeResponse, err error)
- func (c *Client) PayTrade(body PayTradeBody) (aliRsp PayTradeResponse, err error)
- func (c *Client) PreCreateTrade(body PreCreateTradeBody, notifyUrl string) (aliRsp PreCreateTradeResponse, err error)
- func (c *Client) QueryTrade(body QueryTradeBody) (aliRsp QueryTradeResponse, err error)
- func (c *Client) RefundQueryTrade(body RefundQueryTradeBody) (aliRsp RefundQueryTradeResponse, err error)
- func (c *Client) RefundTrade(body RefundTradeBody) (aliRsp RefundTradeResponse, err error)
- func (c *Client) SystemOAuthToken(body SystemOAuthTokenBody) (aliRsp SystemOAuthTokenResponse, err error)
- func (c *Client) VerifySign(raw_url string) (err error)
- type CloseTradeBody
- type CloseTradeResponse
- type CloseTradeResponseModel
- type Config
- type CreateTradeBody
- type CreateTradeResponse
- type CreateTradeResponseModel
- type ExtendParam
- type FundBillListInfo
- type Goods
- type Logistics
- type OrderSettleTradeBody
- type OrderSettleTradeResponse
- type OrderSettleTradeResponseModel
- type OrderSyncTradeBody
- type OrderSyncTradeResponse
- type OrderSyncTradeResponseModel
- type PayTradeBody
- type PayTradeResponse
- type PayTradeResponseModel
- type PreCreateTradeBody
- type PreCreateTradeResponse
- type PreCreateTradeResponseModel
- type PresetPayToolInfo
- type PromoParam
- type QueryTradeBody
- type QueryTradeResponse
- type QueryTradeResponseModel
- type ReceiverAddress
- type RefundQueryTradeBody
- type RefundQueryTradeResponse
- type RefundQueryTradeResponseModel
- type RefundRoyaltyInfo
- type RefundTradeBody
- type RefundTradeResponse
- type RefundTradeResponseModel
- type ResponseModel
- type RoyaltyParameter
- type Settle
- type SettleDetail
- type SystemOAuthTokenBody
- type SystemOAuthTokenData
- type SystemOAuthTokenResponse
- type SystemOAuthTokenResponseModel
- type TradeSettleDetail
- type TradeSettleInfo
- type VoucherDetail
Constants ¶
View Source
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" // 人民币 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" // 权限不足 )
Variables ¶
This section is empty.
Functions ¶
func IsValidAuthCode ¶
25~30开头的长度为16~24位的数字,实际字符串长度以开发者获取的付款码长度为准
Types ¶
type BusinessParam ¶
type CancelTradeBody ¶
type CancelTradeResponse ¶
type CancelTradeResponse 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 CancelTradeResponseModel ¶
type CancelTradeResponseModel struct {
Data CancelTradeResponse `json:"alipay_trade_cancel_response"` // 返回值信息
Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CancelTrade ¶
func (c *Client) CancelTrade(body CancelTradeBody) (aliRsp CancelTradeResponse, err error)
统一收单交易撤销接口
func (*Client) CloseTrade ¶
func (c *Client) CloseTrade(body CloseTradeBody) (aliRsp CloseTradeResponse, err error)
统一收单交易关闭接口
func (*Client) ConvertToBodyMap ¶
生成到BodyMap中
func (*Client) CreateTrade ¶
func (c *Client) CreateTrade(body CreateTradeBody, notifyUrl string) (aliRsp CreateTradeResponse, err error)
统一收单交易创建接口,对应pay接口支付
func (*Client) FormatPrivateKey ¶
将私钥字符串转换为RSA私钥格式
func (*Client) FormatPublicKey ¶
将公钥字符串转换为RSA公钥格式
func (*Client) GenerateBizContent ¶
生成业务字段
func (*Client) OrderSettleTrade ¶
func (c *Client) OrderSettleTrade(body OrderSettleTradeBody) (aliRsp OrderSettleTradeResponse, err error)
统一收单交易结算接口
func (*Client) OrderSyncTrade ¶
func (c *Client) OrderSyncTrade(body OrderSyncTradeBody) (aliRsp OrderSyncTradeResponse, err error)
支付宝订单信息同步接口
func (*Client) PayTrade ¶
func (c *Client) PayTrade(body PayTradeBody) (aliRsp PayTradeResponse, err error)
统一收单交易支付接口
func (*Client) PreCreateTrade ¶
func (c *Client) PreCreateTrade(body PreCreateTradeBody, notifyUrl string) (aliRsp PreCreateTradeResponse, err error)
统一收单交易预创接口,支付动作在支付宝内完成,根据传入的通知地址异步通知服务商(推荐),
func (*Client) QueryTrade ¶
func (c *Client) QueryTrade(body QueryTradeBody) (aliRsp QueryTradeResponse, err error)
统一收单线下交易查询接口
func (*Client) RefundQueryTrade ¶
func (c *Client) RefundQueryTrade(body RefundQueryTradeBody) (aliRsp RefundQueryTradeResponse, err error)
统一收单交易退款查询接口
func (*Client) RefundTrade ¶
func (c *Client) RefundTrade(body RefundTradeBody) (aliRsp RefundTradeResponse, err error)
统一收单交易退款接口
func (*Client) SystemOAuthToken ¶
func (c *Client) SystemOAuthToken(body SystemOAuthTokenBody) (aliRsp SystemOAuthTokenResponse, err error)
换取授权访问令牌接口 https://docs.open.alipay.com/api_9/alipay.system.oauth.token
type CloseTradeBody ¶
type CloseTradeResponse ¶
type CloseTradeResponse struct {
ResponseModel
// 响应参数
TradeNo string `json:"trade_no"` // 支付宝交易号
OutTradeNo string `json:"out_trade_no"` // 商户订单号
}
type CloseTradeResponseModel ¶
type CloseTradeResponseModel struct {
Data CloseTradeResponse `json:"alipay_trade_close_response"` // 返回值信息
Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074
}
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
NotifyUrl string `json:"notify_url"` // 支付宝服务器主动通知商户服务器里指定的页面http/https路径
AppAuthToken string `json:"app_auth_token"` // 应用授权,参见https://docs.open.alipay.com/common/105193
}
公共参数配置
type CreateTradeBody ¶
type CreateTradeBody 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 CreateTradeResponse ¶
type CreateTradeResponse struct {
ResponseModel
// 响应参数
OutTradeNo string `json:"out_trade_no"` // 商户订单号
TradeNo string `json:"trade_no"` // 支付宝交易号
}
type CreateTradeResponseModel ¶
type CreateTradeResponseModel struct {
Data CreateTradeResponse `json:"alipay_trade_create_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 OrderSettleTradeBody ¶
type OrderSettleTradeBody struct {
OutRequestNo string `json:"out_request_no"` // 结算请求流水号
TradeNo string `json:"trade_no"` // 支付宝订单号
RoyaltyParameters []RoyaltyParameter `json:"royalty_parameters"` // 分账明细信息
OperatorId string `json:"operator_id,omitempty"` // 商户操作员编号
}
type OrderSettleTradeResponse ¶
type OrderSettleTradeResponse struct {
ResponseModel
// 响应参数
TradeNo string `json:"trade_no"` // 支付宝交易号
}
type OrderSettleTradeResponseModel ¶
type OrderSettleTradeResponseModel struct {
Data OrderSettleTradeResponse `json:"alipay_trade_order_settle_response"` // 返回值信息
Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074
}
type OrderSyncTradeBody ¶
type OrderSyncTradeBody 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 OrderSyncTradeResponse ¶
type OrderSyncTradeResponse struct {
ResponseModel
// 响应参数
TradeNo string `json:"trade_no"` // 支付宝交易号
OutTradeNo string `json:"out_trade_no,omitempty"` // 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复
BuyerUserId string `json:"buyer_user_id"` // 买家在支付宝的用户id
}
type OrderSyncTradeResponseModel ¶
type OrderSyncTradeResponseModel struct {
Data OrderSyncTradeResponse `json:"alipay_trade_orderinfo_sync_response"` // 返回值信息
Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074
}
type PayTradeBody ¶
type PayTradeBody 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 PayTradeResponse ¶
type PayTradeResponse 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 PayTradeResponseModel ¶
type PayTradeResponseModel struct {
Data PayTradeResponse `json:"alipay_trade_pay_response"` // 返回值信息
Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074
}
type PreCreateTradeBody ¶
type PreCreateTradeBody 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 PreCreateTradeResponse ¶
type PreCreateTradeResponse struct {
ResponseModel
// 响应参数
OutTradeNo string `json:"out_trade_no"` // 商户订单号
QrCode string `json:"qr_code"` // 当前预下单请求生成的二维码码串
}
type PreCreateTradeResponseModel ¶
type PreCreateTradeResponseModel struct {
Data PreCreateTradeResponse `json:"alipay_trade_precreate_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 QueryTradeBody ¶
type QueryTradeResponse ¶
type QueryTradeResponse 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 QueryTradeResponseModel ¶
type QueryTradeResponseModel struct {
Data QueryTradeResponse `json:"alipay_trade_query_response"` // 返回值信息
Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074
}
type ReceiverAddress ¶
type RefundQueryTradeBody ¶
type RefundQueryTradeBody 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 RefundQueryTradeResponse ¶
type RefundQueryTradeResponse 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 RefundQueryTradeResponseModel ¶
type RefundQueryTradeResponseModel struct {
Data RefundQueryTradeResponse `json:"alipay_trade_fastpay_refund_query_response"` // 返回值信息
Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074
}
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 RefundTradeBody ¶
type RefundTradeBody 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 RefundTradeResponse ¶
type RefundTradeResponse 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 RefundTradeResponseModel ¶
type RefundTradeResponseModel struct {
Data RefundTradeResponse `json:"alipay_trade_refund_response"` // 返回值信息
Sign string `json:"sign"` // 签名,参见https://docs.open.alipay.com/291/106074
}
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 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_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
- util.go
Click to show internal directories.
Click to hide internal directories.