{"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 how the Aeropay component validates configuration, shopper details, OTPs, users, and transactions."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Aeropay component validates data at several stages of the payment or payout flow:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Component creation:"]}," Validates the session funding configuration, transaction intent, entry type, and currency."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Button tap:"]}," Runs optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCustomValidation"]},", then validates shopper details if ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," is configured and returns values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Consumer data collection:"]}," Requires valid first name, last name, email address, and phone number values."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OTP verification:"]}," Requires a six-digit code and handles provider verification failures."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Returning-shopper lookup:"]}," Confirms that ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}," belongs to an active Aeropay user."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Transaction submission:"]}," Lets you approve or stop the transaction through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]},", then reports failures only if submission is attempted."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["How you receive an error depends on the validation stage:"]},{"$$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":"Stage"},"children":["Stage"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error behaviour"},"children":["Error behaviour"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Component creation"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["checkout.createComponent()"]}," throws an SDK exception."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom validation returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The flow stops and the popup doesn't open. No SDK error is raised."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shopper data returned by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The component calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1300"]}," and doesn't open the popup."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Consumer form or OTP input"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The component shows an inline validation message and prevents progression."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aeropay user, bank, or provider validation"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Recognised account and provider-processing failures call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},", and often show popup feedback."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction submission"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["After an attempted submission returns a failed response, the component calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},". Returning ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," or omitting ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," stops before Unity submission; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]}," isn't called."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"aeropay-runtime-error-codes","__idx":2},"children":["Aeropay runtime error codes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Aeropay component maps recognised runtime failures to these SDK codes:"]},{"$$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":"Runtime failure"},"children":["Runtime failure"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Behaviour"},"children":["Behaviour"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1300"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Shopper data returned by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," is invalid."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and prevents the popup from opening. Inspect ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.details"]}," for field keys and localised validation messages."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1301"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aeropay user creation fails with a recognised API failure response."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Always calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". Inline or alert feedback in the popup is shown only when the popup is already open (or when create-user fails on the consumer data screen inside the popup)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1302"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aeropay user verification fails with a recognised API failure response."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". Provider code ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AP112"]}," still surfaces as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1302"]},"; the SDK doesn't currently change OTP UI state for a dedicated max-attempts mode."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1303"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK can't parse a valid account-linking payload from the Aerosync success result."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and shows account-linking feedback in the popup."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1304"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Aerosync widget flow fails."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and emits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AerosyncFailed"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1305"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Linking the selected bank account fails with a recognised API failure response."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and shows account-linking feedback in the popup."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1306"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Retrieving linked bank accounts fails with a recognised API failure response."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and shows bank-account feedback in the popup."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1307"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Aeropay user exists but isn't active."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and stops the returning-shopper flow."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1308"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Retrieving the Aeropay user fails with a recognised API failure response."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and stops the returning-shopper flow."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1311"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK can't launch Aerosync because no host Activity is available."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$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":["SDK1319"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aeropay aggregator credentials lookup fails with a recognised API failure response."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$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":["SDK1326"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unity transaction submission returns a failed response that maps to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]}," and emits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}," analytics with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1326"]},". Doesn't call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". Network or transport failures also call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},", but their analytics error code can differ."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1301"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1302"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1305"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1306"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1308"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1319"]}," apply to recognised API or provider failure responses. Network or transport errors on the same operations call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0500"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0000"]}," instead."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"component-creation-validation","__idx":3},"children":["Component creation validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before creating the Aeropay button, the SDK checks that:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.intent.aeropay"]}," is present."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session.allowedFundingTypes.payByBanks.aeropay.externalMerchantId"]}," is present and non-blank."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session.allowedFundingTypes.payByBanks.aeropay.configurationId"]}," is present and non-blank."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.entryType"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EntryType.Ecom"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.currency"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"USD\""]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The supported Aeropay intents are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Authorisation"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Purchase"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EstimatedAuthorisation"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Payout"]},". In Kotlin these values are represented by the sealed ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AeropayIntentType"]}," class."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Catch creation errors around ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createComponent()"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"import com.pxp.checkout.types.ComponentType\nimport com.pxp.checkout.components.aeropaybutton.types.AeropayButtonComponentConfig\nimport com.pxp.checkout.exceptions.BaseSdkException\n\ntry {\n    val aeropayButton = checkout.createComponent(\n        ComponentType.AERO_PAY_BUTTON,\n        AeropayButtonComponentConfig().apply {\n            // Required for payment submission — return true to proceed.\n            // If omitted or returns false, the SDK does not submit.\n            onPreAuthorisation = { true }\n        },\n    )\n} catch (error: BaseSdkException) {\n    // Inspect error.errorCode and error.message\n    showAlternativePaymentMethods()\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Creation validation can produce these errors:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Error code"},"children":["Error code"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Common cause"},"children":["Common cause"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0113"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aeropay is missing from the allowed funding types."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["externalMerchantId"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["configurationId"]}," is missing from the session."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0114"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aeropay supports only the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Ecom"]}," entry type."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.entryType"]}," contains another value."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0115"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Aeropay intent is missing."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.intent.aeropay"]}," isn't set."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0116"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Aeropay supports only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]},"."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.currency"]}," contains another currency."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The session gets ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["externalMerchantId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["configurationId"]}," from the Aeropay service configured in the Unity Portal. Don't add these values in the Android app yourself."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"shopper-data-validation","__idx":4},"children":["Shopper data validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}," isn't set, tapping the button runs shopper pre-validation only if ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," is configured. The SDK trims and validates any returned ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["firstName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," values before opening the popup."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PxpSdkConfig"]}," when you want to prefill or pre-validate shopper data before the popup opens. If you omit it, shoppers enter details on the consumer data screen. Don't rely on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.shopper"]}," alone for Aeropay prefill or pre-check."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can omit fields or return empty strings. The component treats them as missing and lets the shopper enter them on the consumer data screen. If you return a non-empty invalid value, the component calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1300"]},". Invalid formats in the pre-check map to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FN02"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LN02"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EA02"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PN02"]},". Length violations map to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FN03"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LN03"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EA03"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Inspect ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.details"]}," on the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseSdkException"]}," passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," for field keys and localised validation messages when debugging invalid prefilled shopper data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return shopper data in the expected formats:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"import com.pxp.checkout.services.models.transaction.Shopper\n\nonGetShopper = {\n    Shopper(\n        id = \"shopper-123\",\n        firstName = \"John\",\n        lastName = \"Doe\",\n        email = \"john.doe@example.com\",\n        phoneNumber = \"+14155550123\",\n    )\n}\n","lang":"kotlin"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Validation rules for values returned by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},":"]},{"$$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":{"width":"20%","data-label":"Field"},"children":["Field "]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Rule"},"children":["Rule"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["First name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unicode letters and spaces only. Maximum 100 characters."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Last name"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Unicode letters and spaces only. Maximum 100 characters."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Email"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Valid email format. Maximum 128 characters."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Phone number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["US E.164 with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+1"]}," prefix (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["^\\+1\\d{10}$"]},"). Empty or missing values pass the pre-check and remain available for the form."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["skipConsumerDataCollection"]}," requires all four consumer data values to be non-empty and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["consumerDataCollectionConfig.editableFields"]}," to be empty. If any field is listed in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["editableFields"]},", the consumer data screen still appears. An empty phone number from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," also prevents the skip even when the flag is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"consumer-form-validation","__idx":5},"children":["Consumer form validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On the consumer data screen, empty required fields show inline messages such as FN01, LN01, EA01, and PN01. Invalid formats show FN02, LN02, EA02, and PN02."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The shopper can't continue until all four fields pass validation."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"otp-validation","__idx":6},"children":["OTP validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The OTP screen requires a six-digit code. Non-digit characters are filtered out. Verification remains unavailable until all six digits are present."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When OTP verification fails, the component calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1302"]},". If the provider returns code ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AP112"]},", the SDK still reports ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1302"]},". Treat this as a verification failure and let the shopper retry or use ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Resend"]}," when the countdown allows it."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"returning-shopper-validation","__idx":7},"children":["Returning-shopper validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}," is set to a non-empty trimmed value, the SDK retrieves the Aeropay user before opening bank selection:"]},{"$$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":"Outcome"},"children":["Outcome"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Behaviour"},"children":["Behaviour"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User is active"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Opens bank selection and skips consumer data and OTP."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User exists but isn't active"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1307"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["User lookup fails"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1308"]}," for recognised API failure responses. Network or transport errors on user lookup call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0500"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0000"]},", not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1308"]},"."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Empty or blank ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}," values don't start the returning-shopper path. The SDK continues with the new-shopper flow instead."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"transaction-submission-validation","__idx":8},"children":["Transaction submission validation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before submitting the transaction, the SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]},"."]},{"$$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":"Condition"},"children":["Condition"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Behaviour"},"children":["Behaviour"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Callback returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK submits the pay-by-bank transaction."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Callback returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," or is omitted"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK doesn't submit the transaction and leaves the popup open."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Submission returns a mapped failed Unity response"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]}," and emits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}," analytics with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1326"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Submission fails with a network or transport error"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},". ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}," analytics can use a different code, such as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0500"]},"."]}]}]}]}]}]},"headings":[{"value":"Data validation","id":"data-validation","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Aeropay runtime error codes","id":"aeropay-runtime-error-codes","depth":2},{"value":"Component creation validation","id":"component-creation-validation","depth":2},{"value":"Shopper data validation","id":"shopper-data-validation","depth":2},{"value":"Consumer form validation","id":"consumer-form-validation","depth":2},{"value":"OTP validation","id":"otp-validation","depth":2},{"value":"Returning-shopper validation","id":"returning-shopper-validation","depth":2},{"value":"Transaction submission validation","id":"transaction-submission-validation","depth":2}],"frontmatter":{"seo":{"title":"Data validation"}},"lastModified":"2026-08-13T10:57:11.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/android/aeropay/data-validation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}