|
@@ -13,6 +13,7 @@ package refunddomestic
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
+ "time"
|
|
|
)
|
|
|
|
|
|
|
|
@@ -34,10 +35,18 @@ type Amount struct {
|
|
|
Total *int64 `json:"total"`
|
|
|
|
|
|
Refund *int64 `json:"refund"`
|
|
|
-
|
|
|
|
|
|
From []FundsFromItem `json:"from,omitempty"`
|
|
|
-
|
|
|
+
|
|
|
+ PayerTotal *int64 `json:"payer_total"`
|
|
|
+
|
|
|
+ PayerRefund *int64 `json:"payer_refund"`
|
|
|
+
|
|
|
+ SettlementRefund *int64 `json:"settlement_refund"`
|
|
|
+
|
|
|
+ SettlementTotal *int64 `json:"settlement_total"`
|
|
|
+
|
|
|
+ DiscountRefund *int64 `json:"discount_refund"`
|
|
|
|
|
|
Currency *string `json:"currency"`
|
|
|
}
|
|
@@ -59,7 +68,30 @@ func (o Amount) MarshalJSON() ([]byte, error) {
|
|
|
toSerialize["from"] = o.From
|
|
|
}
|
|
|
|
|
|
+ if o.PayerTotal == nil {
|
|
|
+ return nil, fmt.Errorf("field `PayerTotal` is required and must be specified in Amount")
|
|
|
+ }
|
|
|
+ toSerialize["payer_total"] = o.PayerTotal
|
|
|
+
|
|
|
+ if o.PayerRefund == nil {
|
|
|
+ return nil, fmt.Errorf("field `PayerRefund` is required and must be specified in Amount")
|
|
|
+ }
|
|
|
+ toSerialize["payer_refund"] = o.PayerRefund
|
|
|
+
|
|
|
+ if o.SettlementRefund == nil {
|
|
|
+ return nil, fmt.Errorf("field `SettlementRefund` is required and must be specified in Amount")
|
|
|
+ }
|
|
|
+ toSerialize["settlement_refund"] = o.SettlementRefund
|
|
|
|
|
|
+ if o.SettlementTotal == nil {
|
|
|
+ return nil, fmt.Errorf("field `SettlementTotal` is required and must be specified in Amount")
|
|
|
+ }
|
|
|
+ toSerialize["settlement_total"] = o.SettlementTotal
|
|
|
+
|
|
|
+ if o.DiscountRefund == nil {
|
|
|
+ return nil, fmt.Errorf("field `DiscountRefund` is required and must be specified in Amount")
|
|
|
+ }
|
|
|
+ toSerialize["discount_refund"] = o.DiscountRefund
|
|
|
|
|
|
if o.Currency == nil {
|
|
|
return nil, fmt.Errorf("field `Currency` is required and must be specified in Amount")
|
|
@@ -84,6 +116,36 @@ func (o Amount) String() string {
|
|
|
|
|
|
ret += fmt.Sprintf("From:%v, ", o.From)
|
|
|
|
|
|
+ if o.PayerTotal == nil {
|
|
|
+ ret += "PayerTotal:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("PayerTotal:%v, ", *o.PayerTotal)
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.PayerRefund == nil {
|
|
|
+ ret += "PayerRefund:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("PayerRefund:%v, ", *o.PayerRefund)
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.SettlementRefund == nil {
|
|
|
+ ret += "SettlementRefund:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("SettlementRefund:%v, ", *o.SettlementRefund)
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.SettlementTotal == nil {
|
|
|
+ ret += "SettlementTotal:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("SettlementTotal:%v, ", *o.SettlementTotal)
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.DiscountRefund == nil {
|
|
|
+ ret += "DiscountRefund:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("DiscountRefund:%v, ", *o.DiscountRefund)
|
|
|
+ }
|
|
|
+
|
|
|
if o.Currency == nil {
|
|
|
ret += "Currency:<nil>"
|
|
|
} else {
|
|
@@ -113,6 +175,30 @@ func (o Amount) Clone() *Amount {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if o.PayerTotal != nil {
|
|
|
+ ret.PayerTotal = new(int64)
|
|
|
+ *ret.PayerTotal = *o.PayerTotal
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.PayerRefund != nil {
|
|
|
+ ret.PayerRefund = new(int64)
|
|
|
+ *ret.PayerRefund = *o.PayerRefund
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.SettlementRefund != nil {
|
|
|
+ ret.SettlementRefund = new(int64)
|
|
|
+ *ret.SettlementRefund = *o.SettlementRefund
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.SettlementTotal != nil {
|
|
|
+ ret.SettlementTotal = new(int64)
|
|
|
+ *ret.SettlementTotal = *o.SettlementTotal
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.DiscountRefund != nil {
|
|
|
+ ret.DiscountRefund = new(int64)
|
|
|
+ *ret.DiscountRefund = *o.DiscountRefund
|
|
|
+ }
|
|
|
|
|
|
if o.Currency != nil {
|
|
|
ret.Currency = new(string)
|
|
@@ -246,6 +332,11 @@ type CreateRequest struct {
|
|
|
Amount *AmountReq `json:"amount"`
|
|
|
|
|
|
GoodsDetail []GoodsDetail `json:"goods_detail,omitempty"`
|
|
|
+
|
|
|
+
|
|
|
+ MchId *string `json:"mch_id,omitempty"`
|
|
|
+
|
|
|
+ Appid *string `json:"appid,omitempty"`
|
|
|
}
|
|
|
|
|
|
func (o CreateRequest) MarshalJSON() ([]byte, error) {
|
|
@@ -412,17 +503,19 @@ const (
|
|
|
|
|
|
|
|
|
type FundsFromItem struct {
|
|
|
- FundSource *string `json:"funds_source"`
|
|
|
+
|
|
|
+ Account *Account `json:"account"`
|
|
|
+
|
|
|
Amount *int64 `json:"amount"`
|
|
|
}
|
|
|
|
|
|
func (o FundsFromItem) MarshalJSON() ([]byte, error) {
|
|
|
toSerialize := map[string]interface{}{}
|
|
|
|
|
|
- if o.FundSource == nil {
|
|
|
- return nil, fmt.Errorf("field `FundSource` is required and must be specified in FundsFromItem")
|
|
|
+ if o.Account == nil {
|
|
|
+ return nil, fmt.Errorf("field `Account` is required and must be specified in FundsFromItem")
|
|
|
}
|
|
|
- toSerialize["funds_source"] = o.FundSource
|
|
|
+ toSerialize["account"] = o.Account
|
|
|
|
|
|
if o.Amount == nil {
|
|
|
return nil, fmt.Errorf("field `Amount` is required and must be specified in FundsFromItem")
|
|
@@ -433,11 +526,12 @@ func (o FundsFromItem) MarshalJSON() ([]byte, error) {
|
|
|
|
|
|
func (o FundsFromItem) String() string {
|
|
|
var ret string
|
|
|
- if o.FundSource == nil {
|
|
|
- ret += "FundSource:<nil>, "
|
|
|
+ if o.Account == nil {
|
|
|
+ ret += "Account:<nil>, "
|
|
|
} else {
|
|
|
- ret += fmt.Sprintf("FundSource:%v, ", *o.FundSource)
|
|
|
+ ret += fmt.Sprintf("Account:%v, ", *o.Account)
|
|
|
}
|
|
|
+
|
|
|
if o.Amount == nil {
|
|
|
ret += "Amount:<nil>"
|
|
|
} else {
|
|
@@ -450,7 +544,10 @@ func (o FundsFromItem) String() string {
|
|
|
func (o FundsFromItem) Clone() *FundsFromItem {
|
|
|
ret := FundsFromItem{}
|
|
|
|
|
|
-
|
|
|
+ if o.Account != nil {
|
|
|
+ ret.Account = new(Account)
|
|
|
+ *ret.Account = *o.Account
|
|
|
+ }
|
|
|
|
|
|
if o.Amount != nil {
|
|
|
ret.Amount = new(int64)
|
|
@@ -776,19 +873,22 @@ type Refund struct {
|
|
|
TransactionId *string `json:"transaction_id"`
|
|
|
|
|
|
OutTradeNo *string `json:"out_trade_no"`
|
|
|
- Reason *string `json:"reason,omitempty"`
|
|
|
-
|
|
|
- Source *string `json:"source,omitempty"`
|
|
|
-
|
|
|
+
|
|
|
+ Channel *Channel `json:"channel"`
|
|
|
+
|
|
|
+ UserReceivedAccount *string `json:"user_received_account"`
|
|
|
+
|
|
|
+ SuccessTime *time.Time `json:"success_time,omitempty"`
|
|
|
+
|
|
|
+ CreateTime *time.Time `json:"create_time"`
|
|
|
+
|
|
|
+ Status *Status `json:"status"`
|
|
|
+
|
|
|
FundsAccount *FundsAccount `json:"funds_account,omitempty"`
|
|
|
|
|
|
Amount *Amount `json:"amount"`
|
|
|
|
|
|
PromotionDetail []Promotion `json:"promotion_detail,omitempty"`
|
|
|
-
|
|
|
- MchId *string `json:"mch_id,omitempty"`
|
|
|
- AppId *string `json:"app_id,omitempty"`
|
|
|
-
|
|
|
}
|
|
|
|
|
|
func (o Refund) MarshalJSON() ([]byte, error) {
|
|
@@ -814,6 +914,29 @@ func (o Refund) MarshalJSON() ([]byte, error) {
|
|
|
}
|
|
|
toSerialize["out_trade_no"] = o.OutTradeNo
|
|
|
|
|
|
+ if o.Channel == nil {
|
|
|
+ return nil, fmt.Errorf("field `Channel` is required and must be specified in Refund")
|
|
|
+ }
|
|
|
+ toSerialize["channel"] = o.Channel
|
|
|
+
|
|
|
+ if o.UserReceivedAccount == nil {
|
|
|
+ return nil, fmt.Errorf("field `UserReceivedAccount` is required and must be specified in Refund")
|
|
|
+ }
|
|
|
+ toSerialize["user_received_account"] = o.UserReceivedAccount
|
|
|
+
|
|
|
+ if o.SuccessTime != nil {
|
|
|
+ toSerialize["success_time"] = o.SuccessTime.Format(time.RFC3339)
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.CreateTime == nil {
|
|
|
+ return nil, fmt.Errorf("field `CreateTime` is required and must be specified in Refund")
|
|
|
+ }
|
|
|
+ toSerialize["create_time"] = o.CreateTime.Format(time.RFC3339)
|
|
|
+
|
|
|
+ if o.Status == nil {
|
|
|
+ return nil, fmt.Errorf("field `Status` is required and must be specified in Refund")
|
|
|
+ }
|
|
|
+ toSerialize["status"] = o.Status
|
|
|
|
|
|
if o.FundsAccount != nil {
|
|
|
toSerialize["funds_account"] = o.FundsAccount
|
|
@@ -856,7 +979,35 @@ func (o Refund) String() string {
|
|
|
ret += fmt.Sprintf("OutTradeNo:%v, ", *o.OutTradeNo)
|
|
|
}
|
|
|
|
|
|
+ if o.Channel == nil {
|
|
|
+ ret += "Channel:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("Channel:%v, ", *o.Channel)
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.UserReceivedAccount == nil {
|
|
|
+ ret += "UserReceivedAccount:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("UserReceivedAccount:%v, ", *o.UserReceivedAccount)
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.SuccessTime == nil {
|
|
|
+ ret += "SuccessTime:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("SuccessTime:%v, ", *o.SuccessTime)
|
|
|
+ }
|
|
|
|
|
|
+ if o.CreateTime == nil {
|
|
|
+ ret += "CreateTime:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("CreateTime:%v, ", *o.CreateTime)
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.Status == nil {
|
|
|
+ ret += "Status:<nil>, "
|
|
|
+ } else {
|
|
|
+ ret += fmt.Sprintf("Status:%v, ", *o.Status)
|
|
|
+ }
|
|
|
|
|
|
if o.FundsAccount == nil {
|
|
|
ret += "FundsAccount:<nil>, "
|
|
@@ -894,7 +1045,30 @@ func (o Refund) Clone() *Refund {
|
|
|
*ret.OutTradeNo = *o.OutTradeNo
|
|
|
}
|
|
|
|
|
|
+ if o.Channel != nil {
|
|
|
+ ret.Channel = new(Channel)
|
|
|
+ *ret.Channel = *o.Channel
|
|
|
+ }
|
|
|
|
|
|
+ if o.UserReceivedAccount != nil {
|
|
|
+ ret.UserReceivedAccount = new(string)
|
|
|
+ *ret.UserReceivedAccount = *o.UserReceivedAccount
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.SuccessTime != nil {
|
|
|
+ ret.SuccessTime = new(time.Time)
|
|
|
+ *ret.SuccessTime = *o.SuccessTime
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.CreateTime != nil {
|
|
|
+ ret.CreateTime = new(time.Time)
|
|
|
+ *ret.CreateTime = *o.CreateTime
|
|
|
+ }
|
|
|
+
|
|
|
+ if o.Status != nil {
|
|
|
+ ret.Status = new(Status)
|
|
|
+ *ret.Status = *o.Status
|
|
|
+ }
|
|
|
|
|
|
if o.FundsAccount != nil {
|
|
|
ret.FundsAccount = new(FundsAccount)
|