PHPackages                             axel/subscription-webhooks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. axel/subscription-webhooks

ActiveLibrary[API Development](/categories/api)

axel/subscription-webhooks
==========================

Handling Appstore and Android subscription webhooks/notifications

v0.2.0(4w ago)13141MITPHPPHP ^8.0

Since Feb 19Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/satybaldiev/subscription-webhooks)[ Packagist](https://packagist.org/packages/axel/subscription-webhooks)[ RSS](/packages/axel-subscription-webhooks/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (5)Versions (12)Used By (0)

Handle Appstore and Android server notifications
================================================

[](#handle-appstore-and-android-server-notifications)

Installation
------------

[](#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
-----

[](#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

[](#handling-incoming-notifications-via-jobs)

You should extend AnyJobFile from BaseJob

```
