因为工程需要使用apple pay, 网上找了很多资料, 要么陈旧, 要么就是直接复制转载, 无奈之下, 找到苹果的官方文档: 官方传送门, 很详细, 我接下来的操作, 也是按照这个文档进行的.
1. Apple Pay Setup 官方传送门
- 创建商户id (Create a merchant ID)
- 创建付款处理的证书 (Create a Payment Processing certificate.)
步骤1,2
参看官方说明, 中文的, 在此就不赘述
配置 Apple Pay
- xcode的相关设置 (Enable Apple Pay in Xcode. )
常规设置, 类似后台播放那样, 勾选刚才创建的
2. Apple Pay Availability
- 判断设备是否支持apple pay, 以及用户是否已经添加卡片
tips: The PKPaymentAuthorizationController class performs the same role as the PKPaymentAuthorizationViewController class, but it does not depend on the UIKit framework. This means that the authorization controller can be used in places where a view controller cannot (for example, in watchOS apps or in SiriKit extensions).