{"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"},"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"]},". For a new shopper (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}," unset), validates shopper details from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},". For a returning shopper, looks up ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}," instead."]},{"$$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":["pxpCheckout.create(.aeropayButton, componentConfig:)"]}," 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 submission without calling it."]}]}]}]}]},{"$$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."]}]},{"$$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."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". Feedback is shown only if the popup is already open."]}]},{"$$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."]},{"$$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":["Missing or invalid Aerosync payload on the bank-selection screen when no verified Aeropay user ID is available (primary live UI signal), or 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"]}," in most cases and shows popup feedback where applicable. Some link-bank / credentials paths surface only inline or alert feedback without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". Prefer this over ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1311"]}," for missing verification on the current Aerosync screen."]}]},{"$$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."]},{"$$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."]},{"$$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."]},{"$$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":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AeropayAerosyncConfigMissingException"]}," (fixed message: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Aeropay Aerosync token and deeplink are required."]},"). Still present in the SDK but not the merchant-facing signal from the current Aerosync screen callbacks for a missing user ID."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Don't diagnose missing verification primarily via ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1311"]},". Prefer ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1303"]},"."]}]},{"$$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."]},{"$$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":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Network or transport failures during Aeropay service calls typically call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK0500"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["NetworkSdkException"]},"). Other mapped API or provider failures use the Aeropay-specific codes in the table."]}]},{"$$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 and supported."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session.allowedFundingTypes.payByBanks.aeropay.externalMerchantId"]}," is present and non-empty."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["session.allowedFundingTypes.payByBanks.aeropay.configurationId"]}," is present and non-empty."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.entryType"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".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"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Catch creation errors around ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["create"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"do {\n    let config = AeropayButtonComponentConfig()\n    config.onPreAuthorisation = { true }\n    let aeropayButton = try pxpCheckout.create(\n        .aeropayButton,\n        componentConfig: config\n    )\n} catch let error as BaseSdkException {\n    // Inspect error.errorCode and error.errorMessage\n    showAlternativePaymentMethods()\n}\n","lang":"swift"},"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":["SDK0106"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Aeropay button doesn't support the configured intent."]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionData.intent.aeropay"]}," contains an unsupported value. With the current public ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AeropayIntentType"]}," cases, typed Aeropay creation won't hit this path."]}]},{"$$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 iOS 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 calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},". 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":["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"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return shopper data in the expected formats:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"onGetShopper: { TransactionShopper(\n        id: \"shopper-123\",\n        firstName: \"John\",\n        lastName: \"Doe\",\n        email: \"john.doe@example.com\",\n        phoneNumber: \"+14155550123\"\n    )\n}\n","lang":"swift"},"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":{"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"]}," additionally requires all four consumer data values to be non-empty. An empty phone number from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," 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 ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FN01"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LN01"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EA01"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PN01"]},". Invalid formats show ",{"$$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"]},". Field length is limited by the input max length rather than a separate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FN03"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LN03"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EA03"]}," inline message."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FN03"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["LN03"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["EA03"]}," can appear in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1300"]}," details when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," returns values that fail the shopper pre-check, for example names or email addresses that exceed the maximum length."]},{"$$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 value, the SDK retrieves the Aeropay user before opening the Aerosync bank-selection screen:"]},{"$$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 the Aerosync bank-selection screen 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"]},"."]}]}]}]}]},{"$$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."]}]}]}]}]}]},"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-11T10:42:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/ios/aeropay/data-validation","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}