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(3y ago)52801MITPHPPHP &gt;=7.1

Since Jan 27Pushed 3y 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 1mo ago

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 43% 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

1427d 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://www.gravatar.com/avatar/3dc7fe7bdd0f1da934286e25f6e1e04b6b3f48a40851830d8bf92ff57cfb6fb1?d=identicon)[CHfur](/maintainers/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

[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

58596.1k](/packages/lemonsqueezy-laravel)[mollie/laravel-cashier-mollie

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

172155.4k1](/packages/mollie-laravel-cashier-mollie)[dinkbit/conekta-cashier

Dinkbit Cashier nos da una interface para cobrar subscripciones con Conketa en Laravel.

355.4k](/packages/dinkbit-conekta-cashier)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

312.4k1](/packages/dena-a-iran-payment)

PHPackages © 2026

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