PHPackages                             chenkby/apple-pay - 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. chenkby/apple-pay

ActiveLibrary[Payment Processing](/categories/payments)

chenkby/apple-pay
=================

苹果内购

v1.0(8y ago)61.2k2[3 issues](https://github.com/chenkby/apple-pay/issues)BSD-3-ClausePHPPHP &gt;=5.4.0

Since Jan 25Pushed 8y ago1 watchersCompare

[ Source](https://github.com/chenkby/apple-pay)[ Packagist](https://packagist.org/packages/chenkby/apple-pay)[ RSS](/packages/chenkby-apple-pay/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

苹果内购
====

[](#苹果内购)

安装
--

[](#安装)

composer

```
$ php composer.phar require chenkby/apple-pay:1.0
```

或者添加以下代码到`composer.json`文件的`require`块中：

```
"chenkby/apple-pay": "1.0"

```

使用
--

[](#使用)

```
    // $orderId 本地订单号
    // $storeProductId 苹果商店产品ID
    // $tradeNo 苹果交易号

    $order = findOrder($orderId);

    $order->updateReceipt($data['receipt']);
    $applePay = new ApplePay($_POST['receipt'], $orderId);
    if ($applePay->verifyReceipt()) {
        $result = $applePay->query($storeProductId, function ($tradeNo, $returnData) use ($order) {
            // 检查此交易号是否被使用
            if (!$order->checkTradeNoIsUsed($tradeNo)) {
                // 更新本地订单状态等...
                return $this->notify($order, $returnData, $tradeNo);
            } else {
                echo '此笔交易号已经被使用，这笔交易有可能是伪造的！';
                return false;
            }
        });
        if ($result) {
            echo 'success';
        } else {
            echo $applePay->getError();
        }
    } else {
        echo $applePay->getError();
    }
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3032d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35e20aecf431c03a9ea9cbfd44180e97599e2d9db47ca87c408ee16173c5c1a2?d=identicon)[chenkby](/maintainers/chenkby)

---

Top Contributors

[![chenkby](https://avatars.githubusercontent.com/u/13486227?v=4)](https://github.com/chenkby "chenkby (5 commits)")

---

Tags

apple-payApple Pay

### Embed Badge

![Health badge](/badges/chenkby-apple-pay/health.svg)

```
[![Health](https://phpackages.com/badges/chenkby-apple-pay/health.svg)](https://phpackages.com/packages/chenkby-apple-pay)
```

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[mollie/laravel-cashier-mollie

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

172155.4k1](/packages/mollie-laravel-cashier-mollie)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[dnetix/redirection

Library to connect with PlacetoPay Checkout service

17123.3k2](/packages/dnetix-redirection)

PHPackages © 2026

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