Skip to content

Add Track 1 and Track 2 Parse / Build operations #10

@J8k3

Description

@J8k3

Summary

Add payment card magnetic stripe track operations:

  • Parse Track 1 — decode ISO 7813 Track 1 format into named fields
  • Parse Track 2 — decode ISO 7813 Track 2 format into named fields
  • Build Track 1 — encode fields into Track 1 format string
  • Build Track 2 — encode fields into Track 2 format string

Track 1 Format (IATA)

%B4111111111111111^SMITH/JOHN^2512101000000000?
 ^ ^ PAN          ^ Name      ^ Exp/SC/Disc    ^

Fields: FC (Format Code B), PAN, Separator (^), Name, Separator (^), Expiry (YYMM), Service Code, Discretionary Data, End Sentinel, LRC

Track 2 Format (ABA)

;4111111111111111=25121011234500000000?
 ^ PAN          ^ Exp/SC/Disc         ^

Fields: SS (;), PAN, Separator (=), Expiry (YYMM), Service Code, Discretionary Data, End Sentinel, LRC

Service Code Decoding

The 3-digit service code should be decoded into:

  • Digit 1: interchange rules (1=international, 2=international+IC, 5=national, 6=national+IC, 7=private, 9=test)
  • Digit 2: authorization technology (0=normal, 2=IC with contacts, 4=IC without contacts)
  • Digit 3: allowed services / PIN requirements (0=normal/no restriction, 1=normal/PIN required, 2=merchandise only, 3=cashback/PIN req, 4=cash only, 5=goods/services/no cash, 6=no restriction/prompt PIN, 7=goods/services/PIN req)

Module

Payment

References

  • ISO/IEC 7813: Financial transaction cards
  • EMVCo: Track data requirements for contactless

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions