PayPal API 购物车和 Webhooks?

PayPal API shopping cart and Webhooks?

我使用 PayPal 按钮代码生成器创建了 2 个按钮。

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="business" value="sb-3ghgk675036@business.example.com">
    <input type="hidden" name="lc" value="US">
    <input type="hidden" name="item_name" value="TestName">
    <input type="hidden" name="item_number" value="TestID">
    <input type="hidden" name="amount" value="50.00">
    <input type="hidden" name="currency_code" value="USD">
    <input type="hidden" name="button_subtype" value="products">
    <input type="hidden" name="no_note" value="0">
    <input type="hidden" name="tax_rate" value="0.000">
    <input type="hidden" name="shipping" value="0.00">
    <input type="hidden" name="add" value="1">
    <input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHostedGuest">
    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit"
        alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_cart">
    <input type="hidden" name="business" value="ZAH44BSSBQT6G">
    <input type="hidden" name="display" value="1">
    <input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_viewcart_LG.gif" border="0" name="submit"
        alt="PayPal - The safer, easier way to pay online!">
    <img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

我需要知道是否可以通过应用程序 client_id 而不是(我的公司电子邮件或 merchant_id),以便我可以使用这些按钮在我的服务器上触发 Webhooks? 如果不可能,有什么方法可以将贝宝购物车与 REST API webhooks 一起使用?

你为什么要使用那个超旧、丑陋的 web 1.0 购物车?这是一个遗留的东西,只是为了与旧网站向后兼容而存在。您应该实现自己的 JS 购物车并改用智能支付按钮:https://developer.paypal.com/demo/checkout/#/pattern/client

无论如何,如果您坚持使用旧的 web 1.0 集成并希望将其与 webhook 结合使用,请尝试订阅所有可能的付款 capture/completion webhook 事件(v1 和 v2)并查看您收到的内容.如果您什么都没有收到,您​​将需要使用旧的即时付款通知 (IPN) 服务,而不是 webhooks。