lemonphp/webhook-shield 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

lemonphp/webhook-shield

Composer 安装命令:

composer require lemonphp/webhook-shield

包简介

Protects against unverified webhooks from 3rd party services

README 文档

README

Latest Version Software License Build Status Coverage Status Total Downloads Requires PHP

Protects against unverified webhooks from 3rd party services.

Features

  • Compatible with PSR-7, PSR-15 and PSR-17
  • No dependencies
  • Supported drivers
    • Bitbucket
    • Facebook
    • Github
    • Gitlab
    • Mailgun
    • Shopify
    • Trello
  • Coding style follow PSR-2, PSR-4

Requirements

  • php >=7.1

Installation

Begin by pulling in the package through Composer.

$ composer require lemonphp/webhook-shield

Usage

Slim 4

  1. Installation Slim application follow link http://www.slimframework.com/docs/v4/start/installation.html

    $ composer require slim/slim slim/psr7 lemonphp/webhook-shield
  2. Make public/index.php with below content

    <?php
    use Lemon\WebhookShield\ServiceProfiles\Facebook;
    use Lemon\WebhookShield\WebhookShieldMiddleware;
    use Psr\Http\Message\ResponseInterface as Response;
    use Psr\Http\Message\ServerRequestInterface as Request;
    use Slim\Factory\AppFactory;
    
    require __DIR__ . '/../vendor/autoload.php';
    
    $app = AppFactory::create();
    
    $shield = new WebhookShieldMiddleware(new Facebook('secret'), $app->getResponseFactory());
    
    $app->post('/webhook/facebook', function (Request $req, Response $res, $args) {
         // TODO: Add webhook event to message queue
         return $res->withStatus(200, 'OK');
    })->add($shield);
    
    // other routes
    
    $app->run();

Changelog

See all change logs in CHANGELOG

Testing

$ git clone git@github.com/lemonphp/webhook-shield.git /path
$ cd /path
$ composer install
$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email to Oanh Nguyen instead of using the issue tracker.

Credits

License

This project is released under the MIT License.
Copyright © 2019 LemonPHP Team.

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-01-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固