Skip to main content
Version: v3000

Mask and anonymize card data

Handling images and data of payment cards has implications for PCI DSS compliance. BlinkCard can anonymize sensitive fields so they never appear in the data or images it returns.

Anonymization modes​

Each field is anonymized according to an anonymization mode.

  • type: string
  • "none": no anonymization
  • "image-only": the field is covered with a black box in the returned card image, but stays in the result data
  • "result-fields-only": the field is removed from the result data, but stays visible in the image
  • "full-result": the field is removed from both the data and the image

The mode is the same concept on every platform, but the names differ.

  • Web: AnonymizationMode string values "none", "image-only", "result-fields-only", "full-result".
  • Android: AnonymizationMode enum values None, ImageOnly, ResultFieldsOnly, FullResult.
  • iOS: RedactionMode enum cases .none, .imageOnly, .resultFieldsOnly, .fullResult.

Anonymize fields​

Anonymization is configured on the scanning settings and passed when you start the session.

Configure anonymization through scanningSettings.anonymizationSettings and pass it when you create the scanner.

const blinkCard = await createBlinkCard({
licenseKey: "your-license-key",
scanningSettings: {
anonymizationSettings: {
cvvAnonymizationMode: "full-result",
ibanAnonymizationMode: "full-result",
cardholderNameAnonymizationMode: "result-fields-only",
},
},
});

The available per-field modes are:

  • cvvAnonymizationMode (iOS: cvvRedactionMode)
  • ibanAnonymizationMode (iOS: ibanRedactionMode)
  • cardholderNameAnonymizationMode (iOS: cardholderNameRedactionMode)
  • cardNumberPrefixAnonymizationMode (iOS: cardNumberPrefixRedactionMode)

Partially mask the card number​

The card number has its own settings object so you can keep part of it visible, for example the last four digits for display. The object takes a mode plus the number of digits to leave visible at each end.

cardNumberAnonymizationSettings takes a mode plus prefixDigitsVisible and suffixDigitsVisible.

const blinkCard = await createBlinkCard({
licenseKey: "your-license-key",
scanningSettings: {
anonymizationSettings: {
cardNumberAnonymizationSettings: {
mode: "full-result",
prefixDigitsVisible: 0,
suffixDigitsVisible: 4,
},
},
},
});

With the settings above, the card number is masked in both the data and the image, leaving only the last four digits visible.

Mask the card image​

Set a field's mode to "image-only" or "full-result" to cover that field with a black box in the returned card image. This applies to whichever fields you configure, so to redact every sensitive field from the image, set each field's mode accordingly.

If you don't need the card image at all, disable it entirely instead through croppedImageSettings.returnCardImage.