Download the PHP package letbar/loketqris-sdk without Composer
On this page you can find all versions of the php package letbar/loketqris-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download letbar/loketqris-sdk
More information about letbar/loketqris-sdk
Files in letbar/loketqris-sdk
Package loketqris-sdk
Short Description PHP SDK for LoketQRIS API integration for Laravel
License MIT
Informations about the package loketqris-sdk
LoketQRIS SDK
A PHP SDK for integrating with LoketQRIS payment gateway APIs. Built for Laravel applications with support for multi-tenant architectures and event-driven workflows.
Features
- ๐ Secure Authentication - HMAC-SHA256 signature generation with automatic timestamp handling
- ๐ข Multi-tenant Support - Pass credentials per-request or use config-based defaults
- ๐ก Event-driven Architecture - Hook into API lifecycle via Laravel events
- ๐ Webhook Handling - Built-in controllers for
/b2b/tokenand/qris/notifyendpoints - โ Type-safe DTOs - Request/response objects with helper methods
- ๐งช Fully Tested - Comprehensive test suite with 72 tests
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x
Installation
Via Composer
Install loketqris-sdk:
Publish Configuration
Configuration
Environment Variables
Config File
Usage
Generate QRIS
Query QRIS Transaction
Multi-tenant Usage
For multi-tenant applications, pass credentials per-request:
Using the Client Directly
Events
The SDK dispatches events throughout the API lifecycle, allowing you to hook in for logging, monitoring, or custom business logic.
Available Events
| Event | Description | Properties |
|---|---|---|
QrisGenerating |
Before generate API call | $request, $credential |
QrisGenerated |
After successful generate | $request, $response, $credential |
QrisQuerying |
Before query API call | $request, $credential |
QrisQueried |
After successful query | $request, $response, $credential |
TokenRequested |
Webhook: token requested | $request, $kodeLoket, $apiKey |
TokenIssued |
Webhook: token issued | $token, $kodeLoket, $apiKey, $expiresIn |
NotificationReceived |
Webhook: payment notification | $payload, $request |
Listening to Events
Example Listeners
Webhook Handling
The SDK automatically registers webhook routes for receiving callbacks from LoketQRIS.
Default Routes
| Method | Path | Description |
|---|---|---|
| POST | /b2b/token |
Token exchange endpoint |
| POST | /qris/notify |
Payment notification endpoint |
Customizing Routes
Disabling SDK Routes
If you need full control over routing:
Then define your own routes using the SDK controllers:
Multi-tenant Webhook Support
For multi-tenant apps, implement the CredentialResolver contract to resolve credentials for incoming webhooks:
Register the resolver in your service provider:
Exception Handling
The SDK throws specific exceptions for different error scenarios:
Signature Generation
The SDK handles signature generation automatically, but you can also use it directly:
DTOs Reference
CredentialData
GenerateQrisRequest
GenerateQrisResponse
QueryQrisRequest
QueryQrisResponse
NotificationPayload
License
MIT License. See LICENSE for details.
All versions of loketqris-sdk with dependencies
illuminate/contracts Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0