PHPackages                             payu/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. [Security](/categories/security)
4. /
5. payu/apple-pay

ActiveLibrary[Security](/categories/security)

payu/apple-pay
==============

ApplePay Token Decoder

1.4.0(2mo ago)51983.2k—1.6%37[1 issues](https://github.com/PayU-EMEA/apple-pay/issues)[2 PRs](https://github.com/PayU-EMEA/apple-pay/pulls)Apache-2.0PHPPHP ^7.4|^8.0CI failing

Since Feb 27Pushed 2mo ago20 watchersCompare

[ Source](https://github.com/PayU-EMEA/apple-pay)[ Packagist](https://packagist.org/packages/payu/apple-pay)[ Docs](https://github.com/PayU/apple-pay)[ RSS](/packages/payu-apple-pay/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (13)Used By (0)

[![Travis CI](https://camo.githubusercontent.com/0e394f83957ebce67004c251d5d2c86780f2432620472dd9a838b64e04dcc108/68747470733a2f2f7472617669732d63692e6f72672f506179552d454d45412f6170706c652d7061792e737667)](https://travis-ci.org/PayU-EMEA/apple-pay) [![Latest Stable Version](https://camo.githubusercontent.com/c077501ce9b3d9a74e266e22daae3a35e872abbae3a36785c43b6841723d258b/68747470733a2f2f706f7365722e707567782e6f72672f706179752f6170706c652d7061792f762f737461626c652e737667)](https://packagist.org/packages/payu/apple-pay) [![Total Downloads](https://camo.githubusercontent.com/43adb1c8729d9b24226d122ba051955675a70f5ab424ba3b55ca9a5332645e4b/68747470733a2f2f706f7365722e707567782e6f72672f706179752f6170706c652d7061792f646f776e6c6f6164732e737667)](https://packagist.org/packages/payu/apple-pay) [![License](https://camo.githubusercontent.com/95c411fff6dad94dceaafaec5af49deedcd77d618ea0549a0923258b6757d3a0/68747470733a2f2f706f7365722e707567782e6f72672f706179752f6170706c652d7061792f6c6963656e73652e737667)](https://packagist.org/packages/payu/apple-pay)

**Apple Pay Token Decoder**

This library is used to decode tokens for Apple Pay.

It takes a payment token data and returns an ApplePayPaymentData object. ex:

```
class PayU\ApplePay\Decoding\ApplePayPaymentData#19 (9) {
  private $version =>
  int(1)
  private $applicationPrimaryAccountNumber =>
  string(16) "20427527000"
  private $applicationExpirationDate =>
  string(6) "190731"
  private $currencyCode =>
  string(3) "643"
  private $transactionAmount =>
  int(100000)
  private $deviceManufacturerIdentifier =>
  string(12) "050103073"
  private $paymentDataType =>
  string(8) "3DSecure"
  private $onlinePaymentCryptogram =>
  string(28) "Am+7lPDbobAGVT7hNAoABA=="
  private $eciIndicator =>
  NULL
}

```

**Install:**

Run `composer require payu/apple-pay`

**Get AppleRootCA-G3.pem:**

1. Download [AppleRootCA-G3.cer](https://www.apple.com/certificateauthority)
2. Run command: `openssl x509 -inform der -in AppleRootCA-G3.cer -out AppleRootCA-G3.pem`

**Get Private Key:**

1. Export merchant certificate to a p12 cert
2. Use openssl to get the private key: `openssl pkcs12 -in .p12 -out private_key.pem -nocerts -nodes`
3. Copy content without `BEGIN` and `END` markers

**Usage:**

See [https://github.com/PayU/apple-pay/blob/master/examples/decode\_token.php](https://github.com/PayU/apple-pay/blob/master/examples/decode_token.php)

For more information about how Apple Pay tokens decoding works go to:

Only works on Linux hosts with openssl installed

For open pull requests please make sure the Travis build does not fail!

###  Health Score

63

—

FairBetter than 99% of packages

Maintenance83

Actively maintained with recent releases

Popularity53

Moderate usage in the ecosystem

Community26

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 59.5% 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 ~291 days

Recently: every ~441 days

Total

11

Last Release

87d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8714fa223d32c91d96ba5aededaea9dba9b395eb7574732e5964c280d2b5efaf?d=identicon)[drealecs](/maintainers/drealecs)

![](https://www.gravatar.com/avatar/05024869c39d99af5d46130f2338be684f8a3d83ef536f8e57d37b60f4362122?d=identicon)[trydocatch](/maintainers/trydocatch)

---

Top Contributors

[![trydocatch](https://avatars.githubusercontent.com/u/5352167?v=4)](https://github.com/trydocatch "trydocatch (47 commits)")[![sergeyzinder](https://avatars.githubusercontent.com/u/69752567?v=4)](https://github.com/sergeyzinder "sergeyzinder (9 commits)")[![willemstuursma](https://avatars.githubusercontent.com/u/701299?v=4)](https://github.com/willemstuursma "willemstuursma (6 commits)")[![drealecs](https://avatars.githubusercontent.com/u/209984?v=4)](https://github.com/drealecs "drealecs (5 commits)")[![foaieee](https://avatars.githubusercontent.com/u/45826035?v=4)](https://github.com/foaieee "foaieee (5 commits)")[![andreicio](https://avatars.githubusercontent.com/u/20474012?v=4)](https://github.com/andreicio "andreicio (3 commits)")[![gxgpet](https://avatars.githubusercontent.com/u/13217984?v=4)](https://github.com/gxgpet "gxgpet (2 commits)")[![vtychyna](https://avatars.githubusercontent.com/u/224998726?v=4)](https://github.com/vtychyna "vtychyna (1 commits)")[![FromSi](https://avatars.githubusercontent.com/u/22871855?v=4)](https://github.com/FromSi "FromSi (1 commits)")

---

Tags

apple-paydecryptionopensslphpphpopensslApple Paydecryption

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[camcima/dukpt-php

DUKPT implementation in PHP

25153.1k](/packages/camcima-dukpt-php)[poly-crypto/poly-crypto

High-level cryptographic functions that are interoperable between NodeJS and PHP 7.1+

127.8k1](/packages/poly-crypto-poly-crypto)[stymiee/php-simple-encryption

The PHP Simple Encryption library is designed to simplify the process of encrypting and decrypting data while ensuring best practices are followed. By default is uses a secure encryption algorithm and generates a cryptologically strong initialization vector so developers do not need to becomes experts in encryption to securely store sensitive data.

448.0k](/packages/stymiee-php-simple-encryption)[hemiframe/php-aes

PHP class for encrypt and decrypt data with AES algorithm

1030.3k](/packages/hemiframe-php-aes)[ukrbublik/openssl_x509_crl

Missing OpenSSL function on PHP to create CRL (certificate revocation list) for CA

182.1k](/packages/ukrbublik-openssl-x509-crl)

PHPackages © 2026

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