axel/subscription-webhooks
最新稳定版本:v0.1.5-alpha
Composer 安装命令:
composer require axel/subscription-webhooks
包简介
Handling Appstore and Android subscription webhooks/notifications
关键字:
README 文档
README
Installation
You can install this package via composer
composer require axel/subscription-webhooks
The service provider will register itself. Publish the config and migration files with:
php artisan vendor:publish
This is the config that will be published.
return [ 'jobs' => [ 'apple'=>[ // 'initial_buy' => \App\Jobs\AppstoreNotifications\HandleInitialBuy::class, ], 'android'=>[ // 'initial_buy' => \App\Jobs\AppstoreNotifications\HandleInitialBuy::class, ] ], ];
You should run migrate next to create the subscription_notifications table:
php artisan migrate
This packages registers a POST routes for Appstore and Android notifications to the WebhooksController of this package
Usage
When there is an change in one of the subscriptions Apple will send a POST request to a configured endpoint.
This package will send a 200 response if you configured the right Job for the right Notification Type otherwise it will send a 500 back to Apple. Apple will retry a couple of times more. The incoming payload is stored in the apple_notifications table.
Handling incoming notifications via Jobs
You should extend AnyJobFile from BaseJob
<?php namespace App\Jobs\AppstoreNotifications; use Axel\SubscriptionWebhooks\Jobs\BaseJob; class AnyJobFile extends BaseJob { public function handle() { // Do something that matches your business logic with $this->payload } }
Security
If you discover any security related issues, please email satybaldiev@gmail.com
Credits
A big thanks to App Vise laravel-appstore-notifications which was a huge inspiration and starting point for this package. Even README file was copied from them
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 308
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-01