namespace com.hitrust.trustpay.client.b2c { using com.hitrust.trustpay.client; using System; public class VoidRefundRequest : TrxRequest { private string iOrderNo; private double iTrxAmount; public VoidRefundRequest() : base("B2C") { this.iOrderNo = ""; this.iTrxAmount = 0.0; } protected internal override void checkRequest() { if (this.iOrderNo.Length == 0) { throw new TrxException("1100", "商户提交的交易资料不完整", "未设定订单号!"); } if (SupportClass.ToSByteArray(SupportClass.ToByteArray(this.iOrderNo)).Length > 50) { throw new TrxException("1101", "商户提交的交易资料不合法", "订单号不合法!"); } if (this.iTrxAmount <= 0.0) { throw new TrxException("1101", "商户提交的交易资料不合法", "交易金额不合法!"); } if (!DataVerifier.isValidAmount(this.iTrxAmount, 2)) { throw new TrxException("1101", "商户提交的交易资料不合法", "交易金额不合法!"); } } protected internal override TrxResponse constructResponse(XMLDocument aResponseMessage) { return new TrxResponse(aResponseMessage); } public virtual string OrderNo { get { return this.iOrderNo; } set { this.iOrderNo = value.Trim(); } } protected internal override XMLDocument RequestMessage { get { return new XMLDocument(string.Concat(new object[] { "VoidRefund", this.iOrderNo, "", this.iTrxAmount, "" })); } } public virtual double TrxAmount { get { return this.iTrxAmount; } set { this.iTrxAmount = value; } } } }