如何将webhook与paypal返回请求集成

时间:2018-05-04 11:27:02

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

您好我开发了一个项目,并且我已经实施了Paypal结账以获得付款。 当用户成功付款时,paypal返回我的网站,查询字符串作为成功的交易ID传递,然后在我将该交易ID存储到我的数据库后,表明付款已成功完成。

用户支付付款但在交易ID中的前几天不会落入数据库,因为该应用程序显示其未付款。

我搜索了这个,发现我们需要实现web-hook来解决这个问题。 任何人都可以建议如何在我的代码中实现web-hook。

我的paypal代码如下

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的问题吗?

我也知道我会对此产生负面影响。

1 个答案:

答案 0 :(得分:0)

相关问题