Hishop.Plugins/PaymentRequest.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
namespace Hishop.Plugins
{
using System;
using System.Globalization;
using System.Web;
using System.Xml;
public abstract class PaymentRequest : ConfigablePlugin, IPlugin
{
private const string FormFormat = "<form id=\"payform\" name=\"payform\" action=\"{0}\" method=\"POST\">{1}</form>";
private const string InputFormat = "<input type=\"hidden\" id=\"{0}\" name=\"{0}\" value=\"{1}\">";
protected PaymentRequest()
{
}
protected virtual string CreateField(string name, string strValue)
{
return string.Format(CultureInfo.InvariantCulture, "<input type=\"hidden\" id=\"{0}\" name=\"{0}\" value=\"{1}\">", new object[] { name, strValue });
}
protected virtual string CreateForm(string content, string action)
{
content = content + "<input type=\"submit\" value=\"在线支付\" style=\"display:none;\">";
return string.Format(CultureInfo.InvariantCulture, "<form id=\"payform\" name=\"payform\" action=\"{0}\" method=\"POST\">{1}</form>", new object[] { action, content });
}
public static PaymentRequest CreateInstance(string name)
{
if (string.IsNullOrEmpty(name))
{
return null;
}
Type plugin = PaymentPlugins.Instance().GetPlugin("PaymentRequest", name);
if (plugin == null)
{
return null;
}
return (Activator.CreateInstance(plugin) as PaymentRequest);
}
public static PaymentRequest CreateInstance(string name, string configXml, string orderId, decimal amount, string subject, string body, string buyerEmail, DateTime date, string showUrl, string returnUrl, string notifyUrl, string attach)
{
if (string.IsNullOrEmpty(name))
{
return null;
}
object[] args = new object[] { orderId, amount, subject, body, buyerEmail, date, showUrl, returnUrl, notifyUrl, attach };
Type plugin = PaymentPlugins.Instance().GetPlugin("PaymentRequest", name);
if (plugin == null)
{
return null;
}
PaymentRequest request = Activator.CreateInstance(plugin, args) as PaymentRequest;
if (!((request == null) || string.IsNullOrEmpty(configXml)))
{
XmlDocument document = new XmlDocument();
document.LoadXml(configXml);
request.InitConfig(document.FirstChild);
}
后面还有 21 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
