// Code generated by thriftgo (0.1.3). DO NOT EDIT.

package payment

import (
	"context"
	"fmt"
	"strings"

	"github.com/apache/thrift/lib/go/thrift"
)

type UnifyPayReq struct {
	OutOrderNo      string `thrift:"out_order_no,1" json:"out_order_no"`
	TotalAmount     int64  `thrift:"total_amount,2" json:"total_amount"`
	Subject         string `thrift:"subject,3" json:"subject"`
	MerchantId      string `thrift:"merchant_id,4" json:"merchant_id"`
	PayWay          string `thrift:"pay_way,5" json:"pay_way"`
	AppId           string `thrift:"app_id,6" json:"app_id"`
	SubOpenId       string `thrift:"sub_open_id,7" json:"sub_open_id"`
	NotifyUrl       string `thrift:"notify_url,8" json:"notify_url"`
	ClientIp        string `thrift:"client_ip,9" json:"client_ip"`
	OrderExpiration int32  `thrift:"order_expiration,10" json:"order_expiration"`
}

func NewUnifyPayReq() *UnifyPayReq {
	return &UnifyPayReq{}
}

func (p *UnifyPayReq) GetOutOrderNo() (v string) {
	return p.OutOrderNo
}

func (p *UnifyPayReq) GetTotalAmount() (v int64) {
	return p.TotalAmount
}

func (p *UnifyPayReq) GetSubject() (v string) {
	return p.Subject
}

func (p *UnifyPayReq) GetMerchantId() (v string) {
	return p.MerchantId
}

func (p *UnifyPayReq) GetPayWay() (v string) {
	return p.PayWay
}

func (p *UnifyPayReq) GetAppId() (v string) {
	return p.AppId
}

func (p *UnifyPayReq) GetSubOpenId() (v string) {
	return p.SubOpenId
}

func (p *UnifyPayReq) GetNotifyUrl() (v string) {
	return p.NotifyUrl
}

func (p *UnifyPayReq) GetClientIp() (v string) {
	return p.ClientIp
}

func (p *UnifyPayReq) GetOrderExpiration() (v int32) {
	return p.OrderExpiration
}
func (p *UnifyPayReq) SetOutOrderNo(val string) {
	p.OutOrderNo = val
}
func (p *UnifyPayReq) SetTotalAmount(val int64) {
	p.TotalAmount = val
}
func (p *UnifyPayReq) SetSubject(val string) {
	p.Subject = val
}
func (p *UnifyPayReq) SetMerchantId(val string) {
	p.MerchantId = val
}
func (p *UnifyPayReq) SetPayWay(val string) {
	p.PayWay = val
}
func (p *UnifyPayReq) SetAppId(val string) {
	p.AppId = val
}
func (p *UnifyPayReq) SetSubOpenId(val string) {
	p.SubOpenId = val
}
func (p *UnifyPayReq) SetNotifyUrl(val string) {
	p.NotifyUrl = val
}
func (p *UnifyPayReq) SetClientIp(val string) {
	p.ClientIp = val
}
func (p *UnifyPayReq) SetOrderExpiration(val int32) {
	p.OrderExpiration = val
}

var fieldIDToName_UnifyPayReq = map[int16]string{
	1:  "out_order_no",
	2:  "total_amount",
	3:  "subject",
	4:  "merchant_id",
	5:  "pay_way",
	6:  "app_id",
	7:  "sub_open_id",
	8:  "notify_url",
	9:  "client_ip",
	10: "order_expiration",
}

func (p *UnifyPayReq) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 4:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 7:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 8:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 9:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField9(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 10:
			if fieldTypeId == thrift.I32 {
				if err = p.ReadField10(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UnifyPayReq[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *UnifyPayReq) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.OutOrderNo = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.TotalAmount = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Subject = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.MerchantId = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.PayWay = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.AppId = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.SubOpenId = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.NotifyUrl = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField9(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClientIp = v
	}
	return nil
}

func (p *UnifyPayReq) ReadField10(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI32(); err != nil {
		return err
	} else {
		p.OrderExpiration = v
	}
	return nil
}

func (p *UnifyPayReq) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("UnifyPayReq"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}
		if err = p.writeField9(oprot); err != nil {
			fieldId = 9
			goto WriteFieldError
		}
		if err = p.writeField10(oprot); err != nil {
			fieldId = 10
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *UnifyPayReq) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("out_order_no", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OutOrderNo); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *UnifyPayReq) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("total_amount", thrift.I64, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.TotalAmount); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *UnifyPayReq) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("subject", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Subject); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *UnifyPayReq) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("merchant_id", thrift.STRING, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.MerchantId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *UnifyPayReq) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pay_way", thrift.STRING, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.PayWay); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *UnifyPayReq) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("app_id", thrift.STRING, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.AppId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *UnifyPayReq) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("sub_open_id", thrift.STRING, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.SubOpenId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *UnifyPayReq) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("notify_url", thrift.STRING, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.NotifyUrl); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *UnifyPayReq) writeField9(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("client_ip", thrift.STRING, 9); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClientIp); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 9 end error: ", p), err)
}

func (p *UnifyPayReq) writeField10(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("order_expiration", thrift.I32, 10); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI32(p.OrderExpiration); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 10 end error: ", p), err)
}

func (p *UnifyPayReq) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("UnifyPayReq(%+v)", *p)
}

func (p *UnifyPayReq) DeepEqual(ano *UnifyPayReq) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.OutOrderNo) {
		return false
	}
	if !p.Field2DeepEqual(ano.TotalAmount) {
		return false
	}
	if !p.Field3DeepEqual(ano.Subject) {
		return false
	}
	if !p.Field4DeepEqual(ano.MerchantId) {
		return false
	}
	if !p.Field5DeepEqual(ano.PayWay) {
		return false
	}
	if !p.Field6DeepEqual(ano.AppId) {
		return false
	}
	if !p.Field7DeepEqual(ano.SubOpenId) {
		return false
	}
	if !p.Field8DeepEqual(ano.NotifyUrl) {
		return false
	}
	if !p.Field9DeepEqual(ano.ClientIp) {
		return false
	}
	if !p.Field10DeepEqual(ano.OrderExpiration) {
		return false
	}
	return true
}

func (p *UnifyPayReq) Field1DeepEqual(src string) bool {

	if strings.Compare(p.OutOrderNo, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field2DeepEqual(src int64) bool {

	if p.TotalAmount != src {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Subject, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field4DeepEqual(src string) bool {

	if strings.Compare(p.MerchantId, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field5DeepEqual(src string) bool {

	if strings.Compare(p.PayWay, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field6DeepEqual(src string) bool {

	if strings.Compare(p.AppId, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field7DeepEqual(src string) bool {

	if strings.Compare(p.SubOpenId, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field8DeepEqual(src string) bool {

	if strings.Compare(p.NotifyUrl, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field9DeepEqual(src string) bool {

	if strings.Compare(p.ClientIp, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayReq) Field10DeepEqual(src int32) bool {

	if p.OrderExpiration != src {
		return false
	}
	return true
}

type UnifyPayResp struct {
	MerchantId    string `thrift:"merchant_id,1" json:"merchant_id"`
	SubMerchantId string `thrift:"sub_merchant_id,2" json:"sub_merchant_id"`
	OutOrderNo    string `thrift:"out_order_no,3" json:"out_order_no"`
	JspayInfo     string `thrift:"jspay_info,4" json:"jspay_info"`
	PayWay        string `thrift:"pay_way,5" json:"pay_way"`
}

func NewUnifyPayResp() *UnifyPayResp {
	return &UnifyPayResp{}
}

func (p *UnifyPayResp) GetMerchantId() (v string) {
	return p.MerchantId
}

func (p *UnifyPayResp) GetSubMerchantId() (v string) {
	return p.SubMerchantId
}

func (p *UnifyPayResp) GetOutOrderNo() (v string) {
	return p.OutOrderNo
}

func (p *UnifyPayResp) GetJspayInfo() (v string) {
	return p.JspayInfo
}

func (p *UnifyPayResp) GetPayWay() (v string) {
	return p.PayWay
}
func (p *UnifyPayResp) SetMerchantId(val string) {
	p.MerchantId = val
}
func (p *UnifyPayResp) SetSubMerchantId(val string) {
	p.SubMerchantId = val
}
func (p *UnifyPayResp) SetOutOrderNo(val string) {
	p.OutOrderNo = val
}
func (p *UnifyPayResp) SetJspayInfo(val string) {
	p.JspayInfo = val
}
func (p *UnifyPayResp) SetPayWay(val string) {
	p.PayWay = val
}

var fieldIDToName_UnifyPayResp = map[int16]string{
	1: "merchant_id",
	2: "sub_merchant_id",
	3: "out_order_no",
	4: "jspay_info",
	5: "pay_way",
}

func (p *UnifyPayResp) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 4:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_UnifyPayResp[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *UnifyPayResp) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.MerchantId = v
	}
	return nil
}

func (p *UnifyPayResp) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.SubMerchantId = v
	}
	return nil
}

func (p *UnifyPayResp) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.OutOrderNo = v
	}
	return nil
}

func (p *UnifyPayResp) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.JspayInfo = v
	}
	return nil
}

func (p *UnifyPayResp) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.PayWay = v
	}
	return nil
}

func (p *UnifyPayResp) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("UnifyPayResp"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *UnifyPayResp) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("merchant_id", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.MerchantId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *UnifyPayResp) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("sub_merchant_id", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.SubMerchantId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *UnifyPayResp) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("out_order_no", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OutOrderNo); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *UnifyPayResp) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("jspay_info", thrift.STRING, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.JspayInfo); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *UnifyPayResp) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pay_way", thrift.STRING, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.PayWay); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *UnifyPayResp) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("UnifyPayResp(%+v)", *p)
}

func (p *UnifyPayResp) DeepEqual(ano *UnifyPayResp) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.MerchantId) {
		return false
	}
	if !p.Field2DeepEqual(ano.SubMerchantId) {
		return false
	}
	if !p.Field3DeepEqual(ano.OutOrderNo) {
		return false
	}
	if !p.Field4DeepEqual(ano.JspayInfo) {
		return false
	}
	if !p.Field5DeepEqual(ano.PayWay) {
		return false
	}
	return true
}

func (p *UnifyPayResp) Field1DeepEqual(src string) bool {

	if strings.Compare(p.MerchantId, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayResp) Field2DeepEqual(src string) bool {

	if strings.Compare(p.SubMerchantId, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayResp) Field3DeepEqual(src string) bool {

	if strings.Compare(p.OutOrderNo, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayResp) Field4DeepEqual(src string) bool {

	if strings.Compare(p.JspayInfo, src) != 0 {
		return false
	}
	return true
}
func (p *UnifyPayResp) Field5DeepEqual(src string) bool {

	if strings.Compare(p.PayWay, src) != 0 {
		return false
	}
	return true
}

type QRPayReq struct {
	OutOrderNo  string `thrift:"out_order_no,1" json:"out_order_no"`
	TotalAmount int64  `thrift:"total_amount,2" json:"total_amount"`
	Subject     string `thrift:"subject,3" json:"subject"`
	MerchantId  string `thrift:"merchant_id,4" json:"merchant_id"`
	AuthCode    string `thrift:"auth_code,5" json:"auth_code"`
	NotifyUrl   string `thrift:"notify_url,6" json:"notify_url"`
	ClientIp    string `thrift:"client_ip,7" json:"client_ip"`
}

func NewQRPayReq() *QRPayReq {
	return &QRPayReq{}
}

func (p *QRPayReq) GetOutOrderNo() (v string) {
	return p.OutOrderNo
}

func (p *QRPayReq) GetTotalAmount() (v int64) {
	return p.TotalAmount
}

func (p *QRPayReq) GetSubject() (v string) {
	return p.Subject
}

func (p *QRPayReq) GetMerchantId() (v string) {
	return p.MerchantId
}

func (p *QRPayReq) GetAuthCode() (v string) {
	return p.AuthCode
}

func (p *QRPayReq) GetNotifyUrl() (v string) {
	return p.NotifyUrl
}

func (p *QRPayReq) GetClientIp() (v string) {
	return p.ClientIp
}
func (p *QRPayReq) SetOutOrderNo(val string) {
	p.OutOrderNo = val
}
func (p *QRPayReq) SetTotalAmount(val int64) {
	p.TotalAmount = val
}
func (p *QRPayReq) SetSubject(val string) {
	p.Subject = val
}
func (p *QRPayReq) SetMerchantId(val string) {
	p.MerchantId = val
}
func (p *QRPayReq) SetAuthCode(val string) {
	p.AuthCode = val
}
func (p *QRPayReq) SetNotifyUrl(val string) {
	p.NotifyUrl = val
}
func (p *QRPayReq) SetClientIp(val string) {
	p.ClientIp = val
}

var fieldIDToName_QRPayReq = map[int16]string{
	1: "out_order_no",
	2: "total_amount",
	3: "subject",
	4: "merchant_id",
	5: "auth_code",
	6: "notify_url",
	7: "client_ip",
}

func (p *QRPayReq) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.I64 {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 4:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 7:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_QRPayReq[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *QRPayReq) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.OutOrderNo = v
	}
	return nil
}

func (p *QRPayReq) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadI64(); err != nil {
		return err
	} else {
		p.TotalAmount = v
	}
	return nil
}

func (p *QRPayReq) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.Subject = v
	}
	return nil
}

func (p *QRPayReq) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.MerchantId = v
	}
	return nil
}

func (p *QRPayReq) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.AuthCode = v
	}
	return nil
}

func (p *QRPayReq) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.NotifyUrl = v
	}
	return nil
}

func (p *QRPayReq) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.ClientIp = v
	}
	return nil
}

func (p *QRPayReq) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("QRPayReq"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *QRPayReq) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("out_order_no", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OutOrderNo); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *QRPayReq) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("total_amount", thrift.I64, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteI64(p.TotalAmount); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *QRPayReq) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("subject", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.Subject); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *QRPayReq) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("merchant_id", thrift.STRING, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.MerchantId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *QRPayReq) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("auth_code", thrift.STRING, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.AuthCode); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *QRPayReq) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("notify_url", thrift.STRING, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.NotifyUrl); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *QRPayReq) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("client_ip", thrift.STRING, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.ClientIp); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *QRPayReq) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("QRPayReq(%+v)", *p)
}

func (p *QRPayReq) DeepEqual(ano *QRPayReq) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.OutOrderNo) {
		return false
	}
	if !p.Field2DeepEqual(ano.TotalAmount) {
		return false
	}
	if !p.Field3DeepEqual(ano.Subject) {
		return false
	}
	if !p.Field4DeepEqual(ano.MerchantId) {
		return false
	}
	if !p.Field5DeepEqual(ano.AuthCode) {
		return false
	}
	if !p.Field6DeepEqual(ano.NotifyUrl) {
		return false
	}
	if !p.Field7DeepEqual(ano.ClientIp) {
		return false
	}
	return true
}

func (p *QRPayReq) Field1DeepEqual(src string) bool {

	if strings.Compare(p.OutOrderNo, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayReq) Field2DeepEqual(src int64) bool {

	if p.TotalAmount != src {
		return false
	}
	return true
}
func (p *QRPayReq) Field3DeepEqual(src string) bool {

	if strings.Compare(p.Subject, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayReq) Field4DeepEqual(src string) bool {

	if strings.Compare(p.MerchantId, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayReq) Field5DeepEqual(src string) bool {

	if strings.Compare(p.AuthCode, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayReq) Field6DeepEqual(src string) bool {

	if strings.Compare(p.NotifyUrl, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayReq) Field7DeepEqual(src string) bool {

	if strings.Compare(p.ClientIp, src) != 0 {
		return false
	}
	return true
}

type QRPayResp struct {
	MerchantId       string `thrift:"merchant_id,1" json:"merchant_id"`
	SubMerchantId    string `thrift:"sub_merchant_id,2" json:"sub_merchant_id"`
	OutOrderNo       string `thrift:"out_order_no,3" json:"out_order_no"`
	OrderStatus      int8   `thrift:"order_status,4" json:"order_status"`
	PayWay           string `thrift:"pay_way,5" json:"pay_way"`
	OpenId           string `thrift:"open_id,6" json:"open_id"`
	OutTransactionId string `thrift:"out_transaction_id,7" json:"out_transaction_id"`
	SubOpenid        string `thrift:"sub_openid,8" json:"sub_openid"`
}

func NewQRPayResp() *QRPayResp {
	return &QRPayResp{}
}

func (p *QRPayResp) GetMerchantId() (v string) {
	return p.MerchantId
}

func (p *QRPayResp) GetSubMerchantId() (v string) {
	return p.SubMerchantId
}

func (p *QRPayResp) GetOutOrderNo() (v string) {
	return p.OutOrderNo
}

func (p *QRPayResp) GetOrderStatus() (v int8) {
	return p.OrderStatus
}

func (p *QRPayResp) GetPayWay() (v string) {
	return p.PayWay
}

func (p *QRPayResp) GetOpenId() (v string) {
	return p.OpenId
}

func (p *QRPayResp) GetOutTransactionId() (v string) {
	return p.OutTransactionId
}

func (p *QRPayResp) GetSubOpenid() (v string) {
	return p.SubOpenid
}
func (p *QRPayResp) SetMerchantId(val string) {
	p.MerchantId = val
}
func (p *QRPayResp) SetSubMerchantId(val string) {
	p.SubMerchantId = val
}
func (p *QRPayResp) SetOutOrderNo(val string) {
	p.OutOrderNo = val
}
func (p *QRPayResp) SetOrderStatus(val int8) {
	p.OrderStatus = val
}
func (p *QRPayResp) SetPayWay(val string) {
	p.PayWay = val
}
func (p *QRPayResp) SetOpenId(val string) {
	p.OpenId = val
}
func (p *QRPayResp) SetOutTransactionId(val string) {
	p.OutTransactionId = val
}
func (p *QRPayResp) SetSubOpenid(val string) {
	p.SubOpenid = val
}

var fieldIDToName_QRPayResp = map[int16]string{
	1: "merchant_id",
	2: "sub_merchant_id",
	3: "out_order_no",
	4: "order_status",
	5: "pay_way",
	6: "open_id",
	7: "out_transaction_id",
	8: "sub_openid",
}

func (p *QRPayResp) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 2:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField2(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 3:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField3(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 4:
			if fieldTypeId == thrift.BYTE {
				if err = p.ReadField4(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 5:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField5(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 6:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField6(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 7:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField7(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		case 8:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField8(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_QRPayResp[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *QRPayResp) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.MerchantId = v
	}
	return nil
}

func (p *QRPayResp) ReadField2(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.SubMerchantId = v
	}
	return nil
}

func (p *QRPayResp) ReadField3(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.OutOrderNo = v
	}
	return nil
}

func (p *QRPayResp) ReadField4(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadByte(); err != nil {
		return err
	} else {
		p.OrderStatus = v
	}
	return nil
}

func (p *QRPayResp) ReadField5(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.PayWay = v
	}
	return nil
}

func (p *QRPayResp) ReadField6(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.OpenId = v
	}
	return nil
}

func (p *QRPayResp) ReadField7(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.OutTransactionId = v
	}
	return nil
}

func (p *QRPayResp) ReadField8(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.SubOpenid = v
	}
	return nil
}

func (p *QRPayResp) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("QRPayResp"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}
		if err = p.writeField2(oprot); err != nil {
			fieldId = 2
			goto WriteFieldError
		}
		if err = p.writeField3(oprot); err != nil {
			fieldId = 3
			goto WriteFieldError
		}
		if err = p.writeField4(oprot); err != nil {
			fieldId = 4
			goto WriteFieldError
		}
		if err = p.writeField5(oprot); err != nil {
			fieldId = 5
			goto WriteFieldError
		}
		if err = p.writeField6(oprot); err != nil {
			fieldId = 6
			goto WriteFieldError
		}
		if err = p.writeField7(oprot); err != nil {
			fieldId = 7
			goto WriteFieldError
		}
		if err = p.writeField8(oprot); err != nil {
			fieldId = 8
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *QRPayResp) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("merchant_id", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.MerchantId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *QRPayResp) writeField2(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("sub_merchant_id", thrift.STRING, 2); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.SubMerchantId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 2 end error: ", p), err)
}

func (p *QRPayResp) writeField3(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("out_order_no", thrift.STRING, 3); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OutOrderNo); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 3 end error: ", p), err)
}

func (p *QRPayResp) writeField4(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("order_status", thrift.BYTE, 4); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteByte(p.OrderStatus); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 4 end error: ", p), err)
}

func (p *QRPayResp) writeField5(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("pay_way", thrift.STRING, 5); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.PayWay); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 5 end error: ", p), err)
}

func (p *QRPayResp) writeField6(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("open_id", thrift.STRING, 6); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OpenId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 6 end error: ", p), err)
}

func (p *QRPayResp) writeField7(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("out_transaction_id", thrift.STRING, 7); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OutTransactionId); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 7 end error: ", p), err)
}

func (p *QRPayResp) writeField8(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("sub_openid", thrift.STRING, 8); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.SubOpenid); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 8 end error: ", p), err)
}

func (p *QRPayResp) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("QRPayResp(%+v)", *p)
}

func (p *QRPayResp) DeepEqual(ano *QRPayResp) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.MerchantId) {
		return false
	}
	if !p.Field2DeepEqual(ano.SubMerchantId) {
		return false
	}
	if !p.Field3DeepEqual(ano.OutOrderNo) {
		return false
	}
	if !p.Field4DeepEqual(ano.OrderStatus) {
		return false
	}
	if !p.Field5DeepEqual(ano.PayWay) {
		return false
	}
	if !p.Field6DeepEqual(ano.OpenId) {
		return false
	}
	if !p.Field7DeepEqual(ano.OutTransactionId) {
		return false
	}
	if !p.Field8DeepEqual(ano.SubOpenid) {
		return false
	}
	return true
}

func (p *QRPayResp) Field1DeepEqual(src string) bool {

	if strings.Compare(p.MerchantId, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayResp) Field2DeepEqual(src string) bool {

	if strings.Compare(p.SubMerchantId, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayResp) Field3DeepEqual(src string) bool {

	if strings.Compare(p.OutOrderNo, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayResp) Field4DeepEqual(src int8) bool {

	if p.OrderStatus != src {
		return false
	}
	return true
}
func (p *QRPayResp) Field5DeepEqual(src string) bool {

	if strings.Compare(p.PayWay, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayResp) Field6DeepEqual(src string) bool {

	if strings.Compare(p.OpenId, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayResp) Field7DeepEqual(src string) bool {

	if strings.Compare(p.OutTransactionId, src) != 0 {
		return false
	}
	return true
}
func (p *QRPayResp) Field8DeepEqual(src string) bool {

	if strings.Compare(p.SubOpenid, src) != 0 {
		return false
	}
	return true
}

type QueryOrderReq struct {
	OutOrderNo string `thrift:"out_order_no,1" json:"out_order_no"`
}

func NewQueryOrderReq() *QueryOrderReq {
	return &QueryOrderReq{}
}

func (p *QueryOrderReq) GetOutOrderNo() (v string) {
	return p.OutOrderNo
}
func (p *QueryOrderReq) SetOutOrderNo(val string) {
	p.OutOrderNo = val
}

var fieldIDToName_QueryOrderReq = map[int16]string{
	1: "out_order_no",
}

func (p *QueryOrderReq) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_QueryOrderReq[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *QueryOrderReq) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.OutOrderNo = v
	}
	return nil
}

func (p *QueryOrderReq) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("QueryOrderReq"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *QueryOrderReq) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("out_order_no", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OutOrderNo); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *QueryOrderReq) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("QueryOrderReq(%+v)", *p)
}

func (p *QueryOrderReq) DeepEqual(ano *QueryOrderReq) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.OutOrderNo) {
		return false
	}
	return true
}

func (p *QueryOrderReq) Field1DeepEqual(src string) bool {

	if strings.Compare(p.OutOrderNo, src) != 0 {
		return false
	}
	return true
}

type QueryOrderResp struct {
	OrderStatus int8 `thrift:"order_status,1" json:"order_status"`
}

func NewQueryOrderResp() *QueryOrderResp {
	return &QueryOrderResp{}
}

func (p *QueryOrderResp) GetOrderStatus() (v int8) {
	return p.OrderStatus
}
func (p *QueryOrderResp) SetOrderStatus(val int8) {
	p.OrderStatus = val
}

var fieldIDToName_QueryOrderResp = map[int16]string{
	1: "order_status",
}

func (p *QueryOrderResp) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.BYTE {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_QueryOrderResp[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *QueryOrderResp) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadByte(); err != nil {
		return err
	} else {
		p.OrderStatus = v
	}
	return nil
}

func (p *QueryOrderResp) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("QueryOrderResp"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *QueryOrderResp) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("order_status", thrift.BYTE, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteByte(p.OrderStatus); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *QueryOrderResp) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("QueryOrderResp(%+v)", *p)
}

func (p *QueryOrderResp) DeepEqual(ano *QueryOrderResp) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.OrderStatus) {
		return false
	}
	return true
}

func (p *QueryOrderResp) Field1DeepEqual(src int8) bool {

	if p.OrderStatus != src {
		return false
	}
	return true
}

type CloseOrderReq struct {
	OutOrderNo string `thrift:"out_order_no,1" json:"out_order_no"`
}

func NewCloseOrderReq() *CloseOrderReq {
	return &CloseOrderReq{}
}

func (p *CloseOrderReq) GetOutOrderNo() (v string) {
	return p.OutOrderNo
}
func (p *CloseOrderReq) SetOutOrderNo(val string) {
	p.OutOrderNo = val
}

var fieldIDToName_CloseOrderReq = map[int16]string{
	1: "out_order_no",
}

func (p *CloseOrderReq) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRING {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_CloseOrderReq[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *CloseOrderReq) ReadField1(iprot thrift.TProtocol) error {
	if v, err := iprot.ReadString(); err != nil {
		return err
	} else {
		p.OutOrderNo = v
	}
	return nil
}

func (p *CloseOrderReq) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CloseOrderReq"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *CloseOrderReq) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("out_order_no", thrift.STRING, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := oprot.WriteString(p.OutOrderNo); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *CloseOrderReq) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CloseOrderReq(%+v)", *p)
}

func (p *CloseOrderReq) DeepEqual(ano *CloseOrderReq) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.OutOrderNo) {
		return false
	}
	return true
}

func (p *CloseOrderReq) Field1DeepEqual(src string) bool {

	if strings.Compare(p.OutOrderNo, src) != 0 {
		return false
	}
	return true
}

type CloseOrderResp struct {
}

func NewCloseOrderResp() *CloseOrderResp {
	return &CloseOrderResp{}
}

var fieldIDToName_CloseOrderResp = map[int16]string{}

func (p *CloseOrderResp) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}
		if err = iprot.Skip(fieldTypeId); err != nil {
			goto SkipFieldTypeError
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
SkipFieldTypeError:
	return thrift.PrependError(fmt.Sprintf("%T skip field type %d error", p, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *CloseOrderResp) Write(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteStructBegin("CloseOrderResp"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *CloseOrderResp) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("CloseOrderResp(%+v)", *p)
}

func (p *CloseOrderResp) DeepEqual(ano *CloseOrderResp) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	return true
}

type PaymentSvc interface {
	UnifyPay(ctx context.Context, req *UnifyPayReq) (r *UnifyPayResp, err error)

	QRPay(ctx context.Context, req *QRPayReq) (r *QRPayResp, err error)

	QueryOrder(ctx context.Context, req *QueryOrderReq) (r *QueryOrderResp, err error)

	CloseOrder(ctx context.Context, req *CloseOrderReq) (r *CloseOrderResp, err error)
}

type PaymentSvcClient struct {
	c thrift.TClient
}

func NewPaymentSvcClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *PaymentSvcClient {
	return &PaymentSvcClient{
		c: thrift.NewTStandardClient(f.GetProtocol(t), f.GetProtocol(t)),
	}
}

func NewPaymentSvcClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *PaymentSvcClient {
	return &PaymentSvcClient{
		c: thrift.NewTStandardClient(iprot, oprot),
	}
}

func NewPaymentSvcClient(c thrift.TClient) *PaymentSvcClient {
	return &PaymentSvcClient{
		c: c,
	}
}

func (p *PaymentSvcClient) Client_() thrift.TClient {
	return p.c
}

func (p *PaymentSvcClient) UnifyPay(ctx context.Context, req *UnifyPayReq) (r *UnifyPayResp, err error) {
	var _args PaymentSvcUnifyPayArgs
	_args.Req = req
	var _result PaymentSvcUnifyPayResult
	if err = p.Client_().Call(ctx, "UnifyPay", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}

func (p *PaymentSvcClient) QRPay(ctx context.Context, req *QRPayReq) (r *QRPayResp, err error) {
	var _args PaymentSvcQRPayArgs
	_args.Req = req
	var _result PaymentSvcQRPayResult
	if err = p.Client_().Call(ctx, "QRPay", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}

func (p *PaymentSvcClient) QueryOrder(ctx context.Context, req *QueryOrderReq) (r *QueryOrderResp, err error) {
	var _args PaymentSvcQueryOrderArgs
	_args.Req = req
	var _result PaymentSvcQueryOrderResult
	if err = p.Client_().Call(ctx, "QueryOrder", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}

func (p *PaymentSvcClient) CloseOrder(ctx context.Context, req *CloseOrderReq) (r *CloseOrderResp, err error) {
	var _args PaymentSvcCloseOrderArgs
	_args.Req = req
	var _result PaymentSvcCloseOrderResult
	if err = p.Client_().Call(ctx, "CloseOrder", &_args, &_result); err != nil {
		return
	}
	return _result.GetSuccess(), nil
}

type PaymentSvcProcessor struct {
	processorMap map[string]thrift.TProcessorFunction
	handler      PaymentSvc
}

func (p *PaymentSvcProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction) {
	p.processorMap[key] = processor
}

func (p *PaymentSvcProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool) {
	processor, ok = p.processorMap[key]
	return processor, ok
}

func (p *PaymentSvcProcessor) ProcessorMap() map[string]thrift.TProcessorFunction {
	return p.processorMap
}

func NewPaymentSvcProcessor(handler PaymentSvc) *PaymentSvcProcessor {
	self := &PaymentSvcProcessor{handler: handler, processorMap: make(map[string]thrift.TProcessorFunction)}
	self.AddToProcessorMap("UnifyPay", &paymentSvcProcessorUnifyPay{handler: handler})
	self.AddToProcessorMap("QRPay", &paymentSvcProcessorQRPay{handler: handler})
	self.AddToProcessorMap("QueryOrder", &paymentSvcProcessorQueryOrder{handler: handler})
	self.AddToProcessorMap("CloseOrder", &paymentSvcProcessorCloseOrder{handler: handler})
	return self
}
func (p *PaymentSvcProcessor) Process(ctx context.Context, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	name, _, seqId, err := iprot.ReadMessageBegin()
	if err != nil {
		return false, err
	}
	if processor, ok := p.GetProcessorFunction(name); ok {
		return processor.Process(ctx, seqId, iprot, oprot)
	}
	iprot.Skip(thrift.STRUCT)
	iprot.ReadMessageEnd()
	x := thrift.NewTApplicationException(thrift.UNKNOWN_METHOD, "Unknown function "+name)
	oprot.WriteMessageBegin(name, thrift.EXCEPTION, seqId)
	x.Write(oprot)
	oprot.WriteMessageEnd()
	oprot.Flush(ctx)
	return false, x
}

type paymentSvcProcessorUnifyPay struct {
	handler PaymentSvc
}

func (p *paymentSvcProcessorUnifyPay) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := PaymentSvcUnifyPayArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("UnifyPay", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	result := PaymentSvcUnifyPayResult{}
	var retval *UnifyPayResp
	if retval, err2 = p.handler.UnifyPay(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing UnifyPay: "+err2.Error())
		oprot.WriteMessageBegin("UnifyPay", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("UnifyPay", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type paymentSvcProcessorQRPay struct {
	handler PaymentSvc
}

func (p *paymentSvcProcessorQRPay) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := PaymentSvcQRPayArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("QRPay", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	result := PaymentSvcQRPayResult{}
	var retval *QRPayResp
	if retval, err2 = p.handler.QRPay(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing QRPay: "+err2.Error())
		oprot.WriteMessageBegin("QRPay", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("QRPay", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type paymentSvcProcessorQueryOrder struct {
	handler PaymentSvc
}

func (p *paymentSvcProcessorQueryOrder) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := PaymentSvcQueryOrderArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("QueryOrder", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	result := PaymentSvcQueryOrderResult{}
	var retval *QueryOrderResp
	if retval, err2 = p.handler.QueryOrder(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing QueryOrder: "+err2.Error())
		oprot.WriteMessageBegin("QueryOrder", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("QueryOrder", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type paymentSvcProcessorCloseOrder struct {
	handler PaymentSvc
}

func (p *paymentSvcProcessorCloseOrder) Process(ctx context.Context, seqId int32, iprot, oprot thrift.TProtocol) (success bool, err thrift.TException) {
	args := PaymentSvcCloseOrderArgs{}
	if err = args.Read(iprot); err != nil {
		iprot.ReadMessageEnd()
		x := thrift.NewTApplicationException(thrift.PROTOCOL_ERROR, err.Error())
		oprot.WriteMessageBegin("CloseOrder", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return false, err
	}

	iprot.ReadMessageEnd()
	var err2 error
	result := PaymentSvcCloseOrderResult{}
	var retval *CloseOrderResp
	if retval, err2 = p.handler.CloseOrder(ctx, args.Req); err2 != nil {
		x := thrift.NewTApplicationException(thrift.INTERNAL_ERROR, "Internal error processing CloseOrder: "+err2.Error())
		oprot.WriteMessageBegin("CloseOrder", thrift.EXCEPTION, seqId)
		x.Write(oprot)
		oprot.WriteMessageEnd()
		oprot.Flush(ctx)
		return true, err2
	} else {
		result.Success = retval
	}
	if err2 = oprot.WriteMessageBegin("CloseOrder", thrift.REPLY, seqId); err2 != nil {
		err = err2
	}
	if err2 = result.Write(oprot); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.WriteMessageEnd(); err == nil && err2 != nil {
		err = err2
	}
	if err2 = oprot.Flush(ctx); err == nil && err2 != nil {
		err = err2
	}
	if err != nil {
		return
	}
	return true, err
}

type PaymentSvcUnifyPayArgs struct {
	Req *UnifyPayReq `thrift:"req,1" json:"req"`
}

func NewPaymentSvcUnifyPayArgs() *PaymentSvcUnifyPayArgs {
	return &PaymentSvcUnifyPayArgs{}
}

var PaymentSvcUnifyPayArgs_Req_DEFAULT *UnifyPayReq

func (p *PaymentSvcUnifyPayArgs) GetReq() (v *UnifyPayReq) {
	if !p.IsSetReq() {
		return PaymentSvcUnifyPayArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *PaymentSvcUnifyPayArgs) SetReq(val *UnifyPayReq) {
	p.Req = val
}

var fieldIDToName_PaymentSvcUnifyPayArgs = map[int16]string{
	1: "req",
}

func (p *PaymentSvcUnifyPayArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *PaymentSvcUnifyPayArgs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentSvcUnifyPayArgs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PaymentSvcUnifyPayArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewUnifyPayReq()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PaymentSvcUnifyPayArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("UnifyPay_args"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PaymentSvcUnifyPayArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Req.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PaymentSvcUnifyPayArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PaymentSvcUnifyPayArgs(%+v)", *p)
}

func (p *PaymentSvcUnifyPayArgs) DeepEqual(ano *PaymentSvcUnifyPayArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *PaymentSvcUnifyPayArgs) Field1DeepEqual(src *UnifyPayReq) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

type PaymentSvcUnifyPayResult struct {
	Success *UnifyPayResp `thrift:"success,0" json:"success,omitempty"`
}

func NewPaymentSvcUnifyPayResult() *PaymentSvcUnifyPayResult {
	return &PaymentSvcUnifyPayResult{}
}

var PaymentSvcUnifyPayResult_Success_DEFAULT *UnifyPayResp

func (p *PaymentSvcUnifyPayResult) GetSuccess() (v *UnifyPayResp) {
	if !p.IsSetSuccess() {
		return PaymentSvcUnifyPayResult_Success_DEFAULT
	}
	return p.Success
}
func (p *PaymentSvcUnifyPayResult) SetSuccess(x interface{}) {
	p.Success = x.(*UnifyPayResp)
}

var fieldIDToName_PaymentSvcUnifyPayResult = map[int16]string{
	0: "success",
}

func (p *PaymentSvcUnifyPayResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *PaymentSvcUnifyPayResult) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField0(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentSvcUnifyPayResult[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PaymentSvcUnifyPayResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewUnifyPayResp()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PaymentSvcUnifyPayResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("UnifyPay_result"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField0(oprot); err != nil {
			fieldId = 0
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PaymentSvcUnifyPayResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Success.Write(oprot); err != nil {
			return err
		}
		if err = oprot.WriteFieldEnd(); err != nil {
			goto WriteFieldEndError
		}
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}

func (p *PaymentSvcUnifyPayResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PaymentSvcUnifyPayResult(%+v)", *p)
}

func (p *PaymentSvcUnifyPayResult) DeepEqual(ano *PaymentSvcUnifyPayResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *PaymentSvcUnifyPayResult) Field0DeepEqual(src *UnifyPayResp) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

type PaymentSvcQRPayArgs struct {
	Req *QRPayReq `thrift:"req,1" json:"req"`
}

func NewPaymentSvcQRPayArgs() *PaymentSvcQRPayArgs {
	return &PaymentSvcQRPayArgs{}
}

var PaymentSvcQRPayArgs_Req_DEFAULT *QRPayReq

func (p *PaymentSvcQRPayArgs) GetReq() (v *QRPayReq) {
	if !p.IsSetReq() {
		return PaymentSvcQRPayArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *PaymentSvcQRPayArgs) SetReq(val *QRPayReq) {
	p.Req = val
}

var fieldIDToName_PaymentSvcQRPayArgs = map[int16]string{
	1: "req",
}

func (p *PaymentSvcQRPayArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *PaymentSvcQRPayArgs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentSvcQRPayArgs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PaymentSvcQRPayArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewQRPayReq()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PaymentSvcQRPayArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("QRPay_args"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PaymentSvcQRPayArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Req.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PaymentSvcQRPayArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PaymentSvcQRPayArgs(%+v)", *p)
}

func (p *PaymentSvcQRPayArgs) DeepEqual(ano *PaymentSvcQRPayArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *PaymentSvcQRPayArgs) Field1DeepEqual(src *QRPayReq) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

type PaymentSvcQRPayResult struct {
	Success *QRPayResp `thrift:"success,0" json:"success,omitempty"`
}

func NewPaymentSvcQRPayResult() *PaymentSvcQRPayResult {
	return &PaymentSvcQRPayResult{}
}

var PaymentSvcQRPayResult_Success_DEFAULT *QRPayResp

func (p *PaymentSvcQRPayResult) GetSuccess() (v *QRPayResp) {
	if !p.IsSetSuccess() {
		return PaymentSvcQRPayResult_Success_DEFAULT
	}
	return p.Success
}
func (p *PaymentSvcQRPayResult) SetSuccess(x interface{}) {
	p.Success = x.(*QRPayResp)
}

var fieldIDToName_PaymentSvcQRPayResult = map[int16]string{
	0: "success",
}

func (p *PaymentSvcQRPayResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *PaymentSvcQRPayResult) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField0(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentSvcQRPayResult[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PaymentSvcQRPayResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewQRPayResp()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PaymentSvcQRPayResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("QRPay_result"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField0(oprot); err != nil {
			fieldId = 0
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PaymentSvcQRPayResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Success.Write(oprot); err != nil {
			return err
		}
		if err = oprot.WriteFieldEnd(); err != nil {
			goto WriteFieldEndError
		}
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}

func (p *PaymentSvcQRPayResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PaymentSvcQRPayResult(%+v)", *p)
}

func (p *PaymentSvcQRPayResult) DeepEqual(ano *PaymentSvcQRPayResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *PaymentSvcQRPayResult) Field0DeepEqual(src *QRPayResp) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

type PaymentSvcQueryOrderArgs struct {
	Req *QueryOrderReq `thrift:"req,1" json:"req"`
}

func NewPaymentSvcQueryOrderArgs() *PaymentSvcQueryOrderArgs {
	return &PaymentSvcQueryOrderArgs{}
}

var PaymentSvcQueryOrderArgs_Req_DEFAULT *QueryOrderReq

func (p *PaymentSvcQueryOrderArgs) GetReq() (v *QueryOrderReq) {
	if !p.IsSetReq() {
		return PaymentSvcQueryOrderArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *PaymentSvcQueryOrderArgs) SetReq(val *QueryOrderReq) {
	p.Req = val
}

var fieldIDToName_PaymentSvcQueryOrderArgs = map[int16]string{
	1: "req",
}

func (p *PaymentSvcQueryOrderArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *PaymentSvcQueryOrderArgs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentSvcQueryOrderArgs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PaymentSvcQueryOrderArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewQueryOrderReq()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PaymentSvcQueryOrderArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("QueryOrder_args"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PaymentSvcQueryOrderArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Req.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PaymentSvcQueryOrderArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PaymentSvcQueryOrderArgs(%+v)", *p)
}

func (p *PaymentSvcQueryOrderArgs) DeepEqual(ano *PaymentSvcQueryOrderArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *PaymentSvcQueryOrderArgs) Field1DeepEqual(src *QueryOrderReq) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

type PaymentSvcQueryOrderResult struct {
	Success *QueryOrderResp `thrift:"success,0" json:"success,omitempty"`
}

func NewPaymentSvcQueryOrderResult() *PaymentSvcQueryOrderResult {
	return &PaymentSvcQueryOrderResult{}
}

var PaymentSvcQueryOrderResult_Success_DEFAULT *QueryOrderResp

func (p *PaymentSvcQueryOrderResult) GetSuccess() (v *QueryOrderResp) {
	if !p.IsSetSuccess() {
		return PaymentSvcQueryOrderResult_Success_DEFAULT
	}
	return p.Success
}
func (p *PaymentSvcQueryOrderResult) SetSuccess(x interface{}) {
	p.Success = x.(*QueryOrderResp)
}

var fieldIDToName_PaymentSvcQueryOrderResult = map[int16]string{
	0: "success",
}

func (p *PaymentSvcQueryOrderResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *PaymentSvcQueryOrderResult) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField0(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentSvcQueryOrderResult[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PaymentSvcQueryOrderResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewQueryOrderResp()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PaymentSvcQueryOrderResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("QueryOrder_result"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField0(oprot); err != nil {
			fieldId = 0
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PaymentSvcQueryOrderResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Success.Write(oprot); err != nil {
			return err
		}
		if err = oprot.WriteFieldEnd(); err != nil {
			goto WriteFieldEndError
		}
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}

func (p *PaymentSvcQueryOrderResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PaymentSvcQueryOrderResult(%+v)", *p)
}

func (p *PaymentSvcQueryOrderResult) DeepEqual(ano *PaymentSvcQueryOrderResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *PaymentSvcQueryOrderResult) Field0DeepEqual(src *QueryOrderResp) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}

type PaymentSvcCloseOrderArgs struct {
	Req *CloseOrderReq `thrift:"req,1" json:"req"`
}

func NewPaymentSvcCloseOrderArgs() *PaymentSvcCloseOrderArgs {
	return &PaymentSvcCloseOrderArgs{}
}

var PaymentSvcCloseOrderArgs_Req_DEFAULT *CloseOrderReq

func (p *PaymentSvcCloseOrderArgs) GetReq() (v *CloseOrderReq) {
	if !p.IsSetReq() {
		return PaymentSvcCloseOrderArgs_Req_DEFAULT
	}
	return p.Req
}
func (p *PaymentSvcCloseOrderArgs) SetReq(val *CloseOrderReq) {
	p.Req = val
}

var fieldIDToName_PaymentSvcCloseOrderArgs = map[int16]string{
	1: "req",
}

func (p *PaymentSvcCloseOrderArgs) IsSetReq() bool {
	return p.Req != nil
}

func (p *PaymentSvcCloseOrderArgs) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 1:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField1(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentSvcCloseOrderArgs[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PaymentSvcCloseOrderArgs) ReadField1(iprot thrift.TProtocol) error {
	p.Req = NewCloseOrderReq()
	if err := p.Req.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PaymentSvcCloseOrderArgs) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CloseOrder_args"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField1(oprot); err != nil {
			fieldId = 1
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PaymentSvcCloseOrderArgs) writeField1(oprot thrift.TProtocol) (err error) {
	if err = oprot.WriteFieldBegin("req", thrift.STRUCT, 1); err != nil {
		goto WriteFieldBeginError
	}
	if err := p.Req.Write(oprot); err != nil {
		return err
	}
	if err = oprot.WriteFieldEnd(); err != nil {
		goto WriteFieldEndError
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 1 end error: ", p), err)
}

func (p *PaymentSvcCloseOrderArgs) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PaymentSvcCloseOrderArgs(%+v)", *p)
}

func (p *PaymentSvcCloseOrderArgs) DeepEqual(ano *PaymentSvcCloseOrderArgs) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field1DeepEqual(ano.Req) {
		return false
	}
	return true
}

func (p *PaymentSvcCloseOrderArgs) Field1DeepEqual(src *CloseOrderReq) bool {

	if !p.Req.DeepEqual(src) {
		return false
	}
	return true
}

type PaymentSvcCloseOrderResult struct {
	Success *CloseOrderResp `thrift:"success,0" json:"success,omitempty"`
}

func NewPaymentSvcCloseOrderResult() *PaymentSvcCloseOrderResult {
	return &PaymentSvcCloseOrderResult{}
}

var PaymentSvcCloseOrderResult_Success_DEFAULT *CloseOrderResp

func (p *PaymentSvcCloseOrderResult) GetSuccess() (v *CloseOrderResp) {
	if !p.IsSetSuccess() {
		return PaymentSvcCloseOrderResult_Success_DEFAULT
	}
	return p.Success
}
func (p *PaymentSvcCloseOrderResult) SetSuccess(x interface{}) {
	p.Success = x.(*CloseOrderResp)
}

var fieldIDToName_PaymentSvcCloseOrderResult = map[int16]string{
	0: "success",
}

func (p *PaymentSvcCloseOrderResult) IsSetSuccess() bool {
	return p.Success != nil
}

func (p *PaymentSvcCloseOrderResult) Read(iprot thrift.TProtocol) (err error) {

	var fieldTypeId thrift.TType
	var fieldId int16

	if _, err = iprot.ReadStructBegin(); err != nil {
		goto ReadStructBeginError
	}

	for {
		_, fieldTypeId, fieldId, err = iprot.ReadFieldBegin()
		if err != nil {
			goto ReadFieldBeginError
		}
		if fieldTypeId == thrift.STOP {
			break
		}

		switch fieldId {
		case 0:
			if fieldTypeId == thrift.STRUCT {
				if err = p.ReadField0(iprot); err != nil {
					goto ReadFieldError
				}
			} else {
				if err = iprot.Skip(fieldTypeId); err != nil {
					goto SkipFieldError
				}
			}
		default:
			if err = iprot.Skip(fieldTypeId); err != nil {
				goto SkipFieldError
			}
		}

		if err = iprot.ReadFieldEnd(); err != nil {
			goto ReadFieldEndError
		}
	}
	if err = iprot.ReadStructEnd(); err != nil {
		goto ReadStructEndError
	}

	return nil
ReadStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read struct begin error: ", p), err)
ReadFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d begin error: ", p, fieldId), err)
ReadFieldError:
	return thrift.PrependError(fmt.Sprintf("%T read field %d '%s' error: ", p, fieldId, fieldIDToName_PaymentSvcCloseOrderResult[fieldId]), err)
SkipFieldError:
	return thrift.PrependError(fmt.Sprintf("%T field %d skip type %d error: ", p, fieldId, fieldTypeId), err)

ReadFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T read field end error", p), err)
ReadStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T read struct end error: ", p), err)
}

func (p *PaymentSvcCloseOrderResult) ReadField0(iprot thrift.TProtocol) error {
	p.Success = NewCloseOrderResp()
	if err := p.Success.Read(iprot); err != nil {
		return err
	}
	return nil
}

func (p *PaymentSvcCloseOrderResult) Write(oprot thrift.TProtocol) (err error) {
	var fieldId int16
	if err = oprot.WriteStructBegin("CloseOrder_result"); err != nil {
		goto WriteStructBeginError
	}
	if p != nil {
		if err = p.writeField0(oprot); err != nil {
			fieldId = 0
			goto WriteFieldError
		}

	}
	if err = oprot.WriteFieldStop(); err != nil {
		goto WriteFieldStopError
	}
	if err = oprot.WriteStructEnd(); err != nil {
		goto WriteStructEndError
	}
	return nil
WriteStructBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write struct begin error: ", p), err)
WriteFieldError:
	return thrift.PrependError(fmt.Sprintf("%T write field %d error: ", p, fieldId), err)
WriteFieldStopError:
	return thrift.PrependError(fmt.Sprintf("%T write field stop error: ", p), err)
WriteStructEndError:
	return thrift.PrependError(fmt.Sprintf("%T write struct end error: ", p), err)
}

func (p *PaymentSvcCloseOrderResult) writeField0(oprot thrift.TProtocol) (err error) {
	if p.IsSetSuccess() {
		if err = oprot.WriteFieldBegin("success", thrift.STRUCT, 0); err != nil {
			goto WriteFieldBeginError
		}
		if err := p.Success.Write(oprot); err != nil {
			return err
		}
		if err = oprot.WriteFieldEnd(); err != nil {
			goto WriteFieldEndError
		}
	}
	return nil
WriteFieldBeginError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 begin error: ", p), err)
WriteFieldEndError:
	return thrift.PrependError(fmt.Sprintf("%T write field 0 end error: ", p), err)
}

func (p *PaymentSvcCloseOrderResult) String() string {
	if p == nil {
		return "<nil>"
	}
	return fmt.Sprintf("PaymentSvcCloseOrderResult(%+v)", *p)
}

func (p *PaymentSvcCloseOrderResult) DeepEqual(ano *PaymentSvcCloseOrderResult) bool {
	if p == ano {
		return true
	} else if p == nil || ano == nil {
		return false
	}
	if !p.Field0DeepEqual(ano.Success) {
		return false
	}
	return true
}

func (p *PaymentSvcCloseOrderResult) Field0DeepEqual(src *CloseOrderResp) bool {

	if !p.Success.DeepEqual(src) {
		return false
	}
	return true
}
