Introduction
Getting Started
MockPay is a SaaS payment gateway simulation platform designed specifically for developers and QA teams to test payment integrations without connecting to production payment processors.
Each client account operates in complete isolation (multi-tenant architecture), ensuring your transactions, API keys, and webhook configurations remain private and separate from other users.
Development Environment Only
MockPay is intended exclusively for testing and development purposes. Do not use MockPay for production transactions or real financial operations.
Self-Hosted Installation
Local Development Setup
If you prefer to run MockPay on your local machine for development and testing purposes, follow these installation steps:
# Clone and install dependencies
composer install
copy .env.example .env
# Database setup (SQLite)
mkdir -Force database
New-Item -ItemType File -Path database\database.sqlite
# Application configuration
php artisan key:generate
php artisan migrate
# Frontend assets
npm install
npm run build
# Start development server
php artisan serve
Environment Configuration
Ensure APP_URL in your .env file matches your local server address (e.g., http://127.0.0.1:8000).
Integration Guide
Quick Start
Create an Account
Register for a free client account at https://www.mockpay.next-it.my.id/register
Generate API Keys
After logging in, navigate to the Client Dashboard to generate your API credentials:
- Navigate to Client Dashboard → API Keys
- Click "Generate New Key"
- Copy your Server Key (prefixed with
sandbox_sk_) - Store the key securely — treat it as a password
Create Your First Transaction
Make an API request to create a payment transaction:
curl -X POST https://m.next-it.my.id/api/v1/payment/create \
-H "Authorization: Bearer sandbox_sk_test_xxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORDER-12345",
"amount": 100000,
"payment_method": "bank_transfer",
"payment_channel": "bca_va",
"customer": {
"name": "John Doe",
"email": "john@example.com",
"phone": "081234567890"
}
}'
Handle the Response
The API returns a structured response containing payment details:
{
"success": true,
"data": {
"transaction_id": "TRX-xxxxx",
"order_id": "ORDER-12345",
"amount": 100000,
"status": "pending",
"payment_url": "https://m.next-it.my.id/payment/TRX-xxxxx",
"virtual_account_number": "8808123456789012",
"expires_at": "2026-01-30T23:59:59Z"
}
}
Simulate Payment Outcome
Direct your customer to the payment_url for the hosted payment page, or use the Manual Override feature in your Client Dashboard to control the transaction outcome directly.
Pro Tip: Use Manual Override to test success, failure, expiration, and refund scenarios without waiting for actual payment flows.
Access Levels
Guest vs Client
Guest (No Authentication)
-
Browse documentation at
/docs - Access payment simulators
- Check API health status
Client (Authenticated)
- Generate and manage API keys
- Create and manage transactions
- Configure webhook endpoints
- Manual override transaction outcomes
- Download transaction reports (JSON/PDF/CSV)
Security
Understanding API Keys
Server Key
sandbox_sk_test_...
Used for server-side API calls. This key must be kept confidential and should never be exposed in client-side code or version control.
Client Key
sandbox_pk_test_...
Used for client-side integrations. This key can be safely exposed in frontend applications as it has limited permissions.
Security Best Practice
Never commit API keys to version control. Store credentials in environment variables or secure secret management systems.
Continue Learning