AlipayConstants.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. using System;
  2. using System.Text;
  3. namespace Alipay.EasySDK.Kernel
  4. {
  5. /// <summary>
  6. /// 支付宝开放平台网关交互常用常量
  7. /// </summary>
  8. public static class AlipayConstants
  9. {
  10. /// <summary>
  11. /// Config配置参数Key值
  12. /// </summary>
  13. public const string PROTOCOL_CONFIG_KEY = "protocol";
  14. public const string HOST_CONFIG_KEY = "gatewayHost";
  15. public const string ALIPAY_CERT_PATH_CONFIG_KEY = "alipayCertPath";
  16. public const string MERCHANT_CERT_PATH_CONFIG_KEY = "merchantCertPath";
  17. public const string ALIPAY_ROOT_CERT_PATH_CONFIG_KEY = "alipayRootCertPath";
  18. public const string SIGN_TYPE_CONFIG_KEY = "signType";
  19. public const string NOTIFY_URL_CONFIG_KEY = "notifyUrl";
  20. /// <summary>
  21. /// 与网关HTTP交互中涉及到的字段值
  22. /// </summary>
  23. public const string BIZ_CONTENT_FIELD = "biz_content";
  24. public const string ALIPAY_CERT_SN_FIELD = "alipay_cert_sn";
  25. public const string SIGN_FIELD = "sign";
  26. public const string SIGN_TYPE_FIELD = "sign_type";
  27. public const string BODY_FIELD = "http_body";
  28. public const string NOTIFY_URL_FIELD = "notify_url";
  29. public const string METHOD_FIELD = "method";
  30. public const string RESPONSE_SUFFIX = "_response";
  31. public const string ERROR_RESPONSE = "error_response";
  32. /// <summary>
  33. /// 默认字符集编码,EasySDK统一固定使用UTF-8编码,无需用户感知编码,用户面对的总是String而不是bytes
  34. /// </summary>
  35. public readonly static Encoding DEFAULT_CHARSET = Encoding.UTF8;
  36. /// <summary>
  37. /// 默认的签名算法,EasySDK统一固定使用RSA2签名算法(即SHA_256_WITH_RSA),但此参数依然需要用户指定以便用户感知,因为在开放平台接口签名配置界面中需要选择同样的算法
  38. /// </summary>
  39. public const string RSA2 = "RSA2";
  40. /// <summary>
  41. /// RSA2对应的真实签名算法名称
  42. /// </summary>
  43. public const string SHA_256_WITH_RSA = "SHA256WithRSA";
  44. /// <summary>
  45. /// RSA2对应的真实非对称加密算法名称
  46. /// </summary>
  47. public const string RSA = "RSA";
  48. /// <summary>
  49. /// 申请生成的重定向网页的请求类型,GET表示生成URL
  50. /// </summary>
  51. public const string GET = "GET";
  52. /// <summary>
  53. /// 申请生成的重定向网页的请求类型,POST表示生成form表单
  54. /// </summary>
  55. public const string POST = "POST";
  56. }
  57. }