Download the PHP package gonon/laravel-tripay without Composer
On this page you can find all versions of the php package gonon/laravel-tripay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-tripay
Laravel Tripay
An elegant, idiomatic Laravel integration for the official Gonon Tripay PHP SDK.
Requirements
- PHP 8.2+
- Laravel 11+
- gonon/tripay ^1.0
Installation
Configuration
First, publish the configuration file to your application:
or
This will create a config/tripay.php file in your application where you can customize the default settings.
Next, set up your .env with the credentials from your Tripay Merchant Dashboard:
Usage (Facade)
The package provides an expressive Tripay facade that hooks directly into the underlying SDK. It handles all authentication, configuration, and signature generation behind the scenes seamlessly.
First, ensure you import the facade and necessary DTOs at the top of your classes:
1. Fetching Payment Channels
Retrieve a list of available payment channels you can offer to your customers:
2. Creating a Transaction (Closed Payment)
Create a transaction and automatically generate a checkout URL for the customer. The SDK will automatically generate the HMAC signature using your private key.
3. Fetching Transaction Details
Retrieve the real-time status and details of a transaction using your merchant reference.
4. Fee Calculator
Calculate the total fees for a specific payment channel before creating a transaction.
5. Webhook Signature Verification
When Tripay sends a webhook notification to your application, you must verify the signature to ensure the payload is authentic.
Advanced: Dependency Injection & Container
If you prefer passing the client via Dependency Injection instead of using the static Facade, the TripayClient is automatically bound to the Service Container as a singleton.
You can also resolve the client manually using the app() helper anywhere in your application: