Documentation
¶
Index ¶
- func ReturnCodeToMsg(code string) string
- type AlipayClient
- func (s *AlipayClient) GetNotifyResult(httpRequest *http.Request) (map[string]string, *AppPayNotifyResponse, error)
- func (s *AlipayClient) GetOrderQrCode(outTradeNo, subject, body string, amount float64) (string, error)
- func (s *AlipayClient) GetOrderString(outTradeNo, subject, body string, amount float64, passbackParams string, ...) (string, error)
- func (s *AlipayClient) GetReturnResultSignString(returnResultString string) string
- func (s *AlipayClient) NotifyVerify(dataParams map[string]string) (bool, error)
- func (s *AlipayClient) ReturnVerify(returnResultResp *AppPayReturnResultResponse) (bool, error)
- func (s *AlipayClient) SetGatewayUrl(gatewayUrl string)
- func (s *AlipayClient) SetNotifyUrl(notifyUrl string)
- func (s *AlipayClient) SetSellerId(sellerId string)
- func (s *AlipayClient) SetTimeoutExpress(timeoutExpress string)
- func (s *AlipayClient) Sign(datas map[string]string) (string, error)
- type AlipayTradePreCreateResponse
- type AppOauthTokenQueryResponse
- type AppOauthTokenResponse
- type AppPayNotifyResponse
- type AppPayRequest
- type AppPayRequestContent
- type AppPayResponse
- type AppPayReturnResult
- type AppPayReturnResultResponse
- type AppPayTradeAppPayResponse
- type PreCreateRequest
- type PreCreateResponse
- type PreCreateyGoodsDetail
- type PreCreateyRequestContent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReturnCodeToMsg ¶
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 获取同步验签编码对应的消息描述 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Types ¶
type AlipayClient ¶
type AlipayClient struct {
// contains filtered or unexported fields
}
================================================================================ * 支付宝支付签名工具模块 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
func NewAlipayClient ¶
func NewAlipayClient(appId, appPrivate, alipayPublicKey string) *AlipayClient
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 创建Alipay客户端 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) GetNotifyResult ¶
func (s *AlipayClient) GetNotifyResult(httpRequest *http.Request) (map[string]string, *AppPayNotifyResponse, error)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 获取异步通知响应数据结果 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) GetOrderQrCode ¶
func (s *AlipayClient) GetOrderQrCode( outTradeNo, subject, body string, amount float64) (string, error)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 获取预创建支付二维码地址 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) GetOrderString ¶
func (s *AlipayClient) GetOrderString( outTradeNo, subject, body string, amount float64, passbackParams string, creationDate time.Time) (string, error)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 获取订单字符串给APP支付客户端 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) GetReturnResultSignString ¶
func (s *AlipayClient) GetReturnResultSignString(returnResultString string) string
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 从同步结果原始字符串获取待签名的字符串 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) NotifyVerify ¶
func (s *AlipayClient) NotifyVerify(dataParams map[string]string) (bool, error)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 异步验签 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) ReturnVerify ¶
func (s *AlipayClient) ReturnVerify( returnResultResp *AppPayReturnResultResponse) (bool, error)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 同步验签 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) SetGatewayUrl ¶
func (s *AlipayClient) SetGatewayUrl(gatewayUrl string)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 设置网关地址 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) SetNotifyUrl ¶
func (s *AlipayClient) SetNotifyUrl(notifyUrl string)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 设置通知地址 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) SetSellerId ¶
func (s *AlipayClient) SetSellerId(sellerId string)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 设置卖家支付宝id(不设置则已申请支付时绑定的支付宝为默认值) * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
func (*AlipayClient) SetTimeoutExpress ¶
func (s *AlipayClient) SetTimeoutExpress(timeoutExpress string)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 设置订单支付过期时间(15m,24h,1d) * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
type AlipayTradePreCreateResponse ¶
type AlipayTradePreCreateResponse struct { Code string `form:"code" json:"code"` //网关返回码 Msg string `form:"msg" json:"msg"` //网关返回码描述 SubCode string `form:"sub_code" json:"sub_code"` //业务返回码 SubMSg string `form:"sub_msg" json:"sub_msg"` //业务返回码描述 OutTradeNo string `form:"out_trade_no" json:"out_trade_no"` //商户的订单号 QrCode string `form:"qr_code" json:"qr_code"` //当前预下单请求生成的二维码码串,可以用二维码生成工具根据该码串值生成对应的二维码 }
func (*AlipayTradePreCreateResponse) ToMap ¶
func (s *AlipayTradePreCreateResponse) ToMap() map[string]string
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 对象转成字典 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
type AppOauthTokenQueryResponse ¶
type AppOauthTokenQueryResponse struct { UserId string `form:"user_id" json:"user_id"` //授权商户的user_id AuthAppId string `form:"auth_app_id" json:"auth_app_id"` //授权商户的appid AuthMethods []string `form:"auth_methods" json:"auth_methods"` //当前app_auth_token的授权接口列表 AuthStart string `form:"auth_start" json:"auth_start"` //授权生效时间 AuthEnd string `form:"auth_end" json:"auth_end"` //授权失效时间 ExpiresIn string `form:"expires_in" json:"expires_in"` //应用授权令牌失效时间,单位到秒 Status string `form:"status" json:"status"` //valid:有效状态;invalid:无效状态 }
================================================================================ * AppOauthTokenQueryResponse数据域结构 * api: alipay.open.auth.token.app.query * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
type AppOauthTokenResponse ¶
type AppOauthTokenResponse struct { UserId string `form:"user_id" json:"user_id"` //授权商户的user_id AuthAppId string `form:"auth_app_id" json:"auth_app_id"` //授权商户的appid AppAuthToken string `form:"app_auth_token" json:"app_auth_token"` //应用授权令牌 AppRefreshToken string `form:"app_refresh_token" json:"app_refresh_token"` //刷新令牌 ExpiresIn string `form:"expires_in" json:"expires_in"` //应用授权令牌的有效时间(从接口调用时间作为起始时间),单位到秒 ReExpiresIn string `form:"re_expires_in" json:"re_expires_in"` //刷新令牌的有效时间(从接口调用时间作为起始时间),单位到秒 }
================================================================================ * AppPayResponse数据域结构 * api: alipay.open.auth.token.app * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
type AppPayNotifyResponse ¶
type AppPayNotifyResponse struct { AppId string `form:"app_id" json:"app_id"` //支付宝分配给开发者的应用Id Subject string `form:"subject" json:"subject"` //商品的标题/交易标题/订单标题/订单关键字等,是请求时对应的参数,原样通知回来 Body string `form:"body" json:"body"` //该订单的备注、描述、明细等。对应请求时的body参数,原样通知回来 TradeNo string `form:"trade_no" json:"trade_no"` //支付宝交易凭证号 OutTradeNo string `form:"out_trade_no" json:"out_trade_no"` //原支付请求的商户订单号 OutBizNo string `form:"out_biz_no" json:"out_biz_no"` //商户业务ID,主要是退款通知中返回退款申请的流水号 BuyerId string `form:"buyer_id" json:"buyer_id"` //买家支付宝账号对应的支付宝唯一用户号。以2088开头的纯16位数字 BuyerLogonId string `form:"buyer_logon_id" json:"buyer_logon_id"` //买家支付宝账号 SellerId string `form:"seller_id" json:"seller_id"` //卖家支付宝用户号 SellerEmail string `form:"seller_email" json:"seller_email"` //卖家支付宝账号 TradeStatus string `form:"trade_status" json:"trade_status"` //交易目前所处的状态 TotalAmount string `form:"total_amount" json:"total_amount"` //本次交易支付的订单金额,单位为人民币(元) ReceiptAmount string `form:"receipt_amount" json:"receipt_amount"` //商家在交易中实际收到的款项,单位为元 InvoiceAmount string `form:"invoice_amount" json:"invoice_amount"` //用户在交易中支付的可开发票的金额 BuyerPayAmount string `form:"buyer_pay_amount" json:"buyer_pay_amount"` //用户在交易中支付的金额 PointAmount string `form:"point_amount" json:"point_amount"` //使用集分宝支付的金额 RefundFee string `form:"refund_fee" json:"refund_fee"` //退款通知中,返回总退款金额,单位为元,支持两位小数 FundBillList string `form:"fund_bill_list" json:"fund_bill_list"` //支付成功的各个渠道金额信息 VoucherDetailList string `form:"voucher_detail_list" json:"voucher_detail_list"` //本交易支付时所使用的所有优惠券信息 PassbackParams string `form:"passback_params" json:"passback_params"` //公共回传参数,如果请求时传递了该参数,则返回给商户时会在异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付宝 Charset string `form:"charset" json:"charset"` //编码格式,如utf-8、gbk、gb2312等 Sign string `form:"sign" json:"sign"` //601510b7970e52cc63db0f44997cf70e SignType string `form:"sign_type" json:"sign_type"` //商户生成签名字符串所使用的签名算法类型,目前支持RSA2和RSA,推荐使用RSA2 NotifyId string `form:"notify_id" json:"notify_id"` //通知校验ID NotifyType string `form:"notify_type" json:"notify_type"` //通知的类型 NotifyTime string `form:"notify_time" json:"notify_time"` //通知的发送时间。格式为yyyy-MM-dd HH:mm:ss GmtCreate string `form:"gmt_create" json:"gmt_create"` //该笔交易创建的时间。格式为yyyy-MM-dd HH:mm:ss GmtPayment string `form:"gmt_payment" json:"gmt_payment"` //该笔交易的买家付款时间。格式为yyyy-MM-dd HH:mm:ss GmtRefund string `form:"gmt_refund" json:"gmt_refund"` //该笔交易的退款时间。格式为yyyy-MM-dd HH:mm:ss.S GmtClose string `form:"gmt_close" json:"gmt_close"` //该笔交易结束时间。格式为yyyy-MM-dd HH:mm:ss Version string `form:"version" json:"version"` //调用的接口版本,固定为:1.0 }
================================================================================ * AppPayNotifyResponse数据域结构 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
func (*AppPayNotifyResponse) ToMap ¶
func (s *AppPayNotifyResponse) ToMap() map[string]string
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 对象转成字典 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
type AppPayRequest ¶
type AppPayRequest struct { AppId string `form:"app_id" json:"app_id"` //支付宝分配给开发者的应用ID,2014072300007148 BizContent *AppPayRequestContent `form:"biz_content" json:"biz_content"` //业务请求参数的集合,最大长度不限,除公共参数外所有请求参数都必须放在这个参数中传递,具体参照各产品快速接入文档 Method string `form:"method" json:"method"` //接口名称,alipay.trade.app.pay Format string `form:"format" json:"format"` //仅支持JSON,JSON Charset string `form:"charset" json:"charset"` //请求使用的编码格式,如utf-8,gbk,gb2312等,utf-8 Sign string `form:"sign" json:"sign"` //商户请求参数的签名串 SignType string `form:"sign_type" json:"sign_type"` //商户生成签名字符串所使用的签名算法类型,目前支持RSA2和RSA,推荐使用RSA2,RSA2 NotifyUrl string `form:"notify_url" json:"notify_url"` //支付宝服务器主动通知商户服务器里指定的页面http/https路径。建议商户使用https Timestamp string `form:"timestamp" json:"timestamp"` //发送请求的时间,格式"yyyy-MM-dd HH:mm:ss",2014-07-24 03:07:50 Version string `form:"version" json:"version"` //调用的接口版本,固定为:1.0 }
================================================================================ * AppPayRequest数据域结构 * alipay.trade.app.pay app支付接口2.0 * alipay.trade.create 商户通过该接口进行交易的创建下单 * alipay.trade.close 统一收单交易关闭接口 * alipay.trade.cancel 统一收单交易撤销接口 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
func (*AppPayRequest) ToMap ¶
func (s *AppPayRequest) ToMap() map[string]string
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 对象转成字典 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
type AppPayRequestContent ¶
type AppPayRequestContent struct { SellerId string `form:"seller_id" json:"seller_id"` //非必填,收款支付宝用户ID。 如果该值为空,则默认为商户签约账号对应的支付宝用户ID,如:2088102147948060 OutTradeNo string `form:"out_trade_no" json:"out_trade_no"` //必填,商户网站唯一订单号 Subject string `form:"subject" json:"subject"` //必填,商品的标题/交易标题/订单标题/订单关键字等。 Body string `form:"body" json:"body"` //非必填,对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。 GoodsType string `form:"goods_type" json:"goods_type"` //非必填,商品主类型 :0-虚拟类商品,1-实物类商品 ProductCode string `form:"product_code" json:"product_code"` //必填,销售产品码,商家和支付宝签约的产品码,为固定值QUICK_MSECURITY_PAY EnablePayChannels string `form:"enable_pay_channels" json:"enable_pay_channels"` //非必填,可用渠道,用户只能在指定渠道范围内支付当有多个渠道时用“,”分隔 DisablePayChannels string `form:"disable_pay_channels" json:"disable_pay_channels"` //非必填,可用渠道,用户只能在指定渠道范围内支付当有多个渠道时用“,”分隔, 注:与disable_pay_channels互斥 PassbackParams string `form:"passback_params" json:"passback_params"` //非必填,公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付宝只会在同步返回(包括跳转回商户网站)和异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付宝。 PromoParams string `form:"promo_params" json:"promo_params"` //非必填,优惠参数,仅与支付宝协商后可用 ExtendParams string `form:"extend_params" json:"extend_params"` //非必填,业务扩展参数 StoreId string `form:"store_id" json:"store_id"` //非必填,商户门店编号 TimeExpire string `form:"time_expire" json:"time_expire"` //绝对超时时间,格式为yyyy-MM-dd HH:mm。 TimeoutExpress string `form:"timeout_express" json:"timeout_express"` //非必填,该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。 TotalAmount string `form:"total_amount" json:"total_amount"` //必填,订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] }
================================================================================ * AppPayRequestContent数据域结构 * alipay.trade.app.pay app支付接口2.0 * alipay.trade.create 商户通过该接口进行交易的创建下单 * alipay.trade.close 统一收单交易关闭接口 * alipay.trade.cancel 统一收单交易撤销接口 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
type AppPayResponse ¶
type AppPayResponse struct { TradeNo string `form:"trade_no" json:"trade_no"` //该交易在支付宝系统中的交易流水号。 OutTradeNo string `form:"out_trade_no" json:"out_trade_no"` //商户网站唯一订单号 SellerId string `form:"seller_id" json:"seller_id"` //收款支付宝账号对应的支付宝唯一用户号。 以2088开头的纯16位数字 TotalAmount string `form:"total_amount" json:"total_amount"` //该笔订单的资金总额,单位为RMB-Yuan。取值范围为[0.01,100000000.00],精确到小数点后两位。 }
================================================================================ * AppPayResponse数据域结构 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
type AppPayReturnResult ¶
type AppPayReturnResult struct { AppPayTradeAppPayResponse *AppPayTradeAppPayResponse `form:"alipay_trade_app_pay_response" json:"alipay_trade_app_pay_response"` Sign string `form:"sign" json:"sign"` //签名字符串 SignType string `form:"sign_type" json:"sign_type"` //签名类型 }
type AppPayReturnResultResponse ¶
type AppPayReturnResultResponse struct { Memo string `form:"memo" json:"memo"` Result *AppPayReturnResult `form:"result" json:"result"` //同步结果对象 RawResultString string `form:"raw_result_string" json:"raw_result_string"` //原始同步结果字符串 ResultStatus string `form:"result_status" json:"result_status"` //同步结果状态(9000: 订单支付成功) }
================================================================================ * AppPayReturnResponse数据域结构 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu
{ "memo" : "xxxxx", "result" : "{ \"alipay_trade_app_pay_response\":{ \"code\":\"10000\", \"msg\":\"Success\", \"app_id\":\"2014072300007148\", \"out_trade_no\":\"081622560194853\", \"trade_no\":\"2016081621001004400236957647\", \"total_amount\":\"0.01\", \"seller_id\":\"2088702849871851\", \"charset\":\"utf-8\", \"timestamp\":\"2016-10-11 17:43:36\" }, \"sign\":\"NGfStJf3i3ooWBuCDIQSumOpaGBcQz+aoAqyGh3W6EqA/gmyPYwLJ2REFijY9XPTApI9YglZyMw+ZMhd3kb0mh4RAXMrb6mekX4Zu8Nf6geOwIa9kLOnw0IMCjxi4abDIfXhxrXyj********\", \"sign_type\":\"RSA2\" }", "resultStatus" : "9000" }
* 4000: 订单支付失败 * 5000: 重复请求 * 6001: 用户中途取消 * 6002: 网络连接出错 * 6004: 支付结果未知(有可能已经支付成功),请查询商户订单列表中订单的支付状态 * 8000: 正在处理中,支付结果未知(有可能已经支付成功),请查询商户订单列表中订单的支付状态 * 9000: 订单支付成功 * 10000: 接口调用成功,调用结果请参考具体的API文档所对应的业务返回参数 * 20000: 服务不可用 * 20001: 授权权限不足 * 40001: 缺少必选参数 * 40002: 非法的参数 * 40004: 业务处理失败 * 40006: 权限不足 * ================================================================================
type AppPayTradeAppPayResponse ¶
type AppPayTradeAppPayResponse struct { AppId string `form:"app_id" json:"app_id"` //支付宝分配给开发者的应用Id TradeNo string `form:"trade_no" json:"trade_no"` //该交易在支付宝系统中的交易流水号。最长64位。 OutTradeNo string `form:"out_trade_no" json:"out_trade_no"` //商户网站唯一订单号 SellerId string `form:"seller_id" json:"seller_id"` //收款支付宝账号对应的支付宝唯一用户号。以2088开头的纯16位数字 TotalAmount string `form:"total_amount" json:"total_amount"` //该笔订单的资金总额,单位为RMB-Yuan。取值范围为[0.01,100000000.00],精确到小数点后两位。 Code string `form:"code" json:"code"` //结果码 Msg string `form:"msg" json:"msg"` //处理结果的描述,信息来自于code返回结果的描述 Charset string `form:"charset" json:"charset"` //编码格式 Timestamp string `form:"timestamp" json:"timestamp"` //2016-10-11 17:43:36 }
func (*AppPayTradeAppPayResponse) ToMap ¶
func (s *AppPayTradeAppPayResponse) ToMap() map[string]string
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 对象转成字典 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
type PreCreateRequest ¶
type PreCreateRequest struct { AppId string `form:"app_id" json:"app_id"` //支付宝分配给开发者的应用ID BizContent *PreCreateyRequestContent `form:"biz_content" json:"biz_content"` //请求参数的集合,最大长度不限,除公共参数外所有请求参数都必须放在这个参数中传递,具体参照各产品快速接入文档 Method string `form:"method" json:"method"` //接口名称 Format string `form:"format" json:"format"` //仅支持JSON AppAuthToken string `form:"app_auth_token" json:"app_auth_token"` //应用授权概述 Charset string `form:"charset" json:"charset"` //请求使用的编码格式,如utf-8,gbk,gb2312等 Sign string `form:"sign" json:"sign"` //商户请求参数的签名串 SignType string `form:"sign_type" json:"sign_type"` //商户生成签名字符串所使用的签名算法类型,目前支持RSA2和RSA,推荐使用RSA2 NotifyUrl string `form:"notify_url" json:"notify_url"` //支付宝服务器主动通知商户服务器里指定的页面http/https路径 Timestamp string `form:"timestamp" json:"timestamp"` //发送请求的时间,格式"yyyy-MM-dd HH:mm:ss" Version string `form:"version" json:"version"` //调用的接口版本,固定为:1.0 }
================================================================================ * PreCreateRequest数据域结构 * api: alipay.trade.precreate * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
func (*PreCreateRequest) ToMap ¶
func (s *PreCreateRequest) ToMap() map[string]string
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * 对象转成字典 * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
type PreCreateResponse ¶
type PreCreateResponse struct { AlipayTradePreCreateResponse *AlipayTradePreCreateResponse `form:"alipay_trade_precreate_response" json:"alipay_trade_precreate_response"` //当前预下单请求生成的二维码码串,可以用二维码生成工具根据该码串值生成对应的二维码 Sign string `form:"sign" json:"sign"` //签名 }
================================================================================ * PreCreateResponse数据域结构 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================
type PreCreateyGoodsDetail ¶
type PreCreateyGoodsDetail struct { GoodsId string `form:" goods_id " json:" goods_id"` //商品的编号 AlipayGoodsId string `form:" alipay_goods_id " json:" alipay_goods_id"` //支付宝定义的统一商品编号 GoodsName string `form:"goods_name " json:"goods_name"` //商品名称 GoodsCategory string `form:"goods_category " json:" goods_category"` //商品类目 Body string `form:"body " json:" body"` //商品描述信息 ShowUrl string `form:"show_url " json:" show_url"` //商品的展示地址 Quantity int `form:"quantity " json:"quantity"` //商品数量 Price float64 `form:"price " json:"price"` //商品单价,单位为元 }
type PreCreateyRequestContent ¶
type PreCreateyRequestContent struct { SellerId string `form:"seller_id" json:"seller_id"` //卖家支付宝用户ID。 如果该值为空,则默认为商户签约账号对应的支付宝用户ID OutTradeNo string `form:"out_trade_no" json:"out_trade_no"` //必填 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复 Subject string `form:"subject" json:"subject"` //必填 订单标题 Body string `form:"body " json:"body"` //对交易或商品的描述 BuyerLogonId string `form:"buyer_logon_id" json:"buyer_logon_id"` //买家支付宝账号 OperatorId string `form:"operator_id " json:"operator_id"` //商户操作员编号 StoreId string `form:"store_id " json:"store_id"` //商户门店编号 AlipayStoreId string `form:"alipay_store_id " json:"alipay_store_id"` //支付宝店铺的门店ID TerminalId string `form:"terminal_id " json:"terminal_id"` //商户机具终端编号 GoodsDetail []*PreCreateyGoodsDetail `form:"terminal_id " json:"terminal_id"` //订单包含的商品列表信息.Json格式. 其它说明详见:“商品明细说明” UndiscountableAmount float64 `form:"undiscountable_amount" json:"undiscountable_amount"` //不可打折金额. 不参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 如果该值未传入,但传入了【订单总金额】,【打折金额】,则该值默认为【订单总金额】-【打折金额】 DiscountableAmount float64 `form:"discountable_amount" json:"discountable_amount"` //可打折金额. 参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 如果该值未传入,但传入了【订单总金额】,【不可打折金额】则该值默认为【订单总金额】-【不可打折金额】 TotalAmount float64 `form:"total_amount" json:"total_amount"` //必填 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】 TimeoutExpress string `form:"timeout_express" json:"timeout_express"` //该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。 }
================================================================================ * PreCreateyRequestContent数据域结构 * qq group: 582452342 * email : 2091938785@qq.com * author : 美丽的地球啊 - mliu * ================================================================================