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.3(3w ago)056—0%1MITPHPPHP ^8.2

Since Jun 26Pushed 1mo agoCompare

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

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

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

40

—

FairBetter than 86% of packages

Maintenance92

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity39

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

Every ~6 days

Total

4

Last Release

27d ago

PHP version history (2 changes)v0.1.0PHP ^8.1

v0.1.3PHP ^8.2

### 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.4M32](/packages/srmklive-paypal)[unicodeveloper/laravel-paystack

A Laravel Package for Paystack

6471.1M11](/packages/unicodeveloper-laravel-paystack)[recurly/recurly-client

The PHP client library for the Recurly API

1736.7M9](/packages/recurly-recurly-client)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.7M10](/packages/chargebee-chargebee-php)[amzn/amazon-pay-api-sdk-php

Amazon Pay API SDK (PHP)

515.6M14](/packages/amzn-amazon-pay-api-sdk-php)[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

40975.8k6](/packages/cybersource-rest-client-php)

PHPackages © 2026

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