PHPackages                             aimensasi/fpx - 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. aimensasi/fpx

ActiveLibrary

aimensasi/fpx
=============

A laravel implementation for FPX payment service

1.0.3-beta(4y ago)7543[1 issues](https://github.com/aimensasi/fpx/issues)MITPHPPHP ^7.4|^8.0

Since Jan 26Pushed 4y ago2 watchersCompare

[ Source](https://github.com/aimensasi/fpx)[ Packagist](https://packagist.org/packages/aimensasi/fpx)[ Docs](https://github.com/aimensasi/fpx)[ RSS](/packages/aimensasi-fpx/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Very short description of the package
=====================================

[](#very-short-description-of-the-package)

This package provides laravel implementations for Paynet FPX services.

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

[](#installation)

You can install the package via composer:

```
composer require aimensasi/fpx
```

Then run the publish command to publish the config files and support controller

```
php artisan vendor:publish --provider="Aimensasi\FPX\FPXServiceProvider"
```

This will generate the following files

- The config file with default setup for you to override `fpx.php`
- The controller that will receive payment response and any host-to-host events `Http/Controllers/FPX/Controller.php`

Setups
------

[](#setups)

1. Add your redirect urls and your Seller and Exchange Id to the `.env` file.

```
FPX_INDIRECT_URL=https://app.test/payments/fpx/callback
FPX_INDIRECT_PATH=payments/fpx/callback
FPX_DIRECT_URL=https://app.test/payments/fpx/direct-callback
FPX_DIRECT_PATH=payments/fpx/direct-callback

FPX_EXCHANGE_ID=
FPX_SELLER_ID=
```

2. After generating your certificates add them to your app. By default, we look for the certificates inside the following directives.

```
'certificates' => [
	'uat' => [
		'disk' => 'local', // S3 or Local. Don't put your certificate in public disk
		'dir' => '/certificates/uat',
	],
	'production' => [
		'disk' => 'local', // S3 or Local. Don't put your certificate in public disk
		'dir' => '/certificates/prod',
	]
],
```

You can override the defaults by updating the config file.

3. Run migration to add the banks table

```
php artisan migrate
```

Usage
-----

[](#usage)

1. First run the following commands to seed the banks list.

```
php artisan fpx:banks
```

you should schedule the fpx:banks Artisan command to run daily:

```
$schedule->command('fpx:banks')->daily();
```

2. Add one the `x-fpx-pay` component with the following attributes

```

```

During testing, you can use the `test-mode` attribute to override the provided amount to 'MYR 1.00'

```

```

3. Handle the payment response in `Http/Controllers/FPX/Controller.php`

```
	/**
	 * This will be called after the user approve the payment
	 * on the bank side
	 *
	 * @param Request $request
	 * @return Response
	 */
	public function callback(Request $request) {
		$response = $request->handle();

		// Update your order status
	}

	/**
	 * This will handle any direct call from FPX
	 *
	 * @param Request $request
	 * @return string
	 */
	public function webhook(Request $request) {
		$response = $request->handle();

		// Update your order status

		return 'OK';
	}
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [AIMEN.S.A.SASI](https://github.com/aimensasi)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~46 days

Total

4

Last Release

1796d ago

PHP version history (2 changes)1.0-betaPHP ^7.4

1.0.1-betaPHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f4465f9b35e2a42dffe9a3de7893b488fb462cf8bee2f1af0a36eb2f0897e0b?d=identicon)[aimensasi](/maintainers/aimensasi)

---

Top Contributors

[![aimensasi](https://avatars.githubusercontent.com/u/13252355?v=4)](https://github.com/aimensasi "aimensasi (6 commits)")

---

Tags

fpxaimensasi

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aimensasi-fpx/health.svg)

```
[![Health](https://phpackages.com/badges/aimensasi-fpx/health.svg)](https://phpackages.com/packages/aimensasi-fpx)
```

###  Alternatives

[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
