-
What's new in Wallet and Apple Pay
Apple Pay makes it simple to pay for goods and services in your app and on your website. Discover how you can integrate API updates like context-specific button types, contact data formatting, and cross-platform support to make the service more effective for you and people using it. And, if you're building app clips, adopting Apple Pay can help you unlock new commerce experiences.
Recursos
Videos relacionados
WWDC21
WWDC20
-
Buscar este video…
-
-
7:44 - Implementing Apple Pay on the Mac
// PKPaymentAuthorizationControllerDelegate func presentationWindow(for controller: PKPaymentAuthorizationController) -> UIWindow? { let purchaseWindow = yourViewController.view.window return (purchaseWindow) // The window presenting the payment sheet. } func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didRequestMerchantSessionUpdate handler: @escaping (PKPaymentRequestMerchantSessionUpdate) -> Void) { // Get merchant session to enable the user to authorize a transaction. var dict = try? JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: Any] { let session = PKPaymentMerchantSession(dictionary: dict) let update = PKPaymentRequestMerchantSessionUpdate(status: .success, merchantSession: session) handler(update) } }
-