chip_dataHardwareLocale Aware

Mock Jutsu HOW-TO | UK

The chip_data function within the mock-jutsu library provides developers with a robust solution for generating simulated EMV (Europay, Mastercard, and Visa) chip information. In the complex world of financial technology, obtaining high-quality test data is often a bottleneck due to strict security regulations and the scarcity of specialised hardware. By using mock-jutsu, engineers can instantly produce realistic Integrated Circuit Card (ICC) data that follows the strict Tag-Length-Value (TLV) encoding standard. This ensures that payment processing systems, point-of-sale (POS) terminals, and banking applications can be rigorously tested without relying on physical cards or sensitive production information.

At its core, the chip_data generator produces complex hexadecimal strings that mirror the actual responses received from a smart card during a contact or contactless transaction. These strings include essential tags such as 9F02 (Amount, Authorised), 9F03 (Amount, Other), and 5F2A (Transaction Currency Code), formatted precisely to meet international ISO/IEC 7816 standards. This level of detail is crucial for testing the parsing logic of payment gateways and ensuring that transaction kernels correctly interpret the data packets. By utilising this mock data, development teams can simulate various transaction scenarios, including successful authorisations, declined payments, and complex edge cases involving unusual currency codes or transaction amounts.

One of the primary benefits of using mock-jutsu for hardware simulation is the seamless integration across different environments. Whether you are scripting in Python using the native jutsu.generate('chip_data') call, executing quick tests via the command-line interface, or performing large-scale load testing in JMeter with the custom function plugin, the consistency of the output remains unparalleled. This versatility allows QA engineers and developers to maintain a unified testing strategy across the entire software development lifecycle. Furthermore, because the generated data is entirely synthetic, it eliminates the risks associated with handling real Personal Identifiable Information (PII), significantly aiding in PCI-DSS compliance and general data protection efforts.

Ultimately, the chip_data function empowers organisations to accelerate their release cycles by removing the dependency on physical testing infrastructure. Instead of manually configuring card readers or using limited sets of physical test cards, developers can automate the generation of thousands of unique TLV packets. This capability is particularly beneficial for stress testing and performance benchmarking, where large volumes of varied test data are required to identify potential bottlenecks in high-traffic payment environments. By integrating mock-jutsu into your CI/CD pipeline, you ensure that your hardware-dependent software remains resilient, secure, and ready for global deployment.

CLI Usage
mockjutsu generate chip_data --locale TRmockjutsu generate chip_data --locale DEmockjutsu bulk chip_data --count 10 --locale TRmockjutsu export chip_data --count 10 --format json --locale TRmockjutsu export chip_data --count 10 --format csv --locale TRmockjutsu export chip_data --count 10 --format sql --locale TR# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate chip_data --locale TR --maskmockjutsu bulk chip_data --count 5 --locale TR --mask
Python API
from mockjutsu import jutsujutsu.generate('chip_data', locale='TR')jutsu.bulk('chip_data', count=10, locale='TR')jutsu.template(['chip_data'], count=5, locale='TR')# with --locale parameterjutsu.generate('chip_data', locale='TR', locale='TR')# mask=True: regulation-compliant outputjutsu.generate('chip_data', locale='TR', mask=True)jutsu.bulk('chip_data', count=5, locale='TR', mask=True)
JMeter
${__mockjutsu_hardware(chip_data,TR)}# JMeter Function: __mockjutsu_hardware# Parameter 1: chip_data# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_hardware(chip_data,DE)}# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_hardware(chip_data,TR,mask)}
REST API
GET /generate/chip_data?locale=TR# → {"type":"chip_data","result":"...","status":"ok"}GET /bulk/chip_data?count=10&locale=TRPOST /template {"types":["chip_data"],"count":1,"locale":"TR"}# mask=true: regulation-compliant outputGET /generate/chip_data?locale=TR&mask=trueGET /bulk/chip_data?count=5&locale=TR&mask=true

Parameters

Parameter Values Description
--locale TR|UK|US|DE|FR|RU Region / locale for locale-aware output
--locale TR|UK|US|DE|FR|RU Region / locale for locale-aware output
--mask true | false Return a regulation-compliant masked value (PCI DSS, GDPR, KVKK…)

Other Languages