BaseRequest.cs 594 B

123456789101112131415161718192021
  1. using PaySharp.Core.Request;
  2. using PaySharp.Core.Response;
  3. namespace PaySharp.Alipay.Request
  4. {
  5. public class BaseRequest<TModel, TResponse> : Request<TModel, TResponse> where TResponse : IResponse
  6. {
  7. public BaseRequest(string method)
  8. {
  9. RequestUrl = "/gateway.do?charset=UTF-8";
  10. GatewayData.Add("method", method);
  11. }
  12. public override void AddGatewayData(TModel model)
  13. {
  14. base.AddGatewayData(model);
  15. GatewayData.Add("biz_content", PaySharp.Core.Utils.Util.SerializeObject(model));
  16. }
  17. }
  18. }