{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading"]},"type":"markdown"},"seo":{"title":"Troubleshooting","description":"Transform your commerce with PXP's unified platform—seamless payments, real-time insights, and global growth in one powerful integration.","lang":"en-UK","siteUrl":"https://developer.pxp.io","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"troubleshooting","__idx":0},"children":["Troubleshooting"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn how to diagnose and fix common issues with the Apple Pay iOS SDK component."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"exception-types-and-error-codes","__idx":1},"children":["Exception types and error codes"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"sdk-exceptions","__idx":2},"children":["SDK exceptions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Apple Pay iOS SDK throws specific exceptions for different error scenarios:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Exception"},"children":["Exception"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":["Error code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Prevention"},"children":["Prevention"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayPaymentRequestApiNotSupportedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0602"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Apple Pay is not supported on this device or iOS version."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Check device compatibility and iOS version before initialisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePaySessionCancelledException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0615"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Apple Pay session was cancelled by the user."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Handle gracefully as this is expected user behaviour."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayMerchantValidationFailedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0616"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Apple Pay merchant validation failed."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Verify your merchant configuration and certificates."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayCustomApiProcessingFailedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0617"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom API processing failed during Apple Pay payment."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Check network connectivity and API configuration."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayValidationException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0501"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The payment request validation failed."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validate all required fields before submission."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayPaymentFailedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0303"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Apple Pay payment processing failed."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Implement retry logic and proper error handling."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayMerchantIdentifierRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The merchant identifier is missing from the configuration."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ensure merchant identifier is properly configured."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayPaymentRequestNotInitializedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The payment request was not properly initialised."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validate payment request before starting payment flow."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayHttpRequestFailedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["HTTP request failed during payment processing."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Check network connectivity and server availability."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayBlobDecryptionFailedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Failed to decrypt Apple Pay payment token."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Verify merchant certificates and configuration."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ApplePayDisbursementRequestNotSupportedException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Disbursement requests are not supported on this iOS version."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Check iOS version (requires iOS 17.0+) before using disbursements."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-handling-best-practices","__idx":3},"children":["Error handling best practices"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"comprehensive-error-handler","__idx":4},"children":["Comprehensive error handler"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let config = ApplePayButtonComponentConfig()\n\nconfig.onError = { error in\n    // Log error for debugging\n    print(\"Apple Pay Error: \\(error)\")\n    print(\"Error Code: \\(error.userInfo[\"errorCode\"] ?? \"Unknown\")\")\n    print(\"Error Message: \\(error.localizedDescription)\")\n    \n    // Handle specific error types\n    switch type(of: error) {\n    case is ApplePayPaymentRequestApiNotSupportedException.Type:\n        showUserMessage(\"Apple Pay is not available on this device. Please use an alternative payment method.\")\n        showAlternativePaymentMethods()\n        \n    case is ApplePayMerchantValidationFailedException.Type:\n        showUserMessage(\"Payment system temporarily unavailable. Please try again in a few moments.\")\n        logCriticalError(\"Merchant validation failed\", error: error)\n        \n    case is ApplePaySessionCancelledException.Type:\n        // User cancelled - don't show error\n        trackEvent(\"apple_pay_cancelled\")\n        \n    case is ApplePayPaymentFailedException.Type:\n        showUserMessage(\"Payment failed. Please check your payment information and try again.\")\n        offerRetryOption()\n        \n    case is ApplePayValidationException.Type:\n        showUserMessage(\"Please check your payment details and try again.\")\n        highlightValidationErrors()\n        \n    default:\n        showUserMessage(\"An unexpected error occurred. Please try again or contact support.\")\n        logUnknownError(error)\n    }\n}\n\nconfig.onCancel = { error in\n    print(\"Apple Pay cancelled by user\")\n    trackEvent(\"apple_pay_cancelled\")\n    // Handle graceful cancellation\n}\n\nfunc showUserMessage(_ message: String) {\n    DispatchQueue.main.async {\n        // Show user-friendly error message in your UI\n        let alert = UIAlertController(title: \"Payment Error\", message: message, preferredStyle: .alert)\n        alert.addAction(UIAlertAction(title: \"OK\", style: .default))\n        // Present alert to user\n    }\n}\n\nfunc logCriticalError(_ context: String, error: Error) {\n    // Send to error monitoring service\n    // Example: Crashlytics.record(error: error)\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshooting-common-issues","__idx":5},"children":["Troubleshooting common issues"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"apple-pay-button-isnt-showing","__idx":6},"children":["Apple Pay button isn't showing"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The symptoms of this are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The button element is hidden or not rendered."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["There's an empty container where the button should appear."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["No Apple Pay option is visible to customers."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"diagnostic-steps","__idx":7},"children":["Diagnostic steps"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Step 1: Check Apple Pay availability\nprint(\"Checking Apple Pay availability...\")\n\n// Check if PassKit is available\nimport PassKit\n\nif !PKPaymentAuthorizationController.canMakePayments() {\n    print(\"Error: Apple Pay cannot make payments - no setup or unsupported device\")\n    return\n}\n\n// Step 2: Check specific networks\nlet supportedNetworks: [PaymentNetwork] = [.visa, .masterCard, .amex, .discover]\nlet paymentService = ApplePayPaymentService()\n\nif !paymentService.canMakePayments(usingNetworks: supportedNetworks) {\n    print(\"Warning: Apple Pay available but no supported cards configured\")\n}\n\n// Step 3: Verify merchant configuration\nguard let merchantId = checkoutConfig.session.allowedFundingTypes.wallets?.applePay?.merchantId else {\n    print(\"Error: Merchant ID is missing\")\n    return\n}\n\nif !merchantId.hasPrefix(\"merchant.\") {\n    print(\"Error: Invalid merchant ID format: \\(merchantId)\")\n    return\n}\n\n// Step 4: Check iOS version for advanced features\nif #available(iOS 17.0, *) {\n    print(\"iOS 17.0+ features available (disbursements)\")\n} else {\n    print(\"Limited to basic Apple Pay features\")\n}\n\nprint(\"All Apple Pay requirements met\")\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"solutions","__idx":8},"children":["Solutions"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Solution: Graceful fallback\nfunc initializeApplePay() {\n    if checkApplePayAvailability() {\n        renderApplePayButton()\n    } else {\n        renderAlternativePaymentMethods()\n    }\n}\n\nfunc checkApplePayAvailability() -> Bool {\n    return PKPaymentAuthorizationController.canMakePayments() &&\n           hasValidMerchantId() &&\n           isIOSVersionSupported()\n}\n\nfunc renderApplePayButton() {\n    do {\n        let applePayComponent = try ApplePayButtonComponent(\n            config: checkoutConfig,\n            componentConfig: applePayConfig\n        )\n        \n        // Mount the component to your view\n        let buttonView = try applePayComponent.render()\n        containerView.addSubview(buttonView)\n        \n        // Setup constraints\n        buttonView.translatesAutoresizingMaskIntoConstraints = false\n        NSLayoutConstraint.activate([\n            buttonView.leadingAnchor.constraint(equalTo: containerView.leadingAnchor),\n            buttonView.trailingAnchor.constraint(equalTo: containerView.trailingAnchor),\n            buttonView.topAnchor.constraint(equalTo: containerView.topAnchor),\n            buttonView.heightAnchor.constraint(equalToConstant: 44)\n        ])\n        \n    } catch {\n        print(\"Failed to initialise Apple Pay: \\(error)\")\n        renderAlternativePaymentMethods()\n    }\n}\n\nfunc renderAlternativePaymentMethods() {\n    // Show alternative payment options\n    let creditCardButton = UIButton(type: .system)\n    creditCardButton.setTitle(\"Pay with Credit Card\", for: .normal)\n    // Add to your view hierarchy\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"merchant-validation-failures","__idx":9},"children":["Merchant validation failures"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The symptoms of this are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An error occurs during the Apple Pay session initialisation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["\"Merchant validation failed\" error messages are displayed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The payment sheet doesn't appear after button tap."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"diagnostic-steps-1","__idx":10},"children":["Diagnostic steps"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Check merchant ID configuration\nstruct MerchantDiagnostics {\n    let merchantId: String?\n    let bundleId: String\n    let deviceModel: String\n    let iOSVersion: String\n}\n\nlet diagnostics = MerchantDiagnostics(\n    merchantId: checkoutConfig.session.allowedFundingTypes.wallets?.applePay?.merchantId,\n    bundleId: Bundle.main.bundleIdentifier ?? \"Unknown\",\n    deviceModel: UIDevice.current.model,\n    iOSVersion: UIDevice.current.systemVersion\n)\n\nprint(\"Merchant Validation Diagnostics: \\(diagnostics)\")\n\n// Test payment request creation\nfunc testPaymentRequestCreation() {\n    guard let merchantId = diagnostics.merchantId else {\n        print(\"Error: Merchant ID is nil\")\n        return\n    }\n    \n    let paymentRequest = ApplePayPaymentRequest(\n        merchantIdentifier: merchantId,\n        countryCode: \"US\",\n        currencyCode: \"USD\",\n        supportedNetworks: [.visa, .masterCard],\n        merchantCapabilities: [.supports3DS, .supportsEMV],\n        total: ApplePayPaymentSummaryItem(\n            amount: Decimal(string: \"10.00\") ?? 0,\n            type: .final,\n            label: \"Test Payment\"\n        )\n    )\n    \n    // Validate the payment request\n    if ApplePayValidationService.validatePaymentRequest(paymentRequest) {\n        print(\"Payment request validation passed\")\n    } else {\n        print(\"Payment request validation failed\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"solutions-1","__idx":11},"children":["Solutions"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"verify-the-apple-developer-console-setup","__idx":12},"children":["Verify the Apple Developer Console setup"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Checklist for Apple Developer Console\nstruct MerchantSetupChecklist {\n    let merchantIdCreated: Bool = true           // Created in Apple Developer Console\n    let merchantIdFormat: String = \"merchant.com.yourcompany.store\" // Correct format\n    let certificateGenerated: Bool = true        // Payment processing certificate created\n    let certificateInstalled: Bool = true        // Certificate installed on server\n    let bundleIdRegistered: Bool = true         // Bundle ID registered for merchant ID\n    let entitlementsConfigured: Bool = true     // Apple Pay entitlements in app\n}\n\nfunc validateMerchantSetup() -> Bool {\n    // Check entitlements\n    guard let entitlements = Bundle.main.entitlements else {\n        print(\"Error: Cannot read app entitlements\")\n        return false\n    }\n    \n    if let applePayMerchantIds = entitlements[\"com.apple.developer.in-app-payments\"] as? [String] {\n        print(\"Apple Pay merchant IDs configured: \\(applePayMerchantIds)\")\n        return !applePayMerchantIds.isEmpty\n    } else {\n        print(\"Error: Apple Pay entitlements not configured\")\n        return false\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"enhanced-validation-before-payment","__idx":13},"children":["Enhanced validation before payment"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"func validateConfigurationBeforePayment() -> Bool {\n    // Validate merchant ID\n    guard let merchantId = checkoutConfig.session.allowedFundingTypes.wallets?.applePay?.merchantId,\n          !merchantId.isEmpty else {\n        print(\"Error: Merchant ID is missing or empty\")\n        return false\n    }\n    \n    guard merchantId.hasPrefix(\"merchant.\") else {\n        print(\"Error: Invalid merchant ID format: \\(merchantId)\")\n        return false\n    }\n    \n    // Validate entitlements\n    if !validateMerchantSetup() {\n        return false\n    }\n    \n    // Check Apple Pay availability\n    if !PKPaymentAuthorizationController.canMakePayments() {\n        print(\"Error: Apple Pay not available on device\")\n        return false\n    }\n    \n    return true\n}\n\n// Use before starting payment\nfunc startApplePayPayment() {\n    guard validateConfigurationBeforePayment() else {\n        showConfigurationError()\n        return\n    }\n    \n    // Proceed with payment\n    let paymentRequest = createPaymentRequest()\n    applePayService.startPayment(with: paymentRequest)\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"retry-logic-for-transient-failures","__idx":14},"children":["Retry logic for transient failures"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"func startPaymentWithRetry(maxRetries: Int = 3) {\n    Task {\n        for attempt in 1...maxRetries {\n            do {\n                let result = try await processPayment()\n                // Success - exit retry loop\n                handlePaymentSuccess(result)\n                return\n            } catch let error as ApplePayMerchantValidationFailedException {\n                print(\"Merchant validation attempt \\(attempt) failed: \\(error)\")\n                \n                if attempt == maxRetries {\n                    handlePaymentFailure(error)\n                    return\n                }\n                \n                // Wait before retrying (exponential backoff)\n                let delay = TimeInterval(pow(2.0, Double(attempt)))\n                try await Task.sleep(nanoseconds: UInt64(delay * 1_000_000_000))\n            }\n        }\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payment-authorisation-failures","__idx":15},"children":["Payment authorisation failures"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The symptoms of this are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Apple Pay sheet appears but payment fails."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The customer sees a generic error message."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The transaction doesn't complete successfully."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"diagnostic-steps-2","__idx":16},"children":["Diagnostic steps"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Enhanced payment authorisation with detailed logging\nconfig.onPreAuthorisation = { result in\n    print(\"Payment Authorisation Started:\")\n    print(\"- Payment Token: \\(result.data.token.paymentData != nil ? \"Present\" : \"Missing\")\")\n    print(\"- Billing Contact: \\(result.data.billingContact != nil ? \"Present\" : \"Missing\")\")\n    print(\"- Shipping Contact: \\(result.data.shippingContact != nil ? \"Present\" : \"Missing\")\")\n    print(\"- Payment Method: \\(result.data.paymentMethod)\")\n    \n    // Return transaction initialisation data\n    return BaseTransactionResponse() // Your transaction init logic here\n}\n\nconfig.onPostAuthorisation = { result in\n    print(\"Payment Authorisation Completed:\")\n    print(\"- Transaction State: \\(result.state)\")\n    print(\"- Transaction ID: \\(result.transactionId ?? \"None\")\")\n    \n    if let errorReason = result.errorReason {\n        print(\"- Error Reason: \\(errorReason)\")\n    }\n    \n    // Handle success/failure\n    switch result.state {\n    case \"Authorised\", \"Captured\":\n        handlePaymentSuccess(result)\n    default:\n        handlePaymentFailure(result)\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"solutions-2","__idx":17},"children":["Solutions"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"enhanced-validation","__idx":18},"children":["Enhanced validation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"func validatePaymentData(_ payment: PKPayment) throws {\n    // Validate payment token\n    guard payment.token.paymentData.count > 0 else {\n        throw ApplePayValidationException(\"Payment token is missing or invalid\")\n    }\n    \n    guard !payment.token.transactionIdentifier.isEmpty else {\n        throw ApplePayValidationException(\"Transaction identifier is missing\")\n    }\n    \n    // Validate contact information if required\n    if let billingContact = payment.billingContact {\n        guard billingContact.postalAddress != nil else {\n            throw ApplePayValidationException(\"Billing address is required but missing\")\n        }\n    }\n    \n    // Validate payment method\n    guard payment.paymentMethod.network != nil else {\n        throw ApplePayValidationException(\"Payment network information is missing\")\n    }\n}\n\nfunc processPaymentWithValidation(_ payment: PKPayment) async throws -> BaseTransactionResponse {\n    // Validate payment data\n    try validatePaymentData(payment)\n    \n    // Create transaction request\n    let transactionRequest = createTransactionRequest(from: payment)\n    \n    // Process with Unity Service\n    return try await unityService.transactionAsync(transactionRequest)\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"network-error-handling","__idx":19},"children":["Network error handling"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"func processPaymentWithNetworkRetry(_ payment: PKPayment) async throws -> BaseTransactionResponse {\n    let maxRetries = 2\n    var lastError: Error?\n    \n    for attempt in 1...maxRetries {\n        do {\n            return try await processPayment(payment)\n        } catch let error as ApplePayHttpRequestFailedException {\n            print(\"Payment attempt \\(attempt) failed with HTTP error: \\(error)\")\n            lastError = error\n            \n            // Check if retryable\n            if isRetryableHttpError(error) && attempt < maxRetries {\n                let delay = TimeInterval(attempt) // Progressive delay\n                try await Task.sleep(nanoseconds: UInt64(delay * 1_000_000_000))\n                continue\n            }\n            \n            throw error\n        } catch {\n            print(\"Payment attempt \\(attempt) failed: \\(error)\")\n            throw error\n        }\n    }\n    \n    throw lastError ?? ApplePayPaymentFailedException()\n}\n\nfunc isRetryableHttpError(_ error: ApplePayHttpRequestFailedException) -> Bool {\n    let retryableStatusCodes = [408, 429, 500, 502, 503, 504]\n    return retryableStatusCodes.contains(error.statusCode ?? 0)\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validation-errors","__idx":20},"children":["Validation errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The symptoms of this are:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Payment requests fail before reaching Apple Pay."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validation exception messages are displayed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The payment flow doesn't start."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"diagnostic-steps-3","__idx":21},"children":["Diagnostic steps"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"func diagnoseValidationIssues() {\n    let paymentRequest = ApplePayPaymentRequest(\n        merchantIdentifier: \"merchant.com.example.store\",\n        countryCode: \"US\",\n        currencyCode: \"USD\",\n        supportedNetworks: [.visa, .masterCard],\n        merchantCapabilities: [.supports3DS],\n        total: ApplePayPaymentSummaryItem(\n            amount: Decimal(string: \"10.00\") ?? 0,\n            type: .final,\n            label: \"Test Payment\"\n        )\n    )\n    \n    // Test individual validation steps\n    print(\"=== Payment Request Validation ===\")\n    \n    // Basic fields validation\n    print(\"Merchant ID: \\(paymentRequest.merchantIdentifier.isEmpty ? \"❌ Empty\" : \"✅ Valid\")\")\n    print(\"Country Code: \\(ApplePayValidator.isValidCountryCode(paymentRequest.countryCode) ? \"✅ Valid\" : \"❌ Invalid\")\")\n    print(\"Currency Code: \\(ApplePayValidator.isValidCurrencyCode(paymentRequest.currencyCode) ? \"✅ Valid\" : \"❌ Invalid\")\")\n    print(\"Total Amount: \\(paymentRequest.total?.amount.isNegative == false ? \"✅ Valid\" : \"❌ Negative or nil\")\")\n    \n    // Networks and capabilities\n    print(\"Supported Networks: \\(paymentRequest.supportedNetworks.isEmpty ? \"❌ Empty\" : \"✅ Valid\")\")\n    print(\"Merchant Capabilities: \\(paymentRequest.merchantCapabilities.isEmpty ? \"❌ Empty\" : \"✅ Valid\")\")\n    \n    // Run full validation\n    if ApplePayValidationService.validatePaymentRequest(paymentRequest) {\n        print(\"✅ Overall validation: PASSED\")\n    } else {\n        print(\"❌ Overall validation: FAILED\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"solutions-3","__idx":22},"children":["Solutions"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"comprehensive-validation-helper","__idx":23},"children":["Comprehensive validation helper"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"struct PaymentRequestValidator {\n    static func createValidatedPaymentRequest(\n        merchantId: String,\n        amount: String,\n        currency: String = \"USD\",\n        country: String = \"US\",\n        description: String = \"Purchase\"\n    ) throws -> ApplePayPaymentRequest {\n        \n        // Validate merchant ID\n        guard !merchantId.isEmpty && merchantId.hasPrefix(\"merchant.\") else {\n            throw ApplePayValidationException(\"Invalid merchant ID format\")\n        }\n        \n        // Validate amount\n        guard let decimalAmount = Decimal(string: amount), !decimalAmount.isNegative else {\n            throw ApplePayValidationException(\"Invalid payment amount\")\n        }\n        \n        // Validate currency\n        guard ApplePayValidator.isValidCurrencyCode(currency) else {\n            throw ApplePayValidationException(\"Invalid currency code: \\(currency)\")\n        }\n        \n        // Validate country\n        guard ApplePayValidator.isValidCountryCode(country) else {\n            throw ApplePayValidationException(\"Invalid country code: \\(country)\")\n        }\n        \n        return ApplePayPaymentRequest(\n            merchantIdentifier: merchantId,\n            countryCode: country,\n            currencyCode: currency,\n            supportedNetworks: [.visa, .masterCard, .amex],\n            merchantCapabilities: [.supports3DS, .supportsEMV],\n            total: ApplePayPaymentSummaryItem(\n                amount: decimalAmount,\n                type: .final,\n                label: description\n            )\n        )\n    }\n}\n\n// Usage\ndo {\n    let paymentRequest = try PaymentRequestValidator.createValidatedPaymentRequest(\n        merchantId: \"merchant.com.example.store\",\n        amount: \"29.99\",\n        description: \"Product Purchase\"\n    )\n    applePayService.startPayment(with: paymentRequest)\n} catch {\n    handleValidationError(error)\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":5,"id":"real-time-validation-feedback","__idx":24},"children":["Real-time validation feedback"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"func validatePaymentRequestFields(\n    merchantId: String?,\n    amount: String?,\n    currency: String?,\n    country: String?\n) -> [ValidationError] {\n    var errors: [ValidationError] = []\n    \n    // Merchant ID validation\n    if let merchantId = merchantId {\n        if merchantId.isEmpty {\n            errors.append(ValidationError(field: \"merchantId\", message: \"Merchant ID cannot be empty\"))\n        } else if !merchantId.hasPrefix(\"merchant.\") {\n            errors.append(ValidationError(field: \"merchantId\", message: \"Merchant ID must start with 'merchant.'\"))\n        }\n    } else {\n        errors.append(ValidationError(field: \"merchantId\", message: \"Merchant ID is required\"))\n    }\n    \n    // Amount validation\n    if let amount = amount {\n        if amount.isEmpty {\n            errors.append(ValidationError(field: \"amount\", message: \"Amount cannot be empty\"))\n        } else if Decimal(string: amount) == nil {\n            errors.append(ValidationError(field: \"amount\", message: \"Invalid amount format\"))\n        } else if let decimal = Decimal(string: amount), decimal.isNegative {\n            errors.append(ValidationError(field: \"amount\", message: \"Amount cannot be negative\"))\n        }\n    } else {\n        errors.append(ValidationError(field: \"amount\", message: \"Amount is required\"))\n    }\n    \n    // Currency validation\n    if let currency = currency {\n        if !ApplePayValidator.isValidCurrencyCode(currency) {\n            errors.append(ValidationError(field: \"currency\", message: \"Invalid currency code\"))\n        }\n    } else {\n        errors.append(ValidationError(field: \"currency\", message: \"Currency is required\"))\n    }\n    \n    // Country validation\n    if let country = country {\n        if !ApplePayValidator.isValidCountryCode(country) {\n            errors.append(ValidationError(field: \"country\", message: \"Invalid country code\"))\n        }\n    } else {\n        errors.append(ValidationError(field: \"country\", message: \"Country is required\"))\n    }\n    \n    return errors\n}\n\nstruct ValidationError {\n    let field: String\n    let message: String\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"debugging-tools-and-techniques","__idx":25},"children":["Debugging tools and techniques"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To get more detailed information about errors, use this debugging setup:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Enable comprehensive logging\nextension ApplePayButtonComponent {\n    func enableDebugMode() {\n        print(\"Apple Pay Debug Mode Enabled\")\n        logEnvironmentInfo()\n    }\n    \n    private func logEnvironmentInfo() {\n        print(\"=== Apple Pay Environment ===\")\n        print(\"Device Model: \\(UIDevice.current.model)\")\n        print(\"iOS Version: \\(UIDevice.current.systemVersion)\")\n        print(\"Bundle ID: \\(Bundle.main.bundleIdentifier ?? \"Unknown\")\")\n        print(\"Apple Pay Available: \\(PKPaymentAuthorizationController.canMakePayments())\")\n        \n        // Check supported networks\n        let networks: [PKPaymentNetwork] = [.visa, .masterCard, .amex, .discover]\n        print(\"Supported Networks Available: \\(PKPaymentAuthorizationController.canMakePayments(usingNetworks: networks))\")\n        \n        // Check entitlements\n        if let entitlements = Bundle.main.entitlements,\n           let merchantIds = entitlements[\"com.apple.developer.in-app-payments\"] as? [String] {\n            print(\"Merchant IDs in Entitlements: \\(merchantIds)\")\n        } else {\n            print(\"Apple Pay entitlements not found\")\n        }\n    }\n}\n\n// Debug helper class\nclass ApplePayDebugger {\n    static func logPaymentRequest(_ request: ApplePayPaymentRequest) {\n        print(\"=== Payment Request Debug ===\")\n        print(\"Merchant ID: \\(request.merchantIdentifier)\")\n        print(\"Country: \\(request.countryCode)\")\n        print(\"Currency: \\(request.currencyCode)\")\n        print(\"Total: \\(request.total?.amount ?? 0) \\(request.currencyCode)\")\n        print(\"Networks: \\(request.supportedNetworks)\")\n        print(\"Capabilities: \\(request.merchantCapabilities)\")\n        \n        if let lineItems = request.lineItems {\n            print(\"Line Items:\")\n            for item in lineItems {\n                print(\"  - \\(item.label): \\(item.amount)\")\n            }\n        }\n    }\n    \n    static func logPaymentResult(_ result: ApplePayPaymentResult) {\n        print(\"=== Payment Result Debug ===\")\n        print(\"Payment Method: \\(result.data.paymentMethod)\")\n        print(\"Token Present: \\(result.data.token.paymentData.count > 0)\")\n        print(\"Transaction ID: \\(result.data.token.transactionIdentifier)\")\n        \n        if let billingContact = result.data.billingContact {\n            print(\"Billing Contact Present: Yes\")\n            print(\"Billing Country: \\(billingContact.postalAddress?.country ?? \"Unknown\")\")\n        } else {\n            print(\"Billing Contact Present: No\")\n        }\n        \n        if let shippingContact = result.data.shippingContact {\n            print(\"Shipping Contact Present: Yes\")\n            print(\"Shipping Country: \\(shippingContact.postalAddress?.country ?? \"Unknown\")\")\n        } else {\n            print(\"Shipping Contact Present: No\")\n        }\n    }\n}\n\n// Usage in your implementation\nlet applePayComponent = try ApplePayButtonComponent(config: checkoutConfig, componentConfig: applePayConfig)\napplePayComponent.enableDebugMode()\n\n// In your payment flow\nApplePayDebugger.logPaymentRequest(paymentRequest)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prevention-and-best-practices","__idx":26},"children":["Prevention and best practices"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"proactive-error-prevention","__idx":27},"children":["Proactive error prevention"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Pre-flight checks before initialising Apple Pay\nfunc performPreflightChecks() async -> Bool {\n    let checks: [(String, () async -> Bool, String)] = [\n        (\"Apple Pay Support\", {\n            PKPaymentAuthorizationController.canMakePayments()\n        }, \"Apple Pay is not supported on this device\"),\n        \n        (\"Payment Networks\", {\n            let networks: [PKPaymentNetwork] = [.visa, .masterCard, .amex]\n            return PKPaymentAuthorizationController.canMakePayments(usingNetworks: networks)\n        }, \"No supported payment networks available\"),\n        \n        (\"Merchant Configuration\", {\n            return self.validateMerchantConfiguration()\n        }, \"Merchant configuration is invalid\"),\n        \n        (\"iOS Version\", {\n            if #available(iOS 11.0, *) {\n                return true\n            } else {\n                return false\n            }\n        }, \"iOS 11.0 or later required\"),\n        \n        (\"Network Connectivity\", {\n            return await self.checkNetworkConnectivity()\n        }, \"Network connection required\")\n    ]\n    \n    var allPassed = true\n    print(\"=== Apple Pay Pre-flight Checks ===\")\n    \n    for (name, test, failureMessage) in checks {\n        let passed = await test()\n        print(\"\\(passed ? \"✅\" : \"❌\") \\(name): \\(passed ? \"PASSED\" : failureMessage)\")\n        if !passed {\n            allPassed = false\n        }\n    }\n    \n    return allPassed\n}\n\nprivate func validateMerchantConfiguration() -> Bool {\n    guard let merchantId = checkoutConfig.session.allowedFundingTypes.wallets?.applePay?.merchantId,\n          !merchantId.isEmpty,\n          merchantId.hasPrefix(\"merchant.\") else {\n        return false\n    }\n    \n    // Check entitlements\n    guard let entitlements = Bundle.main.entitlements,\n          let merchantIds = entitlements[\"com.apple.developer.in-app-payments\"] as? [String],\n          merchantIds.contains(merchantId) else {\n        return false\n    }\n    \n    return true\n}\n\nprivate func checkNetworkConnectivity() async -> Bool {\n    // Simple connectivity check\n    guard let url = URL(string: \"https://apple.com\") else { return false }\n    \n    do {\n        let (_, response) = try await URLSession.shared.data(from: url)\n        return (response as? HTTPURLResponse)?.statusCode == 200\n    } catch {\n        return false\n    }\n}\n\n// Use before initialisation\nfunc initializeApplePay() async {\n    let preflightPassed = await performPreflightChecks()\n    \n    if preflightPassed {\n        // Safe to initialise Apple Pay\n        do {\n            let applePayComponent = try ApplePayButtonComponent(\n                config: checkoutConfig,\n                componentConfig: applePayConfig\n            )\n            showApplePayButton(applePayComponent)\n        } catch {\n            showFallbackPaymentOptions()\n        }\n    } else {\n        // Show alternative payment methods\n        showFallbackPaymentOptions()\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"monitoring-and-alerting","__idx":28},"children":["Monitoring and alerting"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Error monitoring setup\nclass ApplePayErrorMonitor {\n    static func captureError(_ error: Error, context: [String: Any] = [:]) {\n        var errorData: [String: Any] = [\n            \"error_message\": error.localizedDescription,\n            \"error_type\": String(describing: type(of: error)),\n            \"device_model\": UIDevice.current.model,\n            \"ios_version\": UIDevice.current.systemVersion,\n            \"bundle_id\": Bundle.main.bundleIdentifier ?? \"Unknown\",\n            \"timestamp\": ISO8601DateFormatter().string(from: Date())\n        ]\n        \n        // Add context\n        errorData.merge(context) { _, new in new }\n        \n        // Add error-specific data\n        if let sdkError = error as? BaseSdkException {\n            errorData[\"error_code\"] = sdkError.userInfo[\"errorCode\"]\n            errorData[\"sdk_error\"] = true\n        }\n        \n        // Send to your error tracking service\n        print(\"📊 Error captured: \\(errorData)\")\n        // Example: Crashlytics.record(error: error, userInfo: errorData)\n    }\n    \n    static func trackApplePayEvent(_ eventType: String, data: [String: Any] = [:]) {\n        var eventData = data\n        eventData[\"event_type\"] = eventType\n        eventData[\"timestamp\"] = ISO8601DateFormatter().string(from: Date())\n        eventData[\"component\"] = \"ApplePay\"\n        \n        print(\"📈 Event tracked: \\(eventData)\")\n        // Send to your analytics service\n    }\n}\n\n// Integration with Apple Pay component\nlet config = ApplePayButtonComponentConfig()\n\nconfig.onError = { error in\n    ApplePayErrorMonitor.captureError(error, context: [\n        \"flow_step\": \"payment_authorization\",\n        \"merchant_id\": merchantId\n    ])\n}\n\nconfig.onPostAuthorisation = { result in\n    ApplePayErrorMonitor.trackApplePayEvent(\"payment_completed\", data: [\n        \"transaction_state\": result.state,\n        \"transaction_id\": result.transactionId ?? \"none\"\n    ])\n}\n\nconfig.onCancel = { error in\n    ApplePayErrorMonitor.trackApplePayEvent(\"payment_cancelled\", data: [\n        \"cancellation_reason\": error.localizedDescription\n    ])\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ios-specific-considerations","__idx":29},"children":["iOS-specific considerations"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ios-version-compatibility","__idx":30},"children":["iOS version compatibility"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// Check iOS version for feature availability\nfunc checkiOSFeatureAvailability() {\n    print(\"=== iOS Feature Availability ===\")\n    \n    if #available(iOS 11.0, *) {\n        print(\"✅ Basic Apple Pay (iOS 11.0+)\")\n    } else {\n        print(\"❌ Apple Pay requires iOS 11.0 or later\")\n        return\n    }\n    \n    if #available(iOS 15.0, *) {\n        print(\"✅ Coupon codes (iOS 15.0+)\")\n    } else {\n        print(\"⚠️ Coupon codes not available (requires iOS 15.0+)\")\n    }\n    \n    if #available(iOS 16.0, *) {\n        print(\"✅ Multi-merchant payments (iOS 16.0+)\")\n    } else {\n        print(\"⚠️ Multi-merchant payments not available (requires iOS 16.0+)\")\n    }\n    \n    if #available(iOS 17.0, *) {\n        print(\"✅ Disbursements (iOS 17.0+)\")\n    } else {\n        print(\"⚠️ Disbursements not available (requires iOS 17.0+)\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"device-specific-limitations","__idx":31},"children":["Device-specific limitations"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"func checkDeviceLimitations() {\n    print(\"=== Device limitations ===\")\n    \n    // Check if device supports Apple Pay\n    if PKPaymentAuthorizationController.canMakePayments() {\n        print(\"✅ Device supports Apple Pay\")\n    } else {\n        print(\"❌ Device does not support Apple Pay\")\n        return\n    }\n    \n    // Check available payment networks\n    let allNetworks: [PKPaymentNetwork] = [.visa, .masterCard, .amex, .discover, .maestro, .chinaUnionPay]\n    let availableNetworks = allNetworks.filter { network in\n        PKPaymentAuthorizationController.canMakePayments(usingNetworks: [network])\n    }\n    \n    print(\"Available payment networks: \\(availableNetworks)\")\n    \n    if availableNetworks.isEmpty {\n        print(\"⚠️ No payment cards configured in Wallet\")\n    }\n}\n","lang":"swift"},"children":[]}]},"headings":[{"value":"Troubleshooting","id":"troubleshooting","depth":1},{"value":"Exception types and error codes","id":"exception-types-and-error-codes","depth":2},{"value":"SDK exceptions","id":"sdk-exceptions","depth":3},{"value":"Error handling best practices","id":"error-handling-best-practices","depth":2},{"value":"Comprehensive error handler","id":"comprehensive-error-handler","depth":3},{"value":"Troubleshooting common issues","id":"troubleshooting-common-issues","depth":2},{"value":"Apple Pay button isn't showing","id":"apple-pay-button-isnt-showing","depth":3},{"value":"Diagnostic steps","id":"diagnostic-steps","depth":4},{"value":"Solutions","id":"solutions","depth":4},{"value":"Merchant validation failures","id":"merchant-validation-failures","depth":3},{"value":"Diagnostic steps","id":"diagnostic-steps-1","depth":4},{"value":"Solutions","id":"solutions-1","depth":4},{"value":"Verify the Apple Developer Console setup","id":"verify-the-apple-developer-console-setup","depth":5},{"value":"Enhanced validation before payment","id":"enhanced-validation-before-payment","depth":5},{"value":"Retry logic for transient failures","id":"retry-logic-for-transient-failures","depth":5},{"value":"Payment authorisation failures","id":"payment-authorisation-failures","depth":3},{"value":"Diagnostic steps","id":"diagnostic-steps-2","depth":4},{"value":"Solutions","id":"solutions-2","depth":4},{"value":"Enhanced validation","id":"enhanced-validation","depth":5},{"value":"Network error handling","id":"network-error-handling","depth":5},{"value":"Validation errors","id":"validation-errors","depth":3},{"value":"Diagnostic steps","id":"diagnostic-steps-3","depth":4},{"value":"Solutions","id":"solutions-3","depth":4},{"value":"Comprehensive validation helper","id":"comprehensive-validation-helper","depth":5},{"value":"Real-time validation feedback","id":"real-time-validation-feedback","depth":5},{"value":"Debugging tools and techniques","id":"debugging-tools-and-techniques","depth":2},{"value":"Prevention and best practices","id":"prevention-and-best-practices","depth":2},{"value":"Proactive error prevention","id":"proactive-error-prevention","depth":3},{"value":"Monitoring and alerting","id":"monitoring-and-alerting","depth":3},{"value":"iOS-specific considerations","id":"ios-specific-considerations","depth":2},{"value":"iOS version compatibility","id":"ios-version-compatibility","depth":3},{"value":"Device-specific limitations","id":"device-specific-limitations","depth":3}],"frontmatter":{"seo":{"title":"Troubleshooting"}},"lastModified":"2026-03-24T15:21:03.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/ios/apple-pay/troubleshooting","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}