using Newtonsoft.Json;
|
using System;
|
using System.Collections.Generic;
|
using System.ComponentModel.DataAnnotations;
|
|
namespace LifePayment.Domain.Shared
|
{
|
public class WxPayPostBaseModel
|
{
|
/// <summary>
|
/// 应用ID
|
/// </summary>
|
[JsonProperty("appid")]
|
[Required]
|
public string Appid { get; set; }
|
|
/// <summary>
|
/// 直连商户号
|
/// </summary>
|
[JsonProperty("mchid")]
|
[Required]
|
public string Mchid { get; set; }
|
}
|
|
public class CertificatesReponse
|
{
|
[JsonProperty("data")]
|
public List<CertificatesReponseDetail> Data { get; set; }
|
}
|
|
public class CertificatesReponseDetail
|
{
|
[JsonProperty("serial_no")]
|
public string SerialNo { get; set; }
|
|
[JsonProperty("effective_time")]
|
public string EffectiveTime { get; set; }
|
|
[JsonProperty("expire_time")]
|
public string ExpireTime { get; set; }
|
|
[JsonProperty("encrypt_certificate")]
|
public EncryptCertificate EncryptCertificate { get; set; }
|
}
|
|
public class EncryptCertificate
|
{
|
[JsonProperty("algorithm")]
|
public string Algorithm { get; set; }
|
|
[JsonProperty("nonce")]
|
public string Nonce { get; set; }
|
|
[JsonProperty("associated_data")]
|
public string AssociatedData { get; set; }
|
|
[JsonProperty("ciphertext")]
|
public string Ciphertext { get; set; }
|
}
|
|
public class WxPayGetBaseModel
|
{
|
/// <summary>
|
/// 直连商户号
|
/// </summary>
|
[JsonProperty("mchid")]
|
[Required]
|
[Query]
|
public string Mchid { get; set; }
|
}
|
|
public class PayTransactionsNativeInput : WxPayPostBaseModel
|
{
|
/// <summary>
|
/// 商品描述
|
/// </summary>
|
[JsonProperty("description")]
|
[Required]
|
public string Description { get; set; }
|
|
/// <summary>
|
/// 商户订单号
|
/// </summary>
|
[JsonProperty("out_trade_no")]
|
[Required]
|
public string OutTradeNo { get; set; }
|
|
/// <summary>
|
/// 交易结束时间
|
/// </summary>
|
[JsonProperty("time_expire", NullValueHandling = NullValueHandling.Ignore)]
|
public string TimeExpire { get; set; }
|
|
/// <summary>
|
/// 附加数据
|
/// </summary>
|
[JsonProperty("attach", NullValueHandling = NullValueHandling.Ignore)]
|
public string Attach { get; set; }
|
|
/// <summary>
|
/// 通知地址
|
/// </summary>
|
[JsonProperty("notify_url")]
|
[Required]
|
public string NotifyUrl { get; set; }
|
|
/// <summary>
|
/// 订单优惠标记
|
/// </summary>
|
[JsonProperty("goods_tag", NullValueHandling = NullValueHandling.Ignore)]
|
public string GoodsTag { get; set; }
|
|
/// <summary>
|
/// 订单金额
|
/// </summary>
|
[JsonProperty("amount")]
|
[Required]
|
public PayAmount Amount { get; set; }
|
}
|
|
public class PayTransactionsNativeH5 : WxPayPostBaseModel
|
{
|
/// <summary>
|
/// 商品描述
|
/// </summary>
|
[JsonProperty("description")]
|
[Required]
|
public string Description { get; set; }
|
|
/// <summary>
|
/// 商户订单号
|
/// </summary>
|
[JsonProperty("out_trade_no")]
|
[Required]
|
public string OutTradeNo { get; set; }
|
|
/// <summary>
|
/// 交易结束时间
|
/// </summary>
|
[JsonProperty("time_expire", NullValueHandling = NullValueHandling.Ignore)]
|
public string TimeExpire { get; set; }
|
|
/// <summary>
|
/// 附加数据
|
/// </summary>
|
[JsonProperty("attach", NullValueHandling = NullValueHandling.Ignore)]
|
public string Attach { get; set; }
|
|
/// <summary>
|
/// 通知地址
|
/// </summary>
|
[JsonProperty("notify_url")]
|
[Required]
|
public string NotifyUrl { get; set; }
|
|
/// <summary>
|
/// 订单优惠标记
|
/// </summary>
|
[JsonProperty("goods_tag", NullValueHandling = NullValueHandling.Ignore)]
|
public string GoodsTag { get; set; }
|
|
/// <summary>
|
/// 订单金额
|
/// </summary>
|
[JsonProperty("amount")]
|
[Required]
|
public PayAmount Amount { get; set; }
|
|
[JsonProperty("scene_info")]
|
public H5SceneInfo SceneInfo { get; set; }
|
}
|
|
public class PayAmount
|
{
|
/// <summary>
|
/// 订单总金额,单位为分。
|
/// </summary>
|
[JsonProperty("total")]
|
[Required]
|
public int Total { get; set; }
|
|
/// <summary>
|
/// 货币类型 CNY:人民币,境内商户号仅支持人民币。
|
/// </summary>
|
[JsonProperty("currency")]
|
public string Currency { get; set; } = "CNY";
|
}
|
|
public class H5SceneInfo
|
{
|
/// <summary>
|
/// 用户终端IP
|
/// </summary>
|
[JsonProperty("payer_client_ip")]
|
public string PayerClientIp { get; set; }
|
|
[JsonProperty("h5_info")]
|
public H5Info H5Info { get; set; }
|
}
|
|
public class H5Info
|
{
|
/// <summary>
|
/// 场景类型
|
/// </summary>
|
[JsonProperty("type")]
|
public string Type { get; set; }
|
}
|
|
public class PayTransactionsNativeReponse
|
{
|
/// <summary>
|
/// 二维码链接
|
/// </summary>
|
[JsonProperty("code_url")]
|
public string CodeUrl { get; set; }
|
|
/// <summary>
|
/// 错误码
|
/// </summary>
|
[JsonProperty("code")]
|
public string Code { get; set; }
|
|
/// <summary>
|
/// 说明信息
|
/// </summary>
|
[JsonProperty("message")]
|
public string Message { get; set; }
|
}
|
|
public class PayTransactionsH5Reponse
|
{
|
/// <summary>
|
/// 二维码链接
|
/// </summary>
|
[JsonProperty("h5_url")]
|
public string H5Url { get; set; }
|
|
/// <summary>
|
/// 错误码
|
/// </summary>
|
[JsonProperty("code")]
|
public string Code { get; set; }
|
|
/// <summary>
|
/// 说明信息
|
/// </summary>
|
[JsonProperty("message")]
|
public string Message { get; set; }
|
}
|
|
public class PayTransactionsInput : WxPayGetBaseModel
|
{
|
/// <summary>
|
/// 商户订单号
|
/// </summary>
|
[JsonProperty("out-trade-no")]
|
[Required]
|
[Path]
|
public string OutTradeNo { get; set; }
|
}
|
|
public class PayTransactionsReponse
|
{
|
/// <summary>
|
/// 应用ID
|
/// </summary>
|
[JsonProperty("appid")]
|
public string Appid { get; set; }
|
|
/// <summary>
|
/// 直连商户号
|
/// </summary>
|
[JsonProperty("mchid")]
|
public string Mchid { get; set; }
|
|
/// <summary>
|
/// 商户订单号
|
/// </summary>
|
[JsonProperty("out_trade_no")]
|
public string OutTradeNo { get; set; }
|
|
/// <summary>
|
/// 微信支付订单号
|
/// </summary>
|
[JsonProperty("transaction_id")]
|
public string TransactionId { get; set; }
|
|
/// <summary>
|
/// 交易类型
|
/// </summary>
|
[JsonProperty("trade_type")]
|
public string TradeType { get; set; }
|
|
/// <summary>
|
/// 交易状态
|
/// </summary>
|
[JsonProperty("trade_state")]
|
public string TradeState { get; set; }
|
|
/// <summary>
|
/// 交易状态描述
|
/// </summary>
|
[JsonProperty("trade_state_desc")]
|
public string TradeStateDesc { get; set; }
|
|
/// <summary>
|
/// 付款银行
|
/// </summary>
|
[JsonProperty("bank_type")]
|
public string BankType { get; set; }
|
|
/// <summary>
|
/// 附加数据
|
/// </summary>
|
[JsonProperty("attach")]
|
public string Attach { get; set; }
|
|
/// <summary>
|
/// 支付完成时间
|
/// </summary>
|
[JsonProperty("success_time")]
|
public string SuccessTime { get; set; }
|
|
/// <summary>
|
/// 支付者
|
/// </summary>
|
[JsonProperty("payer")]
|
public Payer Payer { get; set; }
|
|
/// <summary>
|
/// 订单金额
|
/// </summary>
|
[JsonProperty("amount")]
|
public Amount Amount { get; set; }
|
|
/// <summary>
|
/// 场景信息
|
/// </summary>
|
[JsonProperty("scene_info")]
|
public SceneInfo SceneInfo { get; set; }
|
|
/// <summary>
|
/// 优惠功能
|
/// </summary>
|
[JsonProperty("promotion_detail")]
|
public List<PromotionDetail> PromotionDetail { get; set; }
|
}
|
public class Payer
|
{
|
/// <summary>
|
/// 用户标识
|
/// </summary>
|
[JsonProperty("openid")]
|
[Required]
|
public string Openid { get; set; }
|
}
|
|
public class Amount
|
{
|
/// <summary>
|
/// 总金额
|
/// </summary>
|
[JsonProperty("total", NullValueHandling = NullValueHandling.Ignore)]
|
[Required]
|
public int Total { get; set; }
|
|
/// <summary>
|
/// 用户支付金额
|
/// </summary>
|
[JsonProperty("payer_total", NullValueHandling = NullValueHandling.Ignore)]
|
[Required]
|
public int PayerTotal { get; set; }
|
|
/// <summary>
|
/// 货币类型
|
/// </summary>
|
[JsonProperty("currency", NullValueHandling = NullValueHandling.Ignore)]
|
[Required]
|
public string Currency { get; set; }
|
|
/// <summary>
|
/// 用户支付币种
|
/// </summary>
|
[JsonProperty("payer_currency", NullValueHandling = NullValueHandling.Ignore)]
|
[Required]
|
public string PayerCurrency { get; set; }
|
}
|
|
public class SceneInfo
|
{
|
/// <summary>
|
/// 商户端设备号
|
/// </summary>
|
[JsonProperty("device_id", NullValueHandling = NullValueHandling.Ignore)]
|
[Required]
|
public string DeviceId { get; set; }
|
}
|
|
public class PromotionDetail
|
{
|
/// <summary>
|
/// 券ID
|
/// </summary>
|
[JsonProperty("coupon_id")]
|
public string CouponId { get; set; }
|
|
/// <summary>
|
/// 优惠名称
|
/// </summary>
|
[JsonProperty("name")]
|
public string Name { get; set; }
|
|
/// <summary>
|
/// 优惠范围
|
/// </summary>
|
[JsonProperty("scope")]
|
public string Scope { get; set; }
|
|
/// <summary>
|
/// 优惠类型
|
/// </summary>
|
[JsonProperty("type")]
|
public string Type { get; set; }
|
|
/// <summary>
|
/// 优惠券面额
|
/// </summary>
|
[JsonProperty("amount")]
|
public int Amount { get; set; }
|
|
/// <summary>
|
/// 活动ID
|
/// </summary>
|
[JsonProperty("stock_id")]
|
public string StockId { get; set; }
|
|
/// <summary>
|
/// 微信出资
|
/// </summary>
|
[JsonProperty("wechatpay_contribute")]
|
public int WechatpayContribute { get; set; }
|
|
/// <summary>
|
/// 商户出资
|
/// </summary>
|
[JsonProperty("merchant_contribute")]
|
public int MerchantContribute { get; set; }
|
|
/// <summary>
|
/// 其他出资
|
/// </summary>
|
[JsonProperty("other_contribute")]
|
public int OtherContribute { get; set; }
|
|
/// <summary>
|
/// 优惠币种
|
/// </summary>
|
[JsonProperty("currency")]
|
public string Currency { get; set; }
|
|
/// <summary>
|
/// 单品列表
|
/// </summary>
|
[JsonProperty("goods_detail")]
|
public GoodsDetail GoodsDetail { get; set; }
|
}
|
|
public class GoodsDetail
|
{
|
/// <summary>
|
/// 商品编码
|
/// </summary>
|
[JsonProperty("goods_id")]
|
public string GoodsId { get; set; }
|
|
/// <summary>
|
/// 商品数量
|
/// </summary>
|
[JsonProperty("quantity")]
|
public int Quantity { get; set; }
|
|
/// <summary>
|
/// 商品单价
|
/// </summary>
|
[JsonProperty("unit_price")]
|
public int UnitPrice { get; set; }
|
|
/// <summary>
|
/// 商品优惠金额
|
/// </summary>
|
[JsonProperty("discount_amount")]
|
public int DiscountAmount { get; set; }
|
|
/// <summary>
|
/// 商品备注
|
/// </summary>
|
[JsonProperty("goods_remark")]
|
public string GoodsRemark { get; set; }
|
}
|
|
public class QueryAttribute : Attribute
|
{
|
}
|
|
public class PathAttribute : Attribute
|
{
|
}
|
|
public class ModelPaymentMiniPay
|
{
|
public string NonceStr { get; set; }
|
public string Package { get; set; }
|
public string SignType { get; set; }
|
public string PaySign { get; set; }
|
public string Timestamp { get; set; }
|
|
/// <summary>
|
/// 订单失效时间
|
/// </summary>
|
public string TimeExpire { get; set; }
|
/// <summary>
|
/// 错误信息
|
/// </summary>
|
public string Message { get; set; }
|
}
|
|
/// <summary>
|
/// 小程序支付请求
|
/// </summary>
|
public class ModelMiniPayRequest : WxPayPostBaseModel
|
{
|
|
|
[JsonProperty("out_trade_no")]
|
public string OutTradeNo { get; set; }
|
|
|
|
[JsonProperty("description")]
|
public string Description { get; set; }
|
|
[JsonProperty("notify_url")]
|
public string NotifyUrl { get; set; }
|
|
[JsonProperty("attach")]
|
public string Attach { get; set; }
|
|
[JsonProperty("time_expire")]
|
public string TimeExpire { get; set; }
|
|
[JsonProperty("amount")]
|
public Model_MiniPay_Amount Amount { get; set; }
|
|
[JsonProperty("payer")]
|
public Model_MiniPay_Payer Payer { get; set; }
|
}
|
|
/// <summary>
|
/// 订单金额信息
|
/// </summary>
|
public class Model_MiniPay_Amount
|
{
|
[JsonProperty("total")]
|
public int Total { get; set; }
|
|
[JsonProperty("currency")]
|
public string Currency { get; set; }
|
}
|
/// <summary>
|
/// 支付者信息
|
/// </summary>
|
public class Model_MiniPay_Payer
|
{
|
[JsonProperty("openid")]
|
public string OpenId { get; set; }
|
}
|
|
public class ModelPayPrePayId
|
{
|
[JsonProperty("prepay_id")]
|
public string PrepayId { get; set; }
|
|
[JsonProperty("code")]
|
public string Code { get; set; }
|
|
[JsonProperty("message")]
|
public string Message { get; set; }
|
}
|
|
public class LifePayJsAPIRequest
|
{
|
public string OpenId { get; set; }
|
|
public string Attach { get; set; }
|
}
|
}
|