alipay

package module
v3.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2020 License: MIT Imports: 19 Imported by: 39

README

AliPay SDK for Golang

安装

启用 Go module
go get github.com/smartwalle/alipay/v3
import github.com/smartwalle/alipay/v3
未启用 Go module
go get github.com/smartwalle/alipay
import github.com/smartwalle/alipay

帮助

在集成的过程中有遇到问题,欢迎加 QQ 群 564704807 讨论,或者使用微信扫描下方的二维码。

smartwalle

其它支付

微信支付 https://github.com/smartwalle/wxpay

PayPal https://github.com/smartwalle/paypal

关于各分支(版本)

  • v1 - 最老的版本,实现了完整的支付功能,目前已停止更新维护;
  • v2 - 在 v1 的基础上进行了一些优化和规范调整,目前已停止更新维护;
  • v3 - 支持公钥证书普通公钥进行签名验证,详情可以参考 https://docs.open.alipay.com/291/105974/https://docs.open.alipay.com/291/105971/,为目前主要维护分支;
  • master - 和主要维护分支同步;

推荐使用 v3 版本

v3 版本如何初始化

下面用到的 privateKey 需要特别注意一下,如果是通过“支付宝开发平台开发助手”创建的CSR文件,在 CSR 文件所在的目录下会生成相应的私钥文件,我们需要使用该私钥进行签名。

var client, err = alipay.New(appID, privateKey, true)
公钥证书

如果采用公钥证书方式进行验证签名,需要调用以下几个方法加载证书信息,所有证书都是从支付宝创建的应用处下载,参考 https://docs.open.alipay.com/291/105971/https://docs.open.alipay.com/291/105972/

client.LoadAppPublicCertFromFile("appCertPublicKey_2017011104995404.crt") // 加载应用公钥证书
client.LoadAliPayRootCertFromFile("alipayRootCert.crt") // 加载支付宝根证书
client.LoadAliPayPublicCertFromFile("alipayCertPublicKey_RSA2.crt") // 加载支付宝公钥证书
普通公钥
client.LoadAliPayPublicKey("aliPublicKey")

特别注意:公钥证书普通公钥不能同时存在,只能选择其中一种。

已实现接口

手机网站支付API
中线(-)后面的名称是该接口在 AliPay 结构体中对应的方法名。
  • 手机网站支付接口

    alipay.trade.wap.pay - TradeWapPay()

  • 电脑网站支付

    alipay.trade.page.pay - TradePagePay()

  • 统一收单线下交易查询

    alipay.trade.query - TradeQuery()

  • 统一收单交易支付接口

    alipay.trade.pay - TradePay()

  • 统一收单交易创建接口

    alipay.trade.create - TradeCreate()

  • 统一收单线下交易预创建

    alipay.trade.precreate - TradePreCreate()

  • 统一收单交易撤销接口

    alipay.trade.cancel - TradeCancel()

  • 统一收单交易关闭接口

    alipay.trade.close - TradeClose()

  • 统一收单交易退款接口

    alipay.trade.refund - TradeRefund()

  • App支付接口

    alipay.trade.app.pay - TradeAppPay()

  • 统一收单交易退款查询

    alipay.trade.fastpay.refund.query - TradeFastpayRefundQuery()

  • 支付宝订单信息同步接口

    alipay.trade.orderinfo.sync - TradeOrderInfoSync()

  • 单笔转账到支付宝账户接口

    alipay.fund.trans.toaccount.transfer - FundTransToAccountTransfer()

  • 查询转账订单接口

    alipay.fund.trans.order.query - FundTransOrderQuery()

  • 资金授权发码接口

    alipay.fund.auth.order.voucher.create - FundAuthOrderVoucherCreate()

  • 资金授权操作查询接口

    alipay.fund.auth.operation.detail.query - FundAuthOperationDetailQuery()

  • 资金授权撤销接口

    alipay.fund.auth.operation.cancel - FundAuthOperationCancel()

  • 资金授权解冻接口

    alipay.fund.auth.order.unfreeze - FundAuthOrderUnfreeze()

  • 资金授权冻结接口

    alipay.fund.auth.order.freeze - FundAuthOrderFreeze()

  • 线上资金授权冻结接口

    alipay.fund.auth.order.app.freeze - FundAuthOrderAppFreeze()

  • 查询对账单下载地址

    alipay.data.dataservice.bill.downloadurl.query - BillDownloadURLQuery()

  • 支付宝商家账户当前余额查询

    alipay.data.bill.balance.query - BillBalanceQuery()

  • 身份认证初始化服务

    alipay.user.certify.open.initialize - UserCertifyOpenInitialize()

  • 身份认证开始认证

    alipay.user.certify.open.certify - UserCertifyOpenCertify()

  • 身份认证记录查询

    alipay.user.certify.open.query - UserCertifyOpenQuery()

  • 用户信息授权(网站支付宝登录快速接入)

    生成授权链接 - PublicAppAuthorize()

  • 换取授权访问令牌

    alipay.system.oauth.token - SystemOauthToken()

  • 支付宝会员授权信息查询

    alipay.user.info.share - UserInfoShare()

  • App支付宝登录

    com.alipay.account.auth - AccountAuth()

  • 支付宝个人协议页面签约

    alipay.user.agreement.page.sign - AgreementPageSign()

  • 支付宝个人代扣协议查询

    alipay.user.agreement.query - AgreementQuery()

  • 支付宝个人代扣协议解约

    alipay.user.agreement.unsign - AgreementUnsign()

  • 支单笔转账接口

    alipay.fund.trans.uni.transfer - FundTransUniTransfer()

  • 转账业务单据查询接口

    alipay.fund.trans.common.query - FundTransCommonQuery()

  • 支付宝资金账户资产查询接口

    alipay.fund.account.query - FundAccountQuery()

通知
  • 通知内容转换及签名验证

    将支付宝的通知内容转换为 Golang 的结构体,并且验证其合法性。

集成流程

支付宝开放平台申请创建相关的应用,使用自己的支付宝账号登录即可。

沙箱环境

支付宝开放平台为每一个应用提供了沙箱环境,供开发人员开发测试使用。

沙箱环境是独立的,每一个应用都会有一个商家账号和买家账号。

应用信息配置

参考官网文档 进行应用的配置。

本 SDK 中的签名方法默认为 RSA2,采用支付宝提供的 RSA签名&验签工具 生成秘钥时,秘钥的格式必须为 PKCS1,秘钥长度推荐 2048。所以在支付宝管理后台请注意配置 RSA2(SHA256)密钥

生成秘钥对之后,将公钥提供给支付宝(通过支付宝后台上传)对我们请求的数据进行签名验证,我们的代码中将使用私钥对请求数据签名。

请参考 如何生成 RSA 密钥

创建 Wap 支付
var privateKey = "xxx" // 必须,上一步中使用 RSA签名验签工具 生成的私钥
var client, err = alipay.New(appId, privateKey, false)

client.LoadAppPublicCertFromFile("appCertPublicKey_2017011104995404.crt") // 加载应用公钥证书
client.LoadAliPayRootCertFromFile("alipayRootCert.crt") // 加载支付宝根证书
client.LoadAliPayPublicCertFromFile("alipayCertPublicKey_RSA2.crt") // 加载支付宝公钥证书

// 将 key 的验证调整到初始化阶段
if err != nil {
	fmt.Println(err)
	return
}

var p = alipay.TradeWapPay{}
p.NotifyURL = "http://xxx"
p.ReturnURL = "http://xxx"
p.Subject = "标题"
p.OutTradeNo = "传递一个唯一单号"
p.TotalAmount = "10.00"
p.ProductCode = "QUICK_WAP_WAY"

var url, err = client.TradeWapPay(p)
if err != nil {
	fmt.Println(err)
}

var payURL = url.String()
fmt.Println(payURL)
// 这个 payURL 即是用于支付的 URL,可将输出的内容复制,到浏览器中访问该 URL 即可打开支付页面。
同步返回验签

支持自动对支付宝返回的数据进行签名验证,详细信息请参考自行实现验签.

Return URL

发起支付的时候,当我们有提供 Return URL 参数,那么支付成功之后,支付宝将会重定向到该 URL,并附带上相关的参数。

var p = alipay.TradeWapPay{}
p.ReturnURL = "http://xxx/return"

这时候我们需要对支付宝提供的参数进行签名验证:

http.HandleFunc("/return", func(rep http.ResponseWriter, req *http.Request) {
	req.ParseForm()
	ok, err := client.VerifySign(req.Form)
	fmt.Println(ok, err)
}
异步验证支付结果

有支付或者其它动作发生后,支付宝服务器会调用我们提供的 Notify URL,并向其传递会相关的信息。参考手机网站支付结果异步通知

我们需要在提供的 Notify URL 服务中获取相关的参数并进行验证:

http.HandleFunc("/alipay", func(rep http.ResponseWriter, req *http.Request) {
	var noti, _ = client.GetTradeNotification(req)
	if noti != nil {
		fmt.Println("交易状态为:", noti.TradeStatus)
	}
	alipay.AckNotification(rep) // 确认收到通知消息
})

此验证方法适用于支付宝所有情况下发送的 Notify,不管是手机 App 支付还是 Wap 支付。

关于应用私钥 (privateKey)

应用私钥是我们通过工具生成的私钥,调用支付宝接口的时候,我们需要使用该私钥对参数进行签名。

关于 alipay.New() 函数中的最后一个参数 isProduction

支付宝提供了用于开发时测试的 sandbox 环境,对接的时候需要注意相关的 app id 和密钥是 sandbox 环境还是 production 环境的。如果是 sandbox 环境,本参数应该传 false,否则为 true。

支持 RSA 签名及验证

默认采用的是 RSA2 签名,不再提供 RSA 的支持

License

This project is licensed under the MIT License.

Documentation

Index

Constants

View Source
const (
	NotifyTypeTradeStatusSync = "trade_status_sync"
)

Variables

View Source
var (
	ErrSignNotFound         = errors.New("alipay: sign content not found")
	ErrAliPublicKeyNotFound = errors.New("alipay: alipay public key not found")
)

Functions

func AckNotification

func AckNotification(w http.ResponseWriter)

func NewRequest

func NewRequest(method, url string, params url.Values) (*http.Request, error)

Types

type AccessParams added in v3.0.11

type AccessParams struct {
	Channel string `json:"channel,omitempty"` // 目前支持以下值:1.ALIPAYAPP(钱包h5页面签约)2.QRCODE(扫码签约)3.QRCODEORSMS(扫码签约或者短信签约)
}

type AccountAuth added in v3.0.11

type AccountAuth struct {
	Pid      string `json:"pid"`
	TargetId string `json:"target_id"`
	AuthType string `json:"auth_type"`
}

AccountAuth 支付宝登录时, 帮客户端做参数签名, 返回授权请求信息字串接口请求参数 https://docs.open.alipay.com/218/105327/

func (AccountAuth) APIName added in v3.0.11

func (this AccountAuth) APIName() string

func (AccountAuth) Params added in v3.0.11

func (this AccountAuth) Params() map[string]string

type AgreementPageSign added in v3.0.11

type AgreementPageSign struct {
	AppAuthToken        string             `json:"-"`
	ReturnURL           string             `json:"-"`
	NotifyURL           string             `json:"-"`
	SignValidityPeriod  string             `json:"sign_validity_period,omitempty"`  // 当前用户签约请求的协议有效周期。整形数字加上时间单位的协议有效期,从发起签约请求的时间开始算起。目前支持的时间单位:1.d:天2.m:月如果未传入,默认为长期有效
	ProductCode         string             `json:"product_code,omitempty"`          // 销售产品码,商户签约的支付宝合同所对应的产品码
	ExternalLogonId     string             `json:"external_logon_id,omitempty"`     // 用户在商户网站的登录账号,用于在签约页面展示,如果为空,则不展示
	PersonalProductCode string             `json:"personal_product_code,omitempty"` // 个人签约产品码,商户和支付宝签约时确定,商户可咨询技 术支持
	SignScene           string             `json:"sign_scene,omitempty"`            // 协议签约场景,商户和支付宝 签约时确定,商户可咨询技术支持。当传入商户签约号external_agreement_no时,场景不能为默认值DEFAULT|DEFAULT
	ExternalAgreementNo string             `json:"external_agreement_no,omitempty"` // 商户签约号,代扣协议中标示 用户的唯一签约号(确保在商 户系统中唯一)。
	ThirdPartyType      string             `json:"third_party_type,omitempty"`      // 签约第三方主体类型。对于三方协议,表示当前用户和哪一类的第三方主体进行签约。1.PARTNER(平台商户);2.MERCHANT(集团商户);默认为PARTNER
	ZmAuthParams        *ZmAuthParams      `json:"zm_auth_params,omitempty"`        // 芝麻授权信息,针对于信用代扣签约。json格式。
	ProdParams          *ProdParams        `json:"prod_params,omitempty"`           // 签约产品属性
	PromoParams         string             `json:"promo_params,omitempty"`          // 签约营销参数,此值为json格式;具体的key需与营销约定
	AccessParams        *AccessParams      `json:"access_params,omitempty"`
	SubMerchantParams   *SubMerchantParams `json:"sub_merchant_params,omitempty"`
	DeviceParams        *DeviceParams      `json:"device_params,omitempty"`
	MerchantProcessUrl  string             `json:"merchant_process_url,omitempty"`
	IdentityParams      *IdentityParams    `json:"identity_params,omitempty"`
	AgreementEffectType string             `json:"agreement_effect_type,omitempty"`
	UserAgeRange        string             `json:"user_age_range,omitempty"`
	PeriodRuleParams    *PeriodRuleParams  `json:"period_rule_params,omitempty"`
}

AgreementPageSign 支付宝个人协议页面签约接口请求参数 https://docs.open.alipay.com/api_2/alipay.user.agreement.page.sign

func (AgreementPageSign) APIName added in v3.0.11

func (this AgreementPageSign) APIName() string

func (AgreementPageSign) Params added in v3.0.11

func (this AgreementPageSign) Params() map[string]string

type AgreementPageSignRsp added in v3.0.11

type AgreementPageSignRsp struct {
	Content struct {
		Code                Code   `json:"code"`
		Msg                 string `json:"msg"`
		SubCode             string `json:"sub_code"`
		SubMsg              string `json:"sub_msg"`
		ExternalAgreementNo string `json:"external_agreement_no"` // 代扣协议中标示用户的唯一签约号(确保在商户系统中唯一)
		PersonalProductCode string `json:"personal_product_code"` // 协议产品码,商户和支付宝签约时确定,不同业务场景对应不同的签约产品码
		ValidTime           string `json:"valid_time"`            // 协议生效时间,格式为 yyyyMM-dd HH:mm:ss
		SignScene           string `json:"sign_scene"`            // 签约协议的场景
		AgreementNo         string `json:"agreement_no"`          // 用户签约成功后的协议号
		ZmOpenId            string `json:"zm_open_id"`            // 用户的芝麻信用 openId,供商户查询用户芝麻信用使用。
		InvalidTime         string `json:"invalid_time"`          // 协议失效时间,格式为 yyyyMM-dd HH:mm:ss
		SignTime            string `json:"sign_time"`             // 协议签约时间,格式为 yyyyMM-dd HH:mm:ss
		AlipayUserId        string `json:"alipay_user_id"`        // 用户的支付宝账号对应的支付宝唯一用户号,以2088开头的16位纯数字组成;本参数与alipay_logon_id不可同时为空,若都填写,则以本参数为准,优先级高于alipay_logon_id
		Status              string `json:"status"`                // 协议当前状态 1.TEMP:暂存,协议未生效过;2.NORMAL:正常;3.STOP:暂停
		ForexEligible       string `json:"forex_eligible"`        // 是否海外购汇身份。值:T/F(只有在签约成功时才会返回)
		ExternalLogonId     string `json:"external_logon_id"`     // 外部登录Id
		AlipayLogonId       string `json:"alipay_logon_id"`       // 返回脱敏的支付宝账号
	} `json:"agreement_page_sign_response"`
	Sign string `json:"sign"`
}

AgreementPageSignRsp 支付宝个人协议页面签约接口请响应参数

type AgreementParams added in v3.0.14

type AgreementParams struct {
	AgreementNo   string `json:"agreement_no,omitempty"`
	AuthConfirmNo string `json:"auth_confirm_no,omitempty"`
	ApplyToken    string `json:"apply_token,omitempty"`
}

type AgreementQuery added in v3.0.11

type AgreementQuery struct {
	PersonalProductCode string `json:"personal_product_code,omitempty"`  // 协议产品码,商户和支付宝签约时确定,商户可咨询技术支持
	AlipayUserId        string `json:"alipay_user_id,omitempty"`         // 用户的支付宝账号对应的支付宝唯一用户号,以2088开头的16位纯数字组成;本参数与alipay_logon_id不可同时为空,若都填写,则以本参数为准,优先级高于alipay_logon_id
	AlipayLogonId       string `json:"alipay_logon_id,omitempty"`        // 用户的支付宝登录账号,支持邮箱或手机号码格式。本参数与alipay_user_id不可同时为空,若都填写,则以alipay_user_id为准
	SignScene           string `json:"sign_scene,omitempty"`             // 签约协议场景,商户和支付宝签约时确定,商户可咨询技术支持
	ExternalAgreementNo string `jsson:"external_agreement_no,omitempty"` // 代扣协议中标示用户的唯一签约号(确保在商户系统中 唯一)。
	ThirdPartyType      string `jsson:"third_party_type,omitempty"`      // 签约第三方主体类型。对于三方协议,表示当前用户和哪一类的第三方主体进行签约
	AgreementNo         string `json:"agreement_no,omitempty"`           // 支付宝系统中用以唯一标识用户签约记录的编号(用户签约成功后的协议号),如果传了该参数,其他参数会被忽略
	AppAuthToken        string `json:"-"`
}

AgreementQuery 支付宝个人代扣协议查询接口请求参数 https://docs.open.alipay.com/api_2/alipay.user.agreement.query

func (AgreementQuery) APIName added in v3.0.11

func (this AgreementQuery) APIName() string

func (AgreementQuery) Params added in v3.0.11

func (this AgreementQuery) Params() map[string]string

type AgreementQueryRsp added in v3.0.11

type AgreementQueryRsp struct {
	Content struct {
		Code                Code   `json:"code"`
		Msg                 string `json:"msg"`
		SubCode             string `json:"sub_code"`
		SubMsg              string `json:"sub_msg"`
		ValidTime           string `json:"valid_time"`            // 协议生效时间,格式为 yyyyMM-dd HH:mm:ss
		AlipayLogonId       string `json:"alipay_logon_id"`       // 返回脱敏的支付宝账号
		InvalidTime         string `json:"invalid_time"`          // 协议失效时间,格式为 yyyyMM-dd HH:mm:ss
		PricipalType        string `json:"pricipal_type"`         // 签约主体类型。 CARD:支付宝账号 CUSTOMER:支付宝用户
		DeviceId            string `json:"device_id"`             // 设备Id
		PrincipalId         string `json:"principal_id"`          // 签约主体标识。当principal_type为CARD时,该字段为支付宝用户号;当principal_type为CUSTOMER时,该字段为支付宝用户标识。
		SignScene           string `json:"sign_scene"`            // 签约协议的场景
		AgreementNo         string `json:"agreement_no"`          // 用户签约成功后的协议号
		ThirdPartyType      string `json:"third_party_type"`      // 签约第三方主体类型。对于三方协议,表示当前用户和哪一类的第三方主体进行签约。 1.PARTNER(平台商户);2.MERCHANT(集团商户),集团下子商户可共享用户签约内容;默认为PARTNER
		Status              string `json:"status"`                // 协议当前状态 1.TEMP:暂存,协议未生效过;2.NORMAL:正常;3.STOP:暂停
		SignTime            string `json:"sign_time"`             // 协议签约时间,格式为 yyyyMM-dd HH:mm:ss
		PersonalProductCode string `json:"personal_product_code"` // 协议产品码,商户和支付宝签约时确定,不同业务场景对应不同的签约产品码
		ExternalAgreementNo string `json:"external_agreement_no"` // 代扣协议中标示用户的唯一签约号(确保在商户系统中唯一)
		ZmOpenId            string `json:"zm_open_id"`            // 用户的芝麻信用 openId,供商户查询用户芝麻信用使用。
		ExternalLogonId     string `json:"external_logon_id"`     // 外部登录Id
	} `json:"alipay_user_agreement_query_response"`
	Sign string `json:"sign"`
}

AgreementQueryRsp 支付宝个人代扣协议查询接口响应参数

type AgreementUnsign added in v3.0.11

type AgreementUnsign struct {
	AppAuthToken        string `json:"-"`
	NotifyURL           string `json:"-"`
	AlipayUserId        string `json:"alipay_user_id,omitempty"`        // 用户的支付宝账号对应的支付宝唯一用户号,以2088开头的16位纯数字组成;本参数与alipay_logon_id不可同时为空,若都填写,则以本参数为准,优先级高于alipay_logon_id
	AlipayLogonId       string `json:"alipay_logon_id,omitempty"`       // 返回脱敏的支付宝账号
	PersonalProductCode string `json:"personal_product_code,omitempty"` // 协议产品码,商户和支付宝签约时确定,不同业务场景对应不同的签约产品码
	SignScene           string `json:"sign_scene,omitempty"`            // 签约协议的场景
	ExternalAgreementNo string `json:"external_agreement_no,omitempty"` // 代扣协议中标示用户的唯一签约号(确保在商户系统中唯一)
	ThirdPartyType      string `jsson:"third_party_type,omitempty"`     // 签约第三方主体类型。对于三方协议,表示当前用户和哪一类的第三方主体进行签约
	AgreementNo         string `json:"agreement_no,omitempty"`          // 支付宝系统中用以唯一标识用户签约记录的编号(用户签约成功后的协议号),如果传了该参数,其他参数会被忽略
	ExtendParams        string `json:"extend_params,omitempty"`
	OperateType         string `json:"operate_type,omitempty"`
}

AgreementUnsign 支付宝个人代扣协议解约接口请求参数 https://docs.open.alipay.com/api_2/alipay.user.agreement.unsign

func (AgreementUnsign) APIName added in v3.0.11

func (this AgreementUnsign) APIName() string

func (AgreementUnsign) Params added in v3.0.11

func (this AgreementUnsign) Params() map[string]string

type AgreementUnsignRsp added in v3.0.11

type AgreementUnsignRsp struct {
	Content struct {
		Code    Code   `json:"code"`
		Msg     string `json:"msg"`
		SubCode string `json:"sub_code"`
		SubMsg  string `json:"sub_msg"`
	} `json:"agreement_unsign_response"`
	Sign string `json:"sign"`
}

AgreementUnsignRsp 支付宝个人代扣协议解约接口响应参数

type BillBalanceQuery added in v3.0.16

type BillBalanceQuery struct {
	AppAuthToken string `json:"-"` // 可选
}

BillBalanceQuery 支付宝商家账户当前余额查询 https://opendocs.alipay.com/apis/api_15/alipay.data.bill.balance.query

func (BillBalanceQuery) APIName added in v3.0.16

func (this BillBalanceQuery) APIName() string

func (BillBalanceQuery) Params added in v3.0.16

func (this BillBalanceQuery) Params() map[string]string

type BillBalanceQueryRsp added in v3.0.16

type BillBalanceQueryRsp struct {
	Content struct {
		Code            Code   `json:"code"`
		Msg             string `json:"msg"`
		SubCode         string `json:"sub_code"`
		SubMsg          string `json:"sub_msg"`
		TotalAmount     string `json:"total_amount"`
		AvailableAmount string `json:"available_amount"`
		FreezeAmount    string `json:"freeze_amount"`
	} `json:"alipay_data_bill_balance_query_response"`
	Sign string `json:"sign"`
}

BillBalanceQueryRsp 支付宝商家账户当前余额查询响应参数

type BillDownloadURLQuery

type BillDownloadURLQuery struct {
	AppAuthToken string `json:"-"`         // 可选
	BillType     string `json:"bill_type"` // 必选 账单类型,商户通过接口或商户经开放平台授权后其所属服务商通过接口可以获取以下账单类型:trade、signcustomer;trade指商户基于支付宝交易收单的业务账单;signcustomer是指基于商户支付宝余额收入及支出等资金变动的帐务账单。
	BillDate     string `json:"bill_date"` // 必选 账单时间:日账单格式为yyyy-MM-dd,最早可下载2016年1月1日开始的日账单;月账单格式为yyyy-MM,最早可下载2016年1月开始的月账单。
}

BillDownloadURLQuery 查询对账单下载地址接口请求参数 https://docs.open.alipay.com/api_15/alipay.data.dataservice.bill.downloadurl.query

func (BillDownloadURLQuery) APIName

func (this BillDownloadURLQuery) APIName() string

func (BillDownloadURLQuery) Params

func (this BillDownloadURLQuery) Params() map[string]string

type BillDownloadURLQueryRsp

type BillDownloadURLQueryRsp struct {
	Content struct {
		Code            Code   `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"`
}

BillDownloadURLQueryRsp 查询对账单下载地址接口响应参数

type CertDownload

type CertDownload struct {
	AppAuthToken string `json:"-"`              // 可选
	AliPayCertSN string `json:"alipay_cert_sn"` // 支付宝公钥证书序列号
}

func (CertDownload) APIName

func (this CertDownload) APIName() string

func (CertDownload) Params

func (this CertDownload) Params() map[string]string

type CertDownloadRsp

type CertDownloadRsp struct {
	Content struct {
		Code              Code   `json:"code"`
		Msg               string `json:"msg"`
		SubCode           string `json:"sub_code"`
		SubMsg            string `json:"sub_msg"`
		AliPayCertContent string `json:"alipay_cert_content"`
	} `json:"alipay_open_app_alipaycert_download_response"`
	Sign string `json:"sign"`
}

type CertifyBizCode

type CertifyBizCode string
const (
	CertifyBizCodeFace          CertifyBizCode = "FACE"            // 多因子人脸认证
	CertifyBizCodeCertPhoto     CertifyBizCode = "CERT_PHOTO"      // 多因子证照认证
	CertifyBizCodeCertPhotoFace CertifyBizCode = "CERT_PHOTO_FACE" // 多因子证照和人脸认证
	CertifyBizCodeSmartFace     CertifyBizCode = "SMART_FACE"      // 多因子快捷认证
)

type Client

type Client struct {
	Client *http.Client
	// contains filtered or unexported fields
}

func New

func New(appId, privateKey string, isProduction bool, opts ...OptionFunc) (client *Client, err error)

New 初始化支付宝客户端

appId - 支付宝应用 id

privateKey - 应用私钥,开发者自己生成

isProduction - 是否为生产环境,传 false 的时候为沙箱环境,用于开发测试,正式上线的时候需要改为 true

func (*Client) AccountAuth added in v3.0.11

func (this *Client) AccountAuth(param AccountAuth) (result string, err error)

AccountAuth 支付宝登录时, 帮客户端做参数签名, 返回授权请求信息字串接口 https://docs.open.alipay.com/218/105327

func (*Client) AckNotification

func (this *Client) AckNotification(w http.ResponseWriter)

func (*Client) AgreementPageSign added in v3.0.11

func (this *Client) AgreementPageSign(param AgreementPageSign) (result *url.URL, err error)

AgreementPageSign 支付宝个人协议页面签约接口 https://docs.open.alipay.com/api_2/alipay.user.agreement.page.sign

func (*Client) AgreementQuery added in v3.0.11

func (this *Client) AgreementQuery(param AgreementQuery) (result *AgreementQueryRsp, err error)

AgreementQuery 支付宝个人代扣协议查询接口 https://docs.open.alipay.com/api_2/alipay.user.agreement.query

func (*Client) AgreementUnsign added in v3.0.11

func (this *Client) AgreementUnsign(param AgreementUnsign) (result *AgreementUnsignRsp, err error)

AgreementUnsign 支付宝个人代扣协议解约接口 https://docs.open.alipay.com/api_2/alipay.user.agreement.unsign

func (*Client) AppToAppAuth

func (this *Client) AppToAppAuth(redirectURI string) (result *url.URL, err error)

AppToAppAuth 第三方应用授权接口 https://docs.open.alipay.com/20160728150111277227/intro

func (*Client) BillBalanceQuery added in v3.0.16

func (this *Client) BillBalanceQuery(param BillBalanceQuery) (result *BillBalanceQueryRsp, err error)

BillBalanceQuery 支付宝商家账户当前余额查询接口 https://opendocs.alipay.com/apis/api_15/alipay.data.bill.balance.query

func (*Client) BillDownloadURLQuery

func (this *Client) BillDownloadURLQuery(param BillDownloadURLQuery) (result *BillDownloadURLQueryRsp, err error)

BillDownloadURLQuery 查询对账单下载地址接口 https://docs.open.alipay.com/api_15/alipay.data.dataservice.bill.downloadurl.query

func (*Client) CertDownload

func (this *Client) CertDownload(param CertDownload) (result *CertDownloadRsp, err error)

func (*Client) DoRequest

func (this *Client) DoRequest(method string, param Param, result interface{}) (err error)

func (*Client) FundAccountQuery added in v3.0.14

func (this *Client) FundAccountQuery(param FundAccountQuery) (result *FundAccountQueryRsp, err error)

FundAccountQuery 支付宝资金账户资产查询接口 https://docs.open.alipay.com/api_28/alipay.fund.account.query

func (*Client) FundAuthOperationCancel

func (this *Client) FundAuthOperationCancel(param FundAuthOperationCancel) (result *FundAuthOperationCancelRsp, err error)

FundAuthOperationCancel 资金授权撤销接口 https://docs.open.alipay.com/api_28/alipay.fund.auth.operation.cancel/

func (*Client) FundAuthOperationDetailQuery

func (this *Client) FundAuthOperationDetailQuery(param FundAuthOperationDetailQuery) (result *FundAuthOperationDetailQueryRsp, err error)

FundAuthOperationDetailQuery 资金授权操作查询接口 https://docs.open.alipay.com/api_28/alipay.fund.auth.operation.detail.query/

func (*Client) FundAuthOrderAppFreeze

func (this *Client) FundAuthOrderAppFreeze(param FundAuthOrderAppFreeze) (result string, err error)

FundAuthOrderAppFreeze 线上资金授权冻结接口 https://docs.open.alipay.com/api_28/alipay.fund.auth.order.app.freeze

func (*Client) FundAuthOrderFreeze

func (this *Client) FundAuthOrderFreeze(param FundAuthOrderFreeze) (result *FundAuthOrderFreezeRsp, err error)

FundAuthOrderFreeze 资金授权冻结接口 https://docs.open.alipay.com/api_28/alipay.fund.auth.order.freeze/

func (*Client) FundAuthOrderUnfreeze

func (this *Client) FundAuthOrderUnfreeze(param FundAuthOrderUnfreeze) (result *FundAuthOrderUnfreezeRsp, err error)

FundAuthOrderUnfreeze 资金授权解冻接口 https://docs.open.alipay.com/api_28/alipay.fund.auth.order.unfreeze/

func (*Client) FundAuthOrderVoucherCreate

func (this *Client) FundAuthOrderVoucherCreate(param FundAuthOrderVoucherCreate) (result *FundAuthOrderVoucherCreateRsp, err error)

FundAuthOrderVoucherCreate 资金授权发码接口 https://docs.open.alipay.com/api_28/alipay.fund.auth.order.voucher.create/

func (*Client) FundTransCommonQuery added in v3.0.14

func (this *Client) FundTransCommonQuery(param FundTransCommonQuery) (result *FundTransCommonQueryRsp, err error)

FundTransCommonQuery 转账业务单据查询接口 https://docs.open.alipay.com/api_28/alipay.fund.trans.common.query/

func (*Client) FundTransOrderQuery

func (this *Client) FundTransOrderQuery(param FundTransOrderQuery) (result *FundTransOrderQueryRsp, err error)

FundTransOrderQuery 查询转账订单接口 https://docs.open.alipay.com/api_28/alipay.fund.trans.order.query/

func (*Client) FundTransToAccountTransfer

func (this *Client) FundTransToAccountTransfer(param FundTransToAccountTransfer) (result *FundTransToAccountTransferRsp, err error)

FundTransToAccountTransfer 单笔转账到支付宝账户接口 https://docs.open.alipay.com/api_28/alipay.fund.trans.toaccount.transfer

func (*Client) FundTransUniTransfer added in v3.0.14

func (this *Client) FundTransUniTransfer(param FundTransUniTransfer) (result *FundTransUniTransferRsp, err error)

FundTransUniTransfer 单笔转账接口 https://docs.open.alipay.com/api_28/alipay.fund.trans.uni.transfer/

func (*Client) GetTradeNotification

func (this *Client) GetTradeNotification(req *http.Request) (noti *TradeNotification, err error)

func (*Client) IsProduction

func (this *Client) IsProduction() bool

func (*Client) LoadAliPayPublicCert

func (this *Client) LoadAliPayPublicCert(s string) error

LoadAliPayPublicCert 加载支付宝公钥证书

func (*Client) LoadAliPayPublicCertFromFile

func (this *Client) LoadAliPayPublicCertFromFile(filename string) error

LoadAliPayPublicCertFromFile 加载支付宝公钥证书

func (*Client) LoadAliPayPublicKey added in v3.0.10

func (this *Client) LoadAliPayPublicKey(aliPublicKey string) error

LoadAliPayPublicKey 加载支付宝公钥

func (*Client) LoadAliPayRootCert

func (this *Client) LoadAliPayRootCert(s string) error

LoadAliPayRootCert 加载支付宝根证书

func (*Client) LoadAliPayRootCertFromFile

func (this *Client) LoadAliPayRootCertFromFile(filename string) error

LoadAliPayRootCertFromFile 加载支付宝根证书

func (*Client) LoadAppPublicCert

func (this *Client) LoadAppPublicCert(s string) error

LoadAppPublicCert 加载应用公钥证书

func (*Client) LoadAppPublicCertFromFile

func (this *Client) LoadAppPublicCertFromFile(filename string) error

LoadAppPublicCertFromFile 加载应用公钥证书

func (*Client) NotifyVerify

func (this *Client) NotifyVerify(partnerId, notifyId string) bool

func (*Client) OpenAuthTokenApp

func (this *Client) OpenAuthTokenApp(param OpenAuthTokenApp) (result *OpenAuthTokenAppRsp, err error)

OpenAuthTokenApp 换取应用授权令牌接口 https://docs.open.alipay.com/api_9/alipay.open.auth.token.app

func (*Client) PublicAppAuthorize

func (this *Client) PublicAppAuthorize(scopes []string, redirectURI, state string) (result *url.URL, err error)

PublicAppAuthorize 用户信息授权接口(网站支付宝登录快速接入) https://docs.open.alipay.com/289/105656#s3 (https://docs.open.alipay.com/263/105809)

func (*Client) SystemOauthToken

func (this *Client) SystemOauthToken(param SystemOauthToken) (result *SystemOauthTokenRsp, err error)

SystemOauthToken 换取授权访问令牌接口 https://docs.open.alipay.com/api_9/alipay.system.oauth.token

func (*Client) TradeAppPay

func (this *Client) TradeAppPay(param TradeAppPay) (result string, err error)

TradeAppPay App支付接口 https://docs.open.alipay.com/api_1/alipay.trade.app.pay

func (*Client) TradeCancel

func (this *Client) TradeCancel(param TradeCancel) (result *TradeCancelRsp, err error)

TradeCancel 统一收单交易撤销接口 https://docs.open.alipay.com/api_1/alipay.trade.cancel/

func (*Client) TradeClose

func (this *Client) TradeClose(param TradeClose) (result *TradeCloseRsp, err error)

TradeClose 统一收单交易关闭接口 https://docs.open.alipay.com/api_1/alipay.trade.close/

func (*Client) TradeCreate

func (this *Client) TradeCreate(param TradeCreate) (result *TradeCreateRsp, err error)

TradeCreate 统一收单交易创建接口 https://docs.open.alipay.com/api_1/alipay.trade.create/

func (*Client) TradeFastPayRefundQuery

func (this *Client) TradeFastPayRefundQuery(param TradeFastPayRefundQuery) (result *TradeFastPayRefundQueryRsp, err error)

TradeFastPayRefundQuery 统一收单交易退款查询接口 https://docs.open.alipay.com/api_1/alipay.trade.fastpay.refund.query

func (*Client) TradeOrderInfoSync

func (this *Client) TradeOrderInfoSync(param TradeOrderInfoSync) (result *TradeOrderInfoSyncRsp, err error)

TradeOrderInfoSync 支付宝订单信息同步接口 https://docs.open.alipay.com/api_1/alipay.trade.orderinfo.sync/

func (*Client) TradeOrderSettle

func (this *Client) TradeOrderSettle(param TradeOrderSettle) (result *TradeOrderSettleRsp, err error)

TradeOrderSettle 统一收单交易结算接口 https://docs.open.alipay.com/api_1/alipay.trade.order.settle

func (*Client) TradePagePay

func (this *Client) TradePagePay(param TradePagePay) (result *url.URL, err error)

TradePagePay 统一收单下单并支付页面接口 https://docs.open.alipay.com/api_1/alipay.trade.page.pay

func (*Client) TradePay

func (this *Client) TradePay(param TradePay) (result *TradePayRsp, err error)

TradePay 统一收单交易支付接口 https://docs.open.alipay.com/api_1/alipay.trade.pay/

func (*Client) TradePreCreate

func (this *Client) TradePreCreate(param TradePreCreate) (result *TradePreCreateRsp, err error)

TradePreCreate 统一收单线下交易预创建接口 https://docs.open.alipay.com/api_1/alipay.trade.precreate/

func (*Client) TradeQuery

func (this *Client) TradeQuery(param TradeQuery) (result *TradeQueryRsp, err error)

TradeQuery 统一收单线下交易查询接口 https://docs.open.alipay.com/api_1/alipay.trade.query/

func (*Client) TradeRefund

func (this *Client) TradeRefund(param TradeRefund) (result *TradeRefundRsp, err error)

TradeRefund 统一收单交易退款接口 https://docs.open.alipay.com/api_1/alipay.trade.refund/

func (*Client) TradeWapPay

func (this *Client) TradeWapPay(param TradeWapPay) (result *url.URL, err error)

TradeWapPay 手机网站支付接口 https://docs.open.alipay.com/api_1/alipay.trade.wap.pay/

func (*Client) URLValues

func (this *Client) URLValues(param Param) (value url.Values, err error)

func (*Client) UserCertifyOpenCertify

func (this *Client) UserCertifyOpenCertify(param UserCertifyOpenCertify) (result *url.URL, err error)

UserCertifyOpenCertify 身份认证开始认证接口 https://docs.open.alipay.com/api_2/alipay.user.certify.open.certify

func (*Client) UserCertifyOpenInitialize

func (this *Client) UserCertifyOpenInitialize(param UserCertifyOpenInitialize) (result *UserCertifyOpenInitializeRsp, err error)

UserCertifyOpenInitialize 身份认证初始化服务接口 https://docs.open.alipay.com/api_2/alipay.user.certify.open.initialize

func (*Client) UserCertifyOpenQuery

func (this *Client) UserCertifyOpenQuery(param UserCertifyOpenQuery) (result *UserCertifyOpenQueryRsp, err error)

UserCertifyOpenQuery 身份认证记录查询接口 https://docs.open.alipay.com/api_2/alipay.user.certify.open.query/

func (*Client) UserInfoShare

func (this *Client) UserInfoShare(param UserInfoShare) (result *UserInfoShareRsp, err error)

UserInfoShare 支付宝会员授权信息查询接口 https://docs.open.alipay.com/api_2/alipay.user.info.share

func (*Client) VerifySign

func (this *Client) VerifySign(data url.Values) (ok bool, err error)

type Code added in v3.0.14

type Code string

Code 支付宝接口响应 code https://doc.open.alipay.com/docs/doc.htm?treeId=291&articleId=105806&docType=1

const (
	CodeSuccess          Code = "10000" // 接口调用成功
	CodeUnknowError      Code = "20000" // 服务不可用
	CodeInvalidAuthToken Code = "20001" // 授权权限不足
	CodeMissingParam     Code = "40001" // 缺少必选参数
	CodeInvalidParam     Code = "40002" // 非法的参数
	CodeBusinessFailed   Code = "40004" // 业务处理失败
	CodePermissionDenied Code = "40006" // 权限不足
)

func (Code) IsSuccess added in v3.0.14

func (c Code) IsSuccess() bool

type DeviceParams added in v3.0.11

type DeviceParams struct {
	DeviceId   string `json:"device_id,omitempty"`
	DeviceName string `json:"device_name,omitempty"`
	DeviceType string `json:"device_type,omitempty"` // 设备类型,目前有四种值:VR一体机:VR_MACHINE、电视:TV、身份证:ID_CARD、工牌:WORK_CARD
}

type ErrorRsp

type ErrorRsp struct {
	Code    Code   `json:"code"`
	Msg     string `json:"msg"`
	SubCode string `json:"sub_code"`
	SubMsg  string `json:"sub_msg"`
}

func (*ErrorRsp) Error

func (this *ErrorRsp) Error() string

type FundAccountQuery added in v3.0.14

type FundAccountQuery struct {
	AppAuthToken       string `json:"-"`                    // 可选
	AliPayUserId       string `json:"alipay_user_id"`       // 必选 蚂蚁统一会员ID
	MerchantUserId     string `json:"merchant_user_id"`     // 特殊可选 商户会员的唯一标识。如果传入的user_id为虚拟账户userId,此字段必传并比对一致性。
	AccountProductCode string `json:"account_product_code"` // 特殊可选 开户产品码。如果查询托管子户余额,必传且必须传入与开户时传入的值一致。
	AccountType        string `json:"account_type"`         // 特殊可选 查询的账号类型,如查询托管账户值为TRUSTEESHIP_ACCOUNT,查询余额账户值为ACCTRANS_ACCOUNT。查询余额账户时必填。
	AccountSceneCode   string `json:"account_scene_code"`   // 特殊可选 开户场景码,与开户产品码不可同时传递。
	ExtInfo            string `json:"ext_info"`             // 可选 	JSON格式,传递业务扩展参数。
}

FundAccountQuery 支付宝资金账户资产查询接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.account.query

func (FundAccountQuery) APIName added in v3.0.14

func (this FundAccountQuery) APIName() string

func (FundAccountQuery) Params added in v3.0.14

func (this FundAccountQuery) Params() map[string]string

type FundAccountQueryRsp added in v3.0.14

type FundAccountQueryRsp struct {
	Content struct {
		Code            Code   `json:"code"`
		Msg             string `json:"msg"`
		SubCode         string `json:"sub_code"`
		SubMsg          string `json:"sub_msg"`
		AvailableAmount string `json:"available_amount"`
		ExtCardInfo     struct {
			CardNo       string `json:"card_no"`
			BankAccName  string `json:"bank_acc_name"`
			CardBranch   string `json:"card_branch"`
			CardBank     string `json:"card_bank"`
			CardLocation string `json:"card_location"`
			CardDeposit  string `json:"card_deposit"`
			Status       string `json:"status"`
		}
	} `json:"alipay_fund_account_query_response"`
	Sign string `json:"sign"`
}

FundAccountQueryRsp 支付宝资金账户资产查询接口响应参数

func (*FundAccountQueryRsp) IsSuccess added in v3.0.14

func (this *FundAccountQueryRsp) IsSuccess() bool

type FundAuthOperationCancel

type FundAuthOperationCancel 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个汉字
}

FundAuthOperationCancel 资金授权撤销接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.auth.operation.cancel/

func (FundAuthOperationCancel) APIName

func (this FundAuthOperationCancel) APIName() string

func (FundAuthOperationCancel) Params

func (this FundAuthOperationCancel) Params() map[string]string

type FundAuthOperationCancelRsp

type FundAuthOperationCancelRsp struct {
	Content struct {
		Code         Code   `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"`
}

FundAuthOperationCancelRsp 资金授权撤销接口响应参数

type FundAuthOperationDetailQuery

type FundAuthOperationDetailQuery 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"` // 特殊可选, 商户的授权资金操作流水号,与支付宝的授权资金操作流水号不能同时为空,二者都存在时,以支付宝的授权资金操作流水号为准,该参数与商户的授权资金订单号配对使用。
}

FundAuthOperationDetailQuery 资金授权操作查询接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.auth.operation.detail.query/

func (FundAuthOperationDetailQuery) APIName

func (this FundAuthOperationDetailQuery) APIName() string

func (FundAuthOperationDetailQuery) Params

func (this FundAuthOperationDetailQuery) Params() map[string]string

type FundAuthOperationDetailQueryRsp

type FundAuthOperationDetailQueryRsp struct {
	Content struct {
		Code                    Code   `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"`
		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"`
}

FundAuthOperationDetailQueryRsp 资金授权操作查询接口响应参数

type FundAuthOrderAppFreeze

type FundAuthOrderAppFreeze 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)。商户可设置一种支付渠道,也可设置多种支付渠道。
}

FundAuthOrderAppFreeze 线上资金授权冻结接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.auth.order.app.freeze

func (FundAuthOrderAppFreeze) APIName

func (this FundAuthOrderAppFreeze) APIName() string

func (FundAuthOrderAppFreeze) Params

func (this FundAuthOrderAppFreeze) Params() map[string]string

type FundAuthOrderAppFreezeRsp

type FundAuthOrderAppFreezeRsp struct {
	Content struct {
		Code         Code   `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"`
}

FundAuthOrderAppFreezeRsp 线上资金授权冻结接口响应参数

type FundAuthOrderFreeze

type FundAuthOrderFreeze 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。
}

FundAuthOrderFreeze 资金授权冻结接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.auth.order.freeze/

func (FundAuthOrderFreeze) APIName

func (this FundAuthOrderFreeze) APIName() string

func (FundAuthOrderFreeze) Params

func (this FundAuthOrderFreeze) Params() map[string]string

type FundAuthOrderFreezeRsp

type FundAuthOrderFreezeRsp struct {
	Content struct {
		Code         Code   `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"`
}

FundAuthOrderFreezeRsp 资金授权冻结接口响应参数

type FundAuthOrderUnfreeze

type FundAuthOrderUnfreeze struct {
	NotifyURL    string `json:"-"`
	AuthNo       string `json:"auth_no"`               // 必选,支付宝资金授权订单号,支付宝冻结时返回的交易号,数字格式 2016101210002001810258115912
	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
}

FundAuthOrderUnfreeze 资金授权解冻接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.auth.order.unfreeze/

func (FundAuthOrderUnfreeze) APIName

func (this FundAuthOrderUnfreeze) APIName() string

func (FundAuthOrderUnfreeze) Params

func (this FundAuthOrderUnfreeze) Params() map[string]string

type FundAuthOrderUnfreezeRsp

type FundAuthOrderUnfreezeRsp struct {
	Content struct {
		Code         Code   `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"`
}

FundAuthOrderUnfreezeRsp 资金授权解冻接口响应参数

type FundAuthOrderVoucherCreate

type FundAuthOrderVoucherCreate 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)。商户可设置一种支付渠道,也可设置多种支付渠道。
}

FundAuthOrderVoucherCreate 资金授权发码接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.auth.order.voucher.create/

func (FundAuthOrderVoucherCreate) APIName

func (this FundAuthOrderVoucherCreate) APIName() string

func (FundAuthOrderVoucherCreate) Params

func (this FundAuthOrderVoucherCreate) Params() map[string]string

type FundAuthOrderVoucherCreateRsp

type FundAuthOrderVoucherCreateRsp struct {
	Content struct {
		Code         Code   `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"`
}

FundAuthOrderVoucherCreateRsp 资金授权发码接口响应参数

type FundBill

type FundBill struct {
	FundChannel string  `json:"fund_channel"`       // 交易使用的资金渠道,详见 支付渠道列表
	BankCode    string  `json:"bank_code"`          // 银行卡支付时的银行代码
	Amount      string  `json:"amount"`             // 该支付工具类型所使用的金额
	RealAmount  float64 `json:"real_amount,string"` // 渠道实际付款金额
}

type FundTransCommonQuery added in v3.0.14

type FundTransCommonQuery struct {
	AppAuthToken   string `json:"-"`                 // 可选
	ProductCode    string `json:"product_code"`      // 必选 业务产品码, 收发现金红包固定为:STD_RED_PACKET; 单笔无密转账到支付宝账户固定为:TRANS_ACCOUNT_NO_PWD; 单笔无密转账到银行卡固定为:TRANS_BANKCARD_NO_PWD
	BizScene       string `json:"biz_scene"`         // 必选 描述特定的业务场景,可传的参数如下: PERSONAL_COLLECTION:C2C现金红包-领红包; DIRECT_TRANSFER:B2C现金红包、单笔无密转账到支付宝/银行卡
	OutBizNo       string `json:"out_biz_no"`        // 可选 商户端的唯一订单号,对于同一笔转账请求,商户需保证该订单号唯一。
	OrderId        string `json:"order_id"`          // 可选 支付宝转账单据号
	PayFundOrderId string `json:"pay_fund_order_id"` // 可选 支付宝支付资金流水号
}

FundTransCommonQuery 转账业务单据查询接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.trans.common.query/

func (FundTransCommonQuery) APIName added in v3.0.14

func (this FundTransCommonQuery) APIName() string

func (FundTransCommonQuery) Params added in v3.0.14

func (this FundTransCommonQuery) Params() map[string]string

type FundTransCommonQueryRsp added in v3.0.14

type FundTransCommonQueryRsp struct {
	Content struct {
		Code             Code   `json:"code"`
		Msg              string `json:"msg"`
		SubCode          string `json:"sub_code"`
		SubMsg           string `json:"sub_msg"`
		OrderId          string `json:"order_id"`           // 支付宝转账订单号
		PayFundOrderId   string `json:"pay_fund_order_id"`  // 支付宝支付资金流水号
		OutBizNo         string `json:"out_biz_no"`         // 用户订单号
		TransAmount      string `json:"trans_amount"`       // 付款金额
		Status           string `json:"status"`             // 转账单据状态。 SUCCESS:成功(对转账到银行卡的单据, 该状态可能变为退票[REFUND]状态); FAIL:失败(具体失败原因请参见error_code以及fail_reason返回值); DEALING:处理中; REFUND:退票;
		PayDate          string `json:"pay_date"`           // 支付时间
		ArrivalTimeEnd   string `json:"arrival_time_end"`   // 预计到账时间
		OrderFee         string `json:"order_fee"`          // 预计收费金额
		ErrorCode        string `json:"error_code"`         // 查询到的订单状态为FAIL失败或REFUND退票时,返回错误代码
		FailReason       string `json:"fail_reason"`        // 查询到的订单状态为FAIL失败或REFUND退票时,返回具体的原因。
		DeductBillInfo   string `json:"deduct_bill_info"`   // 商户查询代扣订单信息时返回其在代扣请求中传入的账单属性
		TransferBillInfo string `json:"transfer_bill_info"` // 商户在查询代发订单信息时返回其在代发请求中传入的账单属性。
	} `json:"alipay_fund_trans_common_query_response"`
	Sign string `json:"sign"`
}

FundTransCommonQueryRsp 转账业务单据查询接口响应参数

func (*FundTransCommonQueryRsp) IsSuccess added in v3.0.14

func (this *FundTransCommonQueryRsp) IsSuccess() bool

type FundTransOrderQuery

type FundTransOrderQuery struct {
	AppAuthToken string `json:"-"`                    // 可选
	OutBizNo     string `json:"out_biz_no,omitempty"` // 与 OrderId 二选一
	OrderId      string `json:"order_id,omitempty"`   // 与 OutBizNo 二选一
}

FundTransOrderQuery 查询转账订单接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.trans.order.query/

func (FundTransOrderQuery) APIName

func (this FundTransOrderQuery) APIName() string

func (FundTransOrderQuery) Params

func (this FundTransOrderQuery) Params() map[string]string

type FundTransOrderQueryRsp

type FundTransOrderQueryRsp struct {
	Content struct {
		Code           Code   `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"`
}

FundTransOrderQueryRsp 查询转账订单接口响应参数

func (*FundTransOrderQueryRsp) IsSuccess

func (this *FundTransOrderQueryRsp) IsSuccess() bool

type FundTransToAccountTransfer

type FundTransToAccountTransfer 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时必填
}

FundTransToAccountTransfer 单笔转账到支付宝账户接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.trans.toaccount.transfer

func (FundTransToAccountTransfer) APIName

func (this FundTransToAccountTransfer) APIName() string

func (FundTransToAccountTransfer) Params

func (this FundTransToAccountTransfer) Params() map[string]string

type FundTransToAccountTransferRsp

type FundTransToAccountTransferRsp struct {
	Content struct {
		Code     Code   `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"`
}

FundTransToAccountTransferRsp 单笔转账到支付宝账户接口响应参数

func (*FundTransToAccountTransferRsp) IsSuccess

func (this *FundTransToAccountTransferRsp) IsSuccess() bool

type FundTransUniTransfer added in v3.0.14

type FundTransUniTransfer struct {
	AppAuthToken    string     `json:"-"`                 // 可选
	OutBizNo        string     `json:"out_biz_no"`        // 必选 商户端的唯一订单号,对于同一笔转账请求,商户需保证该订单号唯一。
	TransAmount     string     `json:"trans_amount"`      // 必选 订单总金额,单位为元,精确到小数点后两位,STD_RED_PACKET 产品取值范围[0.01,100000000]; TRANS_ACCOUNT_NO_PWD产品取值范围[0.1,100000000]
	ProductCode     string     `json:"product_code"`      // 必选 业务产品码, 收发现金红包固定为:STD_RED_PACKET; 单笔无密转账到支付宝账户固定为:TRANS_ACCOUNT_NO_PWD; 单笔无密转账到银行卡固定为:TRANS_BANKCARD_NO_PWD
	BizScene        string     `json:"biz_scene"`         // 可选 描述特定的业务场景,可传的参数如下: PERSONAL_COLLECTION:C2C现金红包-领红包; DIRECT_TRANSFER:B2C现金红包、单笔无密转账到支付宝/银行卡
	OrderTitle      string     `json:"order_title"`       // 可选 转账业务的标题,用于在支付宝用户的账单里显示
	OriginalOrderId string     `json:"original_order_id"` // 可选 原支付宝业务单号。C2C现金红包-红包领取时,传红包支付时返回的支付宝单号;B2C现金红包、单笔无密转账到支付宝/银行卡不需要该参数。
	PayeeInfo       *PayeeInfo `json:"payee_info"`        // 必选 收款方信息
	Remark          string     `json:"remark"`            // 可选 业务备注
	BusinessParams  string     `json:"business_params"`   // 可选 转账业务请求的扩展参数,支持传入的扩展参数如下: 1、sub_biz_scene 子业务场景,红包业务必传,取值REDPACKET,C2C现金红包、B2C现金红包均需传入; 2、withdraw_timeliness为转账到银行卡的预期到账时间,可选(不传入则默认为T1),取值T0表示预期T+0到账,取值T1表示预期T+1到账,因到账时效受银行机构处理影响,支付宝无法保证一定是T0或者T1到账;
}

FundTransUniTransfer 单笔转账接口请求参数 https://docs.open.alipay.com/api_28/alipay.fund.trans.uni.transfer/

func (FundTransUniTransfer) APIName added in v3.0.14

func (this FundTransUniTransfer) APIName() string

func (FundTransUniTransfer) Params added in v3.0.14

func (this FundTransUniTransfer) Params() map[string]string

type FundTransUniTransferRsp added in v3.0.14

type FundTransUniTransferRsp struct {
	Content struct {
		Code           Code   `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"`          // 支付宝转账订单号
		PayFundOrderId string `json:"pay_fund_order_id"` // 支付宝支付资金流水号
		Status         string `json:"status"`            // 转账单据状态。 SUCCESS:成功(对转账到银行卡的单据, 该状态可能变为退票[REFUND]状态); FAIL:失败(具体失败原因请参见error_code以及fail_reason返回值); DEALING:处理中; REFUND:退票;
		TransDate      string `json:"trans_date"`        // 订单支付时间,格式为yyyy-MM-dd HH:mm:ss
	} `json:"alipay_fund_trans_uni_transfer_response"`
	Sign string `json:"sign"`
}

FundTransUniTransferRsp 单笔转账接口响应参数

func (*FundTransUniTransferRsp) IsSuccess added in v3.0.14

func (this *FundTransUniTransferRsp) IsSuccess() bool

type GoodsDetail

type GoodsDetail struct {
	GoodsId        string  `json:"goods_id"`
	AliPayGoodsId  string  `json:"alipay_goods_id,omitempty"`
	GoodsName      string  `json:"goods_name"`
	Quantity       int     `json:"quantity"`
	Price          float64 `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 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 IdentityParam

type IdentityParam struct {
	IdentityType string `json:"identity_type"` // 身份信息参数类型,必填,必须传入CERT_INFO
	CertType     string `json:"cert_type"`     // 证件类型,必填,当前支持身份证,必须传入IDENTITY_CARD
	CertName     string `json:"cert_name"`     // 真实姓名,必填,填写需要验证的真实姓名
	CertNo       string `json:"cert_no"`       // 证件号码,必填,填写需要验证的证件号码
}

type IdentityParams added in v3.0.11

type IdentityParams struct {
	UserName     string `json:"user_name,omitempty"`
	CertNo       string `json:"cert_no,omitempty"`
	IdentityHash string `json:"identity_hash,omitempty"`
	SignUserId   string `json:"sign_user_id,omitempty"`
}

type MerchantConfig

type MerchantConfig struct {
	ReturnURL string `json:"return_url"`
}

type OpenAuthToken added in v3.0.15

type OpenAuthToken struct {
	AppAuthToken    string `json:"app_auth_token"`    // 授权令牌信息
	AppRefreshToken string `json:"app_refresh_token"` // 令牌信息
	AuthAppId       string `json:"auth_app_id"`       // 授权方应用id
	ExpiresIn       int64  `json:"expires_in"`        // 令牌有效期
	ReExpiresIn     int64  `json:"re_expires_in"`     // 有效期
	UserId          string `json:"user_id"`           // 支付宝用户标识
}

type OpenAuthTokenApp

type OpenAuthTokenApp struct {
	GrantType    string `json:"grant_type"` // 值为 authorization_code 时,代表用code换取;值为refresh_token时,代表用refresh_token换取
	Code         string `json:"code"`
	RefreshToken string `json:"refresh_token"`
}

OpenAuthTokenApp 换取应用授权令牌请求参数 https://docs.open.alipay.com/api_9/alipay.open.auth.token.app

func (OpenAuthTokenApp) APIName

func (this OpenAuthTokenApp) APIName() string

func (OpenAuthTokenApp) Params

func (this OpenAuthTokenApp) Params() map[string]string

type OpenAuthTokenAppRsp

type OpenAuthTokenAppRsp struct {
	Content struct {
		Code   Code             `json:"code"`
		Msg    string           `json:"msg"`
		Tokens []*OpenAuthToken `json:"tokens"`
	} `json:"alipay_open_auth_token_app_response"`
	Sign string `json:"sign"`
}

OpenAuthTokenAppRsp 换取应用授权令牌响应参数 新版返回值 参见https://opendocs.alipay.com/open/20160728150111277227/intro

type OptionFunc added in v3.0.14

type OptionFunc func(c *Client)

func WithHTTPClient added in v3.0.14

func WithHTTPClient(client *http.Client) OptionFunc

func WithTimeLocation added in v3.0.14

func WithTimeLocation(location *time.Location) OptionFunc

type Param

type Param interface {
	// 用于提供访问的 method
	APIName() string

	// 返回参数列表
	Params() map[string]string
}

type PayeeInfo added in v3.0.14

type PayeeInfo struct {
	Identity     string `json:"identity"`      // 必填 参与方的唯一标识
	IdentityType string `json:"identity_type"` // 必填 参与方的标识类型,目前支持如下类型: 1、ALIPAY_USER_ID 支付宝的会员ID 2、ALIPAY_LOGON_ID:支付宝登录号,支持邮箱和手机号格式
	Name         string `json:"name"`          // 可选 参与方真实姓名,如果非空,将校验收款支付宝账号姓名一致性。当identity_type=ALIPAY_LOGON_ID时,本字段必填。
}

type PeriodRuleParams added in v3.0.11

type PeriodRuleParams struct {
	PeriodType    string `json:"period_type,omitempty"`
	Period        string `json:"period,omitempty"`
	ExecuteTime   string `json:"execute_time,omitempty"`
	SingleAmount  string `json:"single_amount,omitempty"`
	TotalAmount   string `json:"total_amount,omitempty"`
	TotalPayments int    `json:"total_payments,omitempty"`
}

type ProdParams added in v3.0.11

type ProdParams struct {
	AuthBizParams string `json:"auth_biz_params,omitempty"` // 预授权业务信息
}

type RefundDetailItem

type RefundDetailItem struct {
	FundChannel string `json:"fund_channel"` // 交易使用的资金渠道,详见 支付渠道列表
	Amount      string `json:"amount"`       // 该支付工具类型所使用的金额
	RealAmount  string `json:"real_amount"`  // 渠道实际付款金额
}

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,omitempty"` // 可选 分账信息中分账百分比。取值范围为大于0,少于或等于100的整数。
	Desc             string  `json:"desc"`                        // 可选 分账描述
}

type SubMerchantItem

type SubMerchantItem struct {
	MerchantId string `json:"merchant_id"`
}

type SubMerchantParams added in v3.0.11

type SubMerchantParams struct {
	SubMerchantId                 string `json:"sub_merchant_id,omitempty"`
	SubMerchantName               string `json:"sub_merchant_name,omitempty"`
	SubMerchantServiceName        string `json:"sub_merchant_service_name,omitempty"`
	SubMerchantServiceDescription string `json:"sub_merchant_service_description,omitempty"`
}

type SystemOauthToken

type SystemOauthToken struct {
	AppAuthToken string `json:"-"` // 可选
	GrantType    string `json:"-"` // 值为 authorization_code 时,代表用code换取;值为refresh_token时,代表用refresh_token换取
	Code         string `json:"-"`
	RefreshToken string `json:"-"`
}

SystemOauthToken 换取授权访问令牌接口请求参数 https://docs.open.alipay.com/api_9/alipay.system.oauth.token

func (SystemOauthToken) APIName

func (this SystemOauthToken) APIName() string

func (SystemOauthToken) Params

func (this SystemOauthToken) Params() map[string]string

type SystemOauthTokenRsp

type SystemOauthTokenRsp struct {
	Content struct {
		Code         Code   `json:"code"`
		Msg          string `json:"msg"`
		SubCode      string `json:"sub_code"`
		SubMsg       string `json:"sub_msg"`
		UserId       string `json:"user_id"`
		AccessToken  string `json:"access_token"`
		ExpiresIn    int64  `json:"expires_in"`
		RefreshToken string `json:"refresh_token"`
		ReExpiresIn  int64  `json:"re_expires_in"`
	} `json:"alipay_system_oauth_token_response"`
	Error *struct {
		Code    string `json:"code"`
		Msg     string `json:"msg"`
		SubCode string `json:"sub_code"`
		SubMsg  string `json:"sub_msg"`
	} `json:"error_response"` // 不要访问此结构体
	Sign string `json:"sign"`
}

SystemOauthTokenRsp 换取授权访问令牌接口请求参数

type Trade

type Trade struct {
	NotifyURL    string `json:"-"`
	ReturnURL    string `json:"-"`
	AppAuthToken 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     map[string]interface{} `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。
	TimeExpire       string                 `json:"time_expire,omitempty"`       // 该笔订单绝对超时时间,格式为yyyy-MM-dd HH:mm:ss
}

type TradeAppPay

type TradeAppPay struct {
	Trade
	TimeExpire  string         `json:"time_expire,omitempty"`  // 绝对超时时间,格式为yyyy-MM-dd HH:mm。
	GoodsDetail []*GoodsDetail `json:"goods_detail,omitempty"` // 订单包含的商品列表信息,Json格式,详见商品明细说明
}

TradeAppPay App支付接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.app.pay/

func (TradeAppPay) APIName

func (this TradeAppPay) APIName() string

func (TradeAppPay) Params

func (this TradeAppPay) Params() map[string]string

type TradeCancel

type TradeCancel struct {
	AppAuthToken string `json:"-"` // 可选
	NotifyURL    string `json:"-"` // 可选

	OutTradeNo string `json:"out_trade_no"` // 原支付请求的商户订单号,和支付宝交易号不能同时为空
	TradeNo    string `json:"trade_no"`     // 支付宝交易号,和商户订单号不能同时为空
}

TradeCancel 统一收单交易撤销接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.cancel/

func (TradeCancel) APIName

func (this TradeCancel) APIName() string

func (TradeCancel) Params

func (this TradeCancel) Params() map[string]string

type TradeCancelRsp

type TradeCancelRsp struct {
	Content struct {
		Code       Code   `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"`
}

TradeCancelRsp 统一收单交易撤销接口响应参数

func (*TradeCancelRsp) IsSuccess

func (this *TradeCancelRsp) IsSuccess() bool

type TradeClose

type TradeClose 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"`  // 可选
}

TradeClose 统一收单交易关闭接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.close/

func (TradeClose) APIName

func (this TradeClose) APIName() string

func (TradeClose) Params

func (this TradeClose) Params() map[string]string

type TradeCloseRsp

type TradeCloseRsp struct {
	Content struct {
		Code       Code   `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"`
}

TradeCloseRsp 统一收单交易关闭接口响应参数

type TradeCreate

type TradeCreate struct {
	Trade
	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"`
}

TradeCreate 统一收单交易创建接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.create/

func (TradeCreate) APIName

func (this TradeCreate) APIName() string

func (TradeCreate) Params

func (this TradeCreate) Params() map[string]string

type TradeCreateRsp

type TradeCreateRsp struct {
	Content struct {
		Code       Code   `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"`
}

TradeCreateRsp 统一收单交易创建接口响应参数

type TradeFastPayRefundQuery

type TradeFastPayRefundQuery 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"`          // 必须 请求退款接口时,传入的退款请求号,如果在退款请求时未传入,则该值为创建交易时的外部交易号
	QueryOptions []string `json:"query_options,omitempty"` // 可选 查询选项,商户通过上送该参数来定制同步需要额外返回的信息字段,数组格式。 refund_detail_item_list
}

TradeFastPayRefundQuery 统一收单交易退款查询接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.fastpay.refund.query

func (TradeFastPayRefundQuery) APIName

func (this TradeFastPayRefundQuery) APIName() string

func (TradeFastPayRefundQuery) Params

func (this TradeFastPayRefundQuery) Params() map[string]string

type TradeFastPayRefundQueryRsp

type TradeFastPayRefundQueryRsp struct {
	Content struct {
		Code                 Code                `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"`                      // 创建交易传入的商户订单号
		OutRequestNo         string              `json:"out_request_no"`                    // 本笔退款对应的退款请求号
		RefundReason         string              `json:"refund_reason"`                     // 发起退款时,传入的退款原因
		TotalAmount          string              `json:"total_amount"`                      // 发该笔退款所对应的交易的订单金额
		RefundAmount         string              `json:"refund_amount"`                     // 本次退款请求,对应的退款金额
		RefundDetailItemList []*RefundDetailItem `json:"refund_detail_item_list,omitempty"` // 本次退款使用的资金渠道;
	} `json:"alipay_trade_fastpay_refund_query_response"`
	Sign string `json:"sign"`
}

TradeFastPayRefundQueryRsp 统一收单交易退款查询接口响应参数

func (*TradeFastPayRefundQueryRsp) IsSuccess

func (this *TradeFastPayRefundQueryRsp) IsSuccess() bool

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       TradeStatus `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"` // 优惠券信息
}

TradeNotification 通知响应参数 https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.8AmJwg&treeId=203&articleId=105286&docType=1

type TradeOrderInfoSync

type TradeOrderInfoSync 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格式
}

TradeOrderInfoSync 支付宝订单信息同步接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.orderinfo.sync/

func (TradeOrderInfoSync) APIName

func (this TradeOrderInfoSync) APIName() string

func (TradeOrderInfoSync) Params

func (this TradeOrderInfoSync) Params() map[string]string

type TradeOrderInfoSyncRsp

type TradeOrderInfoSyncRsp struct {
	Content struct {
		Code        Code   `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"`
}

TradeOrderInfoSyncRsp 支付宝订单信息同步接口响应参数

type TradeOrderSettle

type TradeOrderSettle 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
}

TradeOrderSettle 统一收单交易结算接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.order.settle

func (TradeOrderSettle) APIName

func (this TradeOrderSettle) APIName() string

func (TradeOrderSettle) Params

func (this TradeOrderSettle) Params() map[string]string

type TradeOrderSettleRsp

type TradeOrderSettleRsp struct {
	Content struct {
		Code    Code   `json:"code"`
		Msg     string `json:"msg"`
		SubCode string `json:"sub_code"`
		SubMsg  string `json:"sub_msg"`
		TradeNo string `json:"trade_no"`
	} `json:"alipay_trade_order_settle_response"`
	Sign string `json:"sign"`
}

TradeOrderSettleRsp 统一收单交易结算接口响应参数

type TradePagePay

type TradePagePay struct {
	Trade
	AuthToken   string         `json:"auth_token,omitempty"`   // 针对用户授权接口,获取用户相关数据时,用于标识用户授权关系
	GoodsDetail []*GoodsDetail `json:"goods_detail,omitempty"` // 订单包含的商品列表信息,Json格式,详见商品明细说明
	QRPayMode   string         `json:"qr_pay_mode,omitempty"`  // PC扫码支付的方式,支持前置模式和跳转模式。
	QRCodeWidth string         `json:"qrcode_width,omitempty"` // 商户自定义二维码宽度 注:qr_pay_mode=4时该参数生效
}

TradePagePay 统一收单下单并支付页面接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.app.pay

func (TradePagePay) APIName

func (this TradePagePay) APIName() string

func (TradePagePay) Params

func (this TradePagePay) Params() map[string]string

type TradePay

type TradePay struct {
	Trade
	Scene    string `json:"scene"`               // 必须 支付场景 条码支付,取值:bar_code 声波支付,取值:wave_code, bar_code, wave_code
	AuthCode string `json:"auth_code,omitempty"` // 必须 支付授权码
	AuthNo   string `json:"auth_no,omitempty"`   // 可选 预授权冻结交易号

	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"`
	AgreementParams    *AgreementParams   `json:"agreement_params,omitempty"`
}

TradePay 统一收单交易支付接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.pay/

func (TradePay) APIName

func (this TradePay) APIName() string

func (TradePay) Params

func (this TradePay) Params() map[string]string

type TradePayRsp

type TradePayRsp struct {
	Content struct {
		Code                Code             `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"`
}

TradePayRsp 统一收单交易支付接口响应参数

func (*TradePayRsp) IsSuccess

func (this *TradePayRsp) IsSuccess() bool

type TradePreCreate

type TradePreCreate struct {
	Trade
	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"`            // 可选 商户机具终端编号
}

TradePreCreate 统一收单线下交易预创建接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.precreate/

func (TradePreCreate) APIName

func (this TradePreCreate) APIName() string

func (TradePreCreate) Params

func (this TradePreCreate) Params() map[string]string

type TradePreCreateRsp

type TradePreCreateRsp struct {
	Content struct {
		Code       Code   `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"`
}

TradePreCreateRsp 统一收单线下交易预创建接口响应参数

func (*TradePreCreateRsp) IsSuccess

func (this *TradePreCreateRsp) IsSuccess() bool

type TradeQuery

type TradeQuery struct {
	AppAuthToken string   `json:"-"`                       // 可选
	OutTradeNo   string   `json:"out_trade_no,omitempty"`  // 订单支付时传入的商户订单号, 与 TradeNo 二选一
	TradeNo      string   `json:"trade_no,omitempty"`      // 支付宝交易号
	QueryOptions []string `json:"query_options,omitempty"` // 可选 查询选项,商户通过上送该字段来定制查询返回信息 TRADE_SETTLE_INFO
}

TradeQuery 统一收单线下交易查询接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.query/

func (TradeQuery) APIName

func (this TradeQuery) APIName() string

func (TradeQuery) Params

func (this TradeQuery) Params() map[string]string

type TradeQueryRsp

type TradeQueryRsp struct {
	Content struct {
		Code                Code             `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"`                // 买家支付宝账号
		TradeStatus         TradeStatus      `json:"trade_status"`                  // 交易状态
		TotalAmount         string           `json:"total_amount"`                  // 交易的订单金额
		TransCurrency       string           `json:"trans_currency"`                // 标价币种
		SettleCurrency      string           `json:"settle_currency"`               // 订单结算币种
		SettleAmount        string           `json:"settle_amount"`                 // 结算币种订单金额
		PayCurrency         string           `json:"pay_currency"`                  // 订单支付币种
		PayAmount           string           `json:"pay_amount"`                    // 支付币种订单金额
		SettleTransRate     string           `json:"settle_trans_rate"`             // 结算币种兑换标价币种汇率
		TransPayRate        string           `json:"trans_pay_rate"`                // 标价币种兑换支付币种汇率
		BuyerPayAmount      string           `json:"buyer_pay_amount"`              // 买家实付金额,单位为元,两位小数。
		PointAmount         string           `json:"point_amount"`                  // 积分支付的金额,单位为元,两位小数。
		InvoiceAmount       string           `json:"invoice_amount"`                // 交易中用户支付的可开具发票的金额,单位为元,两位小数。
		SendPayDate         string           `json:"send_pay_date"`                 // 本次交易打款给卖家的时间
		ReceiptAmount       string           `json:"receipt_amount"`                // 实收金额,单位为元,两位小数
		StoreId             string           `json:"store_id"`                      // 商户门店编号
		TerminalId          string           `json:"terminal_id"`                   // 商户机具终端编号
		FundBillList        []*FundBill      `json:"fund_bill_list,omitempty"`      // 交易支付使用的资金渠道
		StoreName           string           `json:"store_name"`                    // 请求交易支付中的商户店铺的名称
		BuyerUserId         string           `json:"buyer_user_id"`                 // 买家在支付宝的用户id
		ChargeAmount        string           `json:"charge_amount"`                 // 该笔交易针对收款方的收费金额;
		ChargeFlags         string           `json:"charge_flags"`                  // 费率活动标识,当交易享受活动优惠费率时,返回该活动的标识;
		SettlementId        string           `json:"settlement_id"`                 // 支付清算编号,用于清算对账使用;
		AuthTradePayMode    string           `json:"auth_trade_pay_mode"`           // 预授权支付模式,该参数仅在信用预授权支付场景下返回。信用预授权支付:CREDIT_PREAUTH_PAY
		BuyerUserType       string           `json:"buyer_user_type"`               // 买家用户类型。CORPORATE:企业用户;PRIVATE:个人用户。
		MdiscountAmount     string           `json:"mdiscount_amount"`              // 商家优惠金额
		DiscountAmount      string           `json:"discount_amount"`               // 平台优惠金额
		BuyerUserName       string           `json:"buyer_user_name"`               // 买家名称;
		Subject             string           `json:"subject"`                       // 订单标题;
		Body                string           `json:"body"`                          // 订单描述;
		AlipaySubMerchantId string           `json:"alipay_sub_merchant_id"`        // 间连商户在支付宝端的商户编号;
		ExtInfos            string           `json:"ext_infos"`                     // 交易额外信息,特殊场景下与支付宝约定返回。
		DiscountGoodsDetail string           `json:"discount_goods_detail"`         // 本次交易支付所使用的单品券优惠的商品优惠信息
		IndustrySepcDetail  string           `json:"industry_sepc_detail"`          // 行业特殊信息(例如在医保卡支付业务中,向用户返回医疗信息)。
		VoucherDetailList   []*VoucherDetail `json:"voucher_detail_list,omitempty"` // 本交易支付时使用的所有优惠券信息
		TradeSettleInfo     *TradeSettleInfo `json:"trade_settle_info,omitempty"`   // 返回的交易结算信息,包含分账、补差等信息
	} `json:"alipay_trade_query_response"`
	Sign string `json:"sign"`
}

TradeQueryRsp 统一收单线下交易查询接口响应参数

func (*TradeQueryRsp) IsSuccess

func (this *TradeQueryRsp) IsSuccess() bool

type TradeRefund

type TradeRefund 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"`         // 必须 标识一次退款请求,同一笔交易多次退款需要保证唯一,如需部分退款,则此参数必传。
	RefundAmount   string `json:"refund_amount"`          // 必须 需要退款的金额,该金额不能大于订单金额,单位为元,支持两位小数
	RefundCurrency string `json:"refund_currency"`        // 可选 订单退款币种信息
	RefundReason   string `json:"refund_reason"`          // 可选 退款的原因说明
	OperatorId     string `json:"operator_id"`            // 可选 商户的操作员编号
	StoreId        string `json:"store_id"`               // 可选 商户的门店编号
	TerminalId     string `json:"terminal_id"`            // 可选 商户的终端编号
}

TradeRefund 统一收单交易退款接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.refund/

func (TradeRefund) APIName

func (this TradeRefund) APIName() string

func (TradeRefund) Params

func (this TradeRefund) Params() map[string]string

type TradeRefundRsp

type TradeRefundRsp struct {
	Content struct {
		Code                         Code                `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"`                        // 退款总金额
		RefundCurrency               string              `json:"refund_currency"`                   // 退款币种信息
		GmtRefundPay                 string              `json:"gmt_refund_pay"`                    // 退款支付时间
		StoreName                    string              `json:"store_name"`                        // 交易在支付时候的门店名称
		RefundDetailItemList         []*RefundDetailItem `json:"refund_detail_item_list,omitempty"` // 退款使用的资金渠道
		RefundSettlementId           string              `json:"refund_settlement_id"`              // 退款清算编号,用于清算对账使用;只在银行间联交易场景下返回该信息;
		PresentRefundBuyerAmount     string              `json:"present_refund_buyer_amount"`       // 本次退款金额中买家退款金额
		PresentRefundDiscountAmount  string              `json:"present_refund_discount_amount"`    // 本次退款金额中平台优惠退款金额
		PresentRefundMdiscountAmount string              `json:"present_refund_mdiscount_amount"`   // 本次退款金额中商家优惠退款金额
		SendBackFee                  string              `json:"send_back_fee"`
	} `json:"alipay_trade_refund_response"`
	Sign string `json:"sign"`
}

TradeRefundRsp 统一收单交易退款接口响应参数

func (*TradeRefundRsp) IsSuccess

func (this *TradeRefundRsp) IsSuccess() bool

type TradeSettleDetail added in v3.0.16

type TradeSettleDetail struct {
	OperationType     string `json:"operation_type"`
	OperationSerialNo string `json:"operation_serial_no"`
	OperationDate     string `json:"operation_dt"`
	TransOut          string `json:"trans_out"`
	TransIn           string `json:"trans_in"`
	Amount            string `json:"amount"`
}

type TradeSettleInfo added in v3.0.16

type TradeSettleInfo struct {
	TradeSettleDetailList []*TradeSettleDetail `json:"trade_settle_detail_list"`
}

type TradeStatus added in v3.0.14

type TradeStatus string
const (
	TradeStatusWaitBuyerPay TradeStatus = "WAIT_BUYER_PAY" //(交易创建,等待买家付款)
	TradeStatusClosed       TradeStatus = "TRADE_CLOSED"   //(未付款交易超时关闭,或支付完成后全额退款)
	TradeStatusSuccess      TradeStatus = "TRADE_SUCCESS"  //(交易支付成功)
	TradeStatusFinished     TradeStatus = "TRADE_FINISHED" //(交易结束,不可退款)
)

type TradeWapPay

type TradeWapPay struct {
	Trade
	QuitURL    string `json:"quit_url,omitempty"`
	AuthToken  string `json:"auth_token,omitempty"`  // 针对用户授权接口,获取用户相关数据时,用于标识用户授权关系
	TimeExpire string `json:"time_expire,omitempty"` // 绝对超时时间,格式为yyyy-MM-dd HH:mm。
}

TradeWapPay 手机网站支付接口请求参数 https://docs.open.alipay.com/api_1/alipay.trade.wap.pay/

func (TradeWapPay) APIName

func (this TradeWapPay) APIName() string

func (TradeWapPay) Params

func (this TradeWapPay) Params() map[string]string

type UserCertifyOpenCertify

type UserCertifyOpenCertify struct {
	AppAuthToken string `json:"-"`          // 可选
	CertifyId    string `json:"certify_id"` // 必选 本次申请操作的唯一标识,由开放认证初始化接口调用后生成,后续的操作都需要用到
}

UserCertifyOpenCertify 身份认证开始认证接口请求参数 https://docs.open.alipay.com/api_2/alipay.user.certify.open.certify

func (UserCertifyOpenCertify) APIName

func (this UserCertifyOpenCertify) APIName() string

func (UserCertifyOpenCertify) Params

func (this UserCertifyOpenCertify) Params() map[string]string

type UserCertifyOpenCertifyRsp

type UserCertifyOpenCertifyRsp struct {
	Content struct {
		Code    Code   `json:"code"`
		Msg     string `json:"msg"`
		SubCode string `json:"sub_code"`
		SubMsg  string `json:"sub_msg"`
	} `json:"alipay_user_certify_open_certify_response"`
	Sign string `json:"sign"`
}

UserCertifyOpenCertifyRsp 身份认证开始认证接口响应参数

type UserCertifyOpenInitialize

type UserCertifyOpenInitialize struct {
	AppAuthToken        string         `json:"-"`                               // 可选
	OuterOrderNo        string         `json:"outer_order_no"`                  // 必选  商户请求的唯一标识,商户要保证其唯一性,值为32位长度的字母数字组合。建议:前面几位字符是商户自定义的简称,中间可以使用一段时间,后段可以使用一个随机或递增序列
	BizCode             CertifyBizCode `json:"biz_code"`                        // 必选 认证场景码。入参支持的认证场景码和商户签约的认证场景相关,取值如下: FACE:多因子人脸认证 CERT_PHOTO:多因子证照认证 CERT_PHOTO_FACE :多因子证照和人脸认证 SMART_FACE:多因子快捷认证
	IdentityParam       IdentityParam  `json:"identity_param"`                  // 必选
	MerchantConfig      MerchantConfig `json:"merchant_config"`                 // 必选 商户个性化配置,格式为json,详细支持的字段说明为: return_url:需要回跳的目标地址,必填,一般指定为商户业务页面
	FaceContrastPicture string         `json:"face_contrast_picture,omitempty"` // 可选 自定义人脸比对图片的base64编码格式的string字符串
}

UserCertifyOpenInitialize 身份认证初始化服务接口请求参数 https://docs.open.alipay.com/api_2/alipay.user.certify.open.initialize

func (UserCertifyOpenInitialize) APIName

func (this UserCertifyOpenInitialize) APIName() string

func (UserCertifyOpenInitialize) Params

func (this UserCertifyOpenInitialize) Params() map[string]string

type UserCertifyOpenInitializeRsp

type UserCertifyOpenInitializeRsp struct {
	Content struct {
		Code      Code   `json:"code"`
		Msg       string `json:"msg"`
		SubCode   string `json:"sub_code"`
		SubMsg    string `json:"sub_msg"`
		CertifyId string `json:"certify_id"`
	} `json:"alipay_user_certify_open_initialize_response"`
	Sign string `json:"sign"`
}

UserCertifyOpenInitializeRsp 身份认证初始化服务接口响应参数

type UserCertifyOpenQuery

type UserCertifyOpenQuery struct {
	AppAuthToken string `json:"-"`          // 可选
	CertifyId    string `json:"certify_id"` // 必选 本次申请操作的唯一标识,由开放认证初始化接口调用后生成,后续的操作都需要用到
}

UserCertifyOpenQuery 身份认证记录查询接口请求参数 https://docs.open.alipay.com/api_2/alipay.user.certify.open.query/

func (UserCertifyOpenQuery) APIName

func (this UserCertifyOpenQuery) APIName() string

func (UserCertifyOpenQuery) Params

func (this UserCertifyOpenQuery) Params() map[string]string

type UserCertifyOpenQueryRsp

type UserCertifyOpenQueryRsp struct {
	Content struct {
		Code         Code   `json:"code"`
		Msg          string `json:"msg"`
		SubCode      string `json:"sub_code"`
		SubMsg       string `json:"sub_msg"`
		Passed       string `json:"passed"`
		IdentityInfo string `json:"identity_info"`
		MaterialInfo string `json:"material_info"`
	} `json:"alipay_user_certify_open_query_response"`
	Sign string `json:"sign"`
}

UserCertifyOpenQueryRsp 身份认证记录查询接口响应参数

type UserInfoShare

type UserInfoShare struct {
	AppAuthToken string `json:"-"` // 可选
	AuthToken    string `json:"-"` // 是
}

UserInfoShare 支付宝会员授权信息查询接口请求参数 https://docs.open.alipay.com/api_2/alipay.user.info.share

func (UserInfoShare) APIName

func (this UserInfoShare) APIName() string

func (UserInfoShare) Params

func (this UserInfoShare) Params() map[string]string

type UserInfoShareRsp

type UserInfoShareRsp struct {
	Content struct {
		Code               Code   `json:"code"`
		Msg                string `json:"msg"`
		SubCode            string `json:"sub_code"`
		SubMsg             string `json:"sub_msg"`
		AuthNo             string `json:"auth_no"`
		UserId             string `json:"user_id"`
		Avatar             string `json:"avatar"`
		Province           string `json:"province"`
		City               string `json:"city"`
		NickName           string `json:"nick_name"`
		IsStudentCertified string `json:"is_student_certified"`
		UserType           string `json:"user_type"`
		UserStatus         string `json:"user_status"`
		IsCertified        string `json:"is_certified"`
		Gender             string `json:"gender"`
	} `json:"alipay_user_info_share_response"`
	Sign string `json:"sign"`
}

UserInfoShareRsp 支付宝会员授权信息查询接口响应参数

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"`                // 优惠券备注信息
}

type ZmAuthParams added in v3.0.11

type ZmAuthParams struct {
	BuckleAppId      string `json:"buckle_app_id,omitempty"`      // 商户在芝麻端申请的appId
	BuckleMerchantId string `json:"buckle_merchant_id,omitempty"` // 商户在芝麻端申请的 merchantId,omitempty
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL