PHPackages                             fahipaydev/gateway-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. fahipaydev/gateway-laravel

ActiveLaravel-package[Payment Processing](/categories/payments)

fahipaydev/gateway-laravel
==========================

FahiPay Payment Gateway integration for Laravel

00PHP

Since Apr 15Pushed 1mo agoCompare

[ Source](https://github.com/eragon2020-dev/fahipay-gateway-laravel)[ Packagist](https://packagist.org/packages/fahipaydev/gateway-laravel)[ RSS](/packages/fahipaydev-gateway-laravel/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

FahiPay Gateway - Laravel Package
=================================

[](#fahipay-gateway---laravel-package)

FahiPay Payment Gateway integration for Laravel 13. Accept payments from Maldives using FahiPay's secure payment infrastructure.

**API Endpoints:**

- Create Transaction: `POST https://fahipay.mv/api/merchants/createTxn/`
- Query Transaction: `GET https://fahipay.mv/api/merchants/getTxn/?mref=`

[![Latest Version on Packagist](https://camo.githubusercontent.com/e62cc07b88ab7a7f9d92f806b6f87b6472e8b84087605ed2dde74cb815d708b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f666168697061792f676174657761792d6c61726176656c2e737667)](https://packagist.org/packages/fahipay/gateway-laravel)[![PHP Version](https://camo.githubusercontent.com/13d8796c0439694da4c99c35f15f5042d7ae2845433ff4773ec4d169441705be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f666168697061792f676174657761792d6c61726176656c2e737667)](https://packagist.org/packages/fahipay/gateway-laravel)[![License](https://camo.githubusercontent.com/e69cc914f28461cf97d1fe6098cf65f123dca2c117d882ee7addfc7061d12375/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f666168697061792f676174657761792d6c61726176656c2e737667)](https://packagist.org/packages/fahipay/gateway-laravel)

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Configuration](#configuration)
- [Quick Start](#quick-start)
- [Usage](#usage)
    - [Basic Payment](#basic-payment)
    - [With Redirect](#with-redirect)
    - [Check Payment Status](#check-payment-status)
    - [Handle Callbacks](#handle-callbacks)
- [Database Integration](#database-integration)
- [Events](#events)
- [Facades](#facades)
- [Routes](#routes)
- [Views](#views)
- [Testing](#testing)
- [Examples](#examples)
    - [Staff Fee Payment](#example-1-staff-fee-payment)
    - [Subscription Payment](#example-2-subscription-payment)
    - [Event Registration](#example-3-event-registration)
- [Troubleshooting](#troubleshooting)

---

Features
--------

[](#features)

- Easy integration with FahiPay payment gateway
- Support for test mode
- Event-driven architecture
- Database model for payment tracking
- Built-in callback handling
- Artisan commands for testing
- Multiple payment methods
- Secure signature verification

---

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 13.0+
- PHP cURL extension
- PHP JSON extension

---

Installation
------------

[](#installation)

### Step 1: Install via Composer

[](#step-1-install-via-composer)

```
composer require fahipay/gateway-laravel
```

### Step 2: Run Installation Command

[](#step-2-run-installation-command)

```
php artisan fahipay:install
```

This command will:

- Publish the configuration file (`config/fahipay.php`)
- Publish database migrations

### Step 3: Run Migrations

[](#step-3-run-migrations)

```
php artisan migrate
```

---

Configuration
-------------

[](#configuration)

### Step 1: Configure Environment Variables

[](#step-1-configure-environment-variables)

Add your FahiPay credentials to your `.env` file:

```
# FahiPay Configuration
FAHIPAY_MERCHANT_ID=your_merchant_id
FAHIPAY_SECRET_KEY=your_secret_key

# Test Mode (set to false for production)
FAHIPAY_TEST_MODE=true

# URLs (optional - defaults are provided)
FAHIPAY_RETURN_URL=/fahipay/callback/success
FAHIPAY_CANCEL_URL=/fahipay/callback/cancel
FAHIPAY_ERROR_URL=/fahipay/callback/error
```

**To get your credentials:**

1. Visit
2. Register or login to your merchant account
3. Get your Merchant ID and Secret Key

### Step 2: Verify Configuration

[](#step-2-verify-configuration)

Check your `config/fahipay.php` after publishing:

```
// config/fahipay.php
