payu / apple-pay
ApplePay令牌解码器
1.3.0
2023-12-09 07:54 UTC
Requires
- php: ^7.4|^8.0
- ext-openssl: *
- phpseclib/phpseclib: ^3.0
- spomky-labs/php-aes-gcm: ^1.2
- symfony/process: ^4.1|^5.0|^6.0
Requires (Dev)
- phpstan/phpstan: ^1.8
- phpunit/phpunit: ^7.5|^9.0
README
Apple Pay令牌解码器
此库用于解码Apple Pay的令牌。
它接受支付令牌数据并返回一个ApplePayPaymentData对象。例如
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
}
安装
运行 composer require payu/apple-pay
获取AppleRootCA-G3.pem
- 下载 AppleRootCA-G3.cer
- 运行命令:
openssl x509 -inform der -in AppleRootCA-G3.cer -out AppleRootCA-G3.pem
获取私钥
- 将商家证书导出为p12证书
- 使用openssl获取私钥:
openssl pkcs12 -in <your_cert>.p12 -out private_key.pem -nocerts -nodes
- 复制不带
BEGIN
和END
标记的内容
使用方法
查看 https://github.com/PayU/apple-pay/blob/master/examples/decode_token.php
有关Apple Pay令牌解码工作原理的更多信息,请访问: https://developer.apple.com/library/content/documentation/PassKit/Reference/PaymentTokenJSON/PaymentTokenJSON.html
仅在安装了openssl的Linux主机上工作
对于开放拉取请求,请确保Travis构建没有失败!