addPaymentPassViewController(_:generateRequestWithCertificateChain:nonce:nonceSignature:completionHandler:)
Asks the delegate to create an add payment request.
Declaration
func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, generateRequestWithCertificateChain certificates: [Data], nonce: Data, nonceSignature: Data, completionHandler handler: @escaping @Sendable (PKAddPaymentPassRequest) -> Void)func addPaymentPassViewController(_ controller: PKAddPaymentPassViewController, generateRequestWithCertificateChain certificates: [Data], nonce: Data, nonceSignature: Data) async -> PKAddPaymentPassRequestParameters
- controller:
The view controller asking for the add payment request.
- certificates:
An array of NSData objects. Each object contains a DER encoded X.509 certificate, with the leaf first and root last. You must download the root CA to validate the entire chain.
- nonce:
A one-time nonce value generated by Apple’s servers. This nonce must be included in the add payment request’s encrypted data.
- nonceSignature:
The device-specific signature for the nonce.This signature must be included in the add payment request’s encrypted data.
- handler:
A completion handler. Call this block after you have created your add payment request.
- request
A newly created add payment request. You must pass a request object to the handler within 20 seconds or the request will fail and the system will display an error message to the user.
Discussion
This method provides the data needed to create an add payment request. Pass the certificate chain to the issuer server. The server returns an encrypted JSON file containing the card data. After you receive the encrypted data, create a add payment request and call the handler.
For more information on the encrypted card data, see encryptedPassData in PKAddPaymentPassRequest.