Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import PassKit
@preconcurrency import PassKit
import ShopifyCheckoutKit

@available(iOS 16.0, *)
extension ApplePayAuthorizationDelegate: PKPaymentAuthorizationControllerDelegate {
extension ApplePayAuthorizationDelegate: @preconcurrency PKPaymentAuthorizationControllerDelegate {
/// Triggers on payment sheet presentation, and if user changes shipping address
///
/// Only triggered if the PKPaymentRequest has `requiredShippingContactFields` set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,24 @@
*/

import Foundation
import PassKit
@preconcurrency import PassKit
import ShopifyCheckoutKit

// MARK: - PaymentAuthorizationController Protocol

/// Protocol to abstract PKPaymentAuthorizationController for testing
@available(iOS 16.0, *)
@MainActor
protocol PaymentAuthorizationController {
var delegate: PKPaymentAuthorizationControllerDelegate? { get set }
var delegate: (any PKPaymentAuthorizationControllerDelegate)? { get set }
func present() async -> Bool
func dismiss(completion: (() -> Void)?)
func dismiss(completion: (@Sendable () -> Void)?)
}

extension PKPaymentAuthorizationController: PaymentAuthorizationController {}

@available(iOS 16.0, *)
typealias PKAuthorizationControllerFactory = (PKPaymentRequest) -> PaymentAuthorizationController
typealias PKAuthorizationControllerFactory = @MainActor (PKPaymentRequest) -> any PaymentAuthorizationController

@available(iOS 16.0, *)
@MainActor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import PassKit

@available(iOS 16.0, *)
class PassKitFactory {
final class PassKitFactory: Sendable {
static let shared = PassKitFactory()

private struct DeliveryOptionWithGroupType {
Expand Down
Loading