谁做过paypal支付。

sh_suyuelin 2010-12-15 06:14:49
谁做过paypal支付平台。他返回值的页面谁有文档提供参考下。非常感谢
...全文
170 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
PayPal_Cathy 2011-04-14
  • 打赏
  • 举报
回复
PayPal注册、认证、激活、提现、收款、PayPal集成等问题可以直接联系paypal顾问

电话:010-65308735

工作QQ:543688668

Email/MSN:lizhao@paypal.com
sh_suyuelin 2010-12-29
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 crackpot2007 的回复:]
谁做过paypal支付平台。他返回值的页面谁有文档提供参考下。非常感谢

---------------------------------------------------------------

paypal支付成功后,它是通过访问你的站点的某个URL来告诉你支付成功的。
而这个URL是你在POST到paypal时,预先存值到控件的value里的。
控件name是:notify……
[/Quote]

这个我懂。就和支付宝一样。返回地址有2个。
crackpot2007 2010-12-29
  • 打赏
  • 举报
回复
谁做过paypal支付平台。他返回值的页面谁有文档提供参考下。非常感谢

---------------------------------------------------------------

paypal支付成功后,它是通过访问你的站点的某个URL来告诉你支付成功的。
而这个URL是你在POST到paypal时,预先存值到控件的value里的。
控件name是:notify_url
如:<input type="hidden" name="notify_url" value="http://你的域名/access.aspx" />

记住:支付成功后,paypal会访问上面这个控件的value(即你提供的URL),所以你的网站必须挂在公网上,paypal才能访问到这个URL,如果是本地测试的localhost。。那么,你的测试永远是无效的,因为paypal无法访问到你的网页。
xuu27 2010-12-29
  • 打赏
  • 举报
回复
/// <summary>
/// 验证ipn返回
/// </summary>
/// <returns></returns>
private string VerifyIPN()
{
string strFormValues = Request.Form.ToString();
string strNewValue;
string strResponse;

string strSandbox =Definited.StoreGateway_paypal_sandbox_Url_gateway;
string strLive = Definited.StoreGateway_paypal_Url_gateway;

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(strLive);

req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
strNewValue = strFormValues + "&cmd=_notify-validate";
req.ContentLength = strNewValue.Length;

StreamWriter stOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.UTF8);
stOut.Write(strNewValue);
stOut.Close();

StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream());

strResponse = stIn.ReadToEnd();
stIn.Close();

//return strResponse == "VERIFIED";

return strResponse;
}



protected void Page_Load(object sender, EventArgs e)
{
string strResponse = VerifyIPN();

if (strResponse == "VERIFIED")//验证成功
{
//check the payment_status is Completed
//check that txn_id has not been previously processed
//check that receiver_email is your Primary PayPal email
//check that payment_amount/payment_currency are correct
//process payment
//string ppTx = Request.Form["txn_id"].ToString();
//string ppStatus = Request.Form["payment_status"].ToString();
//string ppDate = Request.Form["payment_date"].ToString();
//string ppItem = Request.Form["item_name"].ToString();
//string ppPrice = Request.Form["mc_gross"].ToString();

//做日志
try
{
string sellerEmail = Request.Form["business"].ToString();
string payment_status = Request.Form["payment_status"].ToString();
//string ppDate = Request.Form["payment_date"].ToString();
//string ppItem = Request.Form["item_name"].ToString();
string item_name = Request.Form["item_name"].ToString();
string verify_sign = Request.Form["verify_sign"].ToString();

string sLog = "sellerEmail=" + sellerEmail
+ "&" + "payment_status=" + payment_status
//+ "&" + "ppDate=" + ppDate
//+ "&" + "ppItem=" + ppItem
+ "&" + "item_name=" + item_name
+ "&" + "verify_sign=" + verify_sign
;

LogHelper.LogOnlinePayException("paypalPay", LogHelper.CutLogMessage("paypal-ipn-001 ok:" + sLog));

if (payment_status.ToLower() == "completed")
{
string sPayOrderNumber = item_name;
bool bPayState = true;//支付状态
string strtrade_no = "";//支付网关交易号
if (Request.QueryString["trade_no"] != null)//支付网关有传交易号
{
strtrade_no = Request.Form["trade_no"];//交易单号
}

//获得处理结果
int iProcessPayReturnResult = orderService.ProcessPayReturn(sPayOrderNumber, strtrade_no, bPayState);

//this.Response.Write("sPayOrderNumber:" + sPayOrderNumber + "<br>");
//this.Response.Write("iProcessPayReturnResult:" + iProcessPayReturnResult + "<br>");
//return;

if (iProcessPayReturnResult != Convert.ToInt32(DataBaseOperateState.AddFailure)){
//RedirectToSucess(sPayOrderNumber); //成功

LogHelper.LogOnlinePayException("paypalPay", LogHelper.CutLogMessage("paypal-ipn-001 ok:" + sPayOrderNumber + "成功支付!"));

}
else{
// RedirectToFaile(sPayOrderNumber);//失败
LogHelper.LogOnlinePayException("paypalPay", LogHelper.CutLogMessage("paypal-ipn-001 ok:" + sPayOrderNumber + "失败支付!"));
}
}
else
{
LogHelper.LogOnlinePayException("paypalPay", LogHelper.CutLogMessage("paypal-ipn-001 rec ok,but payment_status!=completed,the follow is log:" + sLog));
}

}
catch(Exception ex)
{
LogHelper.LogOnlinePayException("paypalPay", LogHelper.CutLogMessage("paypal-ipn-002 error:" + ex.ToString()));
}
}
else if (strResponse == "INVALID")
{
//log for manual investigation
LogHelper.LogOnlinePayException("paypalPay", LogHelper.CutLogMessage("paypal-ipn-003 INVALID"));
}
else
{
//log response/ipn data for manual investigation
LogHelper.LogOnlinePayException("paypalPay", LogHelper.CutLogMessage("paypal-ipn-004 error else"));
}
}

gongsun 2010-12-29
  • 打赏
  • 举报
回复
paypal有自己的沙盒,你申请做个测试。
sh_suyuelin 2010-12-29
  • 打赏
  • 举报
回复
英文不好。看不懂。即时到帐的参数发送和接收代码 。有吗?

支付宝的已经弄好了。就差这个paypal了。
宝_爸 2010-12-15
  • 打赏
  • 举报
回复
不知道你用paypal的哪个产品。
下面的页面中有各个产品的文档链接

Technical Documentation

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧