PHPackages                             astimpay/laravel-sdk - 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. astimpay/laravel-sdk

ActiveLibrary[Payment Processing](/categories/payments)

astimpay/laravel-sdk
====================

AstimPay offers a range of payment automation solutions for small entrepreneurs in Bangladesh.

1.0.0(1y ago)191MITPHPPHP &gt;=7.4.0

Since Jul 26Pushed 1y agoCompare

[ Source](https://github.com/AstimPay/LaravelSDK)[ Packagist](https://packagist.org/packages/astimpay/laravel-sdk)[ RSS](/packages/astimpay-laravel-sdk/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

AstimPay Laravel SDK
====================

[](#astimpay-laravel-sdk)

[![AstimPay Logo](https://camo.githubusercontent.com/c7a0b83280d9a6bfb850b9865fca16be70a87a65e4f309b1282773fed4cbf67f/68747470733a2f2f617374696d7061792e636f6d2f6173736574732f696d616765732f6c6f676f2e706e67)](https://camo.githubusercontent.com/c7a0b83280d9a6bfb850b9865fca16be70a87a65e4f309b1282773fed4cbf67f/68747470733a2f2f617374696d7061792e636f6d2f6173736574732f696d616765732f6c6f676f2e706e67)

The AstimPay Laravel SDK allows you to seamlessly integrate the AstimPay payment gateway into your Laravel applications.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Initializing the SDK](#initializing-the-sdk)
    - [Initializing a Payment](#initializing-a-payment)
    - [Verifying a Payment](#verifying-a-payment)
    - [Handling IPN Notifications](#handling-ipn-notifications-optional)
- [Notes](#notes)

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

[](#installation)

Run the following command in your project directory:

```
composer require astimpay/laravel-sdk
```

Usage
-----

[](#usage)

### Initializing the SDK

[](#initializing-the-sdk)

```
use AstimPay\LaravelSDK\AstimPay;
```

### Initializing a Payment

[](#initializing-a-payment)

To initiate a payment, follow these steps:

1. Initialize the `AstimPay` class with your API key and base URL:

```
$apiKey = "4a59f023cbc02521417f21a0add4e028febb2ca8"; // API KEY
$apiBaseURL = "https://sandbox.astimpay.com/api/checkout-v1"; // API URL
$astimpay = new AstimPay($apiKey, $apiBaseURL);
```

2. Prepare payment request data and initiate payment:

```
// Example request data for initializing a payment
$requestData = [
    'full_name'     => "John Doe",
    'email'         => "test@test.com",
    'amount'        => 100,
    'metadata'      => [
        'example_metadata_key' => "example_metadata_value",
        // ... Add more key-value pairs for dynamic metadata ...
    ],
    'redirect_url'  => 'http://localhost/success.php', // add your success route
    'return_type'   => 'GET',
    'cancel_url'    => 'http://localhost/cancel.php', // add your cancel route
    'webhook_url'   => 'http://localhost/ipn.php', // add your ipn route
];

try {
    $paymentUrl = $astimpay->initPayment($requestData);
    return redirect($paymentUrl);
} catch (\Exception $e) {
     dd("Initialization Error: " . $e->getMessage());
}
```

#### Available API Types

[](#available-api-types)

The `initPayment` method allows you to specify the API type as the second parameter. The available options are:

- `checkout-v1`: Advanced checkout API (default, Success Page notification only).

### Verifying a Payment

[](#verifying-a-payment)

To verify a payment, follow these steps:

1. Initialize the `AstimPay` class as shown in the previous steps.
2. Get the invoice ID from the payment success page:

```
$invoiceId = $request->invoice_id;
```

3. Verify the payment:

```
try {
    $response = $astimpay->verifyPayment($invoiceId);
    dd($response); // Display the verification response
} catch (\Exception $e) {
    dd("Verification Error: " . $e->getMessage());
}
```

### Handling IPN Notifications (Optional)

[](#handling-ipn-notifications-optional)

To handle IPN (Instant Payment Notification) requests, follow these steps:

1. Initialize the `AstimPay` class as shown in the previous steps.
2. Use the `executePayment` method:

```
try {
    $ipnResponse = $astimpay->executePayment();
    dd($ipnResponse);
} catch (\Exception $e) {
     dd("Error: " . $e->getMessage());
}
```

Notes
-----

[](#notes)

- Replace `"API KEY"` with your actual API key.
- Adjust the request data and other details according to your project requirements.
- The `metadata` field is dynamic; you can add multiple key-value pairs as needed.
- Make sure to handle errors using try-catch blocks as demonstrated above.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

707d ago

### Community

Maintainers

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

---

Top Contributors

[![AstimPayDev](https://avatars.githubusercontent.com/u/176666165?v=4)](https://github.com/AstimPayDev "AstimPayDev (7 commits)")

### Embed Badge

![Health badge](/badges/astimpay-laravel-sdk/health.svg)

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

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)

PHPackages © 2026

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