AlipayConstants.php 1.9 KB

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