{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-android/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["code-walkthrough","step"]},"type":"markdown"},"seo":{"title":"Card Scanner | Finix Android Reference","description":"Enable built-in camera card scanning in the Finix Android Payment Sheet SDK. The SDK handles scanning automatically - no additional configuration required.","siteUrl":"https://docs.finix.com","llmstxt":{"hide":false,"sections":[{"title":"Getting Started","includeFiles":["guides/getting-started/**/*.md"],"excludeFiles":[]},{"title":"Online Payments","includeFiles":["guides/online-payments/**/*.md"],"excludeFiles":["guides/online-payments/payment-features/fsa-hsa-non-healthcare-mcc.md"]},{"title":"In-Person Payments","includeFiles":["guides/in-person-payments/**/*.md"],"excludeFiles":[]},{"title":"Subscriptions","includeFiles":["guides/subscriptions/**/*.md"],"excludeFiles":[]},{"title":"After the Payment","includeFiles":["guides/after-the-payment/**/*.md"],"excludeFiles":[]},{"title":"Managing Operations","includeFiles":["guides/managing-operations/**/*.md"],"excludeFiles":[]},{"title":"Platform Payments","includeFiles":["guides/platform-payments/**/*.md"],"excludeFiles":[]},{"title":"Payouts","includeFiles":["guides/payouts/**/*.md"],"excludeFiles":[]},{"title":"Low-Code / No-Code","includeFiles":["low-code-no-code/**/*.md"],"excludeFiles":[]},{"title":"Developers","includeFiles":["additional-resources/developers/**/*.md"],"excludeFiles":[]},{"title":"Plugins","includeFiles":["additional-resources/plugins/**/*.md"],"excludeFiles":[]},{"title":"Industry Considerations","includeFiles":["guides/industry-considerations/**/*.md"],"excludeFiles":[]},{"title":"Regional Considerations","includeFiles":["guides/regional-considerations/**/*.md"],"excludeFiles":[]},{"title":"Release Notes","includeFiles":["release-notes/**/*.md"],"excludeFiles":[]}]},"image":"/assets/android-online-card-scanner.50ff0082eb90058678ca319581ff0e92efe72988090cdc218f334dc6202b1809.04fe652d.png"},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"CodeWalkthrough","attributes":{"__idx":1,"filters":{},"filesets":[{"files":[{"path":"android/online/_filesets/card-scanner.kt","content":[{"start":0,"condition":{"steps":["permission"]},"children":["// AndroidManifest.xml","// <uses-permission android:name=\"android.permission.CAMERA\" />"]},"",{"start":5,"condition":{"steps":["result-handling"]},"children":["CompletePaymentSheet(","    configuration = configuration,","    amount = 1000L,","    currency = \"USD\",","    onCancel = { /* buyer dismissed */ },","    onSuccess = { response ->","        // Same callback for manually-entered and scanned cards.","        val tokenId = response.tokenizedResponse.id","        // …forward tokenId to your backend.","    },","    onFailure = { error ->","        /* surface error to buyer */","    },",")"]},""],"metadata":{"steps":["permission","result-handling"]},"basename":"card-scanner.kt","language":"kotlin"}],"downloadAssociatedFiles":[]}],"steps":[{"id":"permission","heading":"Add the camera permission"},{"id":"result-handling","heading":"Handling the scanned card"}],"inputs":{},"toggles":{}},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"card-scanner","__idx":0},"children":["Card Scanner"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Android Payment Sheet SDK includes built-in card scanning powered by the device camera and on-device ML Kit text recognition. The buyer initiates a scan from inside the card number field - the SDK requests camera access, scans the card, and auto-populates the card number and expiry fields. No composable parameters are required to enable it; declare the camera permission below and scanning is available in every ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/android/online/payment-sheet"},"children":["PaymentSheet"]}," variant."]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"permission","heading":"Add the camera permission"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the following permission to your app's ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AndroidManifest.xml"]},". The SDK handles the runtime permission request automatically, but the permission must be declared in your manifest or the OS will not grant access."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"xml","header":{"controls":{"copy":{}}},"source":"<uses-permission android:name=\"android.permission.CAMERA\" />\n","lang":"xml"},"children":[]}]},{"$$mdtype":"Tag","name":"CodeStep","attributes":{"id":"result-handling","heading":"Handling the scanned card"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Scanned card details populate the sheet's fields just like manual entry. When the buyer submits the sheet, the tokenization result is delivered through the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/android/online/payment-sheet#param-callbacks"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onSuccess"]}]}," callback used for every submission - there is no separate scan callback to handle."]}]}]}]},"headings":[{"value":"Card Scanner","id":"card-scanner","depth":1}],"frontmatter":{"seo":{"title":"Card Scanner | Finix Android Reference","description":"Enable built-in camera card scanning in the Finix Android Payment Sheet SDK. The SDK handles scanning automatically - no additional configuration required.","image":"/assets/android-online-card-scanner.50ff0082eb90058678ca319581ff0e92efe72988090cdc218f334dc6202b1809.04fe652d.png"},"markdown":{"toc":{"hide":true}},"footer":{"hide":true}},"lastModified":"2026-11-17T17:19:13.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/android/online/card-scanner","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}