DTcms.API/DTcms.API.Payment.chinabankpc/Service.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Text;

namespace DTcms.API.Payment.chinabankpc
{
	public class Service
	{
		private string _partner = string.Empty;

		private string _key = string.Empty;

		private string _input_charset = string.Empty;

		private string _return_url = string.Empty;

		private string _notify_url = string.Empty;

		private string _gateway = "https://pay3.chinabank.com.cn/PayGate?";

		public Service()
		{
			Config xmlConfig = new Config();
			this._partner = xmlConfig.Partner.Trim();
			this._key = xmlConfig.Key.Trim();
			this._input_charset = xmlConfig.Input_charset.Trim().ToLower();
			this._return_url = xmlConfig.Return_url.Trim();
			this._notify_url = xmlConfig.Notify_url.Trim();
		}

		public string BuildFormHtml(System.Collections.Generic.SortedDictionary<string, string> dicPara, string strMethod, string strButtonValue)
		{
			System.Text.StringBuilder sbHtml = new System.Text.StringBuilder();
			sbHtml.Append(string.Concat(new string[]
			{
				"<form id='chinabanksubmit' name='chinabanksubmit' action='",
				this._gateway,
				"encoding=",
				this._input_charset,
				"' method='",
				strMethod.ToLower().Trim(),
				"'>"
			}));
			foreach (System.Collections.Generic.KeyValuePair<string, string> temp in dicPara)
			{
				sbHtml.Append(string.Concat(new string[]
				{
					"<input type='hidden' name='",
					temp.Key,
					"' value='",
					temp.Value,
					"'/>"
				}));
			}
			sbHtml.Append("<input type='submit' value='" + strButtonValue + "' style='display:none;'></form>");
			sbHtml.Append("<script>document.forms['chinabanksubmit'].submit();</script>");
			return sbHtml.ToString();
		}
	}
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。