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; }
|
}
|
|
/// <summary>
|
/// 申请退款
|
/// </summary>
|
public class WxPayDomesticRefundsRequest
|
{
|
/// <summary>
|
/// 微信支付订单号 和out_trade_no必须二选一进行传参
|
/// </summary>
|
[JsonProperty("transaction_id")]
|
public string TransactionId { get; set; }
|
|
/// <summary>
|
/// 商户订单号 和out_trade_no必须二选一进行传参
|
/// </summary>
|
[JsonProperty("out_trade_no")]
|
public string OutTradeNo { get; set; }
|
|
/// <summary>
|
/// 商户退款单号 必填
|
/// </summary>
|
[JsonProperty("out_refund_no")]
|
public string OutRefundNo { get; set; }
|
|
/// <summary>
|
/// 退款原因
|
/// </summary>
|
[JsonProperty("reason")]
|
public string Reason { get; set; }
|
|
/// <summary>
|
/// 退款结果回调url
|
/// </summary>
|
[JsonProperty("notify_url")]
|
public string NotifyUrl { get; set; }
|
|
/// <summary>
|
/// 退款资金来源
|
/// </summary>
|
[JsonProperty("funds_account")]
|
public string FundsAccount { get; set; }
|
|
/// <summary>
|
/// 金额信息 必填
|
/// </summary>
|
[JsonProperty("amount")]
|
public Model_WxPayDomesticRefunds_Amount Amount { get; set; }
|
}
|
public class Model_WxPayDomesticRefunds_Amount
|
{
|
/// <summary>
|
/// 退款金额,单位为分,只能为整数
|
/// </summary>
|
[JsonProperty("refund")]
|
public int Refund { get; set; }
|
|
/// <summary>
|
/// 原订单金额
|
/// </summary>
|
[JsonProperty("total")]
|
public int Total { get; set; }
|
|
/// <summary>
|
/// 退款币种
|
/// </summary>
|
[JsonProperty("currency")]
|
public string Currency { get; set; } = "CNY";
|
}
|
|
public class WxPayDomesticRefundsReponse
|
{
|
/// <summary>
|
/// 微信支付退款单号
|
/// </summary>
|
[JsonProperty("refund_id")]
|
public string RefundId { get; set; }
|
|
/// <summary>
|
/// 商户退款单号
|
/// </summary>
|
[JsonProperty("out_refund_no")]
|
public string OutRefundNo { get; set; }
|
|
/// <summary>
|
/// 微信支付订单号
|
/// </summary>
|
[JsonProperty("transaction_id")]
|
public string TransactionId { get; set; }
|
|
/// <summary>
|
/// 商户订单号
|
/// </summary>
|
[JsonProperty("out_trade_no")]
|
public string OutTradeNo { get; set; }
|
|
/// <summary>
|
/// 退款渠道 ORIGINAL: 原路退款 BALANCE: 退回到余额 OTHER_BALANCE: 原账户异常退到其他余额账户 OTHER_BANKCARD: 原银行卡异常退到其他银行卡(发起异常退款成功后返回)
|
/// </summary>
|
[JsonProperty("channel")]
|
public string Channel { get; set; }
|
|
/// <summary>
|
/// 退款入账账户
|
/// </summary>
|
[JsonProperty("user_received_account")]
|
public string UserReceivedAccount { get; set; }
|
|
/// <summary>
|
/// 退款成功时间
|
/// </summary>
|
[JsonProperty("success_time")]
|
public string SuccessTime { get; set; }
|
|
/// <summary>
|
/// 退款创建时间
|
/// </summary>
|
[JsonProperty("create_time")]
|
public string CreateTime { get; set; }
|
|
/// <summary>
|
/// 退款状态
|
/// </summary>
|
[JsonProperty("status")]
|
public string Status { get; set; }
|
|
/// <summary>
|
/// 资金账户
|
/// </summary>
|
[JsonProperty("funds_account")]
|
public string FundsAccount { get; set; }
|
|
/// <summary>
|
/// 金额信息
|
/// </summary>
|
[JsonProperty("amount")]
|
public Model_WxPayRetuenDomesticRefunds_Amount Amount { get; set; }
|
|
}
|
|
public class Model_WxPayRetuenDomesticRefunds_Amount: Model_WxPayDomesticRefunds_Amount
|
{
|
/// <summary>
|
/// 用户实际支付金额
|
/// </summary>
|
[JsonProperty("payer_total")]
|
public int PayerTotal { get; set; }
|
|
/// <summary>
|
/// 用户退款金额
|
/// </summary>
|
[JsonProperty("payer_refund")]
|
public int PayerRefund { get; set; }
|
|
/// <summary>
|
/// 应结退款金额
|
/// </summary>
|
[JsonProperty("settlement_refund")]
|
public int SettlementRefund { get; set; }
|
|
/// <summary>
|
/// 应结订单金额
|
/// </summary>
|
[JsonProperty("settlement_total")]
|
public int SettlementTotal { get; set; }
|
|
/// <summary>
|
/// 优惠退款金额
|
/// </summary>
|
[JsonProperty("discount_refund")]
|
public int DiscountRefund { get; set; }
|
|
/// <summary>
|
/// 手续费退款金额
|
/// </summary>
|
[JsonProperty("refund_fee")]
|
public int RefundFee { get; set; }
|
|
}
|
|
|
}
|