Ios 如何在ApplePay/Swift中使用pkpaymentsummaryitemtype.pending?
在我的应用程序中,我需要添加待定付款(在用户获得某些服务后)。 我正在实施苹果支付并收到代币。但是我不知道如何使用项目类型pkpaymentsummaryitemtype.pending付款 以下是我的支付方式:Ios 如何在ApplePay/Swift中使用pkpaymentsummaryitemtype.pending?,ios,swift,applepay,Ios,Swift,Applepay,在我的应用程序中,我需要添加待定付款(在用户获得某些服务后)。 我正在实施苹果支付并收到代币。但是我不知道如何使用项目类型pkpaymentsummaryitemtype.pending付款 以下是我的支付方式: func makePay() { let request = PKPaymentRequest() request.merchantIdentifier = ApplePaySwagMerchantID
func makePay()
{
let request = PKPaymentRequest()
request.merchantIdentifier = ApplePaySwagMerchantID
request.supportedNetworks = SupportedPaymentNetworks
request.merchantCapabilities = PKMerchantCapability.capability3DS
request.countryCode = "US"
request.currencyCode = "USD"
request.paymentSummaryItems = [
PKPaymentSummaryItem(label: "Some service", amount: 0, type: PKPaymentSummaryItemType.pending)]
let applePayController = PKPaymentAuthorizationViewController(paymentRequest: request)!
applePayController.delegate = self
var topVC = UIApplication.shared.keyWindow?.rootViewController
while((topVC!.presentedViewController) != nil) {
topVC = topVC!.presentedViewController
}
topVC?.present(applePayController, animated: true)
}
但当我必须出示并借记最终金额时?我在swift/IOS上找不到代码示例
或者,如果我理解正确-使用该类型我刚收到授权,而不是使用收到的代币,我的银行/支付系统将在我发送后借记最终金额
对吗