#AGNI Systems Laravel Test
Deadline: 2 Days

Wallet Integration
Architecture

Design a resilient wallet system using bKash Tokenized Checkout. Prioritize atomic transactions, idempotency, and automated reconciliation.

Access Public Sandbox

* You are not restricted to the public sandbox. If you have official bKash API access, you are encouraged to use it.

Public Sandbox Credentials

Use these if you do not have your own official API credentials.

Whitelisted Numbers
01929918378
01619777283
01619777282
01823074817
01770618575
OTP (Static)
123456
PIN
12121
Laravel
Core API
Vue.js
Frontend
Tailwind
UI Kit
Redis
Cache & Locks
MySQL
Storage
Nginx
Web Server
00

Identity & Localization

Core User Session. Implement a secure authentication layer. Wallet balances and agreement tokens must be strictly scoped to the user.

Localization (i18n) Required

The application must support switching between English and Bangla. Use standard Laravel Localization (PHP/JSON files). Implement a language toggle and persist preference.

LocalStorage Sanctum/Passport Laravel Localization
01

Agreement Binding

Execute createAgreement to generate the binding flow. Upon success, store the returned agreementId permanently.

"This ID is the master key for future charges. Encrypt it at rest."
// Store the Agreement
$wallet = Wallet::create([
    'user_id' => $user->id,
    'token'   => $response['agreementId'], 
    'masked'  => $response['payerAccount']
]);
02

Balance Injection

Payment w/ Agreement

Charge the user without OTP re-entry.

POST /tokenized-checkout/payment-with-agreement/create

Critical: Flow & Lock Strategy

Use Redis to implement an atomic lock (setnx) during the payment process. Prevent double-submissions (e.g., user clicking "Pay" twice).
Handle success, failure, and cancel redirects gracefully.

03

Refund Logic

Refunds require the original trxId and paymentId. The system must support partial refunds and deduct the amount from the internal wallet records.

$payload = [
    'paymentId'    => $pId,
    'trxId'        => $trx,
    'amount'       => '50.00',
    'reason'       => 'User request'
];
04

History & Statements

01. Transaction History UI

Build a comprehensive, paginated view listing all wallet activities (Credits, Debits, Refunds). Users must be able to view their balance history directly on the dashboard.

02. PDF Statement Action

Implement a "Download Statement" button within the history view. This action must trigger the Gotenberg microservice to render the transaction data into a high-fidelity PDF file.

05

Deployment & Infrastructure

Flexible Infrastructure

We focus on results. While Redis and Gotenberg must run via Docker (as they are microservices), the core Application, Web Server, and Database can be dockerized OR set up locally/on a server.

Top Priority

Working Live Demo
Hosting method irrelevant.
Must be testable via URL.
# Service Requirements
Docker Mandatory
⦿ Redis (Cache/Locks)
⦿ Gotenberg (PDF)
Flexible (Docker or Self-Hosted)
⦿ Laravel App (PHP 8.2)
⦿ MySQL 8.0
⦿ Nginx / Apache

Submission Protocol

Authenticity & AI Tools

We understand AI tools (ChatGPT, Copilot) are part of modern development. You are free to use them for assistance, but do not let them write the core logic for you. The interview will focus heavily on why you structured the code the way you did. You must be able to explain every line of your implementation. Code you cannot explain is effectively code you didn't write.

Public Repository

Host on GitHub. Ensure .gitignore is properly configured (no vendor/node_modules).

Clean Commit Log

Atomic commits with descriptive messages. No "WIP" or "Fixed bug" spam.

Documentation

Comprehensive README.md detailing architecture choices and startup instructions.

Copyright © 1995 - 2026 Agni Systems PLC. All Right Reserved.