BaseProcessor.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using Gateway.Payment.Shared;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel.DataAnnotations;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Wechat.PayAPI;
  8. namespace PaymentGateway.GatewayApp
  9. {
  10. public interface IPaymentProcessor
  11. {
  12. Task<GenericProcessResponse> Process(PaymentOrder order);
  13. Task<GenericProcessResponse> Cancel(PaymentOrder order);
  14. Task<GenericProcessResponse> Query(PaymentOrder order);
  15. Task<GenericProcessResponse> Query(PaymentOrder order, int count = 1, int interval = 2000);
  16. Task<GenericProcessResponse> Return(PaymentOrder order);
  17. Task<GenericProcessResponse> UnifiedOrder(PaymentOrder order);
  18. }
  19. //public enum TradeStatus
  20. //{
  21. // SUCCESS,
  22. // PAYERROR,
  23. // CANCELLING,
  24. // CLOSED,
  25. //}
  26. public enum ClientSideReturnCode
  27. {
  28. OK = 0,
  29. SITE_ID_NOT_AUTHORIZED = 1,
  30. PAY_FACTOR_NOT_SET = 2,
  31. CHANNEL_INVALID = 3,
  32. MISS_PARAM = 4,
  33. PARAM_INVALID = 5,
  34. CERT_FILE_ERROR = 6,
  35. CHANNEL_ERROR = 7,
  36. TRADE_CLOSED = 8,
  37. PAY_ERROR = 9,
  38. RUN_TIME_ERROR = 14,
  39. CODE_NOT_FOUND = 15,
  40. }
  41. public class GenericProcessResponse
  42. {
  43. //public AopResponse AopResponse { get; set; }
  44. public WxPayData WeChatResponse { get; set; }
  45. public Dictionary<string, string> AllInPayResponse { get; set; }
  46. public TongLianResponseV2 AllInPayResponseV2 { get; set; }
  47. }
  48. }