{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","admonition"]},"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 fix common issues with the PayPal payout components on iOS."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"common-issues-and-solutions","__idx":1},"children":["Common issues and solutions"]},{"$$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":"Issue"},"children":["Issue"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Next steps"},"children":["Next steps"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout fails with SDK0809"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutPayerIdRequiredException"]}," - Payer ID is empty or missing."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify payer ID is passed in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPrePayoutSubmit"]}," result."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check account ID is not null or empty string."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Implement proper state management for account ID."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout fails with SDK0810"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutAmountInvalidException"]}," - Amount is NaN or infinite."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validate payout amount is a valid number."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check for division by zero in amount calculations."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure amount is properly formatted as Decimal."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify currency conversion logic if applicable."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout fails with SDK0811"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutAmountNotPositiveException"]}," - Amount must be greater than zero."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure payout amount is positive."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check for negative amounts from user input."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validate minimum payout amount ($1.00 USD)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Implement input validation before payout."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout fails with SDK0817"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutPayerIdMaxLengthException"]}," - Payer ID exceeds 13 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validate payer ID length before payout."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check if account ID was incorrectly formatted."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure you're using the correct identifier from PayPal."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Contact support if PayPal returns oversized IDs."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout fails with SDK0818"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutPayerIdInvalidException"]}," - Payer ID format is invalid."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify payer ID contains only alphanumeric characters."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check payer ID isn't corrupted or truncated."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure proper storage and retrieval of payer ID."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Try re-authenticating with PayPal."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout fails with SDK0819"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutFailedException"]}," - Payout transaction failed."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check PayPal Business account has sufficient funds."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify recipient PayPal account exists and is active."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check payout amount is within limits."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Review backend logs for detailed error from PayPal."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Retry the payout after addressing the underlying issue."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Button not rendering"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The PayPal payout button doesn't appear in the SwiftUI view."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify component is properly created and in view hierarchy."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check SwiftUI view provides adequate space (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".frame(height:)"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure component reference is stored in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@State"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check Console for component creation errors."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify SDK initialisation completed successfully."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["onPrePayoutSubmit not called"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The merchant approval callback isn't triggered before payout submission."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["This callback is ONLY called when ALL these conditions are met: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proceedPayoutWithSdk: true"]}," in PayPalConfig, user clicked the payout submission button, and all validation passed (amount, email, payer ID)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["This callback isn't called when: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proceedPayoutWithSdk: false"]}," (backend-managed mode), validation errors occurred before approval stage."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify no errors occurred before this callback."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["onPostPayout not called"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The payout completion callback isn't triggered after approval."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proceedPayoutWithSdk: true"]}," in PayPal config."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPrePayoutSubmit"]}," returned approval (not nil)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify payout execution didn't fail (check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check network connectivity during payout."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Network connectivity issues"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK fails to communicate with PayPal or Unity APIs."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check network reachability using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NWPathMonitor"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify internet connection is available."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Handle network errors in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," callback."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Implement retry logic for transient failures."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check for VPN or firewall blocking connections."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SSL/TLS certificate errors"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payout fails with SSL errors."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["**Never ignore SSL errors in production.**"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure device date/time is correct."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check certificate validity."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Test on physical device (simulator may behave differently)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify App Transport Security settings."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Memory issues"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["App crashes or becomes unresponsive during payout flow."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Monitor memory using Xcode Instruments."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check for memory leaks in closures."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure components are properly released."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Avoid retain cycles in callback closures."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["[weak self]"]}," in async callbacks."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SwiftUI state issues"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Component state is lost or doesn't update properly."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@State"]}," for component references."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Store SDK instance in appropriate scope."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@StateObject"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@ObservedObject"]}," if needed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure state updates happen on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["@MainActor"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check for proper state management in parent views."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Event callbacks not firing"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," or other callbacks aren't called."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify callbacks are defined in configuration."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check Console for error messages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure callbacks are not nil."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add logging to all callbacks to verify execution."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check SDK initialisation completed successfully."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Approval dialog issues"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The approval dialog in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPrePayoutSubmit"]}," doesn't work correctly."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure proper async/await handling with continuations."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckedContinuation"]}," is properly resumed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Don't resume continuation multiple times."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Handle edge cases (user dismisses dialog)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Test cancellation flow thoroughly."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Backend token exchange fails"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Authorization code exchange returns error."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify PayPal client credentials are correct."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check backend logs for specific error details."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify Unity API credentials are valid."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Backend \"Token expired\" error"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal access token has expired when attempting payout."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Implement automatic token refresh before expiry."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["PayPal access tokens expire after 9 hours."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Store token expiry time and refresh proactively."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Handle refresh token failures gracefully."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Backend \"Payout failed - account not found\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payout execution fails because PayPal account can't be found."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payer_id"]}," is correct."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure the PayPal account exists and is active."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check payer ID wasn't corrupted during storage/retrieval."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Backend \"Insufficient permissions\""]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Backend can't execute payouts due to permission issues."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure PayPal app has Payouts API enabled in Developer Dashboard."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify PayPal Business account is fully verified."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check PayPal account has sufficient balance for payouts."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Contact PayPal support if permissions are missing."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Simulator vs device differences"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payout flow works in simulator but fails on device (or vice versa)."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Always test on physical devices for production validation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check for simulator-specific configurations."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify code signing and entitlements."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check network conditions on device."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Review device Console logs."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["App Store rejection"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["App rejected due to PayPal payout integration issues."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure all required privacy descriptions in Info.plist."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Document payout functionality in review notes."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Provide test PayPal sandbox accounts for App Review."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Test in sandbox environment thoroughly."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure proper error handling for edge cases."]}]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"understanding-error-sources","__idx":2},"children":["Understanding error sources"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK can report errors from three different sources. Understanding the distinction helps diagnose issues faster."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"sdk-validation-errors-sdk08xx-sdk09xx","__idx":3},"children":["SDK validation errors (SDK08xx, SDK09xx)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These occur before any API call, during client-side validation:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Caught immediately in SDK"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Can be prevented with proper input validation"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Examples: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0809"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0810"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0811"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0817"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0818"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"unity-api-errors","__idx":4},"children":["Unity API errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These occur when communicating with the the Unity backend:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Session errors (expired, invalid)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Authentication errors"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Network connectivity issues"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Forwarded through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," callback with Unity error format"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"paypal-api-errors","__idx":5},"children":["PayPal API errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These occur during actual payout execution:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Wrapped in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0819"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutFailedException"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Original PayPal error included in message"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Examples: insufficient funds, invalid account, blocked recipient"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Error handling strategy:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import PXPCheckoutSDK\n\nonError: { error in\n    switch error.errorCode {\n    case \"SDK0809\", \"SDK0810\", \"SDK0811\", \"SDK0817\", \"SDK0818\":\n        // SDK validation error - fix input data\n        print(\"Validation error: \\(error.errorMessage)\")\n        \n    case \"SDK0819\":\n        // PayPal API error - check error message for details\n        print(\"Payout failed: \\(error.errorMessage)\")\n        // Message contains PayPal's error code and reason\n        \n    default:\n        // Could be Unity API error or other SDK error\n        print(\"Error: \\(error.errorCode) - \\(error.errorMessage)\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"additional-error-codes","__idx":6},"children":["Additional error codes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK includes additional validation error codes beyond those in the common issues table:"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payout-validation-errors","__idx":7},"children":["Payout validation errors"]},{"$$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":"Error code"},"children":["Error code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Exception"},"children":["Exception"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Solution"},"children":["Solution"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0803"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutReceiverRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receiver information is missing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ensure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayPalWallet.email"]}," is configured in SDK initialisation"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0804"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutReceiverTypeInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid receiver type"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".email"]}," recipient type for PayPal payouts"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0805"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutReceiverTypeEmailOnlyException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Non-email receiver type used"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal payouts only support email recipient type"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0806"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutWalletInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid wallet value"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".paypal"]}," wallet type"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0807"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutWalletRequiresEmailException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wallet type requires email"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ensure receiver type is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".email"]}," when using PayPal wallet"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK0808"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutEmailInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid email format"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validate email format before initialisation"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0812"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutAmountRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount is missing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ensure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransactionData.amount"]}," is provided"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0813"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutCurrencyRequiredException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency code is missing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provide valid currency code in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransactionData"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0814"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutCurrencyLengthInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency code not 3 characters"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use 3-letter ISO 4217 code (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EUR"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GBP"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0815"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayoutCurrencyCodeInvalidException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid ISO 4217 currency code"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use valid ISO 4217 currency code"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0816"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PaypalPayoutEmailMaxLengthException"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email exceeds 127 characters"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validate email length before initialisation"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"paypal-account-setup-issues","__idx":8},"children":["PayPal account setup issues"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payouts-not-enabled","__idx":9},"children":["\"Payouts not enabled\""]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your PayPal Business account doesn't have payout capability enabled."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Solution:"]}," Contact PayPal Support to enable payout capability for your business account. You may need to provide additional business verification documents."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"production-issues","__idx":10},"children":["Production issues"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"payout-failed-in-production-but-worked-in-sandbox","__idx":11},"children":["Payout failed in production but worked in sandbox"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Payouts work in sandbox environment but fail when switching to production."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Causes:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Live PayPal account not verified"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Insufficient funds in live account"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Payout limits exceeded"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Incorrect live credentials"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Solutions:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify your PayPal Business account is fully verified for live transactions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure sufficient funds in your PayPal Business account."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Contact PayPal to increase payout limits if needed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Double-check you're using live credentials (not sandbox)."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"webhooks-not-received-in-production","__idx":12},"children":["Webhooks not received in production"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Webhook events are delivered in sandbox but not in production."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Causes:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Webhook URL not publicly accessible"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["SSL certificate issues"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Firewall blocking PayPal requests"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Solutions:"]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify webhook URL is publicly accessible (not localhost)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure HTTPS with a valid SSL certificate."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check firewall rules allow requests from PayPal IP ranges."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Test with PayPal's webhook simulator in Developer Dashboard."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"logging-and-debugging","__idx":13},"children":["Logging and debugging"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To diagnose issues, enable comprehensive logging."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"console-logging","__idx":14},"children":["Console logging"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use Console.app or Xcode's console to view logs:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import PXPCheckoutSDK\n\nlet config = PayoutSubmissionComponentConfig(\n    buttonText: \"Submit Payout\",\n    \n    // Add verbose logging to callbacks\n    onClick: {\n        print(\"📱 PayPal payout button clicked\")\n    },\n    \n    onPrePayoutSubmit: {\n        print(\"💰 Pre-payout approval requested\")\n        // ... approval logic ...\n        return result\n    },\n    \n    onPostPayout: { result in\n        print(\"🎉 Payout successful!\")\n        print(\"   Merchant TX ID: \\(result.merchantTransactionId)\")\n        print(\"   System TX ID: \\(result.systemTransactionId)\")\n    },\n    \n    onCancel: {\n        print(\"❌ User cancelled payout flow\")\n    },\n    \n    onError: { error in\n        print(\"⚠️ Error occurred:\")\n        print(\"   Code: \\(error.errorCode)\")\n        print(\"   Message: \\(error.errorMessage)\")\n    }\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"console-filters","__idx":15},"children":["Console filters"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These are suggested filters. The actual subsystem/category names depend on the SDK's logging implementation."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To find actual log identifiers:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Run your app with the SDK integrated."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open Console.app."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Search for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PX"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PayPal"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Note the subsystem/category shown in log entries."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use those exact identifiers in your filters."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use Console.app filters to view specific logs:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"# PXP Checkout logs\nsubsystem:com.pxp.checkout\n\n# PayPal payout logs\nprocess:YourAppName AND payout\n\n# All SDK logs\ncategory:PXPCheckoutSDK\n\n# Example filter once you identify the subsystem:\nsubsystem:com.yourcompany.yourapp process:YourAppName\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"xcode-debugging","__idx":16},"children":["Xcode debugging"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Enable detailed logging in Xcode:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open your scheme by going to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Product > Scheme > Edit Scheme"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Run > Arguments"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add these environment variables:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["OS_ACTIVITY_MODE"]}," = ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disable"]}," (for cleaner logs)"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["IDEPreferLogStreaming"]}," = ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YES"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"useful-code-snippets","__idx":17},"children":["Useful code snippets"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"check-network-reachability","__idx":18},"children":["Check network reachability"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this network monitoring implementation before initiating payout flows or when diagnosing network-related errors. The payout SDK requires an active internet connection for payout execution."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import Network\nimport Combine\n\nclass NetworkMonitor: ObservableObject {\n    static let shared = NetworkMonitor()\n    private let monitor = NWPathMonitor()\n    private let queue = DispatchQueue(label: \"NetworkMonitor\")\n    \n    @Published private(set) var isConnected: Bool = false\n    @Published private(set) var connectionType: NWInterface.InterfaceType?\n    \n    private init() {}\n    \n    func startMonitoring() {\n        monitor.pathUpdateHandler = { [weak self] path in\n            DispatchQueue.main.async {\n                self?.isConnected = path.status == .satisfied\n                self?.connectionType = path.availableInterfaces.first?.type\n                \n                if path.status == .satisfied {\n                    print(\"✅ Network connected via \\(path.availableInterfaces.first?.type.debugDescription ?? \"unknown\")\")\n                } else {\n                    print(\"⚠️ Network disconnected\")\n                }\n            }\n        }\n        \n        monitor.start(queue: queue)\n    }\n    \n    func stopMonitoring() {\n        monitor.cancel()\n    }\n    \n    deinit {\n        stopMonitoring()\n    }\n}\n\n// Usage example:\nNetworkMonitor.shared.startMonitoring()\n\nif !NetworkMonitor.shared.isConnected {\n    showAlert(title: \"No Connection\", \n             message: \"Please check your internet connection and try again.\")\n    return\n}\n\n// Proceed with payout flow\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validate-payout-configuration","__idx":19},"children":["Validate payout configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Validate your payout configuration before creating components to catch errors early."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import PXPCheckoutSDK\n\nstruct PayoutValidationResult {\n    let isValid: Bool\n    let errors: [String]\n}\n\nfunc validatePayoutConfig(\n    amount: Decimal,\n    payerId: String?\n) -> PayoutValidationResult {\n    var errors: [String] = []\n    \n    // Validate amount\n    if amount.isNaN {\n        errors.append(\"Amount must be a valid number (SDK0810)\")\n    }\n    \n    if amount <= 0 {\n        errors.append(\"Amount must be greater than zero (SDK0811)\")\n    }\n    \n    if amount < 1.00 {\n        errors.append(\"Amount must be at least $1.00 (PayPal minimum)\")\n    }\n    \n    // Validate payer ID if provided\n    if let payerId = payerId {\n        if payerId.isEmpty {\n            errors.append(\"Payer ID cannot be empty (SDK0809)\")\n        }\n        \n        if payerId.count > 13 {\n            errors.append(\"Payer ID exceeds 13 characters (SDK0817)\")\n        }\n        \n        let alphanumericSet = CharacterSet.alphanumerics\n        if payerId.unicodeScalars.contains(where: { !alphanumericSet.contains($0) }) {\n            errors.append(\"Payer ID must be alphanumeric (SDK0818)\")\n        }\n    }\n    \n    return PayoutValidationResult(\n        isValid: errors.isEmpty,\n        errors: errors\n    )\n}\n\n// Usage example:\nlet validation = validatePayoutConfig(\n    amount: Decimal(100.00),\n    payerId: storedPayerId\n)\n\nif !validation.isValid {\n    print(\"❌ Validation errors: \\(validation.errors.joined(separator: \", \"))\")\n    showErrorDialog(validation.errors.first ?? \"Validation failed\")\n    return\n}\n\n// Proceed with payout\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"handle-approval-dialog-with-continuation","__idx":20},"children":["Handle approval dialog with continuation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Properly implement async approval dialogs using Swift continuations:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import SwiftUI\nimport PXPCheckoutSDK\n\nstruct PayoutView: View {\n    @State private var showApprovalAlert = false\n    @State private var pendingApprovalContinuation: CheckedContinuation<PrePayoutSubmitResult?, Never>?\n    @State private var storedPayerId: String?\n    \n    let payoutAmount = 100.00\n    \n    var body: some View {\n        VStack {\n            // ... payout UI ...\n        }\n        .alert(\"Confirm Payout\", isPresented: $showApprovalAlert) {\n            Button(\"Cancel\", role: .cancel) {\n                // User rejected - resume with nil\n                pendingApprovalContinuation?.resume(returning: nil)\n                pendingApprovalContinuation = nil\n            }\n            Button(\"Confirm\") {\n                // User approved - resume with approval result\n                pendingApprovalContinuation?.resume(returning: \n                    PrePayoutSubmitResult(\n                        isApproved: true,\n                        payerId: storedPayerId ?? \"\"\n                    )\n                )\n                pendingApprovalContinuation = nil\n            }\n        } message: {\n            Text(\"Send $\\(String(format: \"%.2f\", payoutAmount)) to your PayPal account?\")\n        }\n    }\n    \n    private func createPayoutComponent() {\n        let config = PayoutSubmissionComponentConfig(\n            buttonText: \"Submit Payout\",\n            \n            onPrePayoutSubmit: { [self] in\n                // Use withCheckedContinuation for async dialog\n                return await withCheckedContinuation { continuation in\n                    Task { @MainActor in\n                        self.pendingApprovalContinuation = continuation\n                        self.showApprovalAlert = true\n                    }\n                }\n            }\n        )\n        \n        // ... create component ...\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"debug-swiftui-view-hierarchy","__idx":21},"children":["Debug SwiftUI view hierarchy"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use these debugging extensions when components don't appear or layout issues occur:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"extension View {\n    func debugPrint(_ message: String) -> some View {\n        print(\"🔍 \\(message)\")\n        return self\n    }\n    \n    func debugBorder(_ color: Color = .red) -> some View {\n        self.border(color, width: 2)\n    }\n}\n\n// Usage example:\nstruct PayoutView: View {\n    var body: some View {\n        VStack {\n            if let component = payoutComponent {\n                component.buildContent()\n                    .frame(height: 50)\n                    .debugBorder(.red) // Visualise button area\n                    .debugPrint(\"Payout button rendered\")\n            } else {\n                Text(\"Loading...\")\n                    .debugPrint(\"Still loading component\")\n            }\n        }\n        .debugBorder(.blue) // Visualise container\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"handle-async-initialisation-errors","__idx":22},"children":["Handle async initialisation errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement proper error handling when SDK or component initialisation might fail:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import SwiftUI\nimport PXPCheckoutSDK\n\nstruct PayoutView: View {\n    @State private var payoutComponent: BaseComponent?\n    @State private var isLoading = true\n    @State private var errorMessage: String?\n    @State private var initTask: Task<Void, Never>?\n    \n    var body: some View {\n        VStack {\n            if isLoading {\n                ProgressView(\"Initialising...\")\n            } else if let error = errorMessage {\n                Text(\"Error: \\(error)\")\n                    .foregroundColor(.red)\n                Button(\"Retry\") {\n                    initTask = Task {\n                        await createPayoutComponent()\n                    }\n                }\n            } else if let component = payoutComponent {\n                component.buildContent()\n            }\n        }\n        .task {\n            await createPayoutComponent()\n        }\n        .onDisappear {\n            initTask?.cancel()\n        }\n    }\n    \n    @MainActor\n    private func createPayoutComponent() async {\n        isLoading = true\n        errorMessage = nil\n        \n        do {\n            // Initialise SDK\n            let checkoutConfig = CheckoutConfig(\n                environment: .test,\n                session: sessionData,\n                transactionData: transactionData,\n                merchantShopperId: \"user-123\",\n                ownerId: \"merchant-456\",\n                paypalConfig: paypalConfig\n            )\n            \n            let pxpCheckout = try PxpCheckout.initialize(config: checkoutConfig)\n            \n            // Create payout component\n            let config = PayoutSubmissionComponentConfig(\n                buttonText: \"Submit Payout\"\n            )\n            \n            let component = try pxpCheckout.create(\n                .payoutSubmission,\n                componentConfig: config\n            )\n            \n            self.payoutComponent = component\n            \n        } catch let error as NSError {\n            print(\"❌ Initialisation error: \\(error.localizedDescription)\")\n            print(\"Error domain: \\(error.domain)\")\n            print(\"Error code: \\(error.code)\")\n            print(\"Error userInfo: \\(error.userInfo)\")\n            \n            self.errorMessage = \"Failed to initialise payout: \\(error.localizedDescription)\"\n            \n            // Track error for analytics\n            logError(error)\n        }\n        \n        isLoading = false\n    }\n    \n    func logError(_ error: Error) {\n        // Log to your analytics/crash reporting service\n        print(\"📊 Logging error to analytics\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"track-payout-funnel-metrics","__idx":23},"children":["Track payout funnel metrics"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Monitor your payout funnel to identify drop-off points:"]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This example uses a placeholder ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Analytics"]}," class. Replace with your actual analytics service (Firebase Analytics, Mixpanel, Amplitude, or your custom service)."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"import PXPCheckoutSDK\n\n// Example with common analytics services:\n\n// Firebase Analytics:\n// Analytics.logEvent(\"payout_started\", parameters: [...])\n\n// Mixpanel:\n// Mixpanel.mainInstance().track(event: \"payout_started\", properties: [...])\n\n// Amplitude:\n// Amplitude.instance().logEvent(\"payout_started\", withEventProperties: [...])\n\n// Custom analytics service:\n// YourAnalyticsService.shared.trackEvent(name: \"payout_started\", properties: [...])\n\nlet config = PayoutSubmissionComponentConfig(\n    buttonText: \"Submit Payout\",\n    \n    onClick: {\n        Analytics.track(\"payout_started\", properties: [\n            \"timestamp\": Date().timeIntervalSince1970,\n            \"amount\": payoutAmount\n        ])\n    },\n    \n    onPrePayoutSubmit: {\n        Analytics.track(\"payout_approval_requested\", properties: [\n            \"timestamp\": Date().timeIntervalSince1970\n        ])\n        \n        let result = await showApprovalDialog()\n        \n        if result == nil {\n            Analytics.track(\"payout_approval_rejected\", properties: [\n                \"timestamp\": Date().timeIntervalSince1970\n            ])\n        } else {\n            Analytics.track(\"payout_approval_granted\", properties: [\n                \"timestamp\": Date().timeIntervalSince1970\n            ])\n        }\n        \n        return result\n    },\n    \n    onPostPayout: { result in\n        Analytics.track(\"payout_completed\", properties: [\n            \"transactionId\": result.merchantTransactionId,\n            \"timestamp\": Date().timeIntervalSince1970,\n            \"amount\": payoutAmount\n        ])\n    },\n    \n    onCancel: {\n        Analytics.track(\"payout_cancelled\", properties: [\n            \"timestamp\": Date().timeIntervalSince1970\n        ])\n    },\n    \n    onError: { error in\n        Analytics.track(\"payout_error\", properties: [\n            \"errorCode\": error.errorCode,\n            \"errorMessage\": error.errorMessage,\n            \"timestamp\": Date().timeIntervalSince1970\n        ])\n    }\n)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"testing-your-integration","__idx":24},"children":["Testing your integration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For comprehensive testing guidance including sandbox setup, test accounts, test scenarios, and moving to production, see the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/ios/paypal/payouts/testing"},"children":["Testing"]}," guide."]}]},"headings":[{"value":"Troubleshooting","id":"troubleshooting","depth":1},{"value":"Common issues and solutions","id":"common-issues-and-solutions","depth":2},{"value":"Understanding error sources","id":"understanding-error-sources","depth":2},{"value":"SDK validation errors (SDK08xx, SDK09xx)","id":"sdk-validation-errors-sdk08xx-sdk09xx","depth":3},{"value":"Unity API errors","id":"unity-api-errors","depth":3},{"value":"PayPal API errors","id":"paypal-api-errors","depth":3},{"value":"Additional error codes","id":"additional-error-codes","depth":2},{"value":"Payout validation errors","id":"payout-validation-errors","depth":3},{"value":"PayPal account setup issues","id":"paypal-account-setup-issues","depth":2},{"value":"\"Payouts not enabled\"","id":"payouts-not-enabled","depth":3},{"value":"Production issues","id":"production-issues","depth":2},{"value":"Payout failed in production but worked in sandbox","id":"payout-failed-in-production-but-worked-in-sandbox","depth":3},{"value":"Webhooks not received in production","id":"webhooks-not-received-in-production","depth":3},{"value":"Logging and debugging","id":"logging-and-debugging","depth":2},{"value":"Console logging","id":"console-logging","depth":3},{"value":"Console filters","id":"console-filters","depth":3},{"value":"Xcode debugging","id":"xcode-debugging","depth":3},{"value":"Useful code snippets","id":"useful-code-snippets","depth":2},{"value":"Check network reachability","id":"check-network-reachability","depth":3},{"value":"Validate payout configuration","id":"validate-payout-configuration","depth":3},{"value":"Handle approval dialog with continuation","id":"handle-approval-dialog-with-continuation","depth":3},{"value":"Debug SwiftUI view hierarchy","id":"debug-swiftui-view-hierarchy","depth":3},{"value":"Handle async initialisation errors","id":"handle-async-initialisation-errors","depth":3},{"value":"Track payout funnel metrics","id":"track-payout-funnel-metrics","depth":3},{"value":"Testing your integration","id":"testing-your-integration","depth":2}],"frontmatter":{"seo":{"title":"Troubleshooting"}},"lastModified":"2026-06-12T11:56:36.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/ios/paypal/payouts/troubleshooting","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}