PHPackages                             chfur/appgallery-iap - 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. [Payment Processing](/categories/payments)
4. /
5. chfur/appgallery-iap

ActiveLibrary[Payment Processing](/categories/payments)

chfur/appgallery-iap
====================

PHP AppGallery In-App Purchase implementation

v1.2.0(4y ago)52821MITPHPPHP &gt;=7.1

Since Jan 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/CHfur/appgallery-iap)[ Packagist](https://packagist.org/packages/chfur/appgallery-iap)[ Docs](https://github.com/CHfur/appgallery-iap)[ RSS](/packages/chfur-appgallery-iap/feed)WikiDiscussions master Synced today

READMEChangelog (5)Dependencies (8)Versions (6)Used By (0)

AppGallery IAP
==============

[](#appgallery-iap)

About
-----

[](#about)

AppGallery IAP is a PHP library to handle AppGallery purchase verification and Server Notifications. This package simplifies development by allowing you to work with ready-made data objects. The package also contains SHA256WithRSA signature verification with and without PSS filling.

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

[](#installation)

Use composer

```
composer require chfur/appgallery-iap

```

Usage
-----

[](#usage)

The AppGallery IAP verifying Order and Subscription services can be found in the [Package for verification](https://github.com/Stafox/huawei-iap). The implementation for the laravel framework can be found in the [Laravel In-App purchase package](https://github.com/imdhemy/laravel-in-app-purchases).

### Notification About a Key Subscription Event

[](#notification-about-a-key-subscription-event)

You can use server notification handling "About a Key Subscription Event" as follow:

```
use CHfur\AppGallery\ServerNotifications\ServerNotification;
use CHfur\AppGallery\ServerNotifications\SubscriptionNotification;
use Huawei\IAP\Response\SubscriptionResponse;

/**
 * @var array $data AppGallery ServerNotification request
 * @see https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/api-notifications-about-subscription-events-0000001050706084
*/
$data = [];

$publicKey = 'Your AppGallery notification public key';

/** @var ServerNotification $serverNotification */
$serverNotification = ServerNotification::parse($data, $publicKey);

if($serverNotification->isSubscriptionNotification()){
    /** @var SubscriptionNotification $subscriptionNotification */
    $subscriptionNotification = $serverNotification->getSubscriptionNotification();

    $productId = $subscriptionNotification->getProductId();
    $environment = $subscriptionNotification->getEnvironment();

    /** @var SubscriptionResponse $subscriptionResponse */
    $subscriptionResponse = $subscriptionNotification->getSubscriptionResponse();

    $notificationTypeName = $subscriptionNotification->getNotificationTypeName();

    switch ($notificationTypeName){
        case 'RENEWAL':
            //implement your logic
            break;
    }
}
```

### Notification About a Key Event of Pending Purchase

[](#notification-about-a-key-event-of-pending-purchase)

And also you can use server notification handling "About a Key Event of Pending Purchase" as follow:

```
use CHfur\AppGallery\ServerNotifications\PendingPurchaseNotification;
use CHfur\AppGallery\ServerNotifications\ServerNotification;

/**
 * @var array $data AppGallery ServerNotification request
 * @see https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/api-notifications-about-pending-payment-events-0000001230063777
*/
$data = [];

$publicKey = 'Your AppGallery notification public key';

/** @var ServerNotification $serverNotification */
$serverNotification = ServerNotification::parse($data, $publicKey);

if($serverNotification->isPendingPurchaseNotification()){
    /** @var PendingPurchaseNotification $pendingPurchaseNotification */
    $pendingPurchaseNotification = $serverNotification->getPendingPurchaseNotification();

    $productId = $pendingPurchaseNotification->getProductId();
    $purchaseToken = $pendingPurchaseNotification->getPurchaseToken();
    $isSuccessPayment = $pendingPurchaseNotification->getNotificationType();

    //implement your logic
}
```

License
-------

[](#license)

The AppGallery IAP is an open-sourced software licensed under the [MIT license](LICENSE.md).

TODO
----

[](#todo)

- Implementing verification without third-party packages

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Total

5

Last Release

1479d ago

Major Versions

v0.0.1-alpha → v1.0.02022-01-28

PHP version history (2 changes)v1.0.1PHP ^7.1

v1.2.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47483596?v=4)[Dmitry](/maintainers/CHfur)[@CHfur](https://github.com/CHfur)

---

Top Contributors

[![CHfur](https://avatars.githubusercontent.com/u/47483596?v=4)](https://github.com/CHfur "CHfur (9 commits)")

---

Tags

symfonylaraveliapappgalleryappgallery-iap

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/chfur-appgallery-iap/health.svg)

```
[![Health](https://phpackages.com/badges/chfur-appgallery-iap/health.svg)](https://phpackages.com/packages/chfur-appgallery-iap)
```

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[laravel/octane

Supercharge your Laravel application's performance.

4.0k26.6M223](/packages/laravel-octane)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M984](/packages/statamic-cms)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6544.0M13](/packages/aporat-store-receipt-validator)[mollie/laravel-cashier-mollie

Laravel Cashier provides an expressive, fluent interface to Mollie's subscription billing services.

178204.3k1](/packages/mollie-laravel-cashier-mollie)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
