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

ActiveLibrary[Payment Processing](/categories/payments)

thearkaid/laravel-faspay
========================

Unofficial Laravel package for Faspay Payment Gateway

v0.4.1(5y ago)33861MITPHP

Since May 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/TheArKaID/laravel-faspay)[ Packagist](https://packagist.org/packages/thearkaid/laravel-faspay)[ RSS](/packages/thearkaid-laravel-faspay/feed)WikiDiscussions master Synced yesterday

READMEChangelog (9)Dependencies (1)Versions (10)Used By (0)

laravel-faspay
==============

[](#laravel-faspay)

Unofficial Laravel package for [Faspay Payment Gateway](https://faspay.co.id).

This Package is a conversion from [Faspay Api. PHP](https://github.com/faspay-team/Sdk-PHP-Faspay).

Tested on: [![Laravel 5.5](https://camo.githubusercontent.com/5ce09e92bb9c71b230a92661a597b401f216ae07aa951891668716f52b24ea44/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e352d6f72616e67652e737667)](https://laravel.com/docs/5.5) [![Laravel 7.x](https://camo.githubusercontent.com/cb1a5f73220a771a314c8172f22a24beab337002200ad62c5b2d38e7d4d525c3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d372e782d7265642e737667)](https://laravel.com)[![Latest Stable Version](https://camo.githubusercontent.com/9a66b4f7bca47caa8e7f1743b3089c8df316ef4f5e674bb1eadd570e9f5786a0/68747470733a2f2f706f7365722e707567782e6f72672f54686541724b6149442f6c61726176656c2d6661737061792f762f737461626c65)](https://packagist.org/packages/TheArKaID/laravel-faspay) [![Total Downloads](https://camo.githubusercontent.com/dae7a38a893f7d9bc121b73a38ecbeb75bfcc20c327e8348a7e7876d3100fe78/68747470733a2f2f706f7365722e707567782e6f72672f54686541724b6149442f6c61726176656c2d6661737061792f646f776e6c6f6164732e706e67)](https://packagist.org/packages/TheArKaID/laravel-faspay) [![License](https://camo.githubusercontent.com/850eae1099d2b05f53383473d7cd51f9bc1ab09b7d0d9e5122f1dd930efdcc6d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6173686170652f6170697374617475732e737667)](https://packagist.org/packages/TheArKaID/laravel-faspay)

- Faspay Business Debit
- Faspay Business Credit

Features
--------

[](#features)

- Getting Payment Channel
- Creating Payment
- Checking Payment Status
- Cancelling Payment
- Notification
- Callback

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

[](#installation)

You can install the package via composer:

```
composer require thearkaid/laravel-faspay

```

Publish faspay.php configuration

```
php artisan vendor:publish --provider='TheArKaID\LaravelFaspay\Providers\LaravelFaspayServiceProvider'

```

How to Use
----------

[](#how-to-use)

1. Update faspay.php Configuration in your config directory,

```
  /**
   * Set true saat dalam Mode Development
   * Set false saat ke Mode Production
   */
  'isdev' => true,
  // Kredensial saat dalam Mode Development
  'devcred' => [
      'merchantname' => env('FP_DEV_MERCHANT_NAME', 'OR JUST SET HERE'),
      'merchantid' => env('FP_DEV_MERCHANT_ID', 'OR JUST SET HERE'),
      'userid' => env('FP_DEV_USER_ID', 'OR JUST SET HERE'),
      'password' => env('FP_DEV_PASSWORD', 'OR JUST SET HERE'),
      'redirecturl' => env('FP_DEV_REDIRECT_URL', 'OR JUST SET HERE')
  ],
  // Kredensial saat dalam Mode Production
  'prodcred' => [
      'merchantname' => env('FP_PROD_MERCHANT_NAME', 'OR JUST SET HERE'),
      'merchantid' => env('FP_PROD_MERCHANT_ID', 'OR JUST SET HERE'),
      'userid' => env('FP_PROD_USER_ID', 'OR JUST SET HERE'),
      'password' => env('FP_PROD_PASSWORD', 'OR JUST SET HERE'),
      'redirecturl' => env('FP_PROD_REDIRECT_URL', 'OR JUST SET HERE')
  ]
```

1. Alway Use and Create LaravelFaspay Class

```
  // Require LaravelFaspay class
  use TheArKaID\LaravelFaspay\LaravelFaspay;

  // Create an object from LaravelFaspay Class
  $faspayer = new LaravelFaspay();
```

2. Getting Payment Channel

```
  // Return Payment Channel here
  return $faspayer->getPaymentChannel();
```

3. Creating Payment

```
  // Define your payment channel,
  $paymentChannel['pg_code'] = "802";
  $paymentChannel['pg_name'] = "Mandiri Virtual Account";

  // Create an array for ordered Item
  $item = Array();
  $order["product"] = "Item #1"; // Product Name
  $order["qty"] = 1; // QTY
  $order["amount"] = 100000; // Price. Just the real price, without any '.'(dot) or ',' (comma).
  $order["paymentplan"] = 1; // Payment Plan. See References below.
  $order["merchantid"] = $faspayer->getConfig()->getUser()->getMerchantId(); // Merchant ID
  $order["tenor"] = 00; // Tenor. See References below.
  array_push($item, $order); // Push order,
  // Loop or push again for more than 1 items.

  // Create Bill Data
  $billData["billno"] = "1232123"; // Bill Number
  $billData["billdesc"] = "Pembayaran RHI"; // Billing Description
  $billData["billexp"] = 2; // Expired Day Interval (in total days)
  $billData["billtotal"] = 10000; // Bill Total, Just the real bill, without any '.'(dot) or ',' (comma).
  $billData["paytype"] = 3 // Pay Type. See References below.

    // Create User Data
  $userData["phone"] = "087123123123"; // Phone Number
  $userData["email"] = "arka.progammer@gmail.com"; // Email
  $userData["terminal"] = 21; // Terminal
  $userData["custno"] = "12345"; // Customer No
  $userData["custname"] = "thearka"; // Customer Name

  // Proccess the request and return the result.
  return $faspayer->createPayment($item, $paymentChannel, $billData, $userData);
```

4. Checking Payment Status

```
  // Proccess the request and return the result.
  return $faspayer->checkPaymentStatus(
    $reqdesc, // Request Description
    $trx_id, // Transaction ID
    $billno // Billing Number
   );
```

5. Cancelling Payment

```
  // Proccess the request and return the result.
  return $faspayer->cancelPayment(
    $trx_id, // Transaction ID
    $billno, // Billing Number
    $paymentcancel // Description for Cancellation
   );
```

6. Notification

When users accept or cancel payment, notification of payment status sent to your server. Don't forget to return this data to the screen, as response to Faspay that their request accepted in your server

```
  // Get the notification.
  return $faspayer->notifier();

  // The Data returned. Take the data for updating your data status.
  // Success.
  {
    "response": "Payment Notification",
    "response_date": "2020-06-28 17:06:26",
    "trx_id": "1234567890", // Transaction ID
    "merchant_id": "12345", // Merchant ID
    "merchant": "TheArKa", // Merchant Name
    "response_code": "00",
    "response_desc": "Sukses"
  }

  // Failed
  {
    "response": "Payment Notification",
    "response_date": "2020-06-28 17:06:15",
    "trx_id": "1234567890", // Transaction ID
    "merchant_id": "12345", // Merchant ID
    "merchant": "TheArKa", // Merchant Name
    "response_code": "01",
    "response_desc": "Gagal"
  }
```

7. Callback

Callback will be called when the user transaction has finished paid and get a notification that the transaction has been completed.

```
  // Get the callback data
  return $faspayer->callbacker();
  // The Data returned. Take the data for updating your data status.
  {
    "response": "Callback",
    "response_date": "2020-06-28 17:06:26",
    "trx_id": "1234567890", // Transaction ID
    "bill_no": "1234567890", // Bill Number
    "merchant_id": "12345", // Merchant ID
    "merchant": "TheArKa", // Merchant Name
    "bill_ref": "1234567890", // Bill Reference
    "response_code": "00",
    "response_desc": "Sukses"
  }
```

### References

[](#references)

There are informations in Faspay that could help you understanding terms in this package

- [Faspay Business Documentation](https://faspay.co.id/docs/index-business.html#faspay-business)
- [Faspay Simulator](https://dev.faspay.co.id/simulator)

Discontinued!
-------------

[](#discontinued)

This package has been discontinued, but it still works since the last commit, as long as how Faspay works hasn't changed. If you have a reason to continue this package, feel free to fork it or message me for any help.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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 ~5 days

Total

9

Last Release

2140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27f01b40d19c500c47da1b080bb12c694fc5a16e5f3544067a6f08a979aa3560?d=identicon)[TheArKaID](/maintainers/TheArKaID)

---

Top Contributors

[![TheArKaID](https://avatars.githubusercontent.com/u/35050722?v=4)](https://github.com/TheArKaID "TheArKaID (29 commits)")

---

Tags

faspaylaravel-packagepayment-gatewayphp

### Embed Badge

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

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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