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("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("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; } } public class WxPayTradeBillApplyRequest { /// <summary> /// 微信支付订å•å· /// </summary> [JsonProperty("out_bill_no")] public string OutBillNo { get; set; } } public class WxPayTradeBillApplyReponse { /// <summary> /// 微信支付订å•å· /// </summary> [JsonProperty("transfer_bill_no")] public string TransferBillNo { get; set; } } public class WxPayTradeBillQueryRequest { /// <summary> /// 微信支付订å•å· /// </summary> [JsonProperty("transfer_bill_no")] public string TransferBillNo { get; set; } } public class WxPayTradeBillQueryReponse { [JsonProperty("download_url")] public string DownloadUrl { get; set; } } }