Laravel package for LapakGaming Reseller API integration.
This package provides a simple and efficient method to integrate with LapakGaming Reseller API using Laravel. It supports all major operations including product management, order creation, and balance checking.
composer require aungmyokyaw/lapakgaming
You will need to publish the configuration file to your application:
php artisan vendor:publish --tag="lapakgaming-config"
After publishing, you will find the configuration file at config/lapakgaming.php
. Fill out the necessary data:
api_key
: Your LapakGaming API Secret Keyenvironment
: 'development' or 'production'callback_url
: Your webhook callback URL (optional)
- Get Categories
- Get Products
- Get All Products
- Get Best Products
- Get Balance
- Order
- Order Status
- Supported Country Codes
$categories = LapakGaming::getCategories();
// Get all products in a category
$products = LapakGaming::getProductsByCategory('VAL');
// Get products in category for specific country
$products = LapakGaming::getProductsByCategory('VAL', 'id');
// Get products by product code
$products = LapakGaming::getProductsByCode('VAL1650-S14');
// Get products by code for specific country
$products = LapakGaming::getProductsByCode('VAL1650-S14', 'my');
// Filter by both category and product code
$products = LapakGaming::getProductsByCategoryAndCode('VAL', 'VAL1650-S14', 'id');
$allProducts = LapakGaming::getAllProducts();
// Get best products by category
$bestProducts = LapakGaming::getBestProductsByCategory('ML');
// Get best products by category for specific country
$bestProducts = LapakGaming::getBestProductsByCategory('ML', 'id');
// Get best products by group product code
$bestProducts = LapakGaming::getBestProductsByGroupCode('ML1288_166');
// Get best products by group code for specific country
$bestProducts = LapakGaming::getBestProductsByGroupCode('ML1288_166', 'my');
// Filter by both category and group product code
$bestProducts = LapakGaming::getBestProductsByCategoryAndGroupCode('ML', 'ML1288_166', 'id');
$balance = LapakGaming::getBalance();
// Simplest order - quantity defaults to 1
$order = LapakGaming::setProduct('ML78_8-S2')
->setUser('123456789') // Game User ID
->createOrder();
// For games requiring zone or server ID
$order = LapakGaming::setProduct('ML78_8-S2')
->setUser('123456789', '2345') // User ID + Zone/Server ID
->createOrder();
// For games requiring username
$order = LapakGaming::setProduct('ML78_8-S2')
->setUser('123456789', '2345', 'additional_information') // User ID + Zone + Username
->createOrder();
// Validate price to prevent order if price changed
$order = LapakGaming::setProduct('ML78_8-S2', 15000) // Product code + expected price
->setUser('123456789', '2345', 'additional_information')
->createOrder();
// Order multiple items
$order = LapakGaming::setProduct('ML78_8-S2')
->setUser('123456789')
->setQuantity(5) // Order 5 items
->createOrder();
// Specify country for the order
$order = LapakGaming::setProduct('ML78_8-S2')
->setUser('123456789')
->setCountryCode('my') // Malaysia
->createOrder();
// For games requiring login credentials
$order = LapakGaming::setProduct('LOGIN_GAME_PRODUCT')
->setUser('123456789')
->setOrderDetail('Password : mypass123 Nickname : PlayerOne Security code : 9876')
->createOrder();
// Prevent duplicate orders with unique reference ID
$order = LapakGaming::setProduct('ML78_8-S2')
->setUser('123456789')
->setPartnerReferenceId('order-' . time()) // Unique reference
->createOrder();
// Override default callback URL for this order
$order = LapakGaming::setProduct('ML78_8-S2')
->setUser('123456789')
->setCallbackUrl('https://yoursite.com/custom-callback') // Custom callback
->createOrder();
// Order using group product instead of specific product code
$order = LapakGaming::setGroupProduct('mobile-legends')
->setUser('123456789', '2345')
->setCountryCode('id') // Indonesia
->createOrder();
// Order with all possible parameters
$order = LapakGaming::setProduct('ML78_8-S2', 15000) // Product + price validation
->setUser('123456789', '2345', 'additional_information') // Complete user info
->setQuantity(2) // Multiple items
->setCountryCode('my') // Malaysia
->setOrderDetail('Password : 123 Nickname : nick Security code : 1234') // Login details
->setPartnerReferenceId('unique-order-' . time()) // Idempotency
->setCallbackUrl('https://yoursite.com/lapakgaming/callback') // Custom callback
->createOrder();
Method | Parameter | Required | Example |
---|---|---|---|
setProduct() |
product_code, price | product_code required | setProduct('ML78_8-S2', 15000) |
setGroupProduct() |
group_product, country | group_product required | setGroupProduct('mobile-legends', 'id') |
setUser() |
user_id, additional_id, additional_info | user_id for most games | setUser('123456789', '2345', 'additional_information') |
setQuantity() |
count_order | optional (default: 1) | setQuantity(5) |
setCountryCode() |
country_code | optional | setCountryCode('my') |
setOrderDetail() |
orderdetail | optional | setOrderDetail('Password : 123') |
setPartnerReferenceId() |
partner_reference_id | optional | setPartnerReferenceId('unique-123') |
setCallbackUrl() |
override_callback_url | optional | setCallbackUrl('https://site.com/cb') |
Based on LapakGaming API documentation, here are all the parameters you can use when creating orders:
- product_code: Specific product code from
getProductsByCategory()
orgetProductsByCode()
- group_product: Group product code from
getBestProductsByCategory()
orgetBestProductsByGroupCode()
- count_order: Number of items to order (defaults to 1)
- user_id: Game User ID (required for most games, optional for vouchers)
- additional_id: Zone ID or Server ID (required for some games)
- additional_information: Username ID (required for some games)
- orderdetail: Detailed information for games requiring login credentials
- Example: "Password : 123 Nickname : nick ingame Security code : 1234"
- price: Price validation to prevent order if price changed
- country_code: Country specification (optional, default: 'id')
- partner_reference_id: Unique identifier to prevent duplicate orders
- override_callback_url: Custom callback URL for this order
// Check by transaction ID (tid)
$status = LapakGaming::checkOrderStatusByTid('RA171341142175668140');
// Check by partner reference ID
$status = LapakGaming::checkOrderStatusByRefId('R123');
// Check with both transaction ID and partner reference ID
$status = LapakGaming::checkOrderStatusByTidAndRefId('RA171341142175668140', 'R123');
// Check by transaction ID only
$status = LapakGaming::checkOrderStatusBy('RA171341142175668140');
// Check by partner reference ID only
$status = LapakGaming::checkOrderStatusBy(null, 'R123');
// Check by both
$status = LapakGaming::checkOrderStatusBy('RA171341142175668140', 'R123');
When using group products or country-specific operations, use these country codes:
id
- Indonesia (default)my
- Malaysiaph
- Philippinesth
- Thailandus
- United Statesbr
- Brazilvn
- Vietnam
MIT License