PHPackages                             simplephp/iap-service - 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. simplephp/iap-service

ActiveLibrary[Payment Processing](/categories/payments)

simplephp/iap-service
=====================

IAP-Service 组件集成了苹果(apple)、华为(huawei)应用内支付服务(IAP)，统一封装 IAP 服务器 REST API，封装 IAP 服务端通知，方便开发者快速集成支付功能，专注业务开发。

v1.0.4(1y ago)268↓75%1MITPHPPHP ^7.1

Since Nov 13Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/simplephp/iap-service)[ Packagist](https://packagist.org/packages/simplephp/iap-service)[ RSS](/packages/simplephp-iap-service/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (6)Used By (0)

介绍
--

[](#介绍)

---

IAP-Service 组件集成了苹果(apple)、华为(huawei)应用内支付服务(IAP)，统一封装 IAP 服务器 REST API，封装 IAP 服务端通知，方便开发者快速集成支付功能，专注业务开发。

环境依赖
----

[](#环境依赖)

---

- PHP &gt;= 7.1.2
- ext-json
- ext-curl
- ext-openssl
- guzzlehttp/guzzle: ^6.5 || ^7.0
- phpseclib/phpseclib: ^3.0
- firebase/php-jwt: ^6.10

安装
--

[](#安装)

---

1、通过命令行下安装：

```
composer require "simplephp/iap-service:1.0.*"
```

2、通过项目下composer.json文件配置方式安装：

```
"require": {
    "simplephp/iap-service": "1.0.*"
}
```

食用
--

[](#食用)

---

1、配置详解

```
$config = [
    'apple' => [
        'default' => [
            'leaf_cert_oid' => '1.2.***.6.11.1',
            'kid' => 'D37***2LT',
            'bundle_id' => 'com.****.bundler',
            'issuer_id' => '69a6-***-a4d1',
            'private_key_path' => __DIR__ . '/cert/SubscriptionKey_****.p8',
        ]
    ],
];
```

2、集成示例 (示例详情请查看examples目录)

```
├── examples
│   ├── ....
│   ├── app_store_notify.php      // apple iap 事件通知示例
│   ├── app_store_server_api.php  // apple iap rest api 示例
│   └── huawei_server_api.php     // huawei iap rest api 示例
│   └── huawei_server_notify.php  // huawei iap 事件通知示例
├── ...
```

说明
--

[](#说明)

---

- [App Store IAP-事件通知](./apple_storekit2_readme.md)
- [Huawei IAP-事件通知](./huawei_iap_readme.md)
- 大自然的搬运工,相关接口文档请查看官方文档
    - [App Store-服务器通知](https://developer.apple.com/documentation/AppStoreServerNotifications)
    - [App Store-应用商店服务器 API](https://developer.apple.com/documentation/appstoreserverapi)
    - [华为-服务器通知](https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/iap-key-event-notifications-V5)
    - [华为-应用商店服务器 API](https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/iap-rest-V5)
- 有问题请提issues, 有能力的朋友请提交PR, 谢谢！

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance50

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 73.3% 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 ~9 days

Total

5

Last Release

515d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bc85954b85968faaebd19c2a95d42399e528ef9c8b792174ac2e79c0a21fb0d?d=identicon)[simplephp](/maintainers/simplephp)

---

Top Contributors

[![simplephp](https://avatars.githubusercontent.com/u/5026959?v=4)](https://github.com/simplephp "simplephp (11 commits)")[![seekcx](https://avatars.githubusercontent.com/u/8244814?v=4)](https://github.com/seekcx "seekcx (4 commits)")

---

Tags

appleIn App Purchaseiaphuawei

### Embed Badge

![Health badge](/badges/simplephp-iap-service/health.svg)

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

###  Alternatives

[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[packbackbooks/lti-1p3-tool

A library used for building IMS-certified LTI 1.3 tool providers in PHP.

51438.3k2](/packages/packbackbooks-lti-1p3-tool)[hoels/app-store-server-library-php

The PHP server library for the App Store Server API and App Store Server Notifications.

44162.2k](/packages/hoels-app-store-server-library-php)[yanlongli/app-store-server-api

PHP client for App Store Server API. Manage your customers’ App Store transactions from your server.The App Store Server API is a REST API that you call from your server to request and provide information about your customers' in-app purchases. The App Store signs the transaction and subscription renewal information that this API returns using the JSON Web Signature (JWS) specification.App Store Server API is independent of the app’s installation status on the customer’s devices. The App Store server returns information based on the customer’s in-app purchase history regardless of whether the customer installed, removed, or reinstalled the app on their devices.To request transaction and subscription status information with this API, provide any original transaction identifier that belongs to the customer. The transaction history API responds with a complete list of transactions, 20 at a time, starting with the oldest first. The subscription status API returns the status for all of the customer’s subscriptions, organized by their subscription group identifier.Use the Send Consumption Information endpoint to send information to the App Store when customers request a refund for a consumable in-app purchase, after you receive the CONSUMPTION\_REQUEST App Store server notification. Your data helps inform refund decisions.

2532.0k](/packages/yanlongli-app-store-server-api)

PHPackages © 2026

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