using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LifePayment.Domain.Shared;
///
/// 公共请求参数基类
///
public class ACOOLYRequestBaseInput
{
///
/// 请求号(16-40位)无需传入,系统自动生成
///
[JsonProperty("requestNo")]
public string RequestNo { get; set; }
///
/// 商户ID(定长20字符)无需传入,读取配置
///
[JsonProperty("partnerId")]
public string PartnerId { get; set; }
///
/// 服务名称(最大32字符) 无需传入
///
[JsonProperty("service")]
public string Service { get; set; }
///
/// 服务版本(最大8字符)无需传入
///
[JsonProperty("version")]
public string Version { get; set; } = "1.0";
///
/// 协议类型(默认HTTP/JSON)无需传入
///
[JsonProperty("protocol")]
public string Protocol { get; set; } = "HTTP/JSON";
///
/// 会话参数(JSON格式)
///
[StringLength(128, ErrorMessage = "会话参数最大128字符")]
[JsonProperty("context")]
public string Context { get; set; }
///
/// 扩展参数(JSON单层结构)
///
[StringLength(1024, ErrorMessage = "扩展参数最大1024字符")]
[JsonProperty("ext")]
public string Ext { get; set; }
///
/// 页面跳转地址
///
[StringLength(128, ErrorMessage = "跳转地址最大128字符")]
[Url(ErrorMessage = "非法的URL格式")]
[JsonProperty("returnUrl")]
public string ReturnUrl { get; set; }
///
/// 异步通知地址
///
[StringLength(128, ErrorMessage = "通知地址最大128字符")]
[Url(ErrorMessage = "非法的URL格式")]
[JsonProperty("notifyUrl")]
public string NotifyUrl { get; set; }
}
///
/// 获取燃气面值请求参数
///
public class GasParValueRequestInput : ACOOLYRequestBaseInput
{
///
/// 天然气公司类型
///
[JsonProperty("gasOrgType")]
public string GasOrgType { get; set; }
}
///
/// 提交燃气订单请求参数
///
public class ConfirmGasOrderRequestInput : ACOOLYRequestBaseInput
{
///
/// 外部商户订单号
///
[Required(ErrorMessage = "外部商户订单号不能为空")]
[JsonProperty("outOrderNo")]
public string OutOrderNo { get; set; }
///
/// 充值面额
///
[Required(ErrorMessage = "充值面额不能为空")]
[Range(0.01, double.MaxValue, ErrorMessage = "充值面额必须大于0")]
[JsonProperty("parValue")]
public decimal ParValue { get; set; }
///
/// 天然气公司类型
///
[Required(ErrorMessage = "天然气公司类型不能为空")]
[JsonProperty("gasOrgType")]
public string GasOrgType { get; set; }
///
/// 天然气号
///
[Required(ErrorMessage = "天然气号不能为空")]
[JsonProperty("gasAccount")]
public string GasAccount { get; set; }
///
/// 地区
///
[JsonProperty("areaName")]
public string AreaName { get; set; }
}
///
/// 提交电费订单请求参数
///
public class ConfirmElectricOrderRequestInput : ACOOLYRequestBaseInput
{
///
/// 充值面额,单位为元。
///
[Required(ErrorMessage = "充值面额是必填项。")]
[JsonProperty("parValue")]
public decimal ParValue { get; set; }
///
/// 电网类型,例如:"guowang"代表国家电网,"nanwang"代表南方电网。
///
[Required(ErrorMessage = "电网类型是必填项。")]
[JsonProperty("electricType")]
public string ElectricType { get; set; }
///
/// 电费类型,国网必传:住宅、企事业、店铺三个选项。
///
[Required(ErrorMessage = "电费类型是必填项。")]
[StringLength(20, ErrorMessage = "电费类型长度不能超过20个字符。")]
[JsonProperty("electricAccountType")]
public string ElectricAccountType { get; set; }
///
/// 电费户号。
///
[Required(ErrorMessage = "电费户号是必填项。")]
[StringLength(50, ErrorMessage = "电费户号长度不能超过50个字符。")]
[JsonProperty("electricAccount")]
public string ElectricAccount { get; set; }
///
/// 省份。
///
[Required(ErrorMessage = "省份是必填项。")]
[StringLength(20, ErrorMessage = "省份长度不能超过20个字符。")]
[JsonProperty("province")]
public string Province { get; set; }
///
/// 城市。
///
[Required(ErrorMessage = "城市是必填项。")]
[StringLength(20, ErrorMessage = "城市长度不能超过20个字符。")]
[JsonProperty("city")]
public string City { get; set; }
///
/// 客户身份证后6位,南网必传。
///
[JsonProperty("sixID")]
public string SixID { get; set; }
///
/// 订单号
///
[JsonProperty("outOrderNo")]
public string OutOrderNo { get; set; }
}
///
/// 提交电话费订单请求参数
///
public class ConfirmPhoneOrderRequestInput : ACOOLYRequestBaseInput
{
///
/// 运营商编码,例如:"yidong", "dianxin", "liantong"。
///
[Required(ErrorMessage = "运营商编码是必填项。")]
[JsonProperty("ispCode")]
public string IspCode { get; set; }
///
/// 充值面额,单位为元。测试账户:parValue=100:缴费成功,parValue>100:缴费失败。
///
[Required(ErrorMessage = "充值面额是必填项。")]
[JsonProperty("parValue")]
public decimal ParValue { get; set; }
///
/// 手机号。
///
[Required(ErrorMessage = "手机号是必填项。")]
[JsonProperty("phone")]
public string Phone { get; set; }
///
/// 外部订单号
///
[Required(ErrorMessage = "订单号是必填项。")]
[JsonProperty("outOrderNo")]
public string OutOrderNo { get; set; }
///
/// 机主名称(电信手机号必填)
///
[JsonProperty("name")]
public string Name { get; set; }
}
public class SetLifePayOrderPayTypeInput
{
[Required(ErrorMessage = "订单号不可为空")]
public string OrderNo { get; set; }
[EnumValidation(typeof(LifePayTypeEnum), ErrorMessage = "支付方式异常")]
public LifePayTypeEnum LifePayType { get; set; }
public string H5Type { get; set; }
///
/// 支付OpenId
///
public string OpenId { get; set; }
///
/// 商户数据包
///
public string Attach { get; set; }
}
public class GetPayOrderForJsAPIInput
{
[Required(ErrorMessage = "订单号不可为空")]
public string OrderNo { get; set; }
[EnumValidation(typeof(LifePayTypeEnum), ErrorMessage = "支付方式异常")]
public LifePayTypeEnum LifePayType { get; set; }
///
/// 支付OpenId
///
public string OpenId { get; set; }
///
/// 商户数据包
///
public string Attach { get; set; }
}