gpt4 book ai didi

swift - PKAddPaymentPassViewControllerDelegate 方法实现

转载 作者:行者123 更新时间:2023-11-30 10:27:23 41 4
gpt4 key购买 nike

我们必须将借记卡/信用卡从应用程序添加到 Apple Wallet

let config = PKAddPaymentPassRequestConfiguration.init(encryptionScheme: PKEncryptionScheme.ECC_V2)
config?.cardholderName = "John"
config?.primaryAccountSuffix = "9999" //last 4 or 5digits of card
config?.localizedDescription = "This will add the card to Apple Pay";
config?.primaryAccountIdentifier = "test";
config?.paymentNetwork = PKPaymentNetwork(rawValue: "VISA");

guard let addPaymentPassVC = PKAddPaymentPassViewController.init(requestConfiguration: config!, delegate: self) else { return }
self.present(addPaymentPassVC, animated: true, completion: nil)


extension ViewController: PKAddPaymentPassViewControllerDelegate {
func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController,
generateRequestWithCertificateChain certificates: [Data],
nonce: Data,
nonceSignature: Data,
completionHandler handler: @escaping (PKAddPaymentPassRequest) -> Void) {



}

func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController,
didFinishAdding pass: PKPaymentPass?,
error: Error?) {

print("didFinishAdding")

}


}


PKAddPaymentPassViewController 委托(delegate)方法应该实现什么?

最佳答案

我认为首先,您应该检查 Apple 的 PassKit 文档,以正确理解它的工作原理( https://developer.apple.com/wallet/ )。那么也许这个网站适合您:https://github.com/tschoffelen/php-pkpass

但是,除非您直接与苹果联系并获得他们的许可,否则您无法执行任何操作。

关于swift - PKAddPaymentPassViewControllerDelegate 方法实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59857925/

41 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com