PHPackages                             dotlines-io/foster - 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. dotlines-io/foster

ActiveLibrary[Payment Processing](/categories/payments)

dotlines-io/foster
==================

This package can be used for Payment Integration with Foster Payments Platform.

1.0.5(4y ago)0112MITPHPPHP ^7.4|^8.0

Since May 18Pushed 4y ago2 watchersCompare

[ Source](https://github.com/dotlines-io/foster)[ Packagist](https://packagist.org/packages/dotlines-io/foster)[ Docs](https://github.com/dotlines-io/foster)[ RSS](/packages/dotlines-io-foster/feed)WikiDiscussions master Synced today

READMEChangelog (6)Dependencies (6)Versions (7)Used By (0)

Foster Payments Integration Package
===================================

[](#foster-payments-integration-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3f9a4c17a87bf0af0ffceaab23cf201a69ca62363a8c15b5de1a994dc885920a/68747470733a2f2f62616467656e2e6e65742f6769746875622f72656c656173652f646f746c696e65732d696f2f666f73746572)](https://packagist.org/packages/dotlines-io/foster)[![Tests](https://github.com/dotlines-io/foster/actions/workflows/run-tests.yml/badge.svg)](https://github.com/dotlines-io/foster/actions/workflows/run-tests.yml)[![Psalm](https://github.com/dotlines-io/foster/actions/workflows/psalm.yml/badge.svg)](https://github.com/dotlines-io/foster/actions/workflows/psalm.yml)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/3d926b6e2dfd436c7aaa94611cda585ddd791189bc049eb1a705c43a2d69b208/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f646f746c696e65732d696f2f666f737465722f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/dotlines-io/foster/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amaster)[![Total Downloads](https://camo.githubusercontent.com/5a0de80b655e397db4ce4c076217a97f5e3b6b5245fdf17c99ce050e3ab37e50/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f746c696e65732d696f2f666f737465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dotlines-io/foster)[![Total Downloads](https://camo.githubusercontent.com/bffa7e7e1d4faed62a88a62df280ab6ee055c5703a030e345e9435d29c6dcdad/68747470733a2f2f62616467656e2e6e65742f7061636b61676973742f7068702f646f746c696e65732d696f2f666f73746572)](https://packagist.org/packages/dotlines-io/foster)

---

This composer package can be used for payment integration with [Foster](https://fosterpayments.com.bd/) Payments Platform.

For the credentials, please contact with  or call 8801730372941

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

[](#installation)

You can install the package via composer:

```
composer require dotlines-io/foster
```

Usage
-----

[](#usage)

```
/**
 * ******************************************************
 * ******************* Charge Request *******************
 * ******************************************************
 */

$charge_request_url = "/fosterpayments/paymentrequest.php"; // Contact Foster Payments for it
$mcnt_AccessCode = '';          // Contact Foster Payments for it
$mcnt_ShortName = "";           // Contact Foster Payments for it
$mcnt_ShopId = '';              // Contact Foster Payments for it
$secretkey = "";                // Contact Foster Payments for it

$mcnt_TxnNo = '';               // Mandatory | Unique | Max: 32 Char
$mcnt_Amount = 100;             // Mandatory | The total amount payable | Decimal
$mcnt_Currency = 'BDT';         // Mandatory | 3 Letter currency code
$cust_InvoiceTo = '';           // Mandatory | Customer ID
$cust_CustomerServiceName = ''; // Mandatory | Service or Items sold
$cust_CustomerName = '';        // Mandatory | Customer ID
$cust_CustomerEmail = '';       // Mandatory | Customer Email
$cust_CustomerAddress = '';     // Mandatory | Customer Address
$cust_CustomerContact = '';     // Mandatory | Customer Contact no
$cust_CustomerCity = '';        // Mandatory | Customer City
$cust_CustomerState = '';       // Optional | Customer State
$cust_CustomerPostcode = '';    // Optional
$cust_CustomerCountry = '';     // Mandatory | Customer Country
$cust_Billingaddress = '';      // Mandatory | Customer Billing Address
$cust_ShippingAddress = '';     // Mandatory | Customer Shipping Address
$cust_orderitems = '';          // Mandatory | Customer ordered itme name, no, etc.
$success_url = '';              // Mandatory | Customer redirection URL after successful payment
$cancel_url = '';               // Mandatory | Customer redirection URL after payment is canceled
$fail_url = '';                 // Mandatory | Customer redirection URL after payment failure
$merchentdomainname = '';       // Mandatory | Domain Name
$merchentip = '';               // Mandatory | Domain IP
$merchentip = '';               // Mandatory | Domain IP
$gateway = '';                  // Optional  | Gateway name
$card_type = '';                // Optional  | Card Type

$chargeRequest = \Dotlines\Foster\ChargeRequest::getInstance($charge_request_url, $mcnt_AccessCode, $mcnt_ShortName, $mcnt_ShopId, $secretkey,
    $mcnt_TxnNo, $mcnt_Amount, $mcnt_Currency, $cust_InvoiceTo, $cust_CustomerServiceName, $cust_CustomerName, $cust_CustomerEmail, $cust_CustomerAddress,
    $cust_CustomerContact, $cust_CustomerCity, $cust_CustomerState, $cust_CustomerPostcode, $cust_CustomerCountry, $cust_Billingaddress, $cust_ShippingAddress,
    $cust_orderitems, $success_url, $cancel_url, $fail_url, $merchentdomainname, $merchentip, $gateway, $card_type);
echo json_encode($chargeRequest->send()) . '';

/**
 * Success Charge Request Response looks like below.
 * You must store "payment_id" and redirect the user to the "redirect_url" for payment.
 * {
 *  "status": "200",
 *  "message": "Your Request Successfully received",
 *  "data": {
 *      "payment_id": "Testdc400a5.49862879-93218-nYaHX",
 *      "redirect_url": "https://demo.fosterpayments.com.bd/short/redirect.php",
 *      "merchant_ShopId": "6"
 *  }
 * }
 * Fail response only contains status > 200
 */

/**
 * ******************************************************
 * ******************* Status Request *******************
 * ******************************************************
 */

$status_url = "/fosterpayments/TransactionStatus/txstatus.php";
$mcnt_TxnNo = '';   // Transaction No provided during payment request initiation
$secretkey = '';    // Secret key provided by admin

$statusRequest = \Dotlines\Foster\StatusRequest::getInstance($status_url, $mcnt_TxnNo, $secretkey);
echo json_encode($statusRequest->send()) . '';

/**
 * Status Request Response looks like below:
 *[
 * {
 *      "MerchantTxnNo":"XXXXXXXXXXXXX",
 *      "TxnResponse":2,
 *      "TxnAmount":"1020.00",
 *      "Currency":"BDT",
 *      "ConvertionRate":"1",
 *      "OrderNo":"1803600769",
 *      "fosterid":"BUP8d8b615.97386539",
 *      "hashkey":"b3bceae17f843a910a4e295feed349a4",
 *      "message":"Transaction Successfully."
 *  }
 * ]
 * Fail response only contains status > 200
 */
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Rahat Mahmud](https://github.com/peash1068)
- [TareqMahbub](https://github.com/TareqMahbub)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 82.8% 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 ~41 days

Recently: every ~52 days

Total

6

Last Release

1610d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59867500f5299217fec76ab7e0b813ffcb1e63a4b197ba8f41dd49b2d4df48c3?d=identicon)[TareqMahbub](/maintainers/TareqMahbub)

![](https://www.gravatar.com/avatar/f7b106632293b1ab7bbfa5a31cfaa348fbcfb343f6e724f92212c79d092055f4?d=identicon)[shovoneloy](/maintainers/shovoneloy)

---

Top Contributors

[![TareqMahbub](https://avatars.githubusercontent.com/u/1318776?v=4)](https://github.com/TareqMahbub "TareqMahbub (24 commits)")[![peash1068](https://avatars.githubusercontent.com/u/39594521?v=4)](https://github.com/peash1068 "peash1068 (5 commits)")

---

Tags

dotlines-iodotlinesfoster

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dotlines-io-foster/health.svg)

```
[![Health](https://phpackages.com/badges/dotlines-io-foster/health.svg)](https://phpackages.com/packages/dotlines-io-foster)
```

###  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/braintree

Braintree gateway for Omnipay payment processing library

35558.0k3](/packages/omnipay-braintree)

PHPackages © 2026

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