{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","br","details","admonition"]},"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","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":"events","__idx":0},"children":["Events"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement callbacks to customise your Paze payment flow for iOS."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Paze component emits callbacks based on shopper interaction and payment flow state. Use them to inject business logic and UX customisations at critical moments. While the SDK handles checkout, decryption, and authorisation, you retain control over approval gates, error handling, and backend integration."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Callbacks enable you to:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Validate business rules before payments proceed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Display custom error, failure, or success messages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Integrate with fraud detection or customer management systems."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Control how shoppers experience successful and failed transactions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Handle Paze web checkout and decryption flow requirements."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sdk-data-callbacks","__idx":2},"children":["SDK data callbacks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]}," when calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PxpCheckout.initialize(config:)"]},", not on the Paze button component. The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," when building the Unity transaction request after decryption."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," (recommended): Called during authorisation to retrieve shopper data for the transaction payload."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShippingAddress"]}," (optional on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]},"): Available for other checkout components, but ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not called"]}," by the Paze button during authorisation."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ongetshopper","__idx":3},"children":["onGetShopper"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK calls this callback when building the transaction request, after decryption and before Unity authorisation."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use it to:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Provide a stable shopper ID for your customer account or guest session."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Return the latest name, email, and contact details from your application."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Associate the Paze network-token transaction with your customer records."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"configuration","__idx":4},"children":["Configuration"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"let checkoutConfig = CheckoutConfig(\n    environment: .test,\n    session: sessionData,\n    transactionData: transactionData,\n    merchantShopperId: \"shopper-123\",\n    ownerId: \"owner-456\",\n    onGetShopper: { async in\n        TransactionShopper(\n            id: \"shopper-123\",\n            firstName: \"John\",\n            lastName: \"Doe\",\n            email: \"customer@example.com\"\n        )\n    }\n)\n\nlet pxpCheckout = try PxpCheckout.initialize(config: checkoutConfig)\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"return-value","__idx":5},"children":["Return value"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Property"},"children":["Property"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"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":{"align":"left"},"children":["A unique shopper identifier. Return your customer account ID or a persistent guest session ID."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"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":{"align":"left"},"children":["The shopper's given name."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"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":{"align":"left"},"children":["The shopper's family name."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"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":{"align":"left"},"children":["The shopper's email address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"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":{"align":"left"},"children":["The contact phone number for the transaction shopper profile."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dateOfBirth"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The date of birth, when required by your integration or risk screening rules."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["houseNumberOrName"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The first line of the shopper's address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["street"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The street name or remaining address line."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["city"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The city or locality."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["postalCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The postal or ZIP code."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["countryCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The country code in ISO 3166-1 alpha-2 format (e.g., ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"US\""]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["state"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["The state, province, or region."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["products"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["[String: String]?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Key-value metadata describing products in the order."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderDescription"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["A human-readable order description."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All properties are optional in the type, but you should always return an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["id"]}," so transactions can be linked to your customer records."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-implementation","__idx":6},"children":["Example implementation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"onGetShopper: { async in\n    let customer = await getCurrentCustomer()\n\n    if let customer {\n        return TransactionShopper(\n            id: customer.id,\n            email: customer.email,\n            firstName: customer.firstName,\n            lastName: customer.lastName,\n            phoneNumber: customer.phone\n        )\n    }\n\n    return TransactionShopper(id: getOrCreateGuestShopperId())\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Paze wallet identity (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["emailAddress"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["phoneNumber"]}," on the component) is separate from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},". Component identity is passed to Paze during session creation when provided. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," supplies the shopper object sent to Unity during authorisation."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"ongetshippingaddress","__idx":7},"children":["onGetShippingAddress"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShippingAddress"]}," is defined on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]}," for other payment flows (for example, card submit or drop-in). The Paze button component doesn't call it when building the authorisation request."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you need shipping context for Paze, pass it through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["enhancedTransactionData.ecomData.finalShippingAddress"]}," on the component config instead. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/ios/paze/configuration#enhanced-transaction-data"},"children":["Configuration"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"paze-specific-events","__idx":8},"children":["Paze-specific events"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure these callbacks on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonComponentConfig"]}," before calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["create(.pazeButton, componentConfig:)"]},"."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Callback"},"children":["Callback"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"SDK signature"},"children":["SDK signature"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onInit"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(() -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPresentmentResolved"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["((Bool) -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["((BaseSdkException) -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPazeButtonClicked"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(() async -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["((PazeCheckoutResult) async -> Bool)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutIncomplete"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["((PazeCheckoutResult) async -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onComplete"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["((PazeCompleteResult) async -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(() async -> Bool)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostDecryption"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["((PazeDecryptTokenResponseSuccess) async -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(() async -> PazePreAuthorisationResult)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["((MerchantSubmitResult) async -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["((BaseSubmitResult) async -> Void)?"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]},")"]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["(() async -> TransactionShopper?)?"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"callback-order","__idx":9},"children":["Callback order"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For a successful payment, callbacks fire in this order:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onInit"]}," → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPresentmentResolved(true)"]}," when the component view appears."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPazeButtonClicked"]}," when the shopper taps the button."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutIncomplete"]}," after the Paze web checkout session returns."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onComplete"]}," after the complete API succeeds and the response is decoded."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}," → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostDecryption"]}," (if SDK decryption proceeds)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," → Unity authorisation (the SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," here) → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," handles presentment, checkout, complete, and decryption errors. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]}," handles authorisation submission failures, including invalid Kount ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["riskScreeningData"]},". Shopper cancellation is surfaced through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutIncomplete"]},", not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},"."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]}," on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]}," when calling ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PxpCheckout.initialize(config:)"]},". Paze component callbacks handle checkout, decryption, and authorisation events."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"oninit","__idx":10},"children":["onInit"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called after presentment validation succeeds, immediately before ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPresentmentResolved(true)"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onInit = {\n    print(\"Paze component ready\")\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpresentmentresolved","__idx":11},"children":["onPresentmentResolved"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called when presentment resolves with whether the button is visible."]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$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":["isVisible"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Bool"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," when the button is shown, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," when validation failed (see ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPresentmentResolved = { isVisible in\n    if !isVisible {\n        showAlternativePaymentMethods()\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpazebuttonclicked","__idx":12},"children":["onPazeButtonClicked"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called when the shopper taps the button, before the Paze web checkout session opens. Use it for analytics, clearing error messages, or showing a loading state."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPazeButtonClicked"]}," is a component callback. The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PazeButtonClicked"]}," analytics event is separate — it fires only after checkout-time validation succeeds, immediately before the web session opens. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/ios/paze/analytics#when-each-event-fires"},"children":["Analytics"]},"."]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPazeButtonClicked = { async in\n    clearErrorMessages()\n    trackEvent(\"paze_button_clicked\")\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK always opens the Paze checkout session after this callback completes. To block checkout when validation fails, keep the button disabled until your prerequisites are met, or return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]}," after the shopper finishes in Paze."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"oncheckoutcomplete","__idx":13},"children":["onCheckoutComplete"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called when checkout returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["COMPLETE"]},", before the SDK calls the complete API."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," to approve and continue (default when omitted). Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to reject. The SDK calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutIncomplete"]},"."]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$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":["result"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["PazeCheckoutResult"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The checkout result data."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.result"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["enum"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The result: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".complete"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".incomplete"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.checkoutResponse"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The encoded checkout response JWT when complete."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.checkoutDecodedResponse"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["PazeCheckoutDecoded?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The decoded consumer, session, and masked card data."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.checkoutDecodedResponse?.maskedCard?.panLastFour"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The last four digits of the selected card."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.checkoutDecodedResponse?.maskedCard?.paymentCardBrand"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The card brand returned by Paze (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["VISA"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.checkoutDecodedResponse?.maskedCard?.paymentCardNetwork"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The card network returned by Paze."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.reason"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An optional reason from Paze."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onCheckoutComplete = { result async in\n    guard let decoded = result.checkoutDecodedResponse else { return false }\n\n    let isValid = await validateCheckoutOnBackend(\n        sessionId: decoded.sessionId,\n        cardLastFour: decoded.maskedCard?.panLastFour\n    )\n\n    return isValid\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"oncheckoutincomplete","__idx":14},"children":["onCheckoutIncomplete"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called when checkout ends without completion, the shopper cancels, or you return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]},". When you reject in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]},", the reason is set from the SDK's localised merchant-validation message."]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$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":["result.reason"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The reason for the incomplete checkout (e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"User cancelled.\""]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onCheckoutIncomplete = { result async in\n    if result.reason == \"User cancelled.\" {\n        return\n    }\n    showError(\"Checkout was not completed. Please try again.\")\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"oncomplete","__idx":15},"children":["onComplete"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called when the complete API succeeds and the response is decoded. Runs before ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.completeDecodedResponse?.securedPayload"]}," for manual decryption when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}," returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onComplete = { result async in\n    print(\"Payload ID:\", result.completeDecodedResponse?.payloadId ?? \"\")\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpredecryption","__idx":16},"children":["onPreDecryption"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onComplete"]},", before the SDK decrypts the secured payload."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]}," to allow SDK decryption (default when omitted). Return ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]}," to handle decryption on your backend."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPreDecryption = { async in\n    let approved = await requestManagerApproval()\n    return approved\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpostdecryption","__idx":17},"children":["onPostDecryption"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called after Unity successfully decrypts the network token. Fires when SDK decryption proceeds — including when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}," is omitted or returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},". Skipped when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreDecryption"]}," returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$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":["decryptedPayload.shopper"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The customer name, email, and phone from the decrypt response."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decryptedPayload.billingAddress"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The billing address when returned by Paze."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decryptedPayload.fundingData"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The network token, expiry, card network, and related fields."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPostDecryption = { decrypted async in\n    print(\"Card network:\", decrypted.fundingData.cardNetwork)\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpreauthorisation","__idx":18},"children":["onPreAuthorisation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called before the transaction is submitted to Unity."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Return value"},"children":["Return value"]},{"$$mdtype":"Tag","name":"th","attributes":{"align":"left","data-label":"Behaviour"},"children":["Behaviour"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".proceed"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Continue without extra data (default when omitted)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".cancel"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Abort authorisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".transactionInitData(...)"]}]},{"$$mdtype":"Tag","name":"td","attributes":{"align":"left"},"children":["Continue with risk screening or other init data."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPreAuthorisation = { async in\n    guard await validateOrderDetails() else {\n        return .cancel\n    }\n\n    return .transactionInitData(PazeTransactionInitData(\n        riskScreeningData: RiskScreeningData(\n            performRiskScreening: true,\n            userIp: await getUserIpAddress()\n        )\n    ))\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpostauthorisation","__idx":19},"children":["onPostAuthorisation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called when the SDK receives a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantSubmitResult"]},", immediately before your callback runs. Verify the transaction outcome on your backend — the Unity response may report an error state while still returning transaction identifiers."]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$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":["data.merchantTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your transaction identifier."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.systemTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The system transaction identifier generated by PXP."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onPostAuthorisation = { data async in\n    await verifyPaymentOnBackend(systemTransactionId: data.systemTransactionId)\n    navigateToOrderConfirmation(merchantTransactionId: data.merchantTransactionId)\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onsubmiterror","__idx":20},"children":["onSubmitError"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called when authorisation submission fails, including invalid Kount ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["riskScreeningData"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ValidationException"]},"). Cast to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]}," for error details."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onSubmitError = { result async in\n    if let failed = result as? FailedSubmitResult {\n        showError(failed.errorReason ?? \"Payment failed\")\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onerror","__idx":21},"children":["onError"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Called on presentment, checkout, complete, or decryption errors. Shopper cancellation is surfaced through ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutIncomplete"]},", not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},"."]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$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":["error.errorCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The SDK error code (e.g. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SDK1213"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.errorMessage"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A human-readable error message."]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"config.onError = { error in\n    switch error.errorCode {\n    case \"SDK0118\":\n        showError(\"Paze isn't enabled for this session.\")\n    case \"SDK1213\":\n        showError(\"Paze is only available for USD transactions.\")\n    case \"SDK1202\":\n        showError(\"Paze client ID is missing from the session.\")\n    case \"SDK1202A\":\n        showError(\"Paze merchant category code is missing from the session.\")\n    case \"SDK1214\", \"SDK1200\":\n        showError(\"Paze checkout failed. Please try again.\")\n    default:\n        showError(error.errorMessage)\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"event-data-structures","__idx":22},"children":["Event data structures"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"transactionshopper","__idx":23},"children":["TransactionShopper"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Returned by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onGetShopper"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"struct TransactionShopper {\n    var id: String?\n    var firstName: String?\n    var lastName: String?\n    var dateOfBirth: String?\n    var email: String?\n    var phoneNumber: String?\n    var houseNumberOrName: String?\n    var street: String?\n    var city: String?\n    var postalCode: String?\n    var countryCode: String?\n    var state: String?\n    var products: [String: String]?\n    var orderDescription: String?\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"shippingaddress","__idx":24},"children":["ShippingAddress"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Defined on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CheckoutConfig"]}," for other payment flows. Not used by the Paze button component."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"struct ShippingAddress {\n    var countryCode: String?\n    var postalCode: String?\n    var address: String?\n    var addressLine2: String?\n    var city: String?\n    var county: String?\n    var state: String?\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pazecheckoutresult","__idx":25},"children":["PazeCheckoutResult"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutComplete"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCheckoutIncomplete"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"public struct PazeCheckoutResult {\n    var result: CheckoutResultType          // PazeCheckoutResult.CheckoutResultType\n    var checkoutResponse: String?\n    var reason: String?\n    var checkoutDecodedResponse: PazeCheckoutDecoded?\n}\n\npublic extension PazeCheckoutResult {\n    enum CheckoutResultType {\n        case complete    // raw value \"COMPLETE\"\n        case incomplete  // raw value \"INCOMPLETE\"\n    }\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["checkoutDecodedResponse"]}," is populated when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":[".complete"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pazemaskedcard","__idx":26},"children":["PazeMaskedCard"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Included on ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["checkoutDecodedResponse"]}," when checkout completes:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"struct PazeMaskedCard {\n    var panLastFour: String\n    var paymentCardBrand: String\n    var paymentCardNetwork: String\n    var paymentCardDescriptor: String\n    var paymentCardType: String\n    var digitalCardData: PazeDigitalCardData\n    var digitalCardId: String?\n    var paymentAccountReference: String?\n    var panExpirationMonth: String?\n    var panExpirationYear: String?\n    var billingAddress: PazeCheckoutAddress?\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pazecompleteresult","__idx":27},"children":["PazeCompleteResult"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onComplete"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"struct PazeCompleteResult {\n    var completeDecodedResponse: PazeCompleteDecoded?  // payloadId, sessionId, securedPayload\n    var decryptedPayload: PazeDecryptTokenResponseSuccess?  // always nil at onComplete\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Decrypted token data is passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostDecryption"]}," when SDK decryption proceeds."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"pazedecrypttokenresponsesuccess","__idx":28},"children":["PazeDecryptTokenResponseSuccess"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostDecryption"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// decryptedPayload.shopper — fullName, emailAddress, phone fields\n// decryptedPayload.billingAddress — addressLine1, city, state, countryCode, postalCode\n// decryptedPayload.fundingData — networkToken, expirationMonth, expirationYear, cardNetwork\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"merchantsubmitresult","__idx":29},"children":["MerchantSubmitResult"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"class MerchantSubmitResult {\n    let merchantTransactionId: String\n    let systemTransactionId: String\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"failedsubmitresult","__idx":30},"children":["FailedSubmitResult"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Typical type received in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"class FailedSubmitResult {\n    let errorCode: String?\n    let errorReason: String?\n    let correlationId: String?\n    let httpStatusCode: Int?\n    let details: [String]?\n}\n","lang":"swift"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"basesdkexception","__idx":31},"children":["BaseSdkException"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Passed to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"swift","header":{"controls":{"copy":{}}},"source":"// error.errorCode — e.g. \"SDK1213\"\n// error.errorMessage — human-readable description\n","lang":"swift"},"children":[]}]},"headings":[{"value":"Events","id":"events","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"SDK data callbacks","id":"sdk-data-callbacks","depth":2},{"value":"onGetShopper","id":"ongetshopper","depth":3},{"value":"Configuration","id":"configuration","depth":4},{"value":"Return value","id":"return-value","depth":4},{"value":"Example implementation","id":"example-implementation","depth":4},{"value":"onGetShippingAddress","id":"ongetshippingaddress","depth":3},{"value":"Paze-specific events","id":"paze-specific-events","depth":2},{"value":"Callback order","id":"callback-order","depth":3},{"value":"onInit","id":"oninit","depth":3},{"value":"onPresentmentResolved","id":"onpresentmentresolved","depth":3},{"value":"onPazeButtonClicked","id":"onpazebuttonclicked","depth":3},{"value":"onCheckoutComplete","id":"oncheckoutcomplete","depth":3},{"value":"onCheckoutIncomplete","id":"oncheckoutincomplete","depth":3},{"value":"onComplete","id":"oncomplete","depth":3},{"value":"onPreDecryption","id":"onpredecryption","depth":3},{"value":"onPostDecryption","id":"onpostdecryption","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":"TransactionShopper","id":"transactionshopper","depth":3},{"value":"ShippingAddress","id":"shippingaddress","depth":3},{"value":"PazeCheckoutResult","id":"pazecheckoutresult","depth":3},{"value":"PazeMaskedCard","id":"pazemaskedcard","depth":3},{"value":"PazeCompleteResult","id":"pazecompleteresult","depth":3},{"value":"PazeDecryptTokenResponseSuccess","id":"pazedecrypttokenresponsesuccess","depth":3},{"value":"MerchantSubmitResult","id":"merchantsubmitresult","depth":3},{"value":"FailedSubmitResult","id":"failedsubmitresult","depth":3},{"value":"BaseSdkException","id":"basesdkexception","depth":3}],"frontmatter":{"seo":{"title":"Events"}},"lastModified":"2026-06-30T09:48:00.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/ios/paze/events","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}