Pay.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Security.Cryptography;
using System.Configuration;
namespace Help
{
public class Pay
{
#region 财付通接口
/// <summary>
/// 财付通接口
/// </summary>
/// <param name="proName">商品名</param>
/// <param name="orderID">订单号</param>
/// <param name="total">货品总价格</param>
/// <param name="Seller">卖家财付通号</param>
/// <param name="TransportType">物流方式</param>
/// <param name="TransportPrice">物流费用</param>
/// <returns></returns>
public static string getTenpayUrl(string proName,string orderID,string total,string Seller,string TransportType,string TransportPrice)
{
//接收传给财付通网关的商户订单的参数
Md5Pay md5pay = new Md5Pay();
//utf-8编码
md5pay.Encode_type = 1;
//卖家商户号
md5pay.Seller = Seller;
//商品名称
proName = proName.Replace("<", "").Replace(">", "").Replace("%", "").Replace("&", "").Replace("\"", "").Replace("''", "").Replace("=", "").Replace("?", "")
.Replace("+","").Replace("#","");
md5pay.Mch_name = bSubstring(proName, 32);
//商品价格(分为单位)
md5pay.Mch_price = int.Parse(Math.Round(decimal.Parse(total) * 100).ToString());
&nb |