{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","admonition"]},"type":"markdown"},"seo":{"title":"Data validation","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":"data-validation","__idx":0},"children":["Data validation"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn about built-in validation and implement additional scenarios for Paze on Android."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Paze component validates configuration, identity data, and transaction parameters before and during the payment flow. Validation runs at multiple stages:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Presentment:"]}," Session ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientId"]},", currency, client presentation settings, and optional identity fields when the component ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Content()"]}," is composed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Checkout:"]}," Identity re-validation, amount check, optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]}," length, and create-session request building."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Complete:"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantCategoryCode"]}," and complete-request fields when the SDK calls Paze complete."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Merchant callbacks:"]}," Optional approval gates via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If validation fails, the SDK surfaces a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseSdkException"]}," with a structured error code in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK12XX"]}," range. Most validation, checkout, and decrypt failures route to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". Authorisation submission failures route to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Missing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientId"]}," is detected at presentment as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1202"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"built-in-validation","__idx":2},"children":["Built-in validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK validates session configuration, presentation settings, and optional identity fields before checkout proceeds. By default, the Paze component checks that:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["allowedFundingTypes.wallets.paze.clientId"]}," is present in the session."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantCategoryCode"]}," is present in the session when the SDK builds the complete request."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The transaction currency is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When set, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientName"]}," is 50 characters or fewer."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When set, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["siteName"]}," (brand name) is 50 characters or fewer."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["When set, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentDescription"]}," (statement descriptor) is 25 characters or fewer at presentment."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Email addresses are valid RFC 5322-style format and 128 characters or fewer when provided (at presentment and again at checkout)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Phone numbers match ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," followed by 10 digits when provided (at presentment and again at checkout)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The transaction amount is greater than 0 at checkout."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]}," is 255 characters or fewer when set on the component config."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"presentment-and-forwarded-fields","__idx":3},"children":["Presentment and forwarded fields"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The button uses static presentment: it appears after presentment validation succeeds when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Content()"]}," is composed. Optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," are validated when provided and forwarded to the Paze create-session request. Both fields are optional but recommended when you have verified shopper identity."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["acceptedPaymentCardNetworks"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cobrand"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["acceptedShippingCountries"]}," are forwarded to create-session when set. For card networks, omitting the property, passing an empty list, or selecting all three supported networks (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VISA"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MASTERCARD"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DISCOVER"]},") sends no network filter to Paze."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.entryType"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EntryType.Ecom"]}," when initialising the SDK. Paze expects an e-commerce entry type on the authorisation request. The standalone Paze button component does not validate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["entryType"]}," at presentment — it is included on the transaction request after decryption. Checkout drop-in validates ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EntryType.Ecom"]}," separately (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1124"]},")."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"checkout-identity","__idx":4},"children":["Checkout identity"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Component identity (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]},") is passed to Paze during session creation when provided. Each field is validated independently when set. Identity is separate from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},", which supplies shopper data for Unity authorisation after decryption."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you set one or both identity fields, the SDK sends them to Paze as follows:"]},{"$$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":{"align":"left","data-label":"Configuration"},"children":["Configuration"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Sent to Paze"},"children":["Sent to Paze"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Email only"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Phone only"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Email and phone"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validation-error-codes","__idx":5},"children":["Validation error codes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Paze component returns structured error codes when built-in validation or flow checks fail:"]},{"$$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":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Common causes"},"children":["Common causes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1202"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session.allowedFundingTypes.wallets.paze.clientId"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paze ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientId"]}," not in session data at presentment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1202A"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session.allowedFundingTypes.wallets.paze.merchantCategoryCode"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["MCC not included in session when the SDK builds the complete request."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1203"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientName"]}," exceeds 50 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clientName"]}," on SDK initialisation is too long when set."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1204"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["siteName"]}," exceeds 50 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["siteName"]}," on SDK initialisation is too long when set."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1205"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentDescription"]}," exceeds 25 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Statement descriptor on component config is too long when set."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1209"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email address exceeds 128 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," value is too long."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1210"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email address format is invalid."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," is not a valid RFC 5322-style email address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1211"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Phone number exceeds 15 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," value is too long."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1212"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Phone number format is invalid."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," is not a US E.164 number without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1213"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Currency not supported."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction currency is not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1206"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Failed to initialize Paze SDK."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Create-session failure or missing checkout URL."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1200"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Failed to load Paze SDK."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom Tab launch failed."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1214"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paze checkout failed."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Generic checkout or wallet flow failure."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1215"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paze checkout did not return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["checkoutResponse"]}," for a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETE"]}," result."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing checkout response."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1216"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paze complete did not return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["completeResponse"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Missing complete response code."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1219"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paze ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["completeResponse"]}," did not contain ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["securedPayload"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Secured payload missing after complete."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1222"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]}," exceeds 255 characters."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Component ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sessionId"]}," is too long at checkout."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1229"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction amount invalid."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction amount is 0 or negative at checkout."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1231"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Invalid shipping country codes."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["acceptedShippingCountries"]}," contains codes that are not valid ISO 3166-1 alpha-2 values."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1232"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cobrand name required."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cobrand"]}," entry has an empty ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cobrandName"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1233"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Failed to decrypt Paze token."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Decrypt API error or invalid secured payload. Surfaced through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1235"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Paze transaction failed."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Authorisation request failed. Surfaced through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},", not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create-session and complete API provider errors may return provider-specific codes through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeProviderException"]},", not only the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK12XX"]}," values listed above. Map unknown codes using ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.message"]}," and your backend logs. Codes such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1231"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1232"]}," are defined in the SDK but are typically returned by the create-session API rather than thrown locally by the component."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"validation-example","__idx":6},"children":["Validation example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," to map SDK validation and flow errors to user-facing messages:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"config.onError = { error ->\n    when (error.errorCode) {\n        \"SDK1210\" -> showError(\"Please enter a valid email address.\")\n        \"SDK1212\" -> showError(\"Please enter a valid US phone number (e.g. 15551234567).\")\n        \"SDK1213\" -> showError(\"Paze is only available for USD transactions.\")\n        \"SDK1202\", \"SDK1202A\" -> showError(\"Paze is not configured for this session.\")\n        \"SDK1231\" -> showError(\"Invalid shipping country configuration.\")\n        \"SDK1232\" -> showError(\"Cobrand configuration is incomplete.\")\n        \"SDK1233\" -> showError(\"Payment token could not be processed. Please try again.\")\n        \"SDK1200\", \"SDK1214\" -> showError(\"Paze checkout failed. Please try again.\")\n        else -> showError(error.message ?: \"Payment could not be completed.\")\n    }\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"merchant-validation-gates","__idx":7},"children":["Merchant validation gates"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Beyond built-in SDK checks, you can add merchant-side approval gates at key points in the flow."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pre-checkout-validation","__idx":8},"children":["Pre-checkout validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Validate cart state, terms acceptance, and inventory before checkout by disabling the Paze button in your UI until pre-requisites are met. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPazeButtonClicked"]}," has no return value and can't cancel the flow; the SDK opens the Custom Tab as soon as the callback completes. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPazeButtonClicked"]}," only for non-blocking side effects such as analytics or clearing error messages."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To hard-block checkout after the shopper returns from Paze, return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"post-checkout-merchant-validation","__idx":9},"children":["Post-checkout merchant validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]}," to inspect checkout data and approve or reject before the SDK calls complete. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to treat the checkout as incomplete."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example approves checkout only after server-side validation succeeds:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"config.onCheckoutComplete = { result ->\n    val decoded = result.checkoutDecodedResponse ?: return@onCheckoutComplete false\n    return@onCheckoutComplete validateCheckoutOnBackend(\n        sessionId = decoded.sessionId,\n        cardLastFour = decoded.maskedCard.panLastFour,\n    )\n}\n\nconfig.onCheckoutIncomplete = { _ ->\n    showMessage(\"Payment was not completed. Please try again.\")\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pre-decryption-validation","__idx":10},"children":["Pre-decryption validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}," to control whether the SDK decrypts the secured payload. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to handle decryption on your backend. When omitted, the SDK defaults to decrypting."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}," and send the secured payload to your backend in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onComplete"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"config.onPreDecryption = { false }\n\nconfig.onComplete = { result ->\n    val securedPayload = result.completeDecodedResponse?.securedPayload ?: return@onComplete\n    sendToBackendForDecryption(securedPayload)\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pre-authorisation-validation","__idx":11},"children":["Pre-authorisation validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," to provide risk screening data or abort the transaction before submission. When you return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TransactionInitData(...)"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["riskScreeningData"]},", the SDK validates the Kount payload before submitting the transaction. Invalid risk screening data throws a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ValidationException"]}," surfaced through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example cancels authorisation when a fraud check fails, or passes Kount risk screening data when it passes:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"config.onPreAuthorisation = {\n    if (fraudCheckFailed()) {\n        PazePreAuthorisationResult.Cancel\n    } else {\n        PazePreAuthorisationResult.TransactionInitData(\n            PazeTransactionInitData(\n                riskScreeningData = RiskScreeningData(\n                    performRiskScreening = true,\n                    userIp = getUserIpAddress(),\n                ),\n            ),\n        )\n    }\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"identity-validation-rules","__idx":12},"children":["Identity validation rules"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK applies the following rules to optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," fields on the component config."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"email-address","__idx":13},"children":["Email address"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Email validation runs at presentment and again at checkout when the field is set:"]},{"$$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":{"align":"left","data-label":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Requirement"},"children":["Requirement"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Format"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Valid RFC 5322-style email address (format check uses trimmed value)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Maximum length"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["128 characters (checked before trimming)"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Timing"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Optional; validated at presentment and again at checkout when provided"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"phone-number","__idx":14},"children":["Phone number"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Phone validation runs at presentment and again at checkout when the field is set:"]},{"$$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":{"align":"left","data-label":"Rule"},"children":["Rule"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Requirement"},"children":["Requirement"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Format"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["US number without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+"]}," prefix: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," followed by exactly 10 digits (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["^1\\d{10}$"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Valid length"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Exactly 11 characters (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["15551234567"]},")"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Maximum length"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["15 characters. Values longer than 15 throw ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1211"]}," before format validation"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Timing"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Optional; validated at presentment and again at checkout when provided"]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Phone numbers must not include the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+"]}," prefix or formatting characters. Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["15551234567"]},", not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+1 (555) 123-4567"]},"."]}]}]},"headings":[{"value":"Data validation","id":"data-validation","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Built-in validation","id":"built-in-validation","depth":2},{"value":"Presentment and forwarded fields","id":"presentment-and-forwarded-fields","depth":3},{"value":"Checkout identity","id":"checkout-identity","depth":3},{"value":"Validation error codes","id":"validation-error-codes","depth":3},{"value":"Validation example","id":"validation-example","depth":3},{"value":"Merchant validation gates","id":"merchant-validation-gates","depth":2},{"value":"Pre-checkout validation","id":"pre-checkout-validation","depth":3},{"value":"Post-checkout merchant validation","id":"post-checkout-merchant-validation","depth":3},{"value":"Pre-decryption validation","id":"pre-decryption-validation","depth":3},{"value":"Pre-authorisation validation","id":"pre-authorisation-validation","depth":3},{"value":"Identity validation rules","id":"identity-validation-rules","depth":2},{"value":"Email address","id":"email-address","depth":3},{"value":"Phone number","id":"phone-number","depth":3}],"frontmatter":{"seo":{"title":"Data validation"}},"lastModified":"2026-07-01T15:11:56.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/android/paze/data-validation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}