PHPackages                             krisnasw/faspay - 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. krisnasw/faspay

ActiveLibrary[Payment Processing](/categories/payments)

krisnasw/faspay
===============

A Laravel Package For Faspay Payment Gateway

v1.0.0(8y ago)561MITPHPPHP &gt;=7.1.0

Since Aug 28Pushed 8y ago2 watchersCompare

[ Source](https://github.com/Krisnasw/faspay)[ Packagist](https://packagist.org/packages/krisnasw/faspay)[ RSS](/packages/krisnasw-faspay/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Faspay Payment Gateway Package for Laravel 5
============================================

[](#faspay-payment-gateway-package-for-laravel-5)

Use Faspay as your payment gateway for your project? Then this package is for you. This is a laravel package to communicate with [Faspay Payment Gateway API](https://mediaindonusa.com) (currently only support DEBIT API)

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

[](#installation)

To get started with Faspay, run this command or add the package to your `composer.json`

```
composer require krisnasw/faspay dev-master

```

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

[](#configuration)

After installing the Faspay package, register the `Krisnasw\Faspay\FaspayServiceProvider` in your `config/app.php` file. Also, add the `Faspay` and `Payment` facade to the `aliases` array in your `app` configuration file:

```
'Faspay' => Krisnasw\Faspay\Facades\Faspay::class,
'Payment' => Krisnasw\Faspay\Facades\Payment::class,
```

Finally publish the config file:

```
php artisan vendor:publish --provider="Krisnasw\Faspay\FaspayServiceProvider"

```

and change `merchant_id`, `merchant_name`, `user_id`, and `password` in the `config/faspay.php` with yours.

How To Use
----------

[](#how-to-use)

After all sets, use this Faspay package as follows:

```
// Customer class example. You can apply to any model you want.

use Krisnasw\Faspay\CustomerInterface;

class Customer implements CustomerInterface
{
  public function getFaspayCustomerNumber()
  {
    return 'customer-number';
  }

  public function getFaspayCustomerName()
  {
    return 'customer-name';
  }

  public function getFaspayCustomerEmail()
  {
    return 'customer-email';
  }

  public function getFaspayCustomerPhone()
  {
    return 'customer-phone';
  }

  public function getFaspayPreferredCurrency()
  {
    return 'customer-currency';
  }
}
```

```
// Item class example. You can apply to any model you want.

use Krisnasw\Faspay\Payable;

class Item implements Payable
{
  public function getPayableName()
  {
    return 'Product Name';
  }

  public function getPayablePrice()
  {
    return 300000;
  }
}
```

```
// An example how to use the API.

Route::get('/', function () {

  $customer = new Customer();
  $payable = new Item();

  $payment = Payment::performedBy($customer)
    ->via('web')
    ->payWith('tcash')
    ->addTax(10)
    ->addMiscFee(1000);

  $payment->addItem($payable, 2);

  $response = Faspay::registerPayment($payment);

  return Faspay::redirectToPay($payment);
});

Route::get('/callback-notif', function(\Illuminate\Http\Request $request) {
  return Faspay::notified($request, function(\Krisnasw\Faspay\Notification $notification) {
    return $notification;
  });
});
```

To generate a custom billing number/code, you can create a class that implements BillingProfileInterface, for example:

```
class TopupBillingProfile implements BillingProfileInterface
{
  public function description()
  {
    return 'Topup Saldo';
  }

  public function generate(Payment $payment)
  {
    return str_random(15);
  }
}
```

and then pass it as a second argument of `registerPayment()` method.

Bugs &amp; Improvements
-----------------------

[](#bugs--improvements)

This package is far from perfect. It doesn't support BCA KlikPay yet. It doesn't support Faspay Credit API also. Feel free to report me any bug you found or send me pull requests.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40ff98f859279bd7f6f7074fe7cd68c8c27fb39386472b381448516d55cde90c?d=identicon)[Krisnasw](/maintainers/Krisnasw)

---

Top Contributors

[![Krisnasw](https://avatars.githubusercontent.com/u/14161762?v=4)](https://github.com/Krisnasw "Krisnasw (9 commits)")

### Embed Badge

![Health badge](/badges/krisnasw-faspay/health.svg)

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

###  Alternatives

[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

58596.1k](/packages/lemonsqueezy-laravel)[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)[henryejemuta/laravel-monnify

A laravel package to seamlessly integrate monnify api within your laravel application

132.1k](/packages/henryejemuta-laravel-monnify)

PHPackages © 2026

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