> For the complete documentation index, see [llms.txt](https://docs.verygoodsecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verygoodsecurity.com/vault/developer-tools/vgs-collect/android-sdk/card-scan.md).

# Card Scanner

PCI compliance during scanning is required for companies that deal with payment card information. VGS Collect SDK provides several card scan solutions for the Payment Card Industry to help protect your businesses and the sensitive information of your consumers. You can add one of the proposed card scanning solutions into your application.

**BlinkCard** - is an AI-driven credit card scanning solution\
The VGS card scanner module helps to integrate the scanner with VGSCollectSDK.

<figure><img src="/files/qXMb3Xj8JLnaOTvsyBLp" alt=""><figcaption></figcaption></figure>

**It's required to use only the Card Scan Modules listed here, which are audited by VGS PCI requirements.**

## CardScan (BlinkCard) module <a href="#cardscan-blinkcard-module" id="cardscan-blinkcard-module"></a>

You can add a card scanning solution to your application by adding android BlinkCard adapter.

It provides a fast and easy way to scan payment cards and import them to VGS Collect. This tutorial is aimed at helping you to adapt the [BlinkCard SDK](https://github.com/blinkcard/blinkcard-android) to the VGS Collect Android SDK.

NoteWe offer already existing solution for using BlinkCard and still stay in PCI scope. Please contact with [BlinkCard team](https://github.com/blinkcard/blinkcard-android/issues) if you have any issues related to the core API of the card scanner.

See below for more information about how to integrate BlinkCard SDK into your app, and also check the latest release notes.

You can start by watching our step-by-step tutorial, in which you’ll find out how to make BlinkCard SDK a part of your Android app.

To see BlinkCard in action, check our demo app.

### Pricing <a href="#pricing" id="pricing"></a>

`BlinkCard` The module is a paid integration. Please [contact](https://microblink.com/contact-us/) Microblink for more details.

### Before you start <a href="#before-you-start" id="before-you-start"></a>

Using the BlinkCard API in your app requires a valid license. You can obtain a trial license by registering for [Microblink dashboard](https://commerce-platform-staging.blinkreceipt.com/login). After registering, you will be able to generate a license for your app. The license is bound to the package name of your app, so please make sure you enter the correct package name when asked.

### Requirements

* VGS Collect configured in your app (vault ID + environment)
* Valid BlinkCard license key from Microblink
* App minimum SDK: **24**

### Step 1 - Add the dependency

```kotlin
// build.gradle.kts (app module)
dependencies {
    implementation("com.verygoodsecurity:vgscollect:<your-vgscollect-version>")
    implementation("com.verygoodsecurity.api:adapter-blinkcard:1.0.6")
}

repositories {
    google()
    mavenCentral()
}
```

### Step 2 - Configure scan settings

Create scan settings with your BlinkCard license key:

```kotlin
import com.microblink.blinkcard.core.BlinkCardSdkSettings
import com.microblink.blinkcard.ux.contract.BlinkCardScanActivitySettings

val scanSettings = BlinkCardScanActivitySettings(
    BlinkCardSdkSettings("YOUR_BLINKCARD_LICENSE_KEY")
)
```

### Step 3 - Build the scan intent

Map your VGS Collect field names to the scanner. The adapter uses these to populate your fields after a successful scan:

```kotlin
import com.verygoodsecurity.api.blinkcard.VGSBlinkCardIntentBuilder

val intent = VGSBlinkCardIntentBuilder(this, scanSettings)
    .setCardNumberFieldName("card_number")         // your VGS field name
    .setCardHolderFieldName("card_holder_name")    // your VGS field name
    .setExpirationDateFieldName("card_expiration") // your VGS field name
    .setCVCFieldName("card_cvc")                   // your VGS field name
    .build()
```

All field name setters are optional — only configure the ones your form uses.

### Step 4 - Launch the scanner

```kotlin
startActivityForResult(intent, SCAN_REQUEST_CODE)
```

### Step 5 - Handle the result

Forward the result to VGS Collect. The adapter automatically populates your bound fields:

```kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    super.onActivityResult(requestCode, resultCode, data)
    if (requestCode == SCAN_REQUEST_CODE) {
        vgsCollect.onActivityResult(requestCode, resultCode, data)
    }
}
```

On a successful scan, your VGS Collect fields are populated with tokenized card data. No raw card values are ever exposed to your app.

### Error handling

The adapter handles all scanner errors internally. Your `onActivityResult` is always called regardless of outcome:

| Scenario                   | Result                                          |
| -------------------------- | ----------------------------------------------- |
| Card scanned successfully  | Fields populated, `RESULT_OK`                   |
| User cancelled             | Fields not populated, `RESULT_CANCELED`         |
| License invalid or expired | Fields not populated, `RESULT_OK`, error logged |
| Card not recognised        | Fields not populated, `RESULT_OK`, error logged |

If your license is invalid, contact Microblink to verify or renew it.

### Security

* Scanned card data is never exposed to your app in raw form.
* All values are routed through VGS Collect's secure tokenization pipeline.
* The adapter does not log, store, or cache any sensitive card values.

### Further information

For detailed setup, dependency information, and troubleshooting, refer to the [README](https://github.com/verygoodsecurity/vgs-collect-android/blob/main/vgscollect-blinkcard/README.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.verygoodsecurity.com/vault/developer-tools/vgs-collect/android-sdk/card-scan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
