The pos_receipt function within the mock-jutsu library provides developers with a streamlined method for generating realistic, pre-formatted point-of-sale documentation. Designed specifically for the CardPhysics category, this tool produces 40-character wide text blocks that mirror the output of standard thermal printers used in retail environments. By integrating pos_receipt into your development workflow, you can ensure that your financial applications handle physical transaction records with precision, using reliable mock data that adheres to industry-standard formatting conventions.
Each generated string follows a strict structural template to maintain consistency across testing environments. The output typically begins with a placeholder merchant header, "MOCKJ MERCHANT SERVICES," followed by a masked Primary Account Number (PAN) that displays only the final four digits, such as "**** **** **** 9012." To further enhance the realism of the test data, the function includes a unique mock authorisation code and a prominent "TEST" disclaimer. This disclaimer is crucial for distinguishing simulated transactions from genuine financial records, preventing accidental processing in production-like scenarios while maintaining the integrity of the mock-jutsu ecosystem.
For software engineers and quality assurance specialists, the pos_receipt function is invaluable for validating receipt-parsing algorithms and user interface layouts. Whether you are testing the alignment of text on a mobile POS application or verifying that a backend system can correctly extract authorisation codes from a raw text blob, this function provides the necessary variety and structure. It eliminates the need for manual string manipulation, allowing teams to focus on edge-case scenarios, such as character overflow or specific alignment requirements, using consistent and predictable mock data.
Integration is remarkably flexible, catering to diverse technical stacks. Developers can invoke the function directly within a Python script using the jutsu.generate interface or execute it via the command-line interface for rapid prototyping. Furthermore, the inclusion of a dedicated JMeter function allows performance testers to inject realistic receipt data into high-load scenarios seamlessly. By leveraging the pos_receipt utility, development teams can significantly reduce the time spent on data preparation, ensuring that their payment processing systems are robust, compliant, and ready for real-world deployment.
mockjutsu generate pos_receipt --locale TRmockjutsu generate pos_receipt --locale DEmockjutsu bulk pos_receipt --count 10 --locale TRmockjutsu export pos_receipt --count 10 --format json --locale TRmockjutsu export pos_receipt --count 10 --format csv --locale TRmockjutsu export pos_receipt --count 10 --format sql --locale TR# --mask: regulation-compliant output (PCI DSS / GDPR / KVKK)mockjutsu generate pos_receipt --locale TR --maskmockjutsu bulk pos_receipt --count 5 --locale TR --maskfrom mockjutsu import jutsujutsu.generate('pos_receipt', locale='TR')jutsu.bulk('pos_receipt', count=10, locale='TR')jutsu.template(['pos_receipt'], count=5, locale='TR')# with --locale parameterjutsu.generate('pos_receipt', locale='TR', locale='TR')# mask=True: regulation-compliant outputjutsu.generate('pos_receipt', locale='TR', mask=True)jutsu.bulk('pos_receipt', count=5, locale='TR', mask=True)${__mockjutsu_cardphysics(pos_receipt,TR)}# JMeter Function: __mockjutsu_cardphysics# Parameter 1: pos_receipt# Parameter 2: locale (TR/UK/US/DE/FR/RU)${__mockjutsu_cardphysics(pos_receipt,DE)}# Add 'mask' keyword to get a regulation-compliant masked value${__mockjutsu_cardphysics(pos_receipt,TR,mask)}GET /generate/pos_receipt?locale=TR# → {"type":"pos_receipt","result":"...","status":"ok"}GET /bulk/pos_receipt?count=10&locale=TRPOST /template {"types":["pos_receipt"],"count":1,"locale":"TR"}# mask=true: regulation-compliant outputGET /generate/pos_receipt?locale=TR&mask=trueGET /bulk/pos_receipt?count=5&locale=TR&mask=true| 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…) |