{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","admonition","tabs","tab","json-example"]},"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"},"dynamicMarkdocComponents":["openapi"],"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 Drop-in integration in sandbox before enabling live withdrawals."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["test"]}," environment with sandbox Unity configuration, sandbox API credentials, and test shoppers that already have eligible stored payout instruments. Backend reconciliation tests are required even in sandbox: treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," as submission acknowledgement, not settlement."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"use-the-test-environment","__idx":2},"children":["Use the test environment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Initialise Drop-in against the test environment:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"PayoutDropIn.initialize({\n  environment: 'test',\n  // ... rest of config\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["What the test environment gives you:"]},{"$$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":"Point"},"children":["Point"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Detail"},"children":["Detail"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No live funds"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sandbox withdrawals follow test provider rules for your test site."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Same SDK behaviour"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Method detection, filtering, and callbacks match live behaviour."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Credentials"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Use inbound test tokens and the test Client ID from the Unity Portal."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Instruments"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Prepare test shoppers with eligible stored cards, PayPal associations, or wallet device tokens."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Switch to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["environment: 'live'"]}," only after completing the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#pre-production-checklist"},"children":["pre-production checklist"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"prepare-stored-instruments","__idx":3},"children":["Prepare stored instruments"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Prepare instruments with your platform's approved sandbox flows before mounting Drop-in, for example:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Tokenise cards through a payment flow or vault onboarding that stores plain-card tokens for the test shopper."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Link PayPal accounts with your sandbox linking journey (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["activeStatus: Active"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recipientWallet: Paypal"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Vault Apple Pay or Google Pay device tokens (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["panType: Device"]},") through a supported wallet payment or onboarding flow."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Document test shopper IDs and instrument IDs in your team runbook."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For card, the payout session must include ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allowedFundingTypes.cards"]}," (including an empty array). ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardSchemes"]}," alone doesn't enable card in this Drop-in."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"integration-test-scenarios","__idx":4},"children":["Integration test scenarios"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run these scenarios in an approved test environment."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"happy-paths","__idx":5},"children":["Happy paths"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"card","__idx":6},"children":["Card"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The session includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allowedFundingTypes.cards"]},". The shopper has a non-expired plain-card token."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Steps"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The authenticated shopper opens the payout page."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The backend creates a payout session with matching amount and currency."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Drop-in mounts and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Card"]}," appears."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the stored card and submit."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["If configured, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBeforeSubmit"]}," runs first, then ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]},", then ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payoutMethod: 'Card'"]},". Backend verification succeeds."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"paypal","__idx":7},"children":["PayPal"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The session allows ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["wallets.paypal"]},". The shopper has an active PayPal wallet association."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Steps"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Mount Drop-in with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Confirm ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PayPal"]}," shows the linked email."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Submit the payout."]}]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payoutMethod: 'Paypal'"]},". ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBeforeSubmit"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]}," aren't called for this panel."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"apple-pay-or-google-pay","__idx":8},"children":["Apple Pay or Google Pay"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The session allows the wallet. The shopper has a matching device token (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["walletType: ApplePay"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GooglePay"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["panType: Device"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The method appears with filtered tokens. Submit reaches ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]},", or fails with a clear ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1703"]}," if the provider rejects the payout."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"no-methods-available","__idx":9},"children":["No methods available"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The session allows one or more methods, but the shopper has no eligible tokens and no active PayPal link."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Methods stay hidden. After mount, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," receives ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1701"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configuration-failure","__idx":10},"children":["Configuration failure"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payout Drop-in is disabled for the site, the environment is wrong, or configuration retrieval fails."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1700"]},", error shell in the container, and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," invoked. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["create()"]}," usually settles without throwing."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onbeforesubmit-cancellation","__idx":11},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBeforeSubmit"]}," cancellation"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card, Apple Pay, or Google Pay with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBeforeSubmit"]}," returning ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No payout submission, no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]},", and no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]},". The UI remains usable for another attempt."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ongetshopper-rejection","__idx":12},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," rejection"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The callback throws or rejects (e.g., due to an unauthenticated shopper)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["create()"]}," promise rejects. Handle this outside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"blacklist","__idx":13},"children":["Blacklist"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["methodConfig"]}," blacklists the shopper's only card token, or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["blacklistedPayerId"]}," matches the linked PayPal payer."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["That method is hidden. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1701"]}," if no other methods remain."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"amount-or-session-mismatch","__idx":14},"children":["Amount or session mismatch"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Setup"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The frontend ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.amount"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["currency"]}," differs from the values used to create the session."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A provider or API rejection, often ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1703"]},". Keep the session creation and SDK ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData"]}," aligned on the server."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"destroy-and-remount","__idx":15},"children":["Destroy and remount"]},{"$$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":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Steps"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Mount Drop-in, leave the page calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["destroy()"]},", then remount."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Expect"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No duplicate UI and no stale listeners."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"test-error-handling","__idx":16},"children":["Test error handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Force these failure modes and confirm the expected client behaviour:"]},{"$$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":"Technique"},"children":["Technique"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Expected result"},"children":["Expected result"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Provider decline (if your sandbox can force one)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1703"]}," through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". Show a shopper-safe message, and inspect ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["message"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Expired token in vault"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The token is filtered out. The method may disappear."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Offline network during ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["create()"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A mount failure or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1700"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing session ID or HMAC key"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A synchronous throw from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initialize()"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal association inactive or missing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PayPal is hidden. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1701"]}," is possible if nothing else remains."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify loading overlays clear on both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". For PayPal, drive loading from those callbacks because ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]}," doesn't run."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"test-backend-verification","__idx":17},"children":["Test backend verification"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Always verify payouts on your backend before marking withdrawals complete. Frontend callbacks can be manipulated."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use merchant transaction webhooks (or the Transactions API) as the source of truth. A successful payout webhook looks like this:"]},{"$$mdtype":"Tag","name":"Tabs","attributes":{"size":"medium"},"children":[{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"PayPal","disable":false},"children":[{"$$mdtype":"Tag","name":"JsonExample","attributes":{"json":{"eventDate":"2025-12-16T07:37:11.1613200Z","eventCategory":"transaction","eventData":{"state":"Authorised","amount":{"transaction":100,"currencyCode":"USD"},"transactionMethod":"Payout","merchant":"merchant-1","site":"site-1","merchantTransactionDate":"2025-12-16T07:37:11.1613200Z","merchantTransactionId":"PAYOUT_001","systemTransactionId":"787ebfee-c0ce-497a-82c3-265d1bf19b0c","providerTransactionId":"PAYPAL_PAYOUT_ITEM_ID","fundingData":{"paypal":{"paymentSource":"Paypal"}}}},"errors":[]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Card","disable":false},"children":[{"$$mdtype":"Tag","name":"JsonExample","attributes":{"json":{"eventDate":"2025-12-16T07:37:11.1613200Z","eventCategory":"transaction","eventData":{"state":"Authorised","amount":{"transaction":50,"currencyCode":"USD"},"transactionMethod":"Payout","merchant":"merchant-1","site":"site-1","merchantTransactionDate":"2025-12-16T07:37:11.1613200Z","merchantTransactionId":"CARD-PAYOUT-001","systemTransactionId":"a1b2c3d4-e5f6-7890-abcd-ef1234567890","fundingData":{"card":{"cardScheme":"Visa","gatewayTokenId":"1ed768bb-e88a-4636-91ae-67927ccbb03a","schemeTokenNumber":"4837261112345678"}}}},"errors":[]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Apple Pay","disable":false},"children":[{"$$mdtype":"Tag","name":"JsonExample","attributes":{"json":{"eventDate":"2025-12-16T07:37:11.1613200Z","eventCategory":"transaction","eventData":{"state":"Authorised","amount":{"transaction":40,"currencyCode":"USD"},"transactionMethod":"Payout","merchant":"merchant-1","site":"site-1","merchantTransactionDate":"2025-12-16T07:37:11.1613200Z","merchantTransactionId":"APPLEPAY-PAYOUT-001","systemTransactionId":"b2c3d4e5-f6a7-8901-bcde-f12345678901","fundingData":{"card":{"cardScheme":"Mastercard","gatewayTokenId":"2fd879cc-f99b-4747-92bf-78038ddcc03c","schemeTokenNumber":"5200820000000010"}}}},"errors":[]},"children":[]}]},{"$$mdtype":"Tag","name":"TabItemFragment","attributes":{"label":"Google Pay","disable":false},"children":[{"$$mdtype":"Tag","name":"JsonExample","attributes":{"json":{"eventDate":"2025-12-16T07:37:11.1613200Z","eventCategory":"transaction","eventData":{"state":"Authorised","amount":{"transaction":40,"currencyCode":"USD"},"transactionMethod":"Payout","merchant":"merchant-1","site":"site-1","merchantTransactionDate":"2025-12-16T07:37:11.1613200Z","merchantTransactionId":"GOOGLEPAY-PAYOUT-001","systemTransactionId":"c3d4e5f6-a7b8-9012-cdef-123456789012","fundingData":{"card":{"cardScheme":"Visa","gatewayTokenId":"3ae98add-0aac-4858-a3c0-89149eeed14d","schemeTokenNumber":"4111111111111111"}}}},"errors":[]},"children":[]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Essential checks:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Transaction exists:"]}," Confirm the record for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]}," (or each ID in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payouts"]}," for closed-loop)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Amount and currency:"]}," Match the authorised withdrawal."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Merchant transaction ID:"]}," Match your internal record."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Idempotency:"]}," Duplicate webhook or callback delivery doesn't double-pay."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Payout state:"]}," Accept only successful states defined for your programme (the documented examples use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorised"]},")."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Example backend verification handler:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"app.post('/api/verify-payout', async (req, res) => {\n  const { systemTransactionId, merchantTransactionId } = req.body;\n  const withdrawal = await db.withdrawals.findOne({ merchantTransactionId });\n  const transaction = await unityApi.getTransaction(systemTransactionId);\n\n  if (!withdrawal || !transaction) {\n    return res.json({ success: false });\n  }\n\n  if (await db.processedTx.exists({ systemTransactionId })) {\n    return res.json({\n      success: true,\n      withdrawalId: withdrawal.id,\n      duplicate: true,\n    });\n  }\n\n  // Use successful payout states from your Payout API documentation\n  if (!isSuccessfulPayoutState(transaction.state)) {\n    return res.json({ success: false, error: 'Invalid state' });\n  }\n\n  if (transaction.amounts.transactionValue !== withdrawal.amount) {\n    return res.json({ success: false, error: 'Amount mismatch' });\n  }\n\n  if (transaction.amounts.currencyCode !== withdrawal.currency) {\n    return res.json({ success: false, error: 'Currency mismatch' });\n  }\n\n  await markWithdrawalPaid(withdrawal.id);\n  await db.processedTx.insert({ systemTransactionId });\n\n  res.json({ success: true, withdrawalId: withdrawal.id });\n});\n","lang":"javascript"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Confirm acceptable payout states for each method you enable. Don't treat card payment-capture states such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Captured"]}," as universal payout success. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/get-started/manage-webhooks"},"children":["Manage webhooks"]}," for subscription and signature validation."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"test-analytics","__idx":18},"children":["Test analytics"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["With ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["analyticsEvent"]}," registered:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Initialise Drop-in: expect ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DeviceType"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BrowserData"]}," once."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Force a reproducible component failure in QA: expect ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}," where applicable."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Verify analytics payloads exclude secrets (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hmacKey"]},", inbound tokens, wallet JWTs, full card tokens). See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/payout/drop-in/web/analytics"},"children":["Analytics"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"pre-production-checklist","__idx":19},"children":["Pre-production checklist"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before going live, verify the following."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configuration","__idx":20},"children":["Configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Confirm live configuration before cutover:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Production builds use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["environment: 'live'"]}," only."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Production inbound tokens and Client ID stay on the server."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Correct merchant group ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ownerId"]}," for token vault lookups."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Payout Drop-in enabled on the live site with the intended methods."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Live sessions use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["serviceType: 'PayoutDropIn'"]}," and intent ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Payout"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"functional-testing","__idx":21},"children":["Functional testing"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Confirm these functional paths in sandbox or a controlled live dry run:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Each enabled method tested with eligible stored instruments."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Empty-state path tested (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1701"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Configuration failure path understood (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1700"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onBeforeSubmit"]}," returning ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," tested for card-on-file methods."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["PayPal path tested without assuming ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Destroy and remount leaves a clean UI."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"security","__idx":22},"children":["Security"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Confirm these security controls are in place:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Backend verification before marking withdrawals complete."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Replay protection on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["HTTPS on payout pages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["No secrets or full instrument payloads in client logs."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"user-experience","__idx":23},"children":["User experience"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Confirm the shopper experience before go-live:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Mobile layout verified."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Loading and disabled states during submit."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Post-verification confirmation page."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Shopper-safe error copy. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/payout/drop-in/web/error-handling"},"children":["Error handling"]},"."]}]}]},"headings":[{"value":"Testing","id":"testing","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Use the test environment","id":"use-the-test-environment","depth":2},{"value":"Prepare stored instruments","id":"prepare-stored-instruments","depth":2},{"value":"Integration test scenarios","id":"integration-test-scenarios","depth":2},{"value":"Happy paths","id":"happy-paths","depth":3},{"value":"Card","id":"card","depth":4},{"value":"PayPal","id":"paypal","depth":4},{"value":"Apple Pay or Google Pay","id":"apple-pay-or-google-pay","depth":4},{"value":"No methods available","id":"no-methods-available","depth":3},{"value":"Configuration failure","id":"configuration-failure","depth":3},{"value":"onBeforeSubmit cancellation","id":"onbeforesubmit-cancellation","depth":3},{"value":"onGetShopper rejection","id":"ongetshopper-rejection","depth":3},{"value":"Blacklist","id":"blacklist","depth":3},{"value":"Amount or session mismatch","id":"amount-or-session-mismatch","depth":3},{"value":"Destroy and remount","id":"destroy-and-remount","depth":3},{"value":"Test error handling","id":"test-error-handling","depth":2},{"value":"Test backend verification","id":"test-backend-verification","depth":2},{"value":"Test analytics","id":"test-analytics","depth":2},{"value":"Pre-production checklist","id":"pre-production-checklist","depth":2},{"value":"Configuration","id":"configuration","depth":3},{"value":"Functional testing","id":"functional-testing","depth":3},{"value":"Security","id":"security","depth":3},{"value":"User experience","id":"user-experience","depth":3}],"frontmatter":{"seo":{"title":"Testing"}},"lastModified":"2026-11-12T15:20:37.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/payout/drop-in/web/testing","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}