PHPackages                             mdiqbal/laravel-payments - 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. mdiqbal/laravel-payments

ActiveLaravel-package[Payment Processing](/categories/payments)

mdiqbal/laravel-payments
========================

A unified payment gateway package for Laravel supporting 21+ payment providers

2.1.2(4mo ago)029MITPHPPHP ^8.2

Since Dec 15Pushed 4mo agoCompare

[ Source](https://github.com/mdiqbalhossan/laravel-payments)[ Packagist](https://packagist.org/packages/mdiqbal/laravel-payments)[ RSS](/packages/mdiqbal-laravel-payments/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (17)Versions (3)Used By (0)

Laravel Payments Package
========================

[](#laravel-payments-package)

A comprehensive Laravel package for integrating multiple payment gateways into your application. This package provides a unified interface for processing payments through various payment providers including Stripe, PayPal, Razorpay, Paystack, and many more.

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

[](#table-of-contents)

- [Features](#features)
- [Supported Gateways](#supported-gateways)
- [Installation](#installation)
- [Configuration](#configuration)
- [Basic Usage](#basic-usage)
- [Gateway Documentation](#gateway-documentation)
    - [Stripe](#stripe)
    - [PayPal](#paypal)
    - [Paystack](#paystack)
    - [Razorpay](#razorpay)
    - [PayTM](#paytm)
    - [Flutterwave](#flutterwave)
    - [SSLCommerz](#sslcommerz)
    - [Mollie](#mollie)
    - [SenangPay](#senangpay)
    - [bKash](#bkash)
    - [Mercado Pago](#mercado-pago)
    - [Cashfree](#cashfree)
    - [PayFast](#payfast)
    - [Skrill](#skrill)
    - [PhonePe](#phonepe)
    - [Telr](#telr)
    - [iyzico](#iyzico)
    - [Pesapal](#pesapal)
    - [Midtrans](#midtrans)
    - [MyFatoorah](#myfatoorah)
    - [EasyPaisa](#easypaisa)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#features)

- **Unified Interface**: Single API for all payment gateways
- **Multiple Gateways**: Support for 20+ payment gateways
- **Secure**: Built with security best practices
- **Flexible**: Easy to extend with new gateways
- **Laravel Ready**: Built specifically for Laravel
- **Webhook Support**: Built-in webhook handling
- **Error Handling**: Comprehensive error management
- **Test Friendly**: Full testing support

Supported Gateways
------------------

[](#supported-gateways)

GatewayRegionsSupported MethodsDocumentation**Stripe**GlobalCards, Apple Pay, Google Pay, ACH[Guide](docs/stripe-integration.md)**PayPal**GlobalPayPal, Cards, Venmo[Guide](docs/paypal-integration.md)**Paystack**AfricaCards, Bank Transfer, USSD[Guide](docs/paystack-integration.md)**Razorpay**IndiaCards, UPI, NetBanking, Wallets[Guide](docs/razorpay-integration.md)**PayTM**IndiaWallet, Cards, NetBanking, UPI[Guide](docs/paytm-integration.md)**Flutterwave**AfricaCards, Mobile Money, Bank Transfer[Guide](docs/flutterwave-integration.md)**SSLCommerz**BangladeshCards, Mobile Banking, Bank Transfer[Guide](docs/sslcommerz-integration.md)**Mollie**EuropeCards, iDEAL, Bank Transfer, Klarna[Guide](docs/mollie-integration.md)**SenangPay**MalaysiaCards, FPX, Online Banking[Guide](docs/senangpay-integration.md)**bKash**BangladeshMobile Wallet[Guide](docs/bkash-integration.md)**Mercado Pago**Latin AmericaCards, Bank Transfer, Wallets[Guide](docs/mercadopago-integration.md)**Cashfree**IndiaCards, UPI, NetBanking, Wallets[Guide](docs/cashfree-integration.md)**PayFast**South AfricaCards, EFT, Zapper, Masterpass[Guide](docs/payfast-integration.md)**Skrill**GlobalWallet, Cards, Bank Transfer[Guide](docs/skrill-integration.md)**PhonePe**IndiaUPI, Cards, Wallets[Guide](docs/phonepe-integration.md)**Telr**Middle EastCards, Knet, Sadad, Fawry[Guide](docs/telr-integration.md)**iyzico**TurkeyCards, Bank Transfer, Wallets[Guide](docs/iyzico-integration.md)**Pesapal**AfricaCards, Mobile Money, Bank Transfer[Guide](docs/pesapal-integration.md)**Midtrans**IndonesiaCards, Bank Transfer, E-Wallets[Guide](docs/midtrans-integration.md)**MyFatoorah**Middle EastCards, Knet, Benefit, Sadad[Guide](docs/myfatoorah-integration.md)**EasyPaisa**PakistanMobile Wallet, Bank Transfer[Guide](docs/easypaisa-integration.md)Installation
------------

[](#installation)

1. Install the package via Composer:

```
composer require mdiqbal/laravel-payments
```

2. Publish the configuration file:

```
php artisan vendor:publish --provider="Mdiqbal\LaravelPayments\PaymentsServiceProvider"
```

3. Add your payment gateway credentials to your `.env` file:

```
# Example for Stripe
STRIPE_MODE=test
STRIPE_SANDBOX_SECRET=your_sandbox_secret_key
STRIPE_SANDBOX_KEY=your_sandbox_publishable_key
STRIPE_LIVE_SECRET=your_live_secret_key
STRIPE_LIVE_KEY=your_live_publishable_key
STRIPE_WEBHOOK_SECRET=your_webhook_secret

# Example for PayPal
PAYPAL_MODE=sandbox
PAYPAL_SANDBOX_CLIENT_ID=your_sandbox_client_id
PAYPAL_SANDBOX_CLIENT_SECRET=your_sandbox_client_secret
PAYPAL_LIVE_CLIENT_ID=your_live_client_id
PAYPAL_LIVE_CLIENT_SECRET=your_live_client_secret

# Example for Mercado Pago
MERCADOPAGO_MODE=sandbox
MERCADOPAGO_SANDBOX_ACCESS_TOKEN=your_sandbox_access_token
MERCADOPAGO_LIVE_ACCESS_TOKEN=your_live_access_token
MERCADOPAGO_COUNTRY=MX
MERCADOPAGO_WEBHOOK_SECRET=your_webhook_secret
```

Configuration
-------------

[](#configuration)

The package configuration file is located at `config/payments.php`. Here you can configure all supported gateways:

```
return [
    'default' => env('PAYMENT_DEFAULT_GATEWAY', 'stripe'),

    'gateways' => [
        'stripe' => [
            'mode' => env('STRIPE_MODE', 'sandbox'),
            'sandbox' => [
                'secret_key' => env('STRIPE_SANDBOX_SECRET'),
                'api_key' => env('STRIPE_SANDBOX_KEY'),
            ],
            'live' => [
                'secret_key' => env('STRIPE_LIVE_SECRET'),
                'api_key' => env('STRIPE_LIVE_KEY'),
            ],
            'webhook_secret' => env('STRIPE_WEBHOOK_SECRET'),
        ],

        'paypal' => [
            'mode' => env('PAYPAL_MODE', 'sandbox'),
            'sandbox' => [
                'client_id' => env('PAYPAL_SANDBOX_CLIENT_ID'),
                'client_secret' => env('PAYPAL_SANDBOX_CLIENT_SECRET'),
            ],
            'live' => [
                'client_id' => env('PAYPAL_LIVE_CLIENT_ID'),
                'client_secret' => env('PAYPAL_LIVE_CLIENT_SECRET'),
            ],
            'webhook_id' => env('PAYPAL_WEBHOOK_ID'),
        ],

        // ... other gateways
    ],
];
```

Basic Usage
-----------

[](#basic-usage)

### Making a Payment

[](#making-a-payment)

```
use Mdiqbal\LaravelPayments\Facades\Payment;
use Mdiqbal\LaravelPayments\DTO\PaymentRequest;

// Create a payment request
$paymentRequest = new PaymentRequest(
    amount: 100.00,
    currency: 'USD',
    description: 'Payment for Order #12345'
);

// Set optional parameters
$paymentRequest->setTransactionId('order_' . uniqid());
$paymentRequest->setReturnUrl(route('payment.success'));
$paymentRequest->setCancelUrl(route('payment.cancel'));

// Process payment with default gateway
$response = Payment::pay($paymentRequest);

// Or process with a specific gateway
$response = Payment::gateway('stripe')->pay($paymentRequest);

// Handle response
if ($response->isSuccess()) {
    if ($response->isRedirect()) {
        return redirect($response->getRedirectUrl());
    }

    $transactionId = $response->getTransactionId();
    // Save transaction ID to database
} else {
    $errorMessage = $response->getMessage();
    // Handle error
}
```

### Retrieving Payment Status

[](#retrieving-payment-status)

```
use Mdiqbal\LaravelPayments\Facades\Payment;

$transactionId = 'txn_1234567890';
$response = Payment::gateway('stripe')->retrievePayment($transactionId);

if ($response->isSuccess()) {
    $status = $response->getData()['status'];
    $amount = $response->getData()['amount'];
    // Update order status
}
```

### Processing Refunds

[](#processing-refunds)

```
use Mdiqbal\LaravelPayments\Facades\Payment;

$transactionId = 'txn_1234567890';
$refundAmount = 50.00;
$reason = 'Customer requested refund';

try {
    $success = Payment::gateway('stripe')->refund($transactionId, $refundAmount, $reason);

    if ($success) {
        // Refund processed successfully
    }
} catch (\Exception $e) {
    // Handle refund failure
}
```

Gateway Documentation
---------------------

[](#gateway-documentation)

### Stripe

[](#stripe)

[View Full Documentation →](docs/stripe-integration.md)

Stripe is a global payment gateway accepting cards, digital wallets, and local payment methods. Ideal for international businesses.

**Quick Start:**

```
$response = Payment::gateway('stripe')->pay($paymentRequest);
$clientSecret = $response->getData()['client_secret'];
```

### PayPal

[](#paypal)

[View Full Documentation →](docs/paypal-integration.md)

PayPal provides a trusted payment solution with support for PayPal accounts, cards, and alternative payment methods.

**Quick Start:**

```
$response = Payment::gateway('paypal')->pay($paymentRequest);
$approvalUrl = $response->getRedirectUrl();
```

### Paystack

[](#paystack)

[View Full Documentation →](docs/paystack-integration.md)

Paystack is the leading payment gateway in Africa, supporting cards, bank transfers, and mobile money.

**Quick Start:**

```
$response = Payment::gateway('paystack')->pay($paymentRequest);
$authorizationUrl = $response->getRedirectUrl();
```

### Razorpay

[](#razorpay)

[View Full Documentation →](docs/razorpay-integration.md)

Razorpay is India's payment solution supporting UPI, cards, net banking, and popular wallets.

**Quick Start:**

```
$response = Payment::gateway('razorpay')->pay($paymentRequest);
$orderId = $response->getData()['id'];
```

### PayTM

[](#paytm)

[View Full Documentation →](docs/paytm-integration.md)

PayTM is one of India's largest digital payment platforms supporting wallet, cards, and UPI payments.

**Quick Start:**

```
$response = Payment::gateway('paytm')->pay($paymentRequest);
$txnToken = $response->getData()['txnToken'];
```

### Flutterwave

[](#flutterwave)

[View Full Documentation →](docs/flutterwave-integration.md)

Flutterwave powers payments across Africa with support for cards, mobile money, and bank transfers.

**Quick Start:**

```
$response = Payment::gateway('flutterwave')->pay($paymentRequest);
$paymentLink = $response->getRedirectUrl();
```

### SSLCommerz

[](#sslcommerz)

[View Full Documentation →](docs/sslcommerz-integration.md)

SSLCommerz is Bangladesh's leading payment gateway with support for cards, mobile banking, and bank transfers.

**Quick Start:**

```
$response = Payment::gateway('sslcommerz')->pay($paymentRequest);
$gatewayUrl = $response->getRedirectUrl();
```

### Mollie

[](#mollie)

[View Full Documentation →](docs/mollie-integration.md)

Mollie is a European payment gateway supporting iDEAL, credit cards, Bancontact, and other local payment methods.

**Quick Start:**

```
$response = Payment::gateway('mollie')->pay($paymentRequest);
$checkoutUrl = $response->getRedirectUrl();
```

### SenangPay

[](#senangpay)

[View Full Documentation →](docs/senangpay-integration.md)

SenangPay is Malaysia's payment gateway supporting FPX, online banking, and credit cards.

**Quick Start:**

```
$response = Payment::gateway('senangpay')->pay($paymentRequest);
$paymentUrl = $response->getRedirectUrl();
```

### bKash

[](#bkash)

[View Full Documentation →](docs/bkash-integration.md)

bKash is Bangladesh's largest mobile financial service providing mobile wallet payments.

**Quick Start:**

```
$response = Payment::gateway('bkash')->pay($paymentRequest);
$paymentID = $response->getData()['paymentID'];
```

### Mercado Pago

[](#mercado-pago)

[View Full Documentation →](docs/mercadopago-integration.md)

Mercado Pago is Latin America's leading payment platform supporting various local payment methods.

**Quick Start:**

```
$response = Payment::gateway('mercadopago')->pay($paymentRequest);
$initPoint = $response->getData()['init_point'];
```

### Cashfree

[](#cashfree)

[View Full Documentation →](docs/cashfree-integration.md)

Cashfree is an Indian payment gateway supporting UPI, cards, net banking, and wallets.

**Quick Start:**

```
$response = Payment::gateway('cashfree')->pay($paymentRequest);
$paymentLink = $response->getRedirectUrl();
```

### PayFast

[](#payfast)

[View Full Documentation →](docs/payfast-integration.md)

PayFast is South Africa's payment gateway supporting cards, EFT, and various payment methods.

**Quick Start:**

```
$response = Payment::gateway('payfast')->pay($paymentRequest);
$redirectUrl = $response->getRedirectUrl();
```

### Skrill

[](#skrill)

[View Full Documentation →](docs/skrill-integration.md)

Skrill is a global payment solution supporting wallet transfers, cards, and bank transfers.

**Quick Start:**

```
$response = Payment::gateway('skrill')->pay($paymentRequest);
$sessionId = $response->getData()['sessionid'];
```

### PhonePe

[](#phonepe)

[View Full Documentation →](docs/phonepe-integration.md)

PhonePe is India's UPI-based payment platform supporting UPI, cards, and wallets.

**Quick Start:**

```
$response = Payment::gateway('phonepe')->pay($paymentRequest);
$paymentUrl = $response->getRedirectUrl();
```

### Telr

[](#telr)

[View Full Documentation →](docs/telr-integration.md)

Telr is a Middle East payment gateway supporting cards, Knet, Sadad, and other local methods.

**Quick Start:**

```
$response = Payment::gateway('telr')->pay($paymentRequest);
$orderUrl = $response->getRedirectUrl();
```

### iyzico

[](#iyzico)

[View Full Documentation →](docs/iyzico-integration.md)

iyzico is Turkey's payment platform supporting cards, bank transfers, and digital wallets.

**Quick Start:**

```
$response = Payment::gateway('iyzico')->pay($paymentRequest);
$paymentPageUrl = $response->getData()['paymentPageUrl'];
```

### Pesapal

[](#pesapal)

[View Full Documentation →](docs/pesapal-integration.md)

Pesapal provides payment solutions across Africa with support for cards and mobile money.

**Quick Start:**

```
$response = Payment::gateway('pesapal')->pay($paymentRequest);
$redirectUrl = $response->getRedirectUrl();
```

### Midtrans

[](#midtrans)

[View Full Documentation →](docs/midtrans-integration.md)

Midtrans is Indonesia's payment gateway supporting cards, bank transfers, and e-wallets.

**Quick Start:**

```
$response = Payment::gateway('midtrans')->pay($paymentRequest);
$redirectUrl = $response->getRedirectUrl();
```

### MyFatoorah

[](#myfatoorah)

[View Full Documentation →](docs/myfatoorah-integration.md)

MyFatoorah is a Middle East payment platform supporting Knet, Benefit, and other local methods.

**Quick Start:**

```
$response = Payment::gateway('myfatoorah')->pay($paymentRequest);
$invoiceURL = $response->getData()['InvoiceURL'];
```

### EasyPaisa

[](#easypaisa)

[View Full Documentation →](docs/easypaisa-integration.md)

EasyPaisa is Pakistan's mobile banking platform supporting wallet payments and bank transfers.

**Quick Start:**

```
$response = Payment::gateway('easypaisa')->pay($paymentRequest);
$transactionUrl = $response->getRedirectUrl();
```

Testing
-------

[](#testing)

### Running Tests

[](#running-tests)

```
# Run all tests
composer test

# Run specific test
composer test -- --filter StripePaymentTest

# Generate coverage report
composer test -- --coverage
```

### Test Configuration

[](#test-configuration)

Set test mode in your `.env.testing` file:

```
PAYMENT_DEFAULT_GATEWAY=stripe
STRIPE_MODE=test
STRIPE_SANDBOX_SECRET=sk_test_xxxxxxxxxxxxxx
STRIPE_SANDBOX_KEY=pk_test_xxxxxxxxxxxxxx
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

### Development Setup

[](#development-setup)

1. Clone the repository
2. Install dependencies: `composer install`
3. Run tests: `composer test`

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

Support
-------

[](#support)

- 📧 Email:
- 🐛 Issues: [GitHub Issues](https://github.com/your-username/laravel-payments/issues)
- 📖 Documentation: [Full Documentation](https://laravel-payments.com/docs)
- 💬 Discord: [Join our Discord](https://discord.gg/laravel-payments)

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance74

Regular maintenance activity

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Total

2

Last Release

148d ago

Major Versions

1.0.0 → 2.1.22025-12-15

### Community

Maintainers

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

---

Top Contributors

[![mdiqbalhossan](https://avatars.githubusercontent.com/u/88248100?v=4)](https://github.com/mdiqbalhossan "mdiqbalhossan (21 commits)")

---

Tags

laravelstripepaymentgatewaypaypalrazorpay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mdiqbal-laravel-payments/health.svg)

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)

PHPackages © 2026

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