alipay

package module
v0.0.0-...-5c62a0c Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 13 Imported by: 0

README

AliPay SDK for Golang

鸣谢

感谢下列人员对本项目的支持:

@wusphinx

@clearluo

@zwh8800

已实现接口

手机网站支付API
  • 手机网站支付接口

    alipay.trade.wap.pay

  • 电脑网站支付

    alipay.trade.page.pay

  • 统一收单线下交易查询

    alipay.trade.query

  • 统一收单交易支付接口

    alipay.trade.pay

  • 统一收单交易创建接口

    alipay.trade.create

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

    alipay.trade.precreate

  • 统一收单交易撤销接口

    alipay.trade.cancel

  • 统一收单交易关闭接口

    alipay.trade.close

  • 统一收单交易退款接口

    alipay.trade.refund

  • App支付接口

    alipay.trade.app.pay

  • 统一收单交易退款查询

    alipay.trade.fastpay.refund.query

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

    alipay.fund.trans.toaccount.transfer

  • 查询转账订单接口

    alipay.fund.trans.order.query

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

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

集成流程

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

沙箱环境

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

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

应用信息配置

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

本 SDK 中的签名方法为 RSA2,所以请注意配置 RSA2(SHA256)密钥。

请参考 如何生成 RSA 密钥。

创建 Wap 支付
var client = alipay.New(appId, partnerId, publickKey, privateKey, false)

var p = AliPayTradeWapPay{}
p.NotifyURL = "xxx"
p.Subject = "标题"
p.OutTradeNo = "传递一个唯一单号"
p.TotalAmount = "10.00"
p.ProductCode = "商品编码"

var url, _ = client.TradeWapPay(p)
// 直接访问该 URL 就可以了
同步返回验签

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

如果需要开启自动验签,只需要在初始化 AliPay 对象之后给 AliPayPublicKey 属性设置从支付宝管理后台获取到的支付宝公钥即可,如下:

var client = alipay.New(appId, partnerId, publickKey, privateKey, false)
client.AliPayPublicKey = xxx  // 从支付宝管理后台获取支付宝提供的公钥
验证支付结果

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

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


var client = alipay.New(appId, partnerId, publickKey, privateKey, false)
client.AliPayPublicKey = xxx // 从支付宝管理后台获取支付宝提供的公钥
 
http.HandleFunc("/alipay", func(rep http.ResponseWriter, req *http.Request) {
	var noti, _ = client.GetTradeNotification(req)
	if noti != nil {
		fmt.Println("支付成功")
	} else {
		fmt.Println("支付失败")
	}
})

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

需要特别注意,从支付宝后台获取到支付宝的公钥之后,需要将其转换成标准的公钥格式,如下所示:

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2MhEVUp+rRRyAD9HZfiS
g8LLxRAX18XOMJE8/MNnlSSTWCCoHnM+FIU+AfB+8FE+gGIJYXJlpTIyWn4VUMte
wh/4C8uwzBWod/3ilw9Uy7lFblXDBd8En8a59AxC6c9YL1nWD7/sh1szqej31VRI
2OXQSYgvhWNGjzw2/KS1GdrWmdsVP2hOiKVy6TNtH7XnCSRfBBCQ+LgqO1tE0NHD
DswRwBLAFmIlfZ//qZ+a8FvMc//sUm+CV78pQba4nnzsmh10fzVVFIWiKw3VDsxX
PRrAtOJCwNsBwbvMuI/ictvxxjUl4nBZDw4lXt5eWWqBrnTSzogFNOk06aNmEBTU
hwIDAQAB
-----END PUBLIC KEY-----
支持 RSA 签名及验证

默认采用的是 RSA2 签名,如果需要使用 RSA 签名,只需要在初始化 AliPay 的时候,将其 SignType 设置为 alipay.K_SIGN_TYPE_RSA 即可:

var client = alipay.New(appId, partnerId, publickKey, privateKey, false)
client.SignType = alipay.K_SIGN_TYPE_RSA

当然,相关的 Key 也要注意替换。

License

This project is licensed under the MIT License.

Documentation

Index

Constants

View Source
const (
	K_TIME_FORMAT = "2006-01-02 15:04:05"

	K_ALI_PAY_TRADE_STATUS_WAIT_BUYER_PAY = "WAIT_BUYER_PAY" // 交易创建,等待买家付款
	K_ALI_PAY_TRADE_STATUS_TRADE_CLOSED   = "TRADE_CLOSED"   // 未付款交易超时关闭,或支付完成后全额退款
	K_ALI_PAY_TRADE_STATUS_TRADE_SUCCESS  = "TRADE_SUCCESS"  // 交易支付成功
	K_ALI_PAY_TRADE_STATUS_TRADE_FINISHED = "TRADE_FINISHED" // 交易结束,不可退款

	K_ALI_PAY_SANDBOX_API_URL    = "https://openapi.alipaydev.com/gateway.do"
	K_ALI_PAY_PRODUCTION_API_URL = "https://openapi.alipay.com/gateway.do"
	K_MAPI_PRODUCTION_API_URL    = "https://mapi.alipay.com/gateway.do"

	K_FORMAT  = "JSON"
	K_CHARSET = "utf-8"
	K_VERSION = "1.0"

	// https://doc.open.alipay.com/docs/doc.htm?treeId=291&articleId=105806&docType=1
	K_SUCCESS_CODE              = "10000"
	K_SUCESS_PAY_INPROCESS_CODE = "10003"
)
View Source
const (
	K_SIGN_TYPE_RSA2 = "RSA2"
	K_SIGN_TYPE_RSA  = "RSA"
)

Variables

This section is empty.

Functions

func NewRequest

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

Types

type AccessParams

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

type AgreementParams

type AgreementParams struct {
	AgreementNo string `json:"agreement_no"`
}

type AgreementSignNotification

type AgreementSignNotification struct {
	NotifyType          string `json:"notify_type"`           // 通知类型
	NotifyId            string `json:"notify_id"`             // 通知校验ID
	NotifyTime          string `json:"notify_time"`           // 通知时间
	SignType            string `json:"sign_type"`             // 签名类型
	Sign                string `json:"sign"`                  // 签名
	AppId               string `json:"app_id"`                // 开发者的app_id
	AuthAppId           string `json:"auth_app_id"`           // App Id
	SignTime            string `json:"sign_time"`             // 签约时间
	ExternalLogonId     string `json:"external_logon_id"`     // 用户在商户网站的登录账号,如果商户接口中未传,则不会返回
	ExternalAgreementNo string `json:"external_agreement_no"` // 萌推系统内部的 contract_code
	PersonalProductCode string `json:"personal_product_code"` // 个人签约产品码,商户和支付宝签约时确定。 必传
	SignScene           string `json:"sign_scene"`            // 协议签约场景
	AlipayUserId        string `json:"alipay_user_id"`        // 支付宝用户唯一id
	AlipayLogonId       string `json:"alipay_logon_id"`       // 用户的支付宝登录账号,支持邮箱或手机号码格式。本参数与alipay_user_id 不可同时为空,若都填写,则以alipay_user_id 为准
	Status              string `json:"status"`                // 协议的当前状态。 1. TEMP:暂存,协议未生效过; 2. NORMAL:正常; 3. STOP:暂停。 4. UNSIGN:解约。(只有签约成功才会返回)
	ValidTime           string `json:"valid_time"`            // 用户代扣协议的实际生效时间,格式为yyyy-MM-dd HH:mm:ss。(只有签约成功才会返回)
	InvalidTime         string `json:"invalid_time"`          // 用户代扣协议的失效时间,格式为yyyy-MM-dd HH:mm:ss。(只有签约成功才会返回)
	AgreementNo         string `json:"agreement_no"`          // 支付宝系统中用以唯一标识用户签约记录的编号。(只有签约成功时才会返回)
	ZmOpenId            string `json:"zm_open_id"`            // 用户的芝麻信用openId,供商户查询用户芝麻信用使用。(只有签约成功时才返回)
	ForexEligible       string `json:"forex_eligible"`        // 是否海外购汇身份。值:T/F(只有在签约成功时才会返回)
	UnsignTime          string `json:"unsign_time"`           // 解约时间
}

https://docs.open.alipay.com/api_2/alipay.user.agreement.page.sign

func GetAgreementSignNotification

func GetAgreementSignNotification(req *http.Request, aliPayPublicKey []byte) (noti *AgreementSignNotification, err error)

type AgreementSignParams

type AgreementSignParams struct {
	PersonalProductCode string              `json:"personal_product_code"` // 个人签约产品码,商户和支付宝签约时确定。 必传
	SignScene           string              `json:"sign_scene"`            // 协议签约场景,商户和支付宝签约时确定,商户可咨询技术支持。 必传
	ExternalAgreementNo string              `json:"external_agreement_no"` // 萌推系统内部的 contract_id
	AccessParams        *AccessParams       `json:"access_params"`         // 请按当前接入的方式进行填充,且输入值必须为文档中的参数取值范围。 必传
	PeriodRuleParams    *PeriodRuleParams   `json:"period_rule_params"`    // 周期管控规则参数period_rule_params,在签约周期扣款产品(如CYCLE_PAY_AUTH_P)时必传,在签约其他产品时无需传入。 周期扣款产品,会按照这里传入的参数提示用户,并对发起扣款的时间、金额、次数等做相应限制。
	SubMerchant         *SignMerchantParams `json:"sub_merchant"`          // 此参数用于传递子商户信息,无特殊需求时不用关注。目前商户代扣、海外代扣、淘旅行信用住产品支持传入该参数(在销售方案中“是否允许自定义子商户信息”需要选是)
}

type AliPay

type AliPay struct {
	AliPayPublicKey []byte

	SignType string
	// contains filtered or unexported fields
}

func New

func New(appId, partnerId string, publicKey, privateKey []byte, isProduction, isMApi bool) (client *AliPay)

func (*AliPay) AliPayAgreementModify

func (this *AliPay) AliPayAgreementModify(param AliPayAgreementModify) (results *AliPayAgreementModifyResponse, err error)

AgreementModify https://docs.open.alipay.com/api_2/alipay.user.agreement.executionplan.modify 修改协议接口alipay.user.agreement.executionplan.modify

func (*AliPay) AliPayAgreementQuery

func (this *AliPay) AliPayAgreementQuery(param AliPayAgreementQuery) (results *AliPayAgreementQueryResponse, err error)

AgreementQuery https://docs.open.alipay.com/api_2/alipay.user.agreement.query 查询转账订单接口alipay.user.agreement.query

func (*AliPay) AliPayAgreementUnsign

func (this *AliPay) AliPayAgreementUnsign(param AliPayAgreementUnsign) (results *AliPayAgreementUnsignResponse, err error)

AgreementQuery https://docs.open.alipay.com/api_2/alipay.user.agreement.query 查询转账订单接口alipay.user.agreement.query

func (*AliPay) CustomsDeclare

func (this *AliPay) CustomsDeclare(param DeclareRequest) (result *DeclareResponse, err error)

func (*AliPay) DoRequest

func (this *AliPay) DoRequest(method string, param AliPayParam, results interface{}) (err error)

func (*AliPay) FundTransOrderQuery

func (this *AliPay) FundTransOrderQuery(param AliPayFundTransOrderQuery) (results *AliPayFundTransOrderQueryResponse, err error)

FundTransOrderQuery https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.SIkNrH&docType=4&apiId=1322 查询转账订单接口fund.trans.order.query

func (*AliPay) FundTransToAccountTransfer

func (this *AliPay) FundTransToAccountTransfer(param AliPayFundTransToAccountTransfer) (results *AliPayFundTransToAccountTransferResponse, err error)

FundTransToAccountTransfer https://doc.open.alipay.com/docs/api.htm?apiId=1321&docType=4 单笔转账到支付宝账户接口

func (*AliPay) FundTransUniTransfer

func (this *AliPay) FundTransUniTransfer(param FundTransUniTransfer) (results *FundTransUniTransferResponse, err error)

FundTransUniTransfer https://opendocs.alipay.com/apis/api_28/alipay.fund.trans.uni.transfer/ 单笔转账到支付宝账户接口

func (*AliPay) GetAgreementSignNotification

func (this *AliPay) GetAgreementSignNotification(req *http.Request) (*AgreementSignNotification, error)

func (*AliPay) GetTradeNotification

func (this *AliPay) GetTradeNotification(req *http.Request) (*TradeNotification, error)

func (*AliPay) MarketingConsult

func (this *AliPay) MarketingConsult(param MarketingConsultParam) (*MarketingConsultResponse, error)

func (*AliPay) NotifyVerify

func (this *AliPay) NotifyVerify(notifyId string) bool

func (*AliPay) TradeOrderSettle

func (this *AliPay) TradeOrderSettle(param AliPayTradeOrderSettle) (results interface{}, err error)

TradeOrderSettle https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.kqrPAp&docType=4&apiId=1147

func (*AliPay) URLValues

func (this *AliPay) URLValues(param AliPayParam) (value url.Values, err error)

type AliPayAgreementModify

type AliPayAgreementModify struct {
	AgreementNo string `json:"agreement_no"` // 支付宝系统中用以唯一标识用户签约记录的编号(用户签约成功后的协议号),如果传了该参数,其他参数会被忽略
	DeductTime  string `json:"deduct_time"`  // 商户下一次扣款时间
	Memo        string `json:"memo"`         // 具体修改原因
}

////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_2/alipay.user.agreement.executionplan.modify 支付宝个人代扣协议修改接口

func (AliPayAgreementModify) APIName

func (this AliPayAgreementModify) APIName() string

func (AliPayAgreementModify) ExtJSONParamName

func (this AliPayAgreementModify) ExtJSONParamName() string

func (AliPayAgreementModify) ExtJSONParamValue

func (this AliPayAgreementModify) ExtJSONParamValue() string

func (AliPayAgreementModify) Params

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

type AliPayAgreementModifyResponse

type AliPayAgreementModifyResponse struct {
	AlipayUserAgreementExecutionplanModifyResponse struct {
		Code        string `json:"code"`
		Msg         string `json:"msg"`
		SubCode     string `json:"sub_code"`
		SubMsg      string `json:"sub_msg"`
		AgreementNo string `json:"agreement_no"`
		DeductTime  string `json:"deduct_time"`
	} `json:"alipay_user_agreement_executionplan_modify_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayAgreementModifyResponse) IsSuccess

func (this *AliPayAgreementModifyResponse) IsSuccess() bool

func (*AliPayAgreementModifyResponse) SetOriginBody

func (this *AliPayAgreementModifyResponse) SetOriginBody(body string)

type AliPayAgreementQuery

type AliPayAgreementQuery struct {
	PersonalProductCode string `json:"personal_product_code"` // 个人签约产品码,商户和支付宝签约时确定。 必传
	SignScene           string `json:"sign_scene"`            // 协议签约场景,商户和支付宝签约时确定,商户可咨询技术支持。 必传
	AlipayUserId        string `json:"alipay_user_id"`        // 用户的支付宝账号对应 的支付宝唯一用户号,以 2088 开头的 16 位纯数字 组成
	AlipayLogonId       string `json:"alipay_logon_id"`       // 用户的支付宝登录账号,支持邮箱或手机号码格式。本参数与alipay_user_id 不可同时为空,若都填写,则以alipay_user_id 为准
	ExternalAgreementNo string `json:"external_agreement_no"` // 萌推系统内部的 contract_code
}

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

func (AliPayAgreementQuery) APIName

func (this AliPayAgreementQuery) APIName() string

func (AliPayAgreementQuery) ExtJSONParamName

func (this AliPayAgreementQuery) ExtJSONParamName() string

func (AliPayAgreementQuery) ExtJSONParamValue

func (this AliPayAgreementQuery) ExtJSONParamValue() string

func (AliPayAgreementQuery) Params

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

type AliPayAgreementQueryResponse

type AliPayAgreementQueryResponse struct {
	AlipayUserAgreementQueryResponse struct {
		Code                string `json:"code"`
		Msg                 string `json:"msg"`
		SubCode             string `json:"sub_code"`              // 业务错误码
		SubMsg              string `json:"sub_msg"`               // 业务错误报错信息
		ValidTime           string `json:"valid_time"`            // 协议生效时间,格式为 yyyy-MM-dd HH:mm:ss
		AlipayLogonId       string `json:"alipay_logon_id"`       // 返回脱敏的支付宝账号
		InvalidTime         string `json:"invalid_time"`          // 协议失效时间,格式为 yyyy-MM-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 时,该字段为支付宝用户标识。一个用户 可能有多个支付宝账号,即多个支付宝用户号,但只有一个是支付宝用户标识。 一个支付宝账号对应一个支付宝唯一用户号(以2088开头的16位纯数字组成)。
		SignScene           string `json:"sign_scene"`            // 签约协议的场景。INDUSTRY|CARRENTAL
		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"`             // 协议签约时间,格式为 yyyy-MM-dd HH:mm:ss。
		PersonalProductCode string `json:"personal_product_code"` // 协议产品码,商户和支付宝签约时确定,不同业务场景对应不同的签约产品码
		ExternalAgreementNo string `json:"external_agreement_no"` // 萌推系统内部的 contract_code
		ZmOpenId            string `json:"zm_open_id"`            // 用户的芝麻信用 openId,供商 户查询用户芝麻信用使用。
		ExternalLogonId     string `json:"external_logon_id"`     // 外部登录Id
		CreditAuthMode      string `json:"credit_auth_mode"`      // 授信模式,取值:DEDUCT_HUAZHI-花芝GO。目前只在花芝代扣(即花芝go)协议时才会返回
	} `json:"alipay_user_agreement_query_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayAgreementQueryResponse) IsSuccess

func (this *AliPayAgreementQueryResponse) IsSuccess() bool

func (*AliPayAgreementQueryResponse) SetOriginBody

func (this *AliPayAgreementQueryResponse) SetOriginBody(body string)

type AliPayAgreementUnsign

type AliPayAgreementUnsign struct {
	NotifyURL           string `json:"-"`                     // 可选
	OperateType         string `json:"operate_type"`          // confirm(解约确认),invalid(解约作废)
	PersonalProductCode string `json:"personal_product_code"` // 个人签约产品码,商户和支付宝签约时确定。 必传
	SignScene           string `json:"sign_scene"`            // 协议签约场景,商户和支付宝签约时确定,商户可咨询技术支持。 必传
	AlipayUserId        string `json:"alipay_user_id"`        // 用户的支付宝账号对应 的支付宝唯一用户号,以 2088 开头的 16 位纯数字 组成
	AlipayLogonId       string `json:"alipay_logon_id"`       // 用户的支付宝登录账号,支持邮箱或手机号码格式。本参数与alipay_user_id 不可同时为空,若都填写,则以alipay_user_id 为准
	ExternalAgreementNo string `json:"external_agreement_no"` // 萌推系统内部的 contract_code
	AgreementNo         string `json:"agreement_no"`          // 支付宝系统中用以唯一标识用户签约记录的编号(用户签约成功后的协议号),如果传了该参数,其他参数会被忽略
}

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

func (AliPayAgreementUnsign) APIName

func (this AliPayAgreementUnsign) APIName() string

func (AliPayAgreementUnsign) ExtJSONParamName

func (this AliPayAgreementUnsign) ExtJSONParamName() string

func (AliPayAgreementUnsign) ExtJSONParamValue

func (this AliPayAgreementUnsign) ExtJSONParamValue() string

func (AliPayAgreementUnsign) Params

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

type AliPayAgreementUnsignResponse

type AliPayAgreementUnsignResponse struct {
	AlipayUserAgreementUnsignResponse struct {
		Code    string `json:"code"`
		Msg     string `json:"msg"`
		SubCode string `json:"sub_code"`
		SubMsg  string `json:"sub_msg"`
	} `json:"alipay_user_agreement_unsign_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayAgreementUnsignResponse) IsSuccess

func (this *AliPayAgreementUnsignResponse) IsSuccess() bool

func (*AliPayAgreementUnsignResponse) SetOriginBody

func (this *AliPayAgreementUnsignResponse) SetOriginBody(body string)

type AliPayFastpayTradeRefundQuery

type AliPayFastpayTradeRefundQuery struct {
	AppAuthToken string `json:"-"`                      // 可选
	OutTradeNo   string `json:"out_trade_no,omitempty"` // 与 TradeNo 二选一
	TradeNo      string `json:"trade_no,omitempty"`     // 与 OutTradeNo 二选一
	OutRequestNo string `json:"out_request_no"`         // 必须 请求退款接口时,传入的退款请求号,如果在退款请求时未传入,则该值为创建交易时的外部交易号
}

////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.chC7PJ&docType=4&apiId=1049

func (AliPayFastpayTradeRefundQuery) APIName

func (this AliPayFastpayTradeRefundQuery) APIName() string

func (AliPayFastpayTradeRefundQuery) ExtJSONParamName

func (this AliPayFastpayTradeRefundQuery) ExtJSONParamName() string

func (AliPayFastpayTradeRefundQuery) ExtJSONParamValue

func (this AliPayFastpayTradeRefundQuery) ExtJSONParamValue() string

func (AliPayFastpayTradeRefundQuery) Params

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

type AliPayFastpayTradeRefundQueryResponse

type AliPayFastpayTradeRefundQueryResponse struct {
	AliPayTradeFastpayRefundQueryResponse struct {
		Code         string `json:"code"`
		Msg          string `json:"msg"`
		SubCode      string `json:"sub_code"`
		SubMsg       string `json:"sub_msg"`
		OutRequestNo string `json:"out_request_no"` // 本笔退款对应的退款请求号
		OutTradeNo   string `json:"out_trade_no"`   // 创建交易传入的商户订单号
		RefundReason string `json:"refund_reason"`  // 发起退款时,传入的退款原因
		TotalAmount  string `json:"total_amount"`   // 发该笔退款所对应的交易的订单金额
		RefundAmount string `json:"refund_amount"`  // 本次退款请求,对应的退款金额
		TradeNo      string `json:"trade_no"`       // 支付宝交易号
	} `json:"alipay_trade_fastpay_refund_query_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayFastpayTradeRefundQueryResponse) IsSuccess

func (this *AliPayFastpayTradeRefundQueryResponse) IsSuccess() bool

func (*AliPayFastpayTradeRefundQueryResponse) SetOriginBody

func (this *AliPayFastpayTradeRefundQueryResponse) SetOriginBody(body string)

type AliPayFundTransOrderQuery

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

////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.SIkNrH&docType=4&apiId=1322 查询转账订单接口请求参数

func (AliPayFundTransOrderQuery) APIName

func (this AliPayFundTransOrderQuery) APIName() string

func (AliPayFundTransOrderQuery) ExtJSONParamName

func (this AliPayFundTransOrderQuery) ExtJSONParamName() string

func (AliPayFundTransOrderQuery) ExtJSONParamValue

func (this AliPayFundTransOrderQuery) ExtJSONParamValue() string

func (AliPayFundTransOrderQuery) Params

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

type AliPayFundTransOrderQueryResponse

type AliPayFundTransOrderQueryResponse struct {
	Body struct {
		Code           string `json:"code"`
		Msg            string `json:"msg"`
		SubCode        string `json:"sub_code"`
		SubMsg         string `json:"sub_msg"`
		OutBizNo       string `json:"out_biz_no"`       // 发起转账来源方定义的转账单据号。 该参数的赋值均以查询结果中 的 out_biz_no 为准。 如果查询失败,不返回该参数
		OrderId        string `json:"order_id"`         // 支付宝转账单据号,查询失败不返回。
		Status         string `json:"status"`           // 转账单据状态
		PayDate        string `json:"pay_date"`         // 支付时间
		ArrivalTimeEnd string `json:"arrival_time_end"` // 预计到账时间,转账到银行卡专用
		OrderFree      string `json:"order_fee"`        // 预计收费金额(元),转账到银行卡专用
		FailReason     string `json:"fail_reason"`      // 查询到的订单状态为FAIL失败或REFUND退票时,返回具体的原因。
		ErrorCode      string `json:"error_code"`       // 查询失败时,本参数为错误代 码。 查询成功不返回。 对于退票订单,不返回该参数。
	} `json:"alipay_fund_trans_order_query_response"`
	Sign string `json:"sign"`
}

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

func (*AliPayFundTransOrderQueryResponse) IsSuccess

func (this *AliPayFundTransOrderQueryResponse) IsSuccess() bool

type AliPayFundTransToAccountTransfer

type AliPayFundTransToAccountTransfer struct {
	AppAuthToken  string `json:"-"`               // 可选
	OutBizNo      string `json:"out_biz_no"`      // 必选 商户转账唯一订单号
	PayeeType     string `json:"payee_type"`      // 必选 收款方账户类型,"ALIPAY_LOGONID":支付宝帐号
	PayeeAccount  string `json:"payee_account"`   // 必选 收款方账户。与payee_type配合使用
	Amount        string `json:"amount"`          // 必选 转账金额,元
	PayerShowName string `json:"payer_show_name"` // 可选 付款方显示姓名
	PayeeRealName string `json:"payee_real_name"` // 可选 收款方真实姓名,如果本参数不为空,则会校验该账户在支付宝登记的实名是否与收款方真实姓名一致。
	Remark        string `json:"remark"`          // 可选 转账备注,金额大于50000时必填
}

////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?apiId=1321&docType=4 单笔转账到支付宝账户接口请求结构

func (AliPayFundTransToAccountTransfer) APIName

func (AliPayFundTransToAccountTransfer) ExtJSONParamName

func (this AliPayFundTransToAccountTransfer) ExtJSONParamName() string

func (AliPayFundTransToAccountTransfer) ExtJSONParamValue

func (this AliPayFundTransToAccountTransfer) ExtJSONParamValue() string

func (AliPayFundTransToAccountTransfer) Params

type AliPayFundTransToAccountTransferResponse

type AliPayFundTransToAccountTransferResponse struct {
	Body struct {
		Code     string `json:"code"`
		Msg      string `json:"msg"`
		SubCode  string `json:"sub_code"`
		SubMsg   string `json:"sub_msg"`
		OutBizNo string `json:"out_biz_no"` // 商户转账唯一订单号:发起转账来源方定义的转账单据号。请求时对应的参数,原样返回
		OrderId  string `json:"order_id"`   // 支付宝转账单据号,成功一定返回,失败可能不返回也可能返回
		PayDate  string `json:"pay_date"`   // 支付时间:格式为yyyy-MM-dd HH:mm:ss,仅转账成功返回
	} `json:"alipay_fund_trans_toaccount_transfer_response"`
	Sign string `json:"sign"`
}

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

func (*AliPayFundTransToAccountTransferResponse) IsSuccess

type AliPayParam

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

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

	// 返回扩展 JSON 参数的字段名称
	ExtJSONParamName() string

	// 返回扩展 JSON 参数的字段值
	ExtJSONParamValue() string
}

type AliPayTradeAppPay

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

	Body           string `json:"body"`            // 可选 对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。
	Subject        string `json:"subject"`         // 必须 商品的标题/交易标题/订单标题/订单关键字等。
	OutTradeNo     string `json:"out_trade_no"`    // 必须 商户网站唯一订单号
	TimeoutExpress string `json:"timeout_express"` // 可选 该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。
	TotalAmount    string `json:"total_amount"`    // 必须 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]
	SellerId       string `json:"seller_id"`       // 可选 收款支付宝用户ID。 如果该值为空,则默认为商户签约账号对应的支付宝用户ID
	ProductCode    string `json:"product_code"`    // 必须 销售产品码,商家和支付宝签约的产品码
	PassbackParams string `json:"passback_params"` // 可选 公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付宝会在异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付宝
	GoodsType      string `json:"goods_type"`      // 可选 商品主类型:0—虚拟类商品,1—实物类商品 注:虚拟类商品不支持使用花呗渠道
	//PromoParams        string `json:"promo_params"`         // 可选 优惠参数 注:仅与支付宝协商后可用
	//ExtendParams       string `json:"extend_params"`        // 可选 业务扩展参数,详见下面的“业务扩展参数说明”
	//EnablePayChannels  string `json:"enable_pay_channels"`  // 可选 	可用渠道,用户只能在指定渠道范围内支付  当有多个渠道时用“,”分隔 注:与disable_pay_channels互斥
	//DisablePayChannels string `json:"disable_pay_channels"` // 可选 禁用渠道,用户不可用指定渠道支付  当有多个渠道时用“,”分隔 注:与enable_pay_channels互斥
	//StoreId            string `json:"store_id"`             // 可选 商户门店编号
	SpecifiedChannel string `json:"specified_channel,omitempty"` // 指定渠道,目前仅支持传入pcredit(代表花呗单通道),若由于用户原因渠道不可用,用户可选择是否用其他渠道支付。 注:该参数不可与花呗分期参数同时传

	//支付并签约特有参数。
	AgreementSignParams *AgreementSignParams `json:"agreement_sign_params"` // 签约相关 如果希望在sdk中支付并签约,需要在这里传入签约信息。支付并签约额外添加 agreement_sign_params

}

//////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/doc2/detail.htm?treeId=204&articleId=105462&docType=1

func (AliPayTradeAppPay) APIName

func (this AliPayTradeAppPay) APIName() string

func (AliPayTradeAppPay) ExtJSONParamName

func (this AliPayTradeAppPay) ExtJSONParamName() string

func (AliPayTradeAppPay) ExtJSONParamValue

func (this AliPayTradeAppPay) ExtJSONParamValue() string

func (AliPayTradeAppPay) Params

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

type AliPayTradeCancel

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

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

//////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.UKvJeT&docType=4&apiId=866

func (AliPayTradeCancel) APIName

func (this AliPayTradeCancel) APIName() string

func (AliPayTradeCancel) ExtJSONParamName

func (this AliPayTradeCancel) ExtJSONParamName() string

func (AliPayTradeCancel) ExtJSONParamValue

func (this AliPayTradeCancel) ExtJSONParamValue() string

func (AliPayTradeCancel) Params

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

type AliPayTradeCancelResponse

type AliPayTradeCancelResponse struct {
	AliPayTradeCancelResponse struct {
		Code       string `json:"code"`
		Msg        string `json:"msg"`
		SubCode    string `json:"sub_code"`
		SubMsg     string `json:"sub_msg"`
		TradeNo    string `json:"trade_no"`     // 支付宝交易号
		OutTradeNo string `json:"out_trade_no"` // 创建交易传入的商户订单号
		RetryFlag  string `json:"retry_flag"`   // 是否需要重试
		Action     string `json:"action"`       // 本次撤销触发的交易动作 close:关闭交易,无退款 refund:产生了退款
	} `json:"alipay_trade_cancel_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayTradeCancelResponse) IsSuccess

func (this *AliPayTradeCancelResponse) IsSuccess() bool

func (*AliPayTradeCancelResponse) SetOriginBody

func (this *AliPayTradeCancelResponse) SetOriginBody(body string)

type AliPayTradeClose

type AliPayTradeClose struct {
	AppAuthToken string `json:"-"`                      // 可选
	NotifyURL    string `json:"-"`                      // 可选
	OutTradeNo   string `json:"out_trade_no,omitempty"` // 与 TradeNo 二选一
	TradeNo      string `json:"trade_no,omitempty"`     // 与 OutTradeNo 二选一
	OperatorId   string `json:"operator_id,omitempty"`  // 可选
}

////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/doc2/apiDetail.htm?apiId=1058&docType=4

func (AliPayTradeClose) APIName

func (this AliPayTradeClose) APIName() string

func (AliPayTradeClose) ExtJSONParamName

func (this AliPayTradeClose) ExtJSONParamName() string

func (AliPayTradeClose) ExtJSONParamValue

func (this AliPayTradeClose) ExtJSONParamValue() string

func (AliPayTradeClose) Params

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

type AliPayTradeCloseResponse

type AliPayTradeCloseResponse struct {
	AliPayTradeClose struct {
		Code       string `json:"code"`
		Msg        string `json:"msg"`
		SubCode    string `json:"sub_code"`
		SubMsg     string `json:"sub_msg"`
		OutTradeNo string `json:"out_trade_no"`
		TradeNo    string `json:"trade_no"`
	} `json:"alipay_trade_close_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayTradeCloseResponse) SetOriginBody

func (this *AliPayTradeCloseResponse) SetOriginBody(body string)

type AliPayTradeCreate

type AliPayTradeCreate struct {
	AppAuthToken         string             `json:"-"`                      // 可选
	OutTradeNo           string             `json:"out_trade_no,omitempty"` // 与 TradeNo 二选一
	SellerId             string             `json:"seller_id,omitempty"`    // 卖家支付宝用户ID
	TotalAmount          string             `json:"total_amount"`           // 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
	DiscountableAmount   string             `json:"discountable_amount"`    // 可打折金额. 参与优惠计算的金额,单位为元,精确到小数点后两位
	UndiscountableAmount string             `json:"undiscountable_amount"`
	BuyerLogonId         string             `json:"buyer_logon_id"`
	Subject              string             `json:"subject"`
	Body                 string             `json:"body"`
	BuyerId              string             `json:"buyer_id"`
	GoodsDetail          []*GoodsDetailItem `json:"goods_detail,omitempty"`
	OperatorId           string             `json:"operator_id"`
	StoreId              string             `json:"store_id"`
	TerminalId           string             `json:"terminal_id"`
	ExtendParams         *ExtendParamsItem  `json:"extend_params,omitempty"`
	TimeoutExpress       string             `json:"timeout_express"`
	RoyaltyInfo          *RoyaltyInfo       `json:"royalty_info,omitempty"`
	AliPayStoreId        string             `json:"alipay_store_id"`
	SubMerchant          []*SubMerchantItem `json:"sub_merchant,omitempty"`
	MerchantOrderNo      string             `json:"merchant_order_no"`
}

//////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.CkYNiG&docType=4&apiId=1046

func (AliPayTradeCreate) APIName

func (this AliPayTradeCreate) APIName() string

func (AliPayTradeCreate) ExtJSONParamName

func (this AliPayTradeCreate) ExtJSONParamName() string

func (AliPayTradeCreate) ExtJSONParamValue

func (this AliPayTradeCreate) ExtJSONParamValue() string

func (AliPayTradeCreate) Params

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

type AliPayTradeCreateResponse

type AliPayTradeCreateResponse struct {
	AliPayTradeCreateResponse struct {
		Code       string `json:"code"`
		Msg        string `json:"msg"`
		SubCode    string `json:"sub_code"`
		SubMsg     string `json:"sub_msg"`
		TradeNo    string `json:"trade_no"` // 支付宝交易号
		OutTradeNo string `json:"out_trade_no"`
	} `json:"alipay_trade_create_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayTradeCreateResponse) SetOriginBody

func (this *AliPayTradeCreateResponse) SetOriginBody(body string)

type AliPayTradeOrderSettle

type AliPayTradeOrderSettle struct {
	AppAuthToken      string              `json:"-"`                  // 可选
	OutRequestNo      string              `json:"out_request_no"`     // 必须 结算请求流水号 开发者自行生成并保证唯一性
	TradeNo           string              `json:"trade_no"`           // 必须 支付宝订单号
	RoyaltyParameters []*RoyaltyParameter `json:"royalty_parameters"` // 必须 分账明细信息
	OperatorId        string              `json:"operator_id"`        //可选 操作员id
}

////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.kqrPAp&docType=4&apiId=1147

func (AliPayTradeOrderSettle) APIName

func (this AliPayTradeOrderSettle) APIName() string

func (AliPayTradeOrderSettle) ExtJSONParamName

func (this AliPayTradeOrderSettle) ExtJSONParamName() string

func (AliPayTradeOrderSettle) ExtJSONParamValue

func (this AliPayTradeOrderSettle) ExtJSONParamValue() string

func (AliPayTradeOrderSettle) Params

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

type AliPayTradePagePay

type AliPayTradePagePay struct {
	NotifyURL string `json:"-"`
	ReturnURL string `json:"-"`

	// biz content,这四个参数是必须的
	Subject     string `json:"subject"`      // 订单标题
	OutTradeNo  string `json:"out_trade_no"` // 商户订单号,64个字符以内、可包含字母、数字、下划线;需保证在商户端不重复
	TotalAmount string `json:"total_amount"` // 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]
	ProductCode string `json:"product_code"` // 销售产品码,与支付宝签约的产品码名称。 注:目前仅支持FAST_INSTANT_TRADE_PAY

	Body               string `json:"body,omitempty"`                 // 订单描述
	GoodsDetail        string `json:"goods_detail,omitempty"`         // 订单包含的商品列表信息,Json格式,详见商品明细说明
	PassbackParams     string `json:"passback_params,omitempty"`      // 公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付宝只会在异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付宝
	ExtendParams       string `json:"extend_params,omitempty"`        // 业务扩展参数,详见业务扩展参数说明
	GoodsType          string `json:"goods_type,omitempty"`           // 商品主类型:0—虚拟类商品,1—实物类商品(默认) 注:虚拟类商品不支持使用花呗渠道
	TimeoutExpress     string `json:"timeout_express,omitempty"`      // 该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m
	EnablePayChannels  string `json:"enable_pay_channels,omitempty"`  // 可用渠道,用户只能在指定渠道范围内支付 当有多个渠道时用“,”分隔   注:与disable_pay_channels互斥
	DisablePayChannels string `json:"disable_pay_channels,omitempty"` // 禁用渠道,用户不可用指定渠道支付 当有多个渠道时用“,”分隔  注:与enable_pay_channels互斥
	AuthToken          string `json:"auth_token,omitempty"`           // 针对用户授权接口,获取用户相关数据时,用于标识用户授权关系
	QRPayMode          string `json:"qr_pay_mode,omitempty"`          // PC扫码支付的方式,支持前置模式和跳转模式。
	QRCodeWidth        string `json:"qrcode_width,omitempty"`         // 商户自定义二维码宽度 注:qr_pay_mode=4时该参数生效
}

////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/doc2/detail.htm?treeId=270&articleId=105901&docType=1

func (AliPayTradePagePay) APIName

func (this AliPayTradePagePay) APIName() string

func (AliPayTradePagePay) ExtJSONParamName

func (this AliPayTradePagePay) ExtJSONParamName() string

func (AliPayTradePagePay) ExtJSONParamValue

func (this AliPayTradePagePay) ExtJSONParamValue() string

func (AliPayTradePagePay) Params

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

type AliPayTradePay

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

	OutTradeNo           string             `json:"out_trade_no"`           // 必须 商户订单号,64个字符以内、可包含字母、数字、下划线;需保证在商户端不重复
	Scene                string             `json:"scene"`                  // 必须 支付场景 条码支付,取值:bar_code 声波支付,取值:wave_code	bar_code,wave_code
	AuthCode             string             `json:"auth_code"`              // 必须 支付授权码
	Subject              string             `json:"subject"`                // 必须 订单标题
	AgreementParams      *AgreementParams   `json:"agreement_params"`       // 周期扣款时必填参数
	ProductCode          string             `json:"product_code"`           // 可选 销售产品码,与支付宝签约的产品码名称。 注:目前仅支持FAST_INSTANT_TRADE_PAY
	BuyerId              string             `json:"buyer_id"`               // 可选 家的支付宝用户id,如果为空,会从传入了码值信息中获取买家ID
	SellerId             string             `json:"seller_id"`              // 可选 如果该值为空,则默认为商户签约账号对应的支付宝用户ID
	TotalAmount          string             `json:"total_amount"`           // 可选 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。 如果同时传入【可打折金额】和【不可打折金额】,该参数可以不用传入; 如果同时传入了【可打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【可打折金额】+【不可打折金额】
	DiscountableAmount   string             `json:"discountable_amount"`    // 可选 参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。 如果该值未传入,但传入了【订单总金额】和【不可打折金额】,则该值默认为【订单总金额】-【不可打折金额】
	UnDiscountableAmount string             `json:"undiscountable_amount"`  // 可选 不参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。如果该值未传入,但传入了【订单总金额】和【可打折金额】,则该值默认为【订单总金额】-【可打折金额】
	Body                 string             `json:"body"`                   // 可选 订单描述
	GoodsDetail          []*GoodsDetailItem `json:"goods_detail,omitempty"` // 可选 订单包含的商品列表信息,Json格式,其它说明详见商品明细说明
	OperatorId           string             `json:"operator_id"`            // 可选 商户操作员编号
	StoreId              string             `json:"store_id"`               // 可选 商户门店编号
	TerminalId           string             `json:"terminal_id"`            // 可选 商户机具终端编号
	AliPayStoreId        string             `json:"alipay_store_id"`        // 可选 支付宝的店铺编号
	TimeoutExpress       string             `json:"timeout_express"`        // 该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m
	AuthNo               string             `json:"auth_no"`                // 预授权号,预授权转交易请求中传入
}

//////////////////////////////////////////////////////////////////////////////// https://docs.open.alipay.com/api_1/alipay.trade.pay

func (AliPayTradePay) APIName

func (this AliPayTradePay) APIName() string

func (AliPayTradePay) ExtJSONParamName

func (this AliPayTradePay) ExtJSONParamName() string

func (AliPayTradePay) ExtJSONParamValue

func (this AliPayTradePay) ExtJSONParamValue() string

func (AliPayTradePay) Params

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

type AliPayTradePayResponse

type AliPayTradePayResponse struct {
	AliPayTradePay struct {
		Code                string           `json:"code"`
		Msg                 string           `json:"msg"`
		SubCode             string           `json:"sub_code"`
		SubMsg              string           `json:"sub_msg"`
		BuyerLogonId        string           `json:"buyer_logon_id"`           // 买家支付宝账号
		BuyerPayAmount      string           `json:"buyer_pay_amount"`         // 买家实付金额,单位为元,两位小数。
		BuyerUserId         string           `json:"buyer_user_id"`            // 买家在支付宝的用户id
		CardBalance         string           `json:"card_balance"`             // 支付宝卡余额
		DiscountGoodsDetail string           `json:"discount_goods_detail"`    // 本次交易支付所使用的单品券优惠的商品优惠信息
		FundBillList        []*FundBill      `json:"fund_bill_list,omitempty"` // 交易支付使用的资金渠道
		GmtPayment          string           `json:"gmt_payment"`
		InvoiceAmount       string           `json:"invoice_amount"`                // 交易中用户支付的可开具发票的金额,单位为元,两位小数。
		OutTradeNo          string           `json:"out_trade_no"`                  // 创建交易传入的商户订单号
		TradeNo             string           `json:"trade_no"`                      // 支付宝交易号
		PointAmount         string           `json:"point_amount"`                  // 积分支付的金额,单位为元,两位小数。
		ReceiptAmount       string           `json:"receipt_amount"`                // 实收金额,单位为元,两位小数
		StoreName           string           `json:"store_name"`                    // 发生支付交易的商户门店名称
		TotalAmount         string           `json:"total_amount"`                  // 发该笔退款所对应的交易的订单金额
		VoucherDetailList   []*VoucherDetail `json:"voucher_detail_list,omitempty"` // 本交易支付时使用的所有优惠券信息
	} `json:"alipay_trade_pay_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayTradePayResponse) IsSuccess

func (this *AliPayTradePayResponse) IsSuccess() bool

func (*AliPayTradePayResponse) SetOriginBody

func (this *AliPayTradePayResponse) SetOriginBody(body string)

type AliPayTradePreCreate

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

	OutTradeNo         string             `json:"out_trade_no"`            // 必须 商户订单号,64个字符以内、只能包含字母、数字、下划线;需保证在商户端不重复
	Subject            string             `json:"subject"`                 // 必须 订单标题
	SellerId           string             `json:"seller_id"`               // 可选 卖家支付宝用户ID。 如果该值为空,则默认为商户签约账号对应的支付宝用户ID
	TotalAmount        string             `json:"total_amount"`            // 必须 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 如果同时传入了【打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【打折金额】+【不可打折金额】
	DiscountableAmount string             `json:"discountable_amount"`     // 可选 可打折金额. 参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 如果该值未传入,但传入了【订单总金额】,【不可打折金额】则该值默认为【订单总金额】-【不可打折金额】
	Body               string             `json:"body"`                    // 可选 对交易或商品的描述
	GoodsDetail        []*GoodsDetailItem `json:"goods_detail,omitempty"`  // 可选 订单包含的商品列表信息.Json格式. 其它说明详见:“商品明细说明”
	ExtendParams       string             `json:"extend_params,omitempty"` // 业务扩展参数,详见业务扩展参数说明
	OperatorId         string             `json:"operator_id"`             // 可选 商户操作员编号
	StoreId            string             `json:"store_id"`                // 可选 商户门店编号
	TerminalId         string             `json:"terminal_id"`             // 可选 商户机具终端编号
	TimeoutExpress     string             `json:"timeout_express"`         // 可选 该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。
}

//////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.L57zdH&docType=4&apiId=862

func (AliPayTradePreCreate) APIName

func (this AliPayTradePreCreate) APIName() string

func (AliPayTradePreCreate) ExtJSONParamName

func (this AliPayTradePreCreate) ExtJSONParamName() string

func (AliPayTradePreCreate) ExtJSONParamValue

func (this AliPayTradePreCreate) ExtJSONParamValue() string

func (AliPayTradePreCreate) Params

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

type AliPayTradePreCreateResponse

type AliPayTradePreCreateResponse struct {
	AliPayPreCreateResponse struct {
		Code       string `json:"code"`
		Msg        string `json:"msg"`
		SubCode    string `json:"sub_code"`
		SubMsg     string `json:"sub_msg"`
		OutTradeNo string `json:"out_trade_no"` // 创建交易传入的商户订单号
		QRCode     string `json:"qr_code"`      // 当前预下单请求生成的二维码码串,可以用二维码生成工具根据该码串值生成对应的二维码
	} `json:"alipay_trade_precreate_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayTradePreCreateResponse) IsSuccess

func (this *AliPayTradePreCreateResponse) IsSuccess() bool

func (*AliPayTradePreCreateResponse) SetOriginBody

func (this *AliPayTradePreCreateResponse) SetOriginBody(body string)

type AliPayTradeQuery

type AliPayTradeQuery struct {
	AppAuthToken string `json:"-"`                      // 可选
	OutTradeNo   string `json:"out_trade_no,omitempty"` // 与 TradeNo 二选一
	TradeNo      string `json:"trade_no,omitempty"`
}

////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.t3A8tQ&docType=4&apiId=757

func (AliPayTradeQuery) APIName

func (this AliPayTradeQuery) APIName() string

func (AliPayTradeQuery) ExtJSONParamName

func (this AliPayTradeQuery) ExtJSONParamName() string

func (AliPayTradeQuery) ExtJSONParamValue

func (this AliPayTradeQuery) ExtJSONParamValue() string

func (AliPayTradeQuery) Params

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

type AliPayTradeQueryResponse

type AliPayTradeQueryResponse struct {
	AliPayTradeQuery struct {
		Code                string           `json:"code"`
		Msg                 string           `json:"msg"`
		SubCode             string           `json:"sub_code"`
		SubMsg              string           `json:"sub_msg"`
		BuyerLogonId        string           `json:"buyer_logon_id"`                // 买家支付宝账号
		BuyerPayAmount      float64          `json:"buyer_pay_amount,string"`       // 买家实付金额,单位为元,两位小数。
		BuyerUserId         string           `json:"buyer_user_id"`                 // 买家在支付宝的用户id
		InvoiceAmount       float64          `json:"invoice_amount,string"`         // 交易中用户支付的可开具发票的金额,单位为元,两位小数。
		Openid              string           `json:"open_id"`                       // 买家支付宝用户号,该字段将废弃,不要使用
		OutTradeNo          string           `json:"out_trade_no"`                  // 商家订单号
		PointAmount         float64          `json:"point_amount,string"`           // 积分支付的金额,单位为元,两位小数。
		ReceiptAmount       float64          `json:"receipt_amount,string"`         // 实收金额,单位为元,两位小数
		SendPayDate         string           `json:"send_pay_date"`                 // 本次交易打款给卖家的时间
		TotalAmount         float64          `json:"total_amount,string"`           // 交易的订单金额
		TradeNo             string           `json:"trade_no"`                      // 支付宝交易号
		TradeStatus         string           `json:"trade_status"`                  // 交易状态
		AliPayStoreId       string           `json:"alipay_store_id"`               // 支付宝店铺编号
		StoreId             string           `json:"store_id"`                      // 商户门店编号
		TerminalId          string           `json:"terminal_id"`                   // 商户机具终端编号
		StoreName           string           `json:"store_name"`                    // 请求交易支付中的商户店铺的名称
		DiscountGoodsDetail string           `json:"discount_goods_detail"`         // 本次交易支付所使用的单品券优惠的商品优惠信息
		IndustrySepcDetail  string           `json:"industry_sepc_detail"`          // 行业特殊信息(例如在医保卡支付业务中,向用户返回医疗信息)。
		FundBillList        []*FundBill      `json:"fund_bill_list,omitempty"`      // 交易支付使用的资金渠道
		VoucherDetailList   []*VoucherDetail `json:"voucher_detail_list,omitempty"` // 本交易支付时使用的所有优惠券信息
	} `json:"alipay_trade_query_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayTradeQueryResponse) IsSuccess

func (this *AliPayTradeQueryResponse) IsSuccess() bool

func (*AliPayTradeQueryResponse) SetOriginBody

func (this *AliPayTradeQueryResponse) SetOriginBody(body string)

type AliPayTradeRefund

type AliPayTradeRefund struct {
	AppAuthToken string `json:"-"`                      // 可选
	OutTradeNo   string `json:"out_trade_no,omitempty"` // 与 TradeNo 二选一
	TradeNo      string `json:"trade_no,omitempty"`     // 与 OutTradeNo 二选一
	RefundAmount string `json:"refund_amount"`          // 必须 需要退款的金额,该金额不能大于订单金额,单位为元,支持两位小数
	RefundReason string `json:"refund_reason"`          // 可选 退款的原因说明
	OutRequestNo string `json:"out_request_no"`         // 可选 标识一次退款请求,同一笔交易多次退款需要保证唯一,如需部分退款,则此参数必传。
	OperatorId   string `json:"operator_id"`            // 可选 商户的操作员编号
	StoreId      string `json:"store_id"`               // 可选 商户的门店编号
	TerminalId   string `json:"terminal_id"`            // 可选 商户的终端编号
}

////////////////////////////////////////////////////////////////////////////// https://doc.open.alipay.com/docs/api.htm?spm=a219a.7395905.0.0.5zkPUI&docType=4&apiId=759

func (AliPayTradeRefund) APIName

func (this AliPayTradeRefund) APIName() string

func (AliPayTradeRefund) ExtJSONParamName

func (this AliPayTradeRefund) ExtJSONParamName() string

func (AliPayTradeRefund) ExtJSONParamValue

func (this AliPayTradeRefund) ExtJSONParamValue() string

func (AliPayTradeRefund) Params

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

type AliPayTradeRefundResponse

type AliPayTradeRefundResponse struct {
	AliPayTradeRefund struct {
		Code                 string              `json:"code"`
		Msg                  string              `json:"msg"`
		SubCode              string              `json:"sub_code"`
		SubMsg               string              `json:"sub_msg"`
		TradeNo              string              `json:"trade_no"`                          // 支付宝交易号
		OutTradeNo           string              `json:"out_trade_no"`                      // 商户订单号
		BuyerLogonId         string              `json:"buyer_logon_id"`                    // 用户的登录id
		BuyerUserId          string              `json:"buyer_user_id"`                     // 买家在支付宝的用户id
		FundChange           string              `json:"fund_change"`                       // 本次退款是否发生了资金变化
		RefundFee            string              `json:"refund_fee"`                        // 退款总金额
		GmtRefundPay         string              `json:"gmt_refund_pay"`                    // 退款支付时间
		StoreName            string              `json:"store_name"`                        // 交易在支付时候的门店名称
		RefundDetailItemList []*RefundDetailItem `json:"refund_detail_item_list,omitempty"` // 退款使用的资金渠道
	} `json:"alipay_trade_refund_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*AliPayTradeRefundResponse) IsSuccess

func (this *AliPayTradeRefundResponse) IsSuccess() bool

func (*AliPayTradeRefundResponse) SetOriginBody

func (this *AliPayTradeRefundResponse) SetOriginBody(body string)

type AliPayTradeWapPay

type AliPayTradeWapPay struct {
	NotifyURL string `json:"-"`
	ReturnURL string `json:"-"`

	// biz content,这四个参数是必须的
	Subject     string `json:"subject"`      // 商品的标题/交易标题/订单标题/订单关键字等。
	OutTradeNo  string `json:"out_trade_no"` // 商户网站唯一订单号
	TotalAmount string `json:"total_amount"` // 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]
	ProductCode string `json:"product_code"` // 销售产品码,商家和支付宝签约的产品码。该产品请填写固定值:QUICK_WAP_WAY

	Body               string `json:"body,omitempty"`                 // 对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。
	TimeoutExpress     string `json:"timeout_express,omitempty"`      // 该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。
	SellerId           string `json:"seller_id,omitempty"`            // 收款支付宝用户ID。 如果该值为空,则默认为商户签约账号对应的支付宝用户ID
	AuthToken          string `json:"auth_token,omitempty"`           // 针对用户授权接口,获取用户相关数据时,用于标识用户授权关系
	GoodsType          string `json:"goods_type,omitempty"`           // 商品主类型:0—虚拟类商品,1—实物类商品 注:虚拟类商品不支持使用花呗渠道
	PassbackParams     string `json:"passback_params,omitempty"`      // 公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付宝会在异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付宝
	PromoParams        string `json:"promo_params,omitempty"`         // 优惠参数 注:仅与支付宝协商后可用
	ExtendParams       string `json:"extend_params,omitempty"`        // 业务扩展参数,详见下面的“业务扩展参数说明”
	EnablePayChannels  string `json:"enable_pay_channels,omitempty"`  // 可用渠道,用户只能在指定渠道范围内支付 当有多个渠道时用“,”分隔 注:与disable_pay_channels互斥
	DisablePayChannels string `json:"disable_pay_channels,omitempty"` // 禁用渠道,用户不可用指定渠道支付 当有多个渠道时用“,”分隔 注:与enable_pay_channels互斥
	StoreId            string `json:"store_id,omitempty"`             // 商户门店编号。该参数用于请求参数中以区分各门店,非必传项。
}

AliPayTradeWapPay https://doc.open.alipay.com/doc2/detail.htm?treeId=203&articleId=105463&docType=1

func (AliPayTradeWapPay) APIName

func (this AliPayTradeWapPay) APIName() string

func (AliPayTradeWapPay) ExtJSONParamName

func (this AliPayTradeWapPay) ExtJSONParamName() string

func (AliPayTradeWapPay) ExtJSONParamValue

func (this AliPayTradeWapPay) ExtJSONParamValue() string

func (AliPayTradeWapPay) Params

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

type BillDownloadURLQuery

type BillDownloadURLQuery struct {
	AppAuthToken string `json:"-"` // 可选
	BillType     string `json:"bill_type"`
	BillDate     string `json:"bill_date"`
}

func (BillDownloadURLQuery) APIName

func (this BillDownloadURLQuery) APIName() string

func (BillDownloadURLQuery) ExtJSONParamName

func (this BillDownloadURLQuery) ExtJSONParamName() string

func (BillDownloadURLQuery) ExtJSONParamValue

func (this BillDownloadURLQuery) ExtJSONParamValue() string

func (BillDownloadURLQuery) Params

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

type BillDownloadURLQueryResponse

type BillDownloadURLQueryResponse struct {
	AliPayDataServiceBillDownloadURLQueryResponse struct {
		Code            string `json:"code"`
		Msg             string `json:"msg"`
		SubCode         string `json:"sub_code"`
		SubMsg          string `json:"sub_msg"`
		BillDownloadUrl string `json:"bill_download_url"`
	} `json:"alipay_data_dataservice_bill_downloadurl_query_response"`
	Sign string `json:"sign"`
}

type DeclareRequest

type DeclareRequest struct {
	// 必选
	OutRequestNo        string `xml:"out_request_no"`
	TradeNo             string `xml:"trade_no"`
	MerchantCustomsCode string `xml:"merchant_customs_code"`
	MerchantCustomsName string `xml:"merchant_customs_name"`
	Amount              string `xml:"amount"`
	CustomsPlace        string `xml:"customs_place"`

	// 可选
	IsSplit     string `xml:"is_split"`
	SubOutBizNo string `xml:"sub_out_biz_no"`
	BuyerName   string `xml:"buyer_name"`
	BuyerIdNo   string `xml:"buyer_id_no"`
}

https://docs.open.alipay.com/155/104778/

func (DeclareRequest) APIName

func (this DeclareRequest) APIName() string

func (DeclareRequest) Params

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

type DeclareResponse

type DeclareResponse struct {
	Body string `xml:"-"` // 方便记日志用

	IsSuccess string `xml:"is_success"`
	SignType  string `xml:"sign_type"`
	Sign      string `xml:"sign"`
	Error     string `xml:"error"`

	ResultCode      string `xml:"result_code"`
	TradeNo         string `xml:"trade_no"`
	AlipayDeclareNo string `xml:"alipay_declare_no"`
	DetailErrorCode string `xml:"detail_error_code"`
	DetailErrorDes  string `xml:"detail_error_des"`

	IdentityCheck string `xml:"identity_check"`
}

func (*DeclareResponse) SetOriginBody

func (this *DeclareResponse) SetOriginBody(body string)

type ExtendParamsItem

type ExtendParamsItem struct {
	SysServiceProviderId string `json:"sys_service_provider_id"`
	HbFqNum              string `json:"hb_fq_num"`
	HbFqSellerPercent    string `json:"hb_fq_seller_percent"`
	TimeoutExpress       string `json:"timeout_express"`
}

type FundBill

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

type FundTransUniTransfer

type FundTransUniTransfer struct {
	AppAuthToken    string               `json:"-"`                 // 可选
	OutBizNo        string               `json:"out_biz_no"`        // 必选 商户转账唯一订单号
	TransAmount     string               `json:"trans_amount"`      // 必选 订单总金额,单位为元
	ProductCode     string               `json:"product_code"`      // 必选 业务产品码,单笔无密转账到支付宝账户固定为: TRANS_ACCOUNT_NO_PWD; 单笔无密转账到银行卡固定为: RANS_BANKCARD_NO_PWD; 发现金红包固定为: TD_RED_PACKET;
	BizScene        string               `json:"biz_scene"`         // 可选 描述特定的业务场景,DIRECT_TRANSFER:单笔无密转账到支付宝/银行卡, B2C现金红包;PERSONAL_COLLECTION:C2C现金红包-领红包
	OrderTitle      string               `json:"order_title"`       // 可选 转账业务的标题,用于在支付宝用户的账单里显示
	OriginalOrderId string               `json:"original_order_id"` // 可选 原支付宝业务单号。C2C现金红包-红包领取时,传红包支付时返回的支付宝单号;B2C现金红包、单笔无密转账到支付宝/银行卡不需要该参数。
	PayeeInfo       *TransferParticipant `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到账;

}

func (FundTransUniTransfer) APIName

func (this FundTransUniTransfer) APIName() string

func (FundTransUniTransfer) ExtJSONParamName

func (this FundTransUniTransfer) ExtJSONParamName() string

func (FundTransUniTransfer) ExtJSONParamValue

func (this FundTransUniTransfer) ExtJSONParamValue() string

func (FundTransUniTransfer) Params

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

type FundTransUniTransferResponse

type FundTransUniTransferResponse struct {
	Body struct {
		Code           string `json:"code"`
		Msg            string `json:"msg"`
		SubCode        string `json:"sub_code"`
		SubMsg         string `json:"sub_msg"`
		OutBizNo       string `json:"out_biz_no"`        // 商户转账唯一订单号:发起转账来源方定义的转账单据号。请求时对应的参数,原样返回
		OrderId        string `json:"order_id"`          // 支付宝转账单据号,成功一定返回,失败可能不返回也可能返回
		PayFundOrderId string `json:"pay_fund_order_id"` // 支付宝支付资金流水号
		Status         string `json:"status"`            // 转账单据状态。
		TransDate      string `json:"trans_date"`        // 订单支付时间
	} `json:"alipay_fund_trans_uni_transfer_response"`
	Sign string `json:"sign"`
}

单笔转账接口(新)响应参数

func (*FundTransUniTransferResponse) IsSuccess

func (this *FundTransUniTransferResponse) IsSuccess() bool

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 HasOriginBodySet

type HasOriginBodySet interface {
	SetOriginBody(body string)
}

type MarketingConsultParam

type MarketingConsultParam struct {
	BizScene        string `json:"biz_scene"` //64 业务场景,用于区分商户具体的咨场景;OPENING_PAGE:开屏页营销咨询;DETAIL_PAGE:详情页营销咨询;ORDER_PAGE
	Mobile          string `json:"mobile"`
	EncryptedMobile string `json:"encrypted_mobile"`

	//AppAuthToken string `json:"app_auth_token"`
	OutTradeNo           string `json:"out_trade_no"`
	TotalAmount          string `json:"total_amount"`
	UndiscountableAmount string `json:"undiscountable_amount"`
}

func (MarketingConsultParam) APIName

func (this MarketingConsultParam) APIName() string

func (MarketingConsultParam) ExtJSONParamName

func (this MarketingConsultParam) ExtJSONParamName() string

func (MarketingConsultParam) ExtJSONParamValue

func (this MarketingConsultParam) ExtJSONParamValue() string

func (MarketingConsultParam) Params

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

type MarketingConsultResponse

type MarketingConsultResponse struct {
	AlipayPayAppMarketingConsultResponse struct {
		Code        string `json:"code"`
		Msg         string `json:"msg"`
		SubCode     string `json:"sub_code"`
		SubMsg      string `json:"sub_msg"`
		Text        string `json:"text"`          //是 2048 营销文案文本内容 使用支付宝支付笔笔享优惠
		Image       string `json:"image"`         //否 2048 营销图片地址 http://www.xxx.com
		PrePayToken string `json:"pre_pay_token"` //否 64 营销联动唯一标识,商户在后续调收单接口时,需将此字段 透传带入 xxxxxxx
		ExtInfo     string `json:"ext_info"`      //否 2048 扩展信息,json格式 {"icon":"http:xxx"}
	} `json:"alipay_pay_app_marketing_consult_response"`
	Sign string `json:"sign"`
	Body string `json:"-"` // 返回内容原文,主要是为了记录日志
}

func (*MarketingConsultResponse) IsSuccess

func (this *MarketingConsultResponse) IsSuccess() bool

func (*MarketingConsultResponse) SetOriginBody

func (this *MarketingConsultResponse) SetOriginBody(body string)

type PeriodRuleParams

type PeriodRuleParams struct {
	PeriodType   string `json:"period_type"`   // 周期类型period_type是周期扣款产品必填,枚举值为DAY和MONTH。DAY即扣款周期按天计,MONTH代表扣款周期按自然月。
	Period       string `json:"period"`        // 周期数period是周期扣款产品必填。与另一参数period_type组合使用确定扣款周期,例如period_type为DAY,period=90,则扣款周期为90天。
	ExecuteTime  string `json:"execute_time"`  // 首次执行时间execute_time是周期扣款产品必填,即商户发起首次扣款的时间。精确到日,格式为yyyy-MM-dd
	SingleAmount string `json:"single_amount"` // 单次扣款最大金额single_amount是周期扣款产品必填,即每次发起扣款时限制的最大金额,单位为元。商户每次发起扣款都不允许大于此金额。
}

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

type SignMerchantParams

type SignMerchantParams struct {
	SubMerchantId                 string `json:"sub_merchant_id"`                  // 子商户的商户id
	SubMerchantName               string `json:"sub_merchant_name"`                // 子商户的商户名称
	SubMerchantServiceName        string `json:"sub_merchant_service_name"`        //子商户的服务名称
	SubMerchantServiceDescription string `json:"sub_merchant_service_description"` // 子商户的服务描述
}

type SubMerchantItem

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

type TradeNotification

type TradeNotification struct {
	AuthAppId         string `json:"auth_app_id"`         // App Id
	NotifyTime        string `json:"notify_time"`         // 通知时间
	NotifyType        string `json:"notify_type"`         // 通知类型
	NotifyId          string `json:"notify_id"`           // 通知校验ID
	AppId             string `json:"app_id"`              // 开发者的app_id
	Charset           string `json:"charset"`             // 编码格式
	Version           string `json:"version"`             // 接口版本
	SignType          string `json:"sign_type"`           // 签名类型
	Sign              string `json:"sign"`                // 签名
	TradeNo           string `json:"trade_no"`            // 支付宝交易号
	OutTradeNo        string `json:"out_trade_no"`        // 商户订单号
	OutBizNo          string `json:"out_biz_no"`          // 商户业务号
	BuyerId           string `json:"buyer_id"`            // 买家支付宝用户号
	BuyerLogonId      string `json:"buyer_logon_id"`      // 买家支付宝账号
	SellerId          string `json:"seller_id"`           // 卖家支付宝用户号
	SellerEmail       string `json:"seller_email"`        // 卖家支付宝账号
	TradeStatus       string `json:"trade_status"`        // 交易状态
	TotalAmount       string `json:"total_amount"`        // 订单金额
	ReceiptAmount     string `json:"receipt_amount"`      // 实收金额
	InvoiceAmount     string `json:"invoice_amount"`      // 开票金额
	BuyerPayAmount    string `json:"buyer_pay_amount"`    // 付款金额
	PointAmount       string `json:"point_amount"`        // 集分宝金额
	RefundFee         string `json:"refund_fee"`          // 总退款金额
	Subject           string `json:"subject"`             // 总退款金额
	Body              string `json:"body"`                // 商品描述
	GmtCreate         string `json:"gmt_create"`          // 交易创建时间
	GmtPayment        string `json:"gmt_payment"`         // 交易付款时间
	GmtRefund         string `json:"gmt_refund"`          // 交易退款时间
	GmtClose          string `json:"gmt_close"`           // 交易结束时间
	FundBillList      string `json:"fund_bill_list"`      // 支付金额信息
	PassbackParams    string `json:"passback_params"`     // 回传参数
	VoucherDetailList string `json:"voucher_detail_list"` // 优惠券信息
}

https://doc.open.alipay.com/docs/doc.htm?spm=a219a.7629140.0.0.8AmJwg&treeId=203&articleId=105286&docType=1

func GetTradeNotification

func GetTradeNotification(req *http.Request, aliPayPublicKey []byte) (noti *TradeNotification, err error)

type TransferParticipant

type TransferParticipant 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时,本字段必填。
}

////////////////////////////////////////////////////////////////////////////// https://opendocs.alipay.com/apis/api_28/alipay.fund.trans.uni.transfer/ 单笔转账接口(新)请求结构

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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