paypal webhook notification not received

南楼画角 提交于 2019-12-11 11:44:04

问题


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. 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. I know this because the php script creates a txt file every time the page is called. 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

NOTE: If I add the URL in the webhook simulator everything works great.

Am I doing something wrong? Do I have to connect the app with the buy now button?

Thanks

I am using API REST.


回答1:


The way Webhooks simulator works for an event is different from the actual Webhooks delivery.

For a Webhooks simulator, you don't need to create/configure a webhook. Only thing you require is an endpoint URL where the simulator can post the corresponding sample payload for an event selected by you.

To use the simulator, follow these steps:

  1. Go to the Webhooks simulator page. developer.paypal.com/developer/webhooksSimulator
  2. Log in if you haven't already done so.
  3. Enter a Webhooks URL.
  4. Select an event type from the drop-down list.
  5. Click the Send Test button.

From your description, looks like you are doing everything required for Webhooks Simulator and getting the notification via that.

To use Webhooks in the Sandbox or Live environment, do the following:

  1. Go to the My REST apps page.
  2. Create an application if you haven't done so already.
  3. Add a webhook URL (the maximum number of webhooks you can register is 10 per application).
  4. Subscribe to the event types of interest.

Probably you are missing Step 4 above. You need to subscribe to event type for which you want to get notifications.



来源:https://stackoverflow.com/questions/34712498/paypal-webhook-notification-not-received

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!