paypal支付成功返回值是什么?
支付成功后如何接收返回参数,然后根据返回参数判断是否支付成功并更新数据库!!!最好有asp.net使用paypal支付的源码!...
支付成功后如何接收返回参数,然后根据返回参数判断是否支付成功并更新数据库!!!最好有asp.net使用paypal支付的源码!
展开
2个回答
2013-04-17
展开全部
//生成Md5摘要;
string sign = Common.GetMD5(prestr.ToString(), charset);
//构造支付Url;
char[] delimiterChars = { '=' };
StringBuilder parameter = new StringBuilder();
parameter.Append(GETWAY);
for (i = 0; i < Sortedstr.Length; i++)
{
parameter.Append(Sortedstr[i].Split(delimiterChars)[0] + "=" + HttpUtility.UrlEncode(Sortedstr[i].Split(delimiterChars)[1]) + "&");
}
parameter.Append("sign=" + sign + "&sign_type=" + SIGNTYPE);
//返回支付Url;
return parameter.ToString();
}
/// <summary>
/// 创建支付地址
/// </summary>
/// <param name="gateway">支付网关</param>
/// <param name="service">服务参数</param>
/// <param name="partner">合作商</param>
/// <param name="out_trade_no">外部交易号</param>
/// <param name="subject">商品名称</param>
/// <param name="body">商品描述</param>
/// <param name="payment_type">支付类型</param>
/// <param name="total_fee">单价</param>
/// <param name="show_url">展示地址</param>
/// <param name="seller_email">卖家账号</param>
/// <param name="key">安全校验码</param>
/// <param name="return_url">重定向地址</param>
/// <param name="charset">编码类型</param>
/// <param name="notify_url">通知地址</param>
/// <param name="logistics_type">POST</param>
/// <param name="logistics_fee">平邮价格</param>
/// <param name="logistics_payment">BUYER_PAY</param>
/// <param name="logistics_type_1">EXPRESS</param>
/// <param name="logistics_fee_1">快递价格</param>
/// <param name="logistics_payment_1">BUYER_PAY</param>
/// <param name="quantity">数量</param>
/// <param name="receive_name">收货人姓名</param>
/// <param name="receive_address">收货人地址</param>
/// <param name="receive_zip">收货人邮编</param>
/// <param name="receive_phone">收货人电话</param>
/// <returns></returns>
public string CreatTradeUrl(
string partner,
string out_trade_no,
string subject,
string body,
string payment_type,
string total_fee,
string show_url,
string seller_email,
string key,
string return_url,
string charset,
string notify_url,
string logistics_type,
string logistics_fee,
string logistics_payment,
string logistics_type_1,
string logistics_fee_1,
string logistics_payment_1,
string quantity,
string receive_name,
string receive_address,
string receive_zip,
string receive_phone
)
{
int i;
//构造数组;
string[] Oristr ={
"service="+SERVICE,
"partner=" + partner,
"subject=" + subject,
"body=" + body,
"out_trade_no=" + out_trade_no,
"price=" + total_fee,
"show_url=" + show_url,
"payment_type=" + payment_type,
"seller_email=" + seller_email,
"notify_url=" + notify_url,
"_input_charset=" + charset,
"return_url=" + return_url,
"quantity=" + quantity,
"logistics_type=" + logistics_type,
"logistics_fee=" + logistics_fee ,
"logistics_payment=" + logistics_payment,
"logistics_type_1=" + logistics_type_1,
"logistics_fee_1=" + logistics_fee_1,
"logistics_payment_1=" + logistics_payment_1,
"receive_address=" + receive_address,
"receive_name=" + receive_name,
"receive_phone=" + receive_phone,
"receive_zip=" + receive_zip
};
//进行排序;
string[] Sortedstr = Common.BubbleSort(Oristr);
//构造待md5摘要字符串;
StringBuilder prestr = new StringBuilder();
for (i = 0; i < Sortedstr.Length; i++)
{
if (i == Sortedstr.Length - 1)
{
prestr.Append(Sortedstr[i]);
}
else
{
prestr.Append(Sortedstr[i] + "&");
}
}
prestr.Append(key);
//生成Md5摘要;
string sign = Common.GetMD5(prestr.ToString(), charset);
//构造支付Url;
char[] delimiterChars = { '=' };
StringBuilder parameter = new StringBuilder();
parameter.Append(GETWAY);
for (i = 0; i < Sortedstr.Length; i++)
{
parameter.Append(Sortedstr[i].Split(delimiterChars)[0] + "=" + HttpUtility.UrlEncode(Sortedstr[i].Split(delimiterChars)[1]) + "&");
}
parameter.Append("sign=" + sign + "&sign_type=" + SIGNTYPE);
//返回支付Url;
return parameter.ToString();
}
}
string sign = Common.GetMD5(prestr.ToString(), charset);
//构造支付Url;
char[] delimiterChars = { '=' };
StringBuilder parameter = new StringBuilder();
parameter.Append(GETWAY);
for (i = 0; i < Sortedstr.Length; i++)
{
parameter.Append(Sortedstr[i].Split(delimiterChars)[0] + "=" + HttpUtility.UrlEncode(Sortedstr[i].Split(delimiterChars)[1]) + "&");
}
parameter.Append("sign=" + sign + "&sign_type=" + SIGNTYPE);
//返回支付Url;
return parameter.ToString();
}
/// <summary>
/// 创建支付地址
/// </summary>
/// <param name="gateway">支付网关</param>
/// <param name="service">服务参数</param>
/// <param name="partner">合作商</param>
/// <param name="out_trade_no">外部交易号</param>
/// <param name="subject">商品名称</param>
/// <param name="body">商品描述</param>
/// <param name="payment_type">支付类型</param>
/// <param name="total_fee">单价</param>
/// <param name="show_url">展示地址</param>
/// <param name="seller_email">卖家账号</param>
/// <param name="key">安全校验码</param>
/// <param name="return_url">重定向地址</param>
/// <param name="charset">编码类型</param>
/// <param name="notify_url">通知地址</param>
/// <param name="logistics_type">POST</param>
/// <param name="logistics_fee">平邮价格</param>
/// <param name="logistics_payment">BUYER_PAY</param>
/// <param name="logistics_type_1">EXPRESS</param>
/// <param name="logistics_fee_1">快递价格</param>
/// <param name="logistics_payment_1">BUYER_PAY</param>
/// <param name="quantity">数量</param>
/// <param name="receive_name">收货人姓名</param>
/// <param name="receive_address">收货人地址</param>
/// <param name="receive_zip">收货人邮编</param>
/// <param name="receive_phone">收货人电话</param>
/// <returns></returns>
public string CreatTradeUrl(
string partner,
string out_trade_no,
string subject,
string body,
string payment_type,
string total_fee,
string show_url,
string seller_email,
string key,
string return_url,
string charset,
string notify_url,
string logistics_type,
string logistics_fee,
string logistics_payment,
string logistics_type_1,
string logistics_fee_1,
string logistics_payment_1,
string quantity,
string receive_name,
string receive_address,
string receive_zip,
string receive_phone
)
{
int i;
//构造数组;
string[] Oristr ={
"service="+SERVICE,
"partner=" + partner,
"subject=" + subject,
"body=" + body,
"out_trade_no=" + out_trade_no,
"price=" + total_fee,
"show_url=" + show_url,
"payment_type=" + payment_type,
"seller_email=" + seller_email,
"notify_url=" + notify_url,
"_input_charset=" + charset,
"return_url=" + return_url,
"quantity=" + quantity,
"logistics_type=" + logistics_type,
"logistics_fee=" + logistics_fee ,
"logistics_payment=" + logistics_payment,
"logistics_type_1=" + logistics_type_1,
"logistics_fee_1=" + logistics_fee_1,
"logistics_payment_1=" + logistics_payment_1,
"receive_address=" + receive_address,
"receive_name=" + receive_name,
"receive_phone=" + receive_phone,
"receive_zip=" + receive_zip
};
//进行排序;
string[] Sortedstr = Common.BubbleSort(Oristr);
//构造待md5摘要字符串;
StringBuilder prestr = new StringBuilder();
for (i = 0; i < Sortedstr.Length; i++)
{
if (i == Sortedstr.Length - 1)
{
prestr.Append(Sortedstr[i]);
}
else
{
prestr.Append(Sortedstr[i] + "&");
}
}
prestr.Append(key);
//生成Md5摘要;
string sign = Common.GetMD5(prestr.ToString(), charset);
//构造支付Url;
char[] delimiterChars = { '=' };
StringBuilder parameter = new StringBuilder();
parameter.Append(GETWAY);
for (i = 0; i < Sortedstr.Length; i++)
{
parameter.Append(Sortedstr[i].Split(delimiterChars)[0] + "=" + HttpUtility.UrlEncode(Sortedstr[i].Split(delimiterChars)[1]) + "&");
}
parameter.Append("sign=" + sign + "&sign_type=" + SIGNTYPE);
//返回支付Url;
return parameter.ToString();
}
}
2013-04-17
展开全部
网上有支付宝接口文档的!里面有很详细的例子!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询