苹果支付

Apple pay demo

https://applepaydemo.apple.com/

Apple pay merchant integration guide

https://developer.apple.com/apple-pay/Apple-Pay-Merchant-Integration-Guide.pdf

https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/checking_for_apple_pay_availability

Apple网页版本

https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/checking_for_apple_pay_availability

支持银行卡的清单

https://support.apple.com/zh-cn/HT206638

证书教程

https://developer.apple.com/help/account/create-certificates/create-a-certificate-signing-request 生成支付处理证的书请求文件由 cardpay 提供,生成商户证书的请求文件自己在 mac 上生成

Apple pay 开发流程

在开发者账号后中生产商户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

app测试卡

#苹果支付有个域名认证文件 .well-known 非常重要,不能丢失,否则会导致支付时候域名认证失败!