-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package wechat | ||
|
||
//异步通知 | ||
//微信支付-异步通知实体 | ||
type Notify struct { | ||
AppId string `json:"appid" xml:"appid"` //应用id | ||
MchId string `json:"mch_id" xml:"mch_id"` //商户号 | ||
BankType string `json:"bank_type" xml:"bank_type"` //付款银行 | ||
CashFee int `json:"cash_fee" xml:"cash_fee"` //现金支付金额 | ||
FeeType string `json:"fee_type" xml:"fee_type"` //货币种类 | ||
IsSubscribe string `json:"is_subscribe" xml:"is_subscribe"` //是否关注公众号 (Y是,N否) | ||
NonceStr string `json:"nonce_str" xml:"nonce_str"` //随机字符串 | ||
OpenId string `json:"openid" xml:"openid"` //用户标识 | ||
OutTradeNo string `json:"out_trade_no" xml:"out_trade_no"` //商户订单号 | ||
ResultCode string `json:"result_code" xml:"result_code"` //业务结果 | ||
ReturnCode string `json:"return_code" xml:"return_code"` //返回状态码 | ||
Sign string `json:"sign" xml:"sign"` //签名 | ||
TimeEnd string `json:"time_end" xml:"time_end"` //支付完成时间 | ||
TotalFee int `json:"total_fee" xml:"total_fee"` //总金额 | ||
TradeType string `json:"trade_type" xml:"trade_type"` //交易类型 | ||
TransactionId string `json:"transaction_id" xml:"transaction_id"` //微信支付订单号 | ||
} | ||
|
||
//是否成功 | ||
func (b *Notify) IsSuccess() bool { | ||
if b.ResultCode == "SUCCESS" && b.ReturnCode == "SUCCESS" { | ||
return true | ||
} | ||
|
||
return false | ||
} |