嗨,我开发了一个项目,并在其中实施了 Paypal 结帐以进行付款。当用户成功付款时,paypal 返回我的网站,查询字符串作为成功交易 ID 传递,然后在我将该交易 ID 存储到我的数据库后,这表明付款已成功完成。
在用户付款前几天,但在交易 id 中没有出现在数据库中,因为该应用程序显示其未付款。
我搜索了这个,发现我们需要实现 web-hook 来解决这个问题。任何人都可以建议如何在我的代码中实现网络钩子。
我的贝宝代码如下
Response.Write("<form action='" + ConfigurationManager.AppSettings["PayPalURL"].ToString() + "' method='post' name='buyCredits' id='buyCredits'>");
Response.Write("<input type='hidden' name='cmd' value='_xclick'>");
Response.Write("<input type='hidden' name='business' value='" + ConfigurationManager.AppSettings["BusinessURL"].ToString() + "'>");
Response.Write("<input type='hidden' name='currency_code' value='USD'>");
Response.Write("<input type='hidden' name='custom' value='"+lblorderno.Text+"'>");
Response.Write("<input type='hidden' name='item_name' value='" + ItemName + "'>");
Response.Write("<input type='hidden' name='item_number' value='" + Items + "'>");
Response.Write("<input type='hidden' name='amount' id='amount' value='" + Convert.ToString(Math.Round(price,2)) + "'>");
Response.Write("<input type='hidden' name='return' value='" + ConfigurationManager.AppSettings["SuccessURL"].ToString() + Convert.ToString(lblorderno.Text) + "'>");
Response.Write("<input type='hidden' name='cancel_return' value='" + ConfigurationManager.AppSettings["CancelURL"].ToString() + Convert.ToString(lblorderno.Text) + "'>");
Response.Write("</form>");
我从不使用 webhook,所以任何人都可以打电话帮助我了解如何在 paypal 中集成 webhook?
我也知道我会在这方面得到负面评价。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句