chengbo / ApplePayAndroidPayDecryption

A C# library to decrypt Apple Pay or Android Pay token on the server side.
MIT License
11 stars 0 forks source link

ApplePay解密问题 #3

Closed Aaron-Liu closed 7 years ago

Aaron-Liu commented 7 years ago

我按照你的方式,打开证书文件,得到的如下面所示 qq 20170622140540 我拿到的加密信息时这样的,如下图所示 33 我用你的代码测试的时候,到下面这里过不去,是我哪里没用对吗? 44

Aaron-Liu commented 7 years ago

上面的问题我找到原因了,我打开了错误的证书文件,我想问下MerchantIdentifier这个是从哪边获取呢?

chengbo commented 7 years ago

MerchantIdentifier是你在Apple Developer Portal上注册的ID。

See: https://developer.apple.com/library/content/ApplePay_Guide/Configuration.html

Aaron-Liu commented 7 years ago

你好,再请教下,我拿到解密后的数据是这个样子的 { "applicationPrimaryAccountNumber": "623074*4822617", "applicationExpirationDate": "310101", "currencyCode": "156", "transactionAmount": 0, "deviceManufacturerIdentifier": "062010030273", "paymentDataType": "EMV", "paymentData": { "encryptedPINData": "811095b00a21718928b7d9f9e09c8**8208006fffffffffffff", "emvData": "nyYIx3s0X7asDkGfNgIABIECAHCDcFxAY5S3IUbNbCoUU7q0RzIGWc6nitJSk/9Ns6TD/yFxFOTqZKIO7ybVZVr0h4YialLqdn8d+nSUBe5MSbcUjfLIZiDlx+KCoZN1EqBPzLXDI8g2SiMWs15AAg5bmwpL7uwRO3P1gdsQabTdWia3Ax0=" } } 到这步我要和谁去通信呢?我要怎么样才能得到最后解密的数据呢?如果我是跨国的话要对接国内国外各种银行吗?还是要借助第三方?

chengbo commented 7 years ago

建议先详细阅读Apple的文档,写的很详细。相信看完之后你会对Apple Pay的的整个流程和实现方式了解很多。

https://developer.apple.com/apple-pay/get-started/cn/

Aaron-Liu commented 7 years ago

我看了文档,apple pay这边如果再国内我接银联是要都用银联的sdk,那如果我想接国外的服务商,就要对接国外的sdk吗?那如果我针对的是人在国外的国内用户,是不能都兼容吗?假设那些用户有国内的卡,也有国外的卡 流程图见下面 https://developer.apple.com/apple-pay/images/figure-2-payment-flow-cn.png https://open.unionpay.com/upload/image/1456905863250067257.png