{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading"]},"type":"markdown"},"seo":{"title":"Testing","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":"testing","__idx":0},"children":["Testing"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Test your payout integration end-to-end before going live."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"before-you-start","__idx":1},"children":["Before you start"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Complete ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paypal/payouts/onboarding"},"children":["PayPal payouts onboarding"]}," for sandbox."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Implement the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paypal/payouts/withdrawal-flow"},"children":["withdrawal flow"]},"."]}]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Review ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paypal/payouts/how-it-works"},"children":["How it works"]}," so you understand flows and payout modes."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-1-configure-sandbox-environment","__idx":2},"children":["Step 1: Configure sandbox environment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["test"]}," environment and sandbox credentials for both SDK and backend."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { PxpCheckout, IntentType, CurrencyType } from \"@pxpio/web-components-sdk\";\n\nconst pxpCheckoutSdk = PxpCheckout.initialize({\n  environment: \"test\",  // Use test environment\n  session: sessionData,\n  ownerId: \"Unity\",\n  ownerType: \"MerchantGroup\",\n  transactionData: {\n    amount: 100,\n    currency: \"USD\" as CurrencyType,\n    entryType: \"Ecom\",\n    intent: {\n      paypal: IntentType.Payout\n    },\n    merchantTransactionId: crypto.randomUUID(),\n    merchantTransactionDate: () => new Date().toISOString()\n  },\n  paypalConfig: {\n    payoutConfig: {\n      proceedPayoutWithSdk: true\n      // Add paypalWallet / venmoWallet for withdrawal flow tests\n    }\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const config = {\n  paypal: {\n    clientId: process.env.PAYPAL_SANDBOX_CLIENT_ID,\n    secret: process.env.PAYPAL_SANDBOX_SECRET,\n    apiBaseUrl: 'https://api-m.sandbox.paypal.com'\n  },\n  unity: {\n    apiBaseUrl: 'https://api-services-test.pxp.io',\n    clientId: process.env.UNITY_TEST_CLIENT_ID,\n    tokenId: process.env.UNITY_TEST_TOKEN_ID,\n    tokenValue: process.env.UNITY_TEST_TOKEN_VALUE\n  }\n};\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-2-test-core-happy-paths","__idx":3},"children":["Step 2: Test core happy paths"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Focus first on the main customer journeys."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"withdrawal-flow-returning-customers--paypal","__idx":4},"children":["Withdrawal flow (returning customers – PayPal)"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Initialise the SDK with a stored PayPal wallet (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paypalWallet.email"]}," and optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payerId"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Render ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payout-amount"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paypal-payout-receiver"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payout-submission"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Amount and receiver are correctly displayed (including masking behaviour)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Clicking ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Withdraw with PayPal"]}," triggers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPrePayoutSubmit"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Successful approval results in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostPayout"]}," being called and the sandbox recipient balance increasing."]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"withdrawal-flow-returning-customers--venmo","__idx":5},"children":["Withdrawal flow (returning customers – Venmo)"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Initialise the SDK with a Venmo wallet (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["venmoWallet.receiver"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recipientType"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Render ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["venmo-payout-receiver"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payout-submission"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recipientWallet: \"Venmo\""]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify the Venmo receiver displays correctly and a payout in USD completes successfully."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"sdk-initiated-vs-merchant-initiated","__idx":6},"children":["SDK-initiated vs merchant-initiated"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["With ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proceedPayoutWithSdk: true"]},", confirm the SDK executes the payout after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPrePayoutSubmit"]}," approves and calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostPayout"]}," with a transaction ID."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["With ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proceedPayoutWithSdk: false"]},", confirm:",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["SDK validates inputs and calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPrePayoutSubmit"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Your backend receives the necessary data and successfully calls the payout API."]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"minimal-test-checklist","__idx":7},"children":["Minimal test checklist"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this as a lightweight “must-have” list before going live:"]},{"$$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":"Area"},"children":["Area"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Scenario"},"children":["Scenario"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"What to verify"},"children":["What to verify"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Withdrawal flow (PayPal)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Returning customer payout"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Stored PayPal wallet is shown (including masking), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPrePayoutSubmit"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostPayout"]}," fire, and sandbox balance increases."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Withdrawal flow (Venmo)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Returning customer Venmo payout (USD)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Venmo receiver displays correctly, payout in USD succeeds, and Venmo-specific validation works."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Validation & errors"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid amount / email / Venmo phone"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," receives the right ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ErrorCode"]},", and the UI shows clear, user-friendly messages."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integration"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK- vs merchant-initiated payouts"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["proceedPayoutWithSdk"]}," modes behave as expected, and backend payout execution works when SDK is not executing the payout."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-3-test-validation-and-error-handling","__idx":8},"children":["Step 3: Test validation and error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use targeted negative tests rather than exhaustively covering every error code."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Amounts"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Negative or zero amount → expect amount validation error (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paypal/payouts/data-validation"},"children":["Data validation"]},")."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PayPal receiver"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Invalid email format or missing payer ID → expect PayPal receiver errors."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Venmo"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Non-USD currency with Venmo wallet → expect Venmo currency error."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Invalid phone format when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recipientType: \"Phone\""]}," → expect phone validation error."]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Configuration"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Missing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recipientWallet"]}," or wallet details → expect payout configuration errors."]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In each case, verify that:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," is called with the appropriate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ErrorCode"]}," and message."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Your UI maps technical errors to clear, user-friendly messages."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-4-test-ui-and-events","__idx":9},"children":["Step 4: Test UI and events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify that core components render and behave as expected:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payout-amount"]},": correct amount, currency, and custom label/styling."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paypal-payout-receiver"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["venmo-payout-receiver"]},": masking toggle, labels, and styles."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payout-submission"]},":",{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Button states (default, hover, disabled, loading)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Event callbacks: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onClick"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPrePayoutSubmit"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostPayout"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},"."]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For detailed callback payloads, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paypal/payouts/events"},"children":["Events"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"step-5-moving-to-production","__idx":10},"children":["Step 5: Moving to production"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once your sandbox tests pass:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Switch environments"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const pxpCheckoutSdk = PxpCheckout.initialize({\n  environment: \"production\",\n  // ... rest of config\n});\n","lang":"typescript"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Update backend credentials"]}," to use live PayPal and Unity endpoints and secrets."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Run a small live test"]}," (for example, a $1 payout to your own PayPal account) and confirm funds, reporting, and reconciliation."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enable monitoring"]}," (error tracking, alerts on payout failures, webhook monitoring) and roll out gradually if needed."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you hit issues during testing, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paypal/payouts/troubleshooting"},"children":["Troubleshooting"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/web/paypal/payouts/data-validation"},"children":["Data validation"]}," for common problems and error codes."]}]},"headings":[{"value":"Testing","id":"testing","depth":1},{"value":"Before you start","id":"before-you-start","depth":2},{"value":"Step 1: Configure sandbox environment","id":"step-1-configure-sandbox-environment","depth":2},{"value":"Step 2: Test core happy paths","id":"step-2-test-core-happy-paths","depth":2},{"value":"Withdrawal flow (returning customers – PayPal)","id":"withdrawal-flow-returning-customers--paypal","depth":3},{"value":"Withdrawal flow (returning customers – Venmo)","id":"withdrawal-flow-returning-customers--venmo","depth":3},{"value":"SDK-initiated vs merchant-initiated","id":"sdk-initiated-vs-merchant-initiated","depth":3},{"value":"Minimal test checklist","id":"minimal-test-checklist","depth":3},{"value":"Step 3: Test validation and error handling","id":"step-3-test-validation-and-error-handling","depth":2},{"value":"Step 4: Test UI and events","id":"step-4-test-ui-and-events","depth":2},{"value":"Step 5: Moving to production","id":"step-5-moving-to-production","depth":2}],"frontmatter":{"seo":{"title":"Testing"}},"lastModified":"2026-02-26T12:14:32.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/web/paypal/payouts/testing","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}