payu/apple-pay

ApplePay令牌解码器

1.3.0 2023-12-09 07:54 UTC

This package is auto-updated.

Last update: 2024-09-09 09:32:57 UTC


README

Travis CI Latest Stable Version Total Downloads License

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

  1. 下载 AppleRootCA-G3.cer
  2. 运行命令: openssl x509 -inform der -in AppleRootCA-G3.cer -out AppleRootCA-G3.pem

获取私钥

  1. 将商家证书导出为p12证书
  2. 使用openssl获取私钥: openssl pkcs12 -in <your_cert>.p12 -out private_key.pem -nocerts -nodes
  3. 复制不带BEGINEND标记的内容

使用方法

查看 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构建没有失败!