PHPackages                             nm-digital-hub/laravel-payment - 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. nm-digital-hub/laravel-payment

ActiveLibrary[Payment Processing](/categories/payments)

nm-digital-hub/laravel-payment
==============================

SUMIT Payment Gateway for Laravel - Accept credit card payments with invoice generation and secure token storage

013[7 PRs](https://github.com/nm-digitalhub/laravel-sumit-paymentFI/pulls)PHP

Since Nov 13Pushed 5mo agoCompare

[ Source](https://github.com/nm-digitalhub/laravel-sumit-paymentFI)[ Packagist](https://packagist.org/packages/nm-digital-hub/laravel-payment)[ RSS](/packages/nm-digital-hub-laravel-payment/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (14)Used By (0)

SUMIT Payment Gateway for Laravel
=================================

[](#sumit-payment-gateway-for-laravel)

A comprehensive Laravel package for integrating SUMIT payment gateway with your Laravel 11+ application. This package provides secure payment processing, credit card tokenization, invoice generation, recurring billing capabilities, and full Filament Admin Panel integration.

Features
--------

[](#features)

- 💳 **Secure Payment Processing** - Process credit card payments with PCI compliance
- 🔐 **Token Storage** - Securely store customer payment methods for future use
- 📄 **Invoice Generation** - Automatically generate and email invoices/receipts
- 🔄 **Recurring Billing** - Support for subscription and recurring payments with automated charging
- 💰 **Refunds** - Process full or partial refunds through the API
- 🎯 **Events System** - Laravel events for payment lifecycle hooks
- 🔔 **Webhooks** - Handle payment status updates via webhooks
- 🛡️ **Security** - Built-in security features and encryption
- 🌐 **Multi-Currency** - Support for multiple currencies
- 📱 **Redirect &amp; Direct** - Both redirect and direct payment flows
- ⚙️ **Filament Integration** - Complete admin panel with settings, transactions, and token management
- 🎨 **Spatie Settings** - Modern settings management with Laravel Spatie Settings
- 🔁 **CRM Synchronization** - Bidirectional sync between local database and SUMIT CRM

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 11.x or 12.x
- SUMIT merchant account
- (Optional) Filament 4.x for admin panel integration

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

[](#installation)

Install the package via Composer:

```
composer require sumit/laravel-payment-gateway
```

Publish the configuration file:

```
php artisan vendor:publish --tag=sumit-payment-config
```

Publish and run the migrations:

```
php artisan vendor:publish --tag=sumit-payment-migrations
php artisan migrate
```

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

[](#configuration)

Add your SUMIT credentials to your `.env` file:

```
SUMIT_COMPANY_ID=your-company-id
SUMIT_API_KEY=your-api-key
SUMIT_API_PUBLIC_KEY=your-public-key
SUMIT_MERCHANT_NUMBER=your-merchant-number
SUMIT_ENVIRONMENT=www

# Optional settings
SUMIT_TESTING_MODE=false
SUMIT_PCI_MODE=direct
SUMIT_EMAIL_DOCUMENT=true
SUMIT_DOCUMENT_LANGUAGE=he
SUMIT_MAXIMUM_PAYMENTS=12
```

Usage
-----

[](#usage)

### Basic Payment Processing

[](#basic-payment-processing)

```
use Sumit\LaravelPayment\Facades\SumitPayment;

$result = SumitPayment::processPayment([
    'amount' => 100.00,
    'currency' => 'ILS',
    'customer_name' => 'John Doe',
    'customer_email' => 'john@example.com',
    'card_number' => '4580000000000000',
    'expiry_month' => '12',
    'expiry_year' => '25',
    'cvv' => '123',
    'description' => 'Order #12345',
]);

if ($result['success']) {
    $transaction = $result['transaction'];
    // Payment successful
} else {
    // Payment failed
    $errorMessage = $result['message'];
}
```

### Tokenize a Credit Card

[](#tokenize-a-credit-card)

```
$result = SumitPayment::tokenizeCard([
    'card_number' => '4580000000000000',
    'expiry_month' => '12',
    'expiry_year' => '25',
    'cvv' => '123',
    'cardholder_name' => 'John Doe',
], auth()->id());

if ($result['success']) {
    $token = $result['token'];
    // Token saved
}
```

### Process Payment with Saved Token

[](#process-payment-with-saved-token)

```
$result = SumitPayment::processPaymentWithToken([
    'amount' => 100.00,
    'customer_name' => 'John Doe',
    'customer_email' => 'john@example.com',
], $tokenId);
```

### Using the Service Directly

[](#using-the-service-directly)

```
use Sumit\LaravelPayment\Services\PaymentService;

class CheckoutController extends Controller
{
    public function processPayment(PaymentService $paymentService)
    {
        $result = $paymentService->processPayment([
            'amount' => 100.00,
            'customer_name' => 'John Doe',
            'customer_email' => 'john@example.com',
            // ... other payment data
        ]);

        return response()->json($result);
    }
}
```

Events
------

[](#events)

The package dispatches the following events:

### PaymentCompleted

[](#paymentcompleted)

Fired when a payment is successfully processed:

```
use Sumit\LaravelPayment\Events\PaymentCompleted;

Event::listen(PaymentCompleted::class, function (PaymentCompleted $event) {
    $transaction = $event->transaction;
    // Send confirmation email, update order status, etc.
});
```

### PaymentFailed

[](#paymentfailed)

Fired when a payment fails:

```
use Sumit\LaravelPayment\Events\PaymentFailed;

Event::listen(PaymentFailed::class, function (PaymentFailed $event) {
    $transaction = $event->transaction;
    $errorMessage = $event->errorMessage;
    // Log error, notify admin, etc.
});
```

### TokenCreated

[](#tokencreated)

Fired when a new payment token is created:

```
use Sumit\LaravelPayment\Events\TokenCreated;

Event::listen(TokenCreated::class, function (TokenCreated $event) {
    $token = $event->token;
    // Send notification to user
});
```

Models
------

[](#models)

### Transaction

[](#transaction)

```
use Sumit\LaravelPayment\Models\Transaction;

// Get all completed transactions
$completedTransactions = Transaction::completed()->get();

// Get pending transactions
$pendingTransactions = Transaction::pending()->get();

// Get subscription transactions
$subscriptions = Transaction::subscriptions()->get();

// Check transaction status
if ($transaction->isSuccessful()) {
    // Transaction completed
}
```

### PaymentToken

[](#paymenttoken)

```
use Sumit\LaravelPayment\Models\PaymentToken;

// Get user's tokens
$tokens = PaymentToken::where('user_id', auth()->id())
    ->active()
    ->get();

// Get default token
$defaultToken = PaymentToken::where('user_id', auth()->id())
    ->default()
    ->first();
```

### Customer

[](#customer)

```
use Sumit\LaravelPayment\Models\Customer;

// Find customer by SUMIT ID
$customer = Customer::findBySumitId($sumitCustomerId);

// Get or create customer for user
$customer = Customer::findOrCreateByUser(auth()->id(), [
    'email' => 'john@example.com',
    'name' => 'John Doe',
]);
```

API Routes
----------

[](#api-routes)

The package registers the following routes:

### Payment Routes

[](#payment-routes)

- `POST /sumit/payment/process` - Process a payment
- `GET /sumit/payment/callback` - Handle redirect callback
- `GET /sumit/payment/{transactionId}` - Get transaction details

### Token Routes (Authenticated)

[](#token-routes-authenticated)

- `GET /sumit/tokens` - Get user's tokens
- `POST /sumit/tokens` - Create new token
- `PUT /sumit/tokens/{tokenId}/default` - Set token as default
- `DELETE /sumit/tokens/{tokenId}` - Delete token

Advanced Usage
--------------

[](#advanced-usage)

### Custom Payment Items

[](#custom-payment-items)

```
$result = SumitPayment::processPayment([
    'amount' => 150.00,
    'customer_name' => 'John Doe',
    'customer_email' => 'john@example.com',
    'items' => [
        [
            'Name' => 'Product 1',
            'Price' => 100.00,
            'Quantity' => 1,
        ],
        [
            'Name' => 'Product 2',
            'Price' => 50.00,
            'Quantity' => 1,
        ],
    ],
    // ... card details
]);
```

### Installment Payments

[](#installment-payments)

```
$result = SumitPayment::processPayment([
    'amount' => 1200.00,
    'payments_count' => 12, // 12 monthly payments
    // ... other payment data
]);
```

### Donation Receipts

[](#donation-receipts)

```
$result = SumitPayment::processPayment([
    'amount' => 100.00,
    'is_donation' => true,
    // ... other payment data
]);
```

Refunds
-------

[](#refunds)

Process full or partial refunds:

```
use Sumit\LaravelPayment\Services\RefundService;
use Sumit\LaravelPayment\Models\Transaction;

$refundService = app(RefundService::class);
$transaction = Transaction::find($transactionId);

// Full refund
$result = $refundService->processRefund($transaction);

// Partial refund
$result = $refundService->processRefund($transaction, 50.00, 'Customer requested partial refund');

if ($result['success']) {
    // Refund processed successfully
    $refundDocumentId = $result['refund_document_id'];
}
```

Recurring Billing &amp; Subscriptions
-------------------------------------

[](#recurring-billing--subscriptions)

Create and manage recurring subscriptions:

```
use Sumit\LaravelPayment\Services\RecurringBillingService;

$billingService = app(RecurringBillingService::class);

// Create a subscription
$result = $billingService->createSubscription([
    'user_id' => auth()->id(),
    'amount' => 99.00,
    'currency' => 'ILS',
    'frequency' => 'monthly', // daily, weekly, monthly, yearly
    'token_id' => $savedTokenId,
    'description' => 'Premium Membership',
    'charge_immediately' => true,
]);

if ($result['success']) {
    $subscription = $result['subscription'];
}

// Cancel a subscription
$result = $billingService->cancelSubscription($subscription);

// Update subscription
$result = $billingService->updateSubscription($subscription, [
    'amount' => 119.00,
    'frequency' => 'monthly',
]);

// Process due subscriptions (add to your scheduled tasks)
$results = $billingService->processDueSubscriptions();
```

### Automated Subscription Charging

[](#automated-subscription-charging)

Add to `app/Console/Kernel.php`:

```
use Sumit\LaravelPayment\Services\RecurringBillingService;

protected function schedule(Schedule $schedule)
{
    $schedule->call(function () {
        app(RecurringBillingService::class)->processDueSubscriptions();
    })->daily()->at('02:00');
}
```

Webhooks
--------

[](#webhooks)

Handle payment status updates from SUMIT:

### Webhook URL

[](#webhook-url)

Configure your webhook URL in SUMIT dashboard to point to:

```
https://your-domain.com/sumit/webhook

```

### Listening to Webhook Events

[](#listening-to-webhook-events)

```
use Sumit\LaravelPayment\Events\WebhookReceived;
use Sumit\LaravelPayment\Events\PaymentStatusChanged;

// Listen for any webhook
Event::listen(WebhookReceived::class, function (WebhookReceived $event) {
    $eventType = $event->eventType;
    $data = $event->data;

    // Handle webhook
});

// Listen for payment status changes
Event::listen(PaymentStatusChanged::class, function (PaymentStatusChanged $event) {
    $transaction = $event->transaction;
    $newStatus = $event->newStatus;
    $oldStatus = $event->oldStatus;

    // Update your order status, send notifications, etc.
});
```

### Available Webhook Events

[](#available-webhook-events)

- `payment.completed` - Payment successfully processed
- `payment.failed` - Payment failed
- `payment.refunded` - Payment refunded
- `payment.authorized` - Payment authorized (J5 mode)
- `subscription.charged` - Subscription successfully charged
- `subscription.failed` - Subscription charge failed

Filament Admin Panel Integration
--------------------------------

[](#filament-admin-panel-integration)

This package includes full integration with Filament Admin Panel for managing payments, settings, and tokens.

### Quick Setup

[](#quick-setup)

1. Install Filament (if not already installed):

```
composer require filament/filament:"^4.1"
```

2. Register the plugin in your Filament Panel Provider:

```
use Sumit\LaravelPayment\Filament\SumitPaymentPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            SumitPaymentPlugin::make(),
        ]);
}
```

### Features

[](#features-1)

- **Settings Page** - Manage all payment gateway settings through a user-friendly interface
- **Transaction Resource** - View, filter, and manage all transactions with refund capabilities
- **Payment Token Resource** - Manage saved payment methods
- **Customer Resource** - Complete CRUD for SUMIT customers with relationship views
- **Relationship Management** - Navigate between customers, transactions, and tokens
- **Refund Actions** - Process refunds directly through the admin panel using SUMIT API
- **Real-time Updates** - Live status updates and filtering
- **Export Capabilities** - Export transaction data

For detailed Filament integration guide, see [FILAMENT\_INTEGRATION.md](FILAMENT_INTEGRATION.md). For recent improvements, see [FILAMENT\_IMPROVEMENTS.md](FILAMENT_IMPROVEMENTS.md).

Testing
-------

[](#testing)

```
composer test
```

Security
--------

[](#security)

- Credit card data is never stored in your database
- PCI DSS compliant tokenization
- All API communication over HTTPS
- Sensitive data is excluded from logs

Support
-------

[](#support)

For support, email  or visit

License
-------

[](#license)

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

Credits
-------

[](#credits)

- [SUMIT](https://www.sumit.co.il)
- Converted from WooCommerce plugin to Laravel package

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance48

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 58.5% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/127d9d84318cddc32aa5b44640b8f431b89793d11eddf26c55938e8c0b87a217?d=identicon)[NMDIGITALHUB](/maintainers/NMDIGITALHUB)

---

Top Contributors

[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (38 commits)")[![nm-digitalhub](https://avatars.githubusercontent.com/u/211350234?v=4)](https://github.com/nm-digitalhub "nm-digitalhub (26 commits)")[![KALFANET](https://avatars.githubusercontent.com/u/104522435?v=4)](https://github.com/KALFANET "KALFANET (1 commits)")

### Embed Badge

![Health badge](/badges/nm-digital-hub-laravel-payment/health.svg)

```
[![Health](https://phpackages.com/badges/nm-digital-hub-laravel-payment/health.svg)](https://phpackages.com/packages/nm-digital-hub-laravel-payment)
```

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

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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