因?yàn)楣こ绦枰褂胊pple pay, 網(wǎng)上找了很多資料, 要么陳舊, 要么就是直接復(fù)制轉(zhuǎn)載, 無(wú)奈之下, 找到蘋(píng)果的官方文檔: 官方傳送門(mén), 很詳細(xì), 我接下來(lái)的操作, 也是按照這個(gè)文檔進(jìn)行的.
1. Apple Pay Setup 官方傳送門(mén)
- 創(chuàng)建商戶(hù)id (Create a merchant ID)
- 創(chuàng)建付款處理的證書(shū) (Create a Payment Processing certificate.)
步驟1,2
參看官方說(shuō)明, 中文的, 在此就不贅述
配置 Apple Pay
- xcode的相關(guān)設(shè)置 (Enable Apple Pay in Xcode. )
常規(guī)設(shè)置, 類(lèi)似后臺(tái)播放那樣, 勾選剛才創(chuàng)建的
2. Apple Pay Availability
- 判斷設(shè)備是否支持apple pay, 以及用戶(hù)是否已經(jīng)添加卡片
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).