【问题标题】:Paypal integration with paypal webservice in asp.net site [closed]贝宝与 asp.net 网站中的贝宝网络服务集成 [关闭]
【发布时间】:2012-05-21 20:44:01
【问题描述】:

我现在从不使用任何支付网关....但现在我需要为我的购物车集成贝宝。用户可以从那里购买多个数据并从贝宝网站为多个项目付款。我正在寻找如何将贝宝整合到我的网站中。我认为贝宝必须有用于支付集成的网络服务。我搜索谷歌提交多个购物车项目数据到贝宝。我得到了代码,但这不是很好的解决方案

String url;
url= “https://www.paypal.com/us/cgi-bin/webscr?” ;
url+= “cmd=_xclick”;
url+= “&business=vikvish@yahoo.co.in”;
url+= “&item_name=Sample_testing”;
url+= “&amount=10.50″;
url+= “&quantity=2″;
url+= “&return=http://www.google.com”;
url += “&cancel_return=http://www.rediffmail.com”;
url+= “&currency_code=USD”;
Response.Redirect(url);

这样我不想将多个购物车数据发送到贝宝网站。

这里是另一种方式。

protected void btnPayPal_Click(object sender, ImageClickEventArgs e)

{

System.Web.HttpContext.Current.Response.Clear();

System.Web.HttpContext.Current.Response.Write("<html><head>");

System.Web.HttpContext.Current.Response.Write(

"</head><body onload='document.form1.submit()'>");

System.Web.HttpContext.Current.Response.Write(

"<form action='https://www.paypal.com/cgi-bin/webscr' " +

"name='form1' method='post'>");

System.Web.HttpContext.Current.Response.Write(

"<input type='hidden' name='cmd' value='_xclick'>");

System.Web.HttpContext.Current.Response.Write(

"<input type='hidden' name='business' " +

"value='bob@domain.com'>");

System.Web.HttpContext.Current.Response.Write(

"<input type='hidden' name='lc' value='US'>");

System.Web.HttpContext.Current.Response.Write(

"<input type='hidden' name='item_name' value='Widget'>");

System.Web.HttpContext.Current.Response.Write(

"<input type='hidden' name='amount' value='100.00'>");

System.Web.HttpContext.Current.Response.Write(

"<input type='hidden' name='currency_code' value='USD'>

System.Web.HttpContext.Current.Response.Write(

"<input type='hidden' name='bn' " +

"value='PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest'>

System.Web.HttpContext.Current.Response.Write(

"<input type='image' " +

"src='https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif' " +

"border='0' name='submit' alt=''>");

System.Web.HttpContext.Current.Response.Write(

"<img alt='' border='0' " +

"src='https://www.paypal.com/en_US/i/scr/pixel.gif' " +

"width='1' height='1'>");

System.Web.HttpContext.Current.Response.Write("</form>");

System.Web.HttpContext.Current.Response.Write("</body></html>");

System.Web.HttpContext.Current.Response.End();

}

通过这种方式,我们将购物车商品数据从后面的代码发送到贝宝网站。

我需要通过 paypal 网络服务将我的多个购物车项目发布到 paypal。 所以请从头开始详细告诉我所有步骤。我需要做什么。 我需要在贝宝端创建买家和卖家两个帐户吗?如何获取贝宝网络服务网址。我需要将我的多个贝宝购物车商品数据发送到贝宝的示例贝宝网络服务代码。如何测试一切正常。什么是贝宝沙盒网址。我需要向沙盒网址提供有效的信用卡号吗?如果是,那么在从沙盒 url 进行测试后,钱将如何再次返还。请详细讨论所有要点并在所有阶段逐步指导我使用示例代码,例如从创建帐户到使用网络服务将多个购物车数据发送到贝宝网站。谢谢

【问题讨论】:

    标签: c# asp.net paypal paypal-sandbox


    【解决方案1】:

    PayPal 为他们的所有产品在不同平台上定义明确且公开可用的SDKs

    阅读他们的文档并遵循他们记录的 API 说明,而不是试图拼凑一个“解决方法”,这对您很有帮助 - 是的,您可以轻松地做到这一点(为 HTML 表单创建解决方法),但您可能会错过安全 - 例如在您上面的代码中,任何人都可以检查和篡改您的所有 FORM POST 值。

    【讨论】:

    • 你说“在你上面的代码中,任何人都可以检查和篡改你所有的 FORM POST 值。”那么如何确保安全。
    猜你喜欢
    • 2011-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-13
    • 2020-07-18
    • 1970-01-01
    • 1970-01-01
    • 2011-07-12
    相关资源
    最近更新 更多