{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","admonition","br","details","required"]},"type":"markdown"},"seo":{"title":"Events","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":"events","__idx":0},"children":["Events"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement callbacks to customise your Aeropay payment flow for iOS."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Aeropay callbacks let your application respond to shopper interaction, custom validation, user verification, popup cancellation, transaction submission, and errors."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use callbacks to:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Block the flow when checkout isn't ready."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Save the verified Aeropay user ID for returning-shopper flows."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validate business rules before submitting a transaction."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify successful transactions on your backend."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Restore your checkout interface when the shopper dismisses the popup."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Log errors and show appropriate recovery options."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]},". Configure the other callbacks on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AeropayButtonComponentConfig"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"basic-event-handling","__idx":2},"children":["Basic event handling"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example implements the main Aeropay callbacks:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let checkoutConfig = CheckoutConfig(\n    // ...session and transaction configuration\n    onGetShopper: { TransactionShopper(\n            id: \"shopper-123\",\n            firstName: \"John\",\n            lastName: \"Doe\",\n            email: \"john.doe@example.com\",\n            phoneNumber: \"+14155550123\"\n        )\n    }\n)\n\nlet config = AeropayButtonComponentConfig()\nconfig.onClick = {\n    clearPaymentErrors()\n}\nconfig.onCustomValidation = {\n    await validateCheckoutReady()\n}\nconfig.onUserVerificationSuccess = { user in\n    saveAeropayUserId(user.id)\n}\nconfig.onCancel = {\n    resetCheckoutState()\n}\nconfig.onPreAuthorisation = {\n    await validateOrderOnBackend()\n}\nconfig.onPostAuthorisation = { result in\n    verifyPaymentOnBackend(result)\n}\nconfig.onSubmitError = { _ in\n    showAlternativePaymentMethods()\n}\nconfig.onError = { _ in\n    showPaymentError(\"Unable to complete the Aeropay flow.\")\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Client callbacks aren't proof of payment. Verify every transaction on your backend before fulfilling an order or confirming a payout."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"callback-order","__idx":3},"children":["Callback order"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"new-shopper-flow","__idx":4},"children":["New-shopper flow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a successful new-shopper transaction, callbacks run in this order:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onClick"]}," runs when the shopper taps the button."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCustomValidation"]}," runs. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to stop before the flow starts."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The SDK requests available consumer details from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The component shows the consumer-data screen and then OTP, unless ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["skipConsumerDataCollection"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," with complete valid shopper data (and empty/",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nil"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["editableFields"]},"), in which case it skips consumer data and opens OTP after background user creation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onUserVerificationSuccess"]}," runs after successful OTP verification."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," runs after the shopper selects a bank account and confirms the transaction."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," may run again when the SDK builds the transaction request (after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," and before Unity submission)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," runs after successful transaction submission."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the shopper dismisses the popup, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]}," runs. Flow errors call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},", while transaction submission failures call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"returning-shopper-flow","__idx":5},"children":["Returning-shopper flow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you provide ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]},", the SDK skips consumer data collection and OTP verification. A successful returning-shopper transaction follows this order:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onClick"]}," runs when the shopper taps the button."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCustomValidation"]}," runs. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to stop before user lookup."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The SDK validates ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]}," and opens the Aerosync bank-selection screen."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," runs after the shopper selects a bank account and confirms the transaction."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," may run if configured when the SDK builds the transaction request (before Unity submission)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," runs after successful transaction submission."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The returning-shopper flow doesn't call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onUserVerificationSuccess"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sdk-data-callbacks","__idx":6},"children":["SDK data callbacks"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ongetshopper","__idx":7},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]},". For a new shopper, the SDK calls it when the Aeropay button is tapped and uses ",{"$$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"]}," to prefill consumer data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK may also call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," when building the pay-by-bank transaction request after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},". Shopper fields on the Unity request come from that call. Return current shopper data on every invocation, or keep the callback side-effect-free if the transaction doesn't require shopper fields. If you only supply data on the first call and return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nil"]}," later, the submitted transaction can omit shopper details."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a returning shopper with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]},", the SDK doesn't call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," to open the popup. If ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," is configured, it may still run when the transaction is submitted."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the callback to return the latest shopper data from your application:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"onGetShopper: {\n    let shopper = await getCurrentShopper()\n    return TransactionShopper(\n        id: shopper.id,\n        firstName: shopper.firstName,\n        lastName: shopper.lastName,\n        email: shopper.email,\n        phoneNumber: shopper.phoneNumber\n    )\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Aeropay flow uses these shopper properties:"]},{"$$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":"Property"},"children":["Property "]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your shopper identifier. Include a stable value so you can associate the transaction with your customer record."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["firstName"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The shopper's given name. Used to prefill consumer data and included in the transaction request."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastName"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The shopper's family name. Used to prefill consumer data and included in the transaction request."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The shopper's email address. Used to prefill consumer data and included in the transaction request."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The shopper's US phone number, including the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["+1"]}," country prefix. Used to prefill consumer data, OTP delivery, and the transaction request."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The new-shopper flow validates any values returned for ",{"$$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"]},". Invalid data calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," and prevents the popup from opening."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"aeropay-component-callbacks","__idx":8},"children":["Aeropay component callbacks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure the following callbacks on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AeropayButtonComponentConfig"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onclick","__idx":9},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onClick"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onClick"]}," when the shopper taps the Aeropay button. Custom validation and popup opening happen after this callback."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this callback to clear previous errors, update your checkout interface, or track the interaction:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onClick = {\n    clearPaymentErrors()\n    setCheckoutActive(true)\n    trackEvent(\"aeropay-button-clicked\")\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This callback receives no parameters."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"oncustomvalidation","__idx":10},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCustomValidation"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCustomValidation"]}," after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onClick"]}," and before the Aeropay flow starts. Because the callback is asynchronous, you can call network APIs directly."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," to continue or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to stop:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onCustomValidation = {\n    let checkoutReady = await validateCheckoutReady()\n    if !checkoutReady {\n        showPaymentError(\"Checkout isn't ready for Aeropay.\")\n    }\n    return checkoutReady\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the callback is omitted, the SDK treats the result as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},"."]},{"$$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":"Return value"},"children":["Return value"]},{"$$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":["true"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK continues with returning-user lookup or new-shopper shopper-data checks."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK stops and doesn't open the popup."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onuserverificationsuccess","__idx":11},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onUserVerificationSuccess"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onUserVerificationSuccess"]}," after a new shopper enters the correct OTP. The callback isn't called for returning shoppers who enter the flow with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["userId"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Store the returned Aeropay user ID securely so you can use the returning-shopper flow:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onUserVerificationSuccess = { user in\n    saveAeropayUserId(\n        shopperId: getCurrentShopperId(),\n        aeropayUserId: user.id\n    )\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The callback receives an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AeropayUser"]}," object:"]},{"$$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":"Property"},"children":["Property "]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Required","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The verified Aeropay user ID."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["firstName"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The user's given name."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastName"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The user's family name."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Aeropay user type."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The user's email address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The user's phone number."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createdDate"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The date and time when the Aeropay user was created."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"oncancel","__idx":12},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]}," when the shopper dismisses the Aeropay popup, including the close control and swipe dismiss."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Programmatic dismissal after a successful payment doesn't call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use this callback to restore your checkout interface without treating cancellation as an error:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onCancel = {\n    setCheckoutActive(false)\n    setLoading(false)\n    showAlternativePaymentMethods()\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This callback receives no parameters and has no return value."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpreauthorisation","__idx":13},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," after the shopper selects a bank account and confirms the payment or payout. Use it to validate your order or payout before the SDK submits the transaction."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," to submit. Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to abort submission without calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]}," — the bank-selection screen stays open:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPreAuthorisation = {\n    let validation = await validateOrderOnBackend()\n    if !validation.approved {\n        showPaymentError(validation.message)\n    }\n    return validation.approved\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The callback controls transaction submission 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":{"data-label":"Return value"},"children":["Return value"]},{"$$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":["true"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK builds and submits the transaction."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," or omitted callback"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK aborts transaction submission without calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},", and leaves the bank-selection screen open."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," and return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," when the transaction can proceed. If the callback is omitted or doesn't return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},", the SDK doesn't submit the transaction."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpostauthorisation","__idx":14},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," after PXP accepts the transaction submission. The successful payload is a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantSubmitResult"]}," containing the transaction identifiers."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Send the identifiers to your backend and verify the final transaction state:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPostAuthorisation = { submitResult in\n    verifyPaymentOnBackend(\n        merchantTransactionId: submitResult.merchantTransactionId,\n        systemTransactionId: submitResult.systemTransactionId\n    )\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The successful payload contains these properties:"]},{"$$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":"Property"},"children":["Property "]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Required","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your unique transaction identifier."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Required","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PXP's unique transaction identifier."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onsubmiterror","__idx":15},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]}," when transaction submission fails. It isn't used for consumer data, user verification, bank account, or Aerosync failures. Those errors call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Handle submission failures without exposing technical details to the shopper:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onSubmitError = { submitError in\n    if let failed = submitError as? FailedSubmitResult {\n        logPaymentFailure(\n            errorCode: failed.errorCode,\n            correlationId: failed.correlationId\n        )\n    }\n    setLoading(false)\n    showPaymentError(\"We could not complete the transaction. Try again or use another payment method.\")\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A failed PXP response typically passes a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]},":"]},{"$$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":"Property"},"children":["Property "]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The transaction error code."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorReason"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A description of the failure."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["correlationId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The correlation identifier to include in logs and support requests."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["httpStatusCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Int?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The HTTP status code returned by PXP."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["[String]?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Additional error details."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a failed Unity transaction response is mapped to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]},", the SDK also emits ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}," analytics with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1326"]},". Network or transport failures still call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},", but their ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ComponentError"]}," analytics can use a different code. Neither path delivers ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1326"]}," through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},". Handle the response details from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onerror","__idx":16},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," for errors outside transaction submission, including:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Invalid shopper data."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Aeropay user creation or verification failure."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Invalid or inactive returning users."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Bank account retrieval or linking failure."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Aerosync failure."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Aerosync / bank-selection failures such as missing or invalid Aerosync payload (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1303"]},"). Don't treat ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1311"]}," as the primary \"missing verified user ID\" signal from the current bank UI."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Log recognised SDK errors and show a message that helps the shopper recover:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onError = { error in\n    logErrorToMonitoring(\n        errorCode: error.errorCode,\n        message: error.errorMessage\n    )\n    setLoading(false)\n    showPaymentError(\"Unable to continue with Aeropay. Try again or use another payment method.\")\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Recognised SDK failures use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseSdkException"]},":"]},{"$$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":"Property"},"children":["Property "]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Required","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The PXP iOS SDK error code."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorMessage"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Required","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A description of the error."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"event-data-structures","__idx":17},"children":["Event data structures"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"aeropayuser","__idx":18},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AeropayUser"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onUserVerificationSuccess"]}," receives an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AeropayUser"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," and optional ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["firstName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["lastName"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["email"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["createdDate"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"merchantsubmitresult","__idx":19},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantSubmitResult"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Successful transaction submission produces a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantSubmitResult"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"failedsubmitresult","__idx":20},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A failed PXP transaction response produces a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorReason"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["correlationId"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["httpStatusCode"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["details"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"basesdkexception","__idx":21},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseSdkException"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Recognised ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," failures use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["BaseSdkException"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorMessage"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"error-handling-pattern","__idx":22},"children":["Error-handling pattern"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Keep error logging separate from the message shown to the shopper. The following pattern records diagnostic information while displaying a neutral recovery message:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let config = AeropayButtonComponentConfig()\nconfig.onPreAuthorisation = { true }\n\nconfig.onPostAuthorisation = { result in\n    do {\n        try verifyPaymentOnBackend(result)\n        showPaymentSuccess()\n    } catch {\n        showPaymentError(\"We could not confirm the transaction status. Contact support before trying again.\")\n    }\n}\n\nconfig.onSubmitError = { submitResult in\n    if let failed = submitResult as? FailedSubmitResult {\n        logPaymentFailure(\n            errorCode: failed.errorCode,\n            errorReason: failed.errorReason,\n            correlationId: failed.correlationId\n        )\n    }\n    showPaymentError(\"We could not complete the transaction. Try another payment method.\")\n}\n\nconfig.onError = { error in\n    reportErrorToMonitoring(\n        errorCode: error.errorCode,\n        message: error.errorMessage\n    )\n    showPaymentError(\"Unable to continue with Aeropay. Try again or use another payment method.\")\n}\n","lang":"swift"},"children":[]}]},"headings":[{"value":"Events","id":"events","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Basic event handling","id":"basic-event-handling","depth":2},{"value":"Callback order","id":"callback-order","depth":2},{"value":"New-shopper flow","id":"new-shopper-flow","depth":3},{"value":"Returning-shopper flow","id":"returning-shopper-flow","depth":3},{"value":"SDK data callbacks","id":"sdk-data-callbacks","depth":2},{"value":"onGetShopper","id":"ongetshopper","depth":3},{"value":"Aeropay component callbacks","id":"aeropay-component-callbacks","depth":2},{"value":"onClick","id":"onclick","depth":3},{"value":"onCustomValidation","id":"oncustomvalidation","depth":3},{"value":"onUserVerificationSuccess","id":"onuserverificationsuccess","depth":3},{"value":"onCancel","id":"oncancel","depth":3},{"value":"onPreAuthorisation","id":"onpreauthorisation","depth":3},{"value":"onPostAuthorisation","id":"onpostauthorisation","depth":3},{"value":"onSubmitError","id":"onsubmiterror","depth":3},{"value":"onError","id":"onerror","depth":3},{"value":"Event data structures","id":"event-data-structures","depth":2},{"value":"AeropayUser","id":"aeropayuser","depth":3},{"value":"MerchantSubmitResult","id":"merchantsubmitresult","depth":3},{"value":"FailedSubmitResult","id":"failedsubmitresult","depth":3},{"value":"BaseSdkException","id":"basesdkexception","depth":3},{"value":"Error-handling pattern","id":"error-handling-pattern","depth":2}],"frontmatter":{"seo":{"title":"Events"}},"lastModified":"2026-08-11T10:42:42.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/ios/aeropay/events","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}