PrimerCheckout( clientToken: clientToken, scope: { checkoutScope in if let applePayScope: PrimerApplePayScope = checkoutScope.getPaymentMethodScope(PrimerApplePayScope.self) { Task { for await state in applePayScope.state { if state.isAvailable { print("Apple Pay is available") } else if let error = state.availabilityError { print("Apple Pay unavailable: \(error)") } } } } })
if let applePayScope: PrimerApplePayScope = checkoutScope.getPaymentMethodScope(PrimerApplePayScope.self) { // Use the SDK button let button = applePayScope.PrimerApplePayButton { applePayScope.submit() }}