{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","br","details","admonition"]},"type":"markdown"},"seo":{"title":"Card submit","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":"card-submit","__idx":0},"children":["Card submit"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn about customisation options for the card submit component."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"styling","__idx":1},"children":["Styling"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"val cardSubmitComponentConfig = CardSubmitComponentConfig(\n    cardNumberComponent = CardNumberComponent?,\n    cardExpiryDateComponent = CardExpiryDateComponent?,\n    cardCvcComponent = CardCvcComponent?,\n    cardHolderNameComponent = CardHolderNameComponent?,\n    newCardComponent = NewCardComponent?,\n    cardOnFileComponent = CardOnFileComponent?,\n    clickOnceStandaloneComponent = ClickOnceStandaloneComponent?,\n    cardConsentComponent = CardConsentComponent?,\n    billingAddressComponents = BillingAddressComponents?,\n    useCardOnFile = Boolean,\n    componentsToValidate = List<BaseComponent<*>>,\n    avsRequest = Boolean,\n    hideSubmitButton = Boolean,\n    disableUntilValidated = Boolean,\n    validateOnBlur = Boolean,\n    errorMessage = String?,\n    style = CardSubmitStyle?,\n    buttonText = String?,\n    loadingText = String?,\n    fingerprintCallbackUrl = String?\n)\n","lang":"kotlin"},"children":[]},{"$$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":"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":["cardNumberComponent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["CardNumberComponent?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card number component reference for validation and data collection."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardExpiryDateComponent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["CardExpiryDateComponent?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card expiry date component reference for validation and data collection."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardCvcComponent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["CardCvcComponent?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card CVC component reference for validation and data collection."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardHolderNameComponent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["CardHolderNameComponent?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card holder name component reference for validation and data collection."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["newCardComponent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["NewCardComponent?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Combined card component reference for validation and data collection."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardOnFileComponent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["CardOnFileComponent?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card on file component reference for token-based payments."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["clickOnceStandaloneComponent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["ClickOnceStandaloneComponent?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ClickOnce component reference for quick payments."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardConsentComponent"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["CardConsentComponent?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card consent component reference for card storage consent."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["billingAddressComponents"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["BillingAddressComponents?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Billing address components for address verification service."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useCardOnFile"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether to use card on file for payment. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["componentsToValidate"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["List<BaseComponent<*>>"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["List of components to validate on submit. Defaults to empty list."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["avsRequest"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether to request Address Verification Service. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["hideSubmitButton"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether to hide the submit button. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["disableUntilValidated"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether to disable button until all fields are validated. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["validateOnBlur"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["Boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether to validate fields when they lose focus. Defaults to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},"."]}]},{"$$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":"td","attributes":{},"children":["Error message to display on the submit button."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["style"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["CardSubmitStyle?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom styling configuration for the submit button."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["buttonText"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Custom text for the submit button."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["loadingText"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Text to display while processing payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["fingerprintCallbackUrl"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["String?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Callback URL for fraud detection fingerprinting."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"callbacks","__idx":2},"children":["Callbacks"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"data class CardSubmitComponentConfig(\n    val onValidationPassed: ((List<ValidationResult>) -> Unit)? = null,\n    val onValidationFailed: ((List<ValidationResult>) -> Unit)? = null,\n    val onTriggerFieldValidation: ((ValidationResult) -> Unit)? = null,\n    val onPreTokenisation: (() -> Boolean)? = null,\n    val onPostTokenisation: ((CardTokenisationResult) -> Unit)? = null,\n    val onSubmit: (() -> Unit)? = null,\n    val onStartSubmit: (() -> Unit)? = null,\n    val onChange: ((CardSubmitState) -> Unit)? = null,\n    val onValidation: ((List<ValidationResult>) -> Unit)? = null,\n    val onConsentChanged: ((Boolean) -> Unit)? = null,\n    val onCustomValidation: (() -> Boolean)? = null,\n    val onSubmitError: ((BaseSdkException) -> Unit)? = null,\n    val onCollectStart: (() -> Unit)? = null,\n    val onCollectEnd: (() -> Unit)? = null,\n    val onPreInitiateAuthentication: (() -> PreInitiateIntegratedAuthenticationData?)? = null,\n    val onPostInitiateAuthentication: ((AuthenticationResult) -> Unit)? = null,\n    val onPreAuthentication: ((PreInitiateSuccessAuthenticationResult) -> InitiateIntegratedAuthenticationData?)? = null,\n    val onPostAuthentication: ((AuthenticationResult, ThreeDSAuthenticationData?) -> Unit)? = null,\n    val onPreAuthorisation: ((PreAuthorisationData) -> TransactionInitiationData?)? = null,\n    val onPostAuthorisation: ((SubmitResult) -> Unit)? = null\n)\n","lang":"kotlin"},"children":[]},{"$$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":"Callback"},"children":["Callback"]},{"$$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":["onValidationPassed: ((List<ValidationResult>) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for when validation passes. Inherited from ComponentConfigImpl."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onValidationFailed: ((List<ValidationResult>) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for when validation fails. Inherited from ComponentConfigImpl."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onTriggerFieldValidation: ((ValidationResult) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for when field validation is triggered individually. Inherited from ComponentConfigImpl."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreTokenisation: (() -> Boolean)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called before card tokenisation. Return false to prevent tokenisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostTokenisation: ((CardTokenisationResult) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called after successful card tokenisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmit: (() -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for when submit button is clicked."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onStartSubmit: (() -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called when submission begins. Triggered after validation passes and before tokenisation begins. Useful for showing loading states or tracking when a submission starts."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onChange: ((CardSubmitState) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for component state changes."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onValidation: ((List<ValidationResult>) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for validation results from all components."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onConsentChanged: ((Boolean) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for card storage consent changes."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCustomValidation: (() -> Boolean)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for custom validation logic. Called after standard component validation passes. Return true to allow submission, false to block submission."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSubmitError: ((BaseSdkException) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for submission errors."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCollectStart: (() -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for when data collection starts."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCollectEnd: (() -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler for when data collection ends."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreInitiateAuthentication: (() -> PreInitiateIntegratedAuthenticationData?)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called before initiating 3DS authentication."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostInitiateAuthentication: ((AuthenticationResult) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called after 3DS authentication initiation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthentication: ((PreInitiateSuccessAuthenticationResult) -> InitiateIntegratedAuthenticationData?)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called before 3DS challenge."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthentication: ((AuthenticationResult, ThreeDSAuthenticationData?) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called after 3DS challenge completion."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation: ((PreAuthorisationData) -> TransactionInitiationData?)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called before payment authorisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation: ((SubmitResult) -> Unit)?"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Event handler called after payment authorisation."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more information about callbacks, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/checkout/components/android/card/events"},"children":["Events"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"example","__idx":3},"children":["Example"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"kotlin","header":{"controls":{"copy":{}}},"source":"import com.pxp.checkout.components.cardsubmit.CardSubmitComponent\nimport com.pxp.checkout.components.cardsubmit.CardSubmitComponentConfig\nimport com.pxp.checkout.components.cardnumber.CardNumberComponent\nimport com.pxp.checkout.components.cardexpirydate.CardExpiryDateComponent\nimport com.pxp.checkout.components.cardcvc.CardCvcComponent\nimport com.pxp.checkout.components.cardholdername.CardHolderNameComponent\nimport com.pxp.checkout.components.cardsubmit.CardSubmitStyle\n\n// Create individual card components\nval cardNumberComponent = checkout.createComponent<CardNumberComponent, CardNumberComponentConfig>(\n    type = ComponentType.CARD_NUMBER,\n    config = CardNumberComponentConfig(\n        placeholder = \"1234 5678 9012 3456\"\n    )\n)\n\nval cardExpiryComponent = checkout.createComponent<CardExpiryDateComponent, CardExpiryDateComponentConfig>(\n    type = ComponentType.CARD_EXPIRY_DATE,\n    config = CardExpiryDateComponentConfig(\n        placeholder = \"MM/YY\"\n    )\n)\n\nval cardCvcComponent = checkout.createComponent<CardCvcComponent, CardCvcComponentConfig>(\n    type = ComponentType.CARD_CVC,\n    config = CardCvcComponentConfig(\n        placeholder = \"123\"\n    )\n)\n\nval cardHolderNameComponent = checkout.createComponent<CardHolderNameComponent, CardHolderNameComponentConfig>(\n    type = ComponentType.CARD_HOLDER_NAME,\n    config = CardHolderNameComponentConfig(\n        placeholder = \"John Doe\"\n    )\n)\n\n// Optional: Create custom styling\nval customStyle = CardSubmitStyle(\n    backgroundColor = Color.Blue,\n    textColor = Color.White,\n    borderRadius = 8.dp,\n    padding = 16.dp,\n    loadingIndicatorColor = Color.White\n)\n\nval config = CardSubmitComponentConfig(\n    // Component references for validation and data collection\n    cardNumberComponent = cardNumberComponent,\n    cardExpiryDateComponent = cardExpiryComponent,\n    cardCvcComponent = cardCvcComponent,\n    cardHolderNameComponent = cardHolderNameComponent,\n    \n    // Payment configuration\n    useCardOnFile = false,\n    avsRequest = true,\n    disableUntilValidated = true,\n    validateOnBlur = true,\n    \n    // Button configuration\n    buttonText = \"Pay Now\",\n    loadingText = \"Processing Payment...\",\n    hideSubmitButton = false,\n    \n    // Styling\n    style = customStyle,\n            \n    // Payment flow callbacks\n    onPreTokenisation = {\n        println(\"About to tokenise card data\")\n        // Perform pre-tokenisation checks\n        true // Return true to proceed\n    },\n    \n    onStartSubmit = {\n        println(\"Submission process starting\")\n        // Show loading indicator or track submission start\n    },\n    \n    onPostTokenisation = { result ->\n        println(\"Card tokenised successfully: ${result.token}\")\n    },\n    \n    onSubmit = {\n        println(\"Submit button clicked\")\n    },\n    \n    onChange = { state ->\n        println(\"Submit state changed: ${state.status}\")\n    },\n    \n    onValidation = { results ->\n        val allValid = results.all { it.isValid }\n        println(\"Validation results: ${if (allValid) \"Valid\" else \"Invalid\"}\")\n    },\n    \n    // Custom validation for business rules\n    onCustomValidation = {\n        println(\"Running custom validation checks\")\n        \n        // Example: Validate transaction amount\n        val amount = checkout.getSdkConfig().transactionData.amount\n        if (amount > 10000) {\n            println(\"Transaction amount exceeds limit\")\n            false // Block submission\n        } else {\n            println(\"Custom validation passed\")\n            true // Allow submission\n        }\n    },\n    \n    onSubmitError = { error ->\n        println(\"Submit error: ${error.message}\")\n    },\n    \n    // 3DS Authentication callbacks\n    onPreInitiateAuthentication = {\n        println(\"Preparing 3DS authentication\")\n        // Return authentication data if needed\n        null\n    },\n    \n    onPostInitiateAuthentication = { result ->\n        println(\"3DS authentication initiated: ${result.status}\")\n    },\n    \n    onPreAuthentication = { result ->\n        println(\"Starting 3DS challenge\")\n        // Return challenge data if needed\n        null\n    },\n    \n    onPostAuthentication = { result, authData ->\n        println(\"3DS authentication completed: ${result.status}\")\n    },\n    \n    // Payment authorisation callbacks\n    onPreAuthorisation = { data ->\n        println(\"Preparing payment authorisation: $data\")\n        // Return transaction data if needed, or null\n        null\n    },\n    \n    onPostAuthorisation = { result ->\n        println(\"Payment completed: ${result.status}\")\n        if (result.isSuccess) {\n            println(\"Payment successful!\")\n                                } else {\n            println(\"Payment failed: ${result.errorMessage}\")\n        }\n    }\n)\n\nval cardSubmitComponent = checkout.createComponent<CardSubmitComponent, CardSubmitComponentConfig>(\n    type = ComponentType.CARD_SUBMIT,\n    config = config\n)\n","lang":"kotlin"},"children":[]}]},"headings":[{"value":"Card submit","id":"card-submit","depth":1},{"value":"Styling","id":"styling","depth":2},{"value":"Callbacks","id":"callbacks","depth":2},{"value":"Example","id":"example","depth":2}],"frontmatter":{"seo":{"title":"Card submit"}},"lastModified":"2026-04-22T11:24:40.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/android/card/card-submit","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}