[英]paypal webhook notification not received
I'm trying to get notified via webhooks when a simple payment is made, however I don't receive any request from paypal on the specified URL. 我正在尝试通过简单的付款方式来通过webhooks接收通知,但是我没有收到来自贝宝的指定URL的任何请求。 Here is what I've done:
这是我所做的:
I have 2 sandbox accounts: Facilitator and Buyer Create an app (sanbox mode) for the facilitator account Add a webhook URL in that app Login into sanbox.paypal.com with the sandbox facilitator username and password Generate a buy now button with a test product Paste the button code on my page and make a purchase with the sanbox Buyer account In developer dashboard the payment is received if I go to Sandbox -> Notifications: "Notification of Payment Received from test buyer", but the webhook page on my server is not called. 我有2个沙箱帐户:主持人和买方为主持人帐户创建一个应用程序(sanbox模式)在该应用程序中添加Webhook URL使用沙箱主持人用户名和密码登录sanbox.paypal.com生成带有测试产品的“立即购买”按钮将按钮代码粘贴到我的页面上,并使用sanbox买方帐户进行购买在开发人员仪表板中,如果我转到“沙箱”->“通知:“从测试买方收到了付款通知”,则已收到付款,但服务器上的webhook页是不叫。 I know this because the php script creates a txt file every time the page is called.
我知道这一点,因为每次页面被调用时php脚本都会创建一个txt文件。 Also if I go to Developer Account -> Webhook Notifications and select the app I have this message: You don't have any events for the selected application
另外,如果我转到开发者帐户-> Webhook通知并选择该应用程序,我也会收到此消息:所选应用程序没有任何事件
NOTE: If I add the URL in the webhook simulator everything works great. 注意:如果我在webhook模拟器中添加URL,则一切正常。
Am I doing something wrong? 难道我做错了什么? Do I have to connect the app with the buy now button?
我必须使用“立即购买”按钮连接该应用程序吗?
Thanks 谢谢
I am using API REST. 我正在使用API REST。
The way Webhooks simulator works for an event is different from the actual Webhooks delivery. Webhooks模拟器用于事件的工作方式与实际的Webhooks交付方式不同。
For a Webhooks simulator, you don't need to create/configure a webhook. 对于Webhooks模拟器,您无需创建/配置Webhook。 Only thing you require is an endpoint URL where the simulator can post the corresponding sample payload for an event selected by you.
您只需要一个端点URL,模拟器就可以在其中为您选择的事件发布相应的示例有效负载。
To use the simulator, follow these steps: 要使用模拟器,请按照下列步骤操作:
From your description, looks like you are doing everything required for Webhooks Simulator and getting the notification via that. 根据您的描述,您似乎正在完成Webhooks Simulator所需的所有工作,并由此获得通知。
To use Webhooks in the Sandbox or Live environment, do the following: 要在沙盒或实时环境中使用Webhooks,请执行以下操作:
Probably you are missing Step 4 above. 可能您缺少上面的步骤4。 You need to subscribe to event type for which you want to get notifications.
您需要订阅要为其接收通知的事件类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.