PHPackages                             fastaar/fastaar-php - 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. fastaar/fastaar-php

ActiveLibrary[Payment Processing](/categories/payments)

fastaar/fastaar-php
===================

PHP SDK for the Fastaar payment gateway — accept bKash &amp; Nagad payments in Bangladesh.

v0.1.0(today)01↑2900%MITPHPPHP ^8.1

Since Jun 26Pushed todayCompare

[ Source](https://github.com/fastaar/fastaar-php)[ Packagist](https://packagist.org/packages/fastaar/fastaar-php)[ RSS](/packages/fastaar-fastaar-php/feed)WikiDiscussions main Synced today

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

Fastaar PHP SDK
===============

[](#fastaar-php-sdk)

Accept bKash &amp; Nagad payments on any PHP website via [Fastaar](https://fastaar.com).

Install
-------

[](#install)

```
composer require fastaar/fastaar-php
```

Create a payment &amp; redirect to checkout
-------------------------------------------

[](#create-a-payment--redirect-to-checkout)

```
use Fastaar\FastaarClient;

$fastaar = new FastaarClient(apiKey: getenv('FASTAAR_API_KEY')); // fk_live_... or fk_test_...

$payment = $fastaar->createPayment([
    'amount' => 1250,
    'invoice_id' => 'ORDER-42',                         // your order reference
    'success_url' => 'https://shop.example.com/thanks', // optional, customer returns here
    'cancel_url' => 'https://shop.example.com/cart',    // optional
]);

header('Location: '.$payment['checkout_url']);
exit;
```

Passing the same `invoice_id` again returns the existing payment instead of creating a duplicate, so a retried request never double-charges.

Confirm the order from a webhook
--------------------------------

[](#confirm-the-order-from-a-webhook)

```
use Fastaar\WebhookSignature;

$rawBody = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_FASTAAR_SIGNATURE'] ?? '';

if (! WebhookSignature::verify(getenv('FASTAAR_WEBHOOK_SECRET'), $rawBody, $signature)) {
    http_response_code(400);
    exit;
}

$event = json_decode($rawBody, true);

if ($event['event'] === 'payment.completed') {
    $orderId = $event['data']['invoice_id'];
    // mark the order as paid, idempotently (use $event['data']['id'] as the key)
}

http_response_code(200);
```

Other calls
-----------

[](#other-calls)

```
$payment = $fastaar->getPayment('01jxyz...');                 // retrieve one
$payment = $fastaar->findByInvoiceId('ORDER-42');             // look up by your reference
$payments = $fastaar->listPayments(['status' => 'completed']);
```

Errors throw `Fastaar\FastaarException` with `->errorType` (e.g. `authentication_error`, `subscription_required`, `transaction_limit_reached`) and `->statusCode`.

Test mode
---------

[](#test-mode)

Use an `fk_test_` key: payments auto-complete on the checkout page without real money, and webhooks fire exactly like production with `"livemode": false`.

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance100

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/295312969?v=4)[Fastaar](/maintainers/fastaar)[@fastaar](https://github.com/fastaar)

---

Top Contributors

[![amdad121](https://avatars.githubusercontent.com/u/11732880?v=4)](https://github.com/amdad121 "amdad121 (1 commits)")

---

Tags

paymentsbkashnagadbangladeshfastaar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fastaar-fastaar-php/health.svg)

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

###  Alternatives

[srmklive/paypal

PayPal REST API client for Laravel and standalone PHP.

1.1k4.0M29](/packages/srmklive-paypal)[amzn/amazon-pay-sdk-php

Amazon Pay SDK (PHP)

20412.2M3](/packages/amzn-amazon-pay-sdk-php)[unicodeveloper/laravel-paystack

A Laravel Package for Paystack

6491.0M11](/packages/unicodeveloper-laravel-paystack)[ignited/laravel-omnipay

Integrates Omnipay with Laravel and provides an easy configuration.

5151.1M12](/packages/ignited-laravel-omnipay)[recurly/recurly-client

The PHP client library for the Recurly API

1736.5M8](/packages/recurly-recurly-client)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.3M9](/packages/chargebee-chargebee-php)

PHPackages © 2026

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