苹果支付
https://applepaydemo.apple.com/
https://developer.apple.com/apple-pay/Apple-Pay-Merchant-Integration-Guide.pdf
https://support.apple.com/zh-cn/HT206638
https://developer.apple.com/help/account/create-certificates/create-a-certificate-signing-request 生成支付处理证的书请求文件由 cardpay 提供,生成商户证书的请求文件自己在 mac 上生成
在开发者账号后中生产商户ID
向unlimit索要csr请求证书(通过邮件接收)
拿到请求证书在开发者账号中生产支付处理证书,通过回复邮件将支付处理证书发送个unlimit
在商家id详情页验证域名
在商家id详情页生成商户身份证书得到merchant_id.cer文件
通过苹果密钥串软件将生产私钥和共钥文件,参考“Apple pay merchant integration guide”, 高版本 openssl3可能会报错相关文档:https://www.iclarified.com/92617/how-to-fix-error-0308010c-digital-envelope-routines-unsupported
openssl pkcs12 -in zs.p12 -out ApplePay.crt.pem -nokeys -legacy
#这里需要输入一个密码,然后php curl请求时候附带上密码,curl_setopt($ch, CURLOPT_SSLKEYPASSWD, 'your_pass_phrase');
openssl pkcs12 -in zs.p12 -out ApplePay.key.pem -nocerts -legacy
curl --location 'https://apple-pay-gateway-cert.apple.com/paymentservices/paymentSession' \
--header 'Content-Type: text/plain' \
--data '{
"merchantIdentifier": "merchant.com.iflamme",
"displayName": "iflamme",
"initiative": "web",
"initiativeContext": "www.iflamme.com"
}' \
--cert /Users/wudi/Downloads/tm3/ApplePay.crt.pem\
--key /Users/wudi/Downloads/tm3/ApplePay.key.pem
#苹果支付有个域名认证文件 .well-known 非常重要,不能丢失,否则会导致支付时候域名认证失败!
