zhengyuxuan
2025-03-19 82831a86d529817e51f5b6e3cec636d21cef3c9b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
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; }
 
    }
 
 
}