我有一个问题,为Paypal通知网络挂钩编写PHP侦听器脚本。我只是需要一个脚本来倾听和请求贝宝的json数据。多亏了大量的在线文档,我已经成功地为Stripe创建了一个。这就是我所拥有的:
<?php require_once('./lib/Stripe.php');
Stripe::setApiKey("my_secret_stripe_key");
$input = @file_get_contents("php://input");
$event_json = json_decode($input);
// then I request the json data from a Stripe event... //
$event_json->type == 'charge.succeeded'
// etc... //
?>
我只是需要一些类似的东西来处理贝宝事件json。
发布于 2015-06-11 14:24:40
PayPal刚刚发布了一个新版本,webhook SDK1.4.0;它有一个PayPal钩子监听器。
https://github.com/paypal/PayPal-PHP-SDK/releases/tag/v1.4.0
该文件为ValidateWebhookEvent.php
它在样本中。
PayPal-PHP-SDK/paypal/rest-api-sdk-php/sample/notifications/ValidateWebhookEvent.php
文档在这里
https://github.com/paypal/PayPal-PHP-SDK/wiki/Webhook-Validation
发布于 2016-08-09 23:48:14
我使用了这个tutorial on http://code.tutsplus.com/,它非常有用。您可能还想看看the webhook validation。
https://stackoverflow.com/questions/29700437
复制相似问题