PHPackages                             nm-digitalhub/laravel-officeguy - 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-digitalhub/laravel-officeguy

ActiveLibrary[Payment Processing](/categories/payments)

nm-digitalhub/laravel-officeguy
===============================

Laravel package for SUMIT payment gateway integration with invoice creation, credit card token storage, and secure transaction processing

07PHPCI failing

Since Nov 13Pushed 5mo agoCompare

[ Source](https://github.com/nm-digitalhub/laravel-officeguy-package)[ Packagist](https://packagist.org/packages/nm-digitalhub/laravel-officeguy)[ RSS](/packages/nm-digitalhub-laravel-officeguy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel OfficeGuy Payment Gateway Package
=========================================

[](#laravel-officeguy-payment-gateway-package)

A comprehensive Laravel package for integrating SUMIT (OfficeGuy) payment gateway with invoice creation, credit card token storage, and secure transaction processing. This package is a complete conversion of the WooCommerce plugin to a Laravel 12+ compatible package.

> **🚀 Quick Start**: See [QUICKSTART.md](QUICKSTART.md) for a 5-minute setup guide.

Features
--------

[](#features)

- 🔒 **Secure Payment Processing** - PCI-compliant credit card processing
- 💳 **Token Management** - Store and manage payment tokens securely
- 📄 **Invoice Generation** - Automatic invoice/receipt creation
- 🔄 **Subscription Support** - Recurring payment handling
- 📦 **Stock Synchronization** - Inventory sync with SUMIT
- 🎯 **Event System** - Laravel events for payment lifecycle
- 🔗 **Webhook Support** - Handle payment callbacks
- 🌐 **Multi-currency** - Support for ILS, USD, EUR, GBP
- 📊 **Payment Tracking** - Complete payment history and logging

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

[](#requirements)

- PHP 8.1 or higher
- Laravel 11.x or 12.x
- MySQL/PostgreSQL database
- SUMIT account with API credentials

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require nm-digitalhub/laravel-officeguy
```

### 2. Publish Configuration

[](#2-publish-configuration)

```
php artisan vendor:publish --tag=officeguy-config
```

This will create a `config/officeguy.php` file where you can customize the package settings.

### 3. Publish Migrations

[](#3-publish-migrations)

```
php artisan vendor:publish --tag=officeguy-migrations
```

### 4. Run Migrations

[](#4-run-migrations)

```
php artisan migrate
```

This will create the following tables:

- `officeguy_payment_tokens` - Stores payment tokens
- `officeguy_payments` - Payment transaction records
- `officeguy_customers` - Customer information
- `officeguy_stock_sync_logs` - Stock synchronization logs

### 5. Configure Environment Variables

[](#5-configure-environment-variables)

Add the following to your `.env` file:

```
OFFICEGUY_COMPANY_ID=your_company_id
OFFICEGUY_PRIVATE_KEY=your_private_key
OFFICEGUY_PUBLIC_KEY=your_public_key
OFFICEGUY_ENVIRONMENT=www
OFFICEGUY_MERCHANT_NUMBER=your_merchant_number

# Optional settings
OFFICEGUY_TESTING_MODE=false
OFFICEGUY_AUTHORIZE_ONLY=false
OFFICEGUY_DRAFT_DOCUMENT=false
OFFICEGUY_SEND_DOCUMENT_BY_EMAIL=true
```

You can find your API credentials at:

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

[](#configuration)

The package configuration file (`config/officeguy.php`) contains all available settings:

- **Credentials** - Company ID, API keys
- **Environment** - Production or development
- **Payment Settings** - Merchant numbers, authorization settings
- **Payment Limits** - Maximum payments, minimum amounts
- **Customer Settings** - Customer merge options
- **Document Settings** - Language, VAT settings
- **Token Settings** - Token storage configuration
- **Stock Settings** - Inventory synchronization
- **Logging** - Log channel and level
- **Routes** - API endpoint configuration

Usage
-----

[](#usage)

### Processing a Payment

[](#processing-a-payment)

```
use NmDigitalHub\LaravelOfficeGuy\Services\PaymentService;

class CheckoutController extends Controller
{
    public function processPayment(PaymentService $paymentService)
    {
        $result = $paymentService->processPayment([
            'amount' => 100.00,
            'currency' => 'ILS',
            'user_id' => auth()->id(),
            'order_id' => 12345,
            'description' => 'Order #12345',
            'customer' => [
                'name' => 'John Doe',
                'email' => 'john@example.com',
                'phone' => '0501234567',
                'address' => '123 Main St',
                'city' => 'Tel Aviv',
            ],
            'single_use_token' => $request->input('payment_token'),
            'save_token' => true,
        ]);

        if ($result['success']) {
            return redirect()->route('payment.success')
                ->with('payment_id', $result['payment']->id);
        }

        return back()->with('error', $result['error']);
    }
}
```

### Creating a Payment Token

[](#creating-a-payment-token)

```
use NmDigitalHub\LaravelOfficeGuy\Services\TokenService;

class PaymentMethodController extends Controller
{
    public function addCard(TokenService $tokenService, Request $request)
    {
        $result = $tokenService->createToken([
            'user_id' => auth()->id(),
            'single_use_token' => $request->input('token'),
            'set_as_default' => true,
        ]);

        if ($result['success']) {
            return response()->json([
                'message' => 'Card added successfully',
                'token' => $result['token'],
            ]);
        }

        return response()->json([
            'error' => $result['error']
        ], 400);
    }
}
```

### Subscription Payment

[](#subscription-payment)

```
use NmDigitalHub\LaravelOfficeGuy\Services\SubscriptionService;

class SubscriptionController extends Controller
{
    public function processSubscription(SubscriptionService $subscriptionService)
    {
        $result = $subscriptionService->createSubscription([
            'user_id' => auth()->id(),
            'amount' => 99.00,
            'currency' => 'ILS',
            'description' => 'Monthly Subscription',
            'customer' => [
                'name' => auth()->user()->name,
                'email' => auth()->user()->email,
            ],
            'single_use_token' => $request->input('token'),
        ]);

        if ($result['success']) {
            // Store subscription details
            return redirect()->route('subscription.success');
        }

        return back()->with('error', $result['error']);
    }
}
```

### Stock Synchronization

[](#stock-synchronization)

```
use NmDigitalHub\LaravelOfficeGuy\Services\StockService;

class StockController extends Controller
{
    public function syncStock(StockService $stockService)
    {
        $result = $stockService->updateStock(forceSync: true);

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

### Using the Facade

[](#using-the-facade)

```
use NmDigitalHub\LaravelOfficeGuy\Facades\OfficeGuy;

// Process payment
$result = OfficeGuy::processPayment($paymentData);

// Create token
$result = OfficeGuy::createToken($tokenData);

// Update stock
$result = OfficeGuy::updateStock();
```

Events
------

[](#events)

The package dispatches the following events:

### PaymentProcessed

[](#paymentprocessed)

Fired when a payment is successfully processed.

```
use NmDigitalHub\LaravelOfficeGuy\Events\PaymentProcessed;

Event::listen(PaymentProcessed::class, function ($event) {
    // $event->payment - Payment model
    // $event->response - API response

    // Send confirmation email, update order, etc.
});
```

### PaymentFailed

[](#paymentfailed)

Fired when a payment fails.

```
use NmDigitalHub\LaravelOfficeGuy\Events\PaymentFailed;

Event::listen(PaymentFailed::class, function ($event) {
    // $event->payment - Payment model
    // $event->response - API response

    // Log failure, notify admin, etc.
});
```

### TokenCreated

[](#tokencreated)

Fired when a payment token is created.

```
use NmDigitalHub\LaravelOfficeGuy\Events\TokenCreated;

Event::listen(TokenCreated::class, function ($event) {
    // $event->token - PaymentToken model

    // Update user preferences, send notification, etc.
});
```

### StockSynced

[](#stocksynced)

Fired when stock synchronization completes.

```
use NmDigitalHub\LaravelOfficeGuy\Events\StockSynced;

Event::listen(StockSynced::class, function ($event) {
    // $event->updatedCount - Number of products updated
    // $event->failedCount - Number of failed updates

    // Log results, notify admin, etc.
});
```

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

[](#api-routes)

The package registers the following API routes (prefix: `/api/officeguy`):

### Payment Routes

[](#payment-routes)

- `POST /payments` - Process a payment
- `GET /payments` - List user payments
- `GET /payments/{id}` - Get payment details
- `POST /payments/{id}/refund` - Refund a payment

### Token Routes

[](#token-routes)

- `POST /tokens` - Create a payment token
- `GET /tokens` - List user tokens
- `DELETE /tokens/{id}` - Delete a token
- `POST /tokens/{id}/set-default` - Set token as default

### Stock Routes

[](#stock-routes)

- `POST /stock/sync` - Trigger stock synchronization
- `GET /stock/logs` - Get sync logs
- `GET /stock/status` - Get sync status

### Webhook Routes

[](#webhook-routes)

- `POST /webhook` - Handle payment webhooks
- `GET /redirect` - Handle payment redirects

Models
------

[](#models)

### Payment

[](#payment)

```
use NmDigitalHub\LaravelOfficeGuy\Models\Payment;

// Find payment
$payment = Payment::find($id);

// Check status
if ($payment->isSuccessful()) {
    // Payment completed
}

// Get payments
$payments = Payment::successful()->get();
$subscriptionPayments = Payment::subscription()->get();
```

### PaymentToken

[](#paymenttoken)

```
use NmDigitalHub\LaravelOfficeGuy\Models\PaymentToken;

// Get user tokens
$tokens = PaymentToken::forUser($userId)->get();

// Get default token
$defaultToken = PaymentToken::forUser($userId)->default()->first();

// Check expiry
if ($token->isExpired()) {
    // Token expired
}
```

### Customer

[](#customer)

```
use NmDigitalHub\LaravelOfficeGuy\Models\Customer;

// Find by email
$customer = Customer::byEmail('john@example.com')->first();

// Get full address
$address = $customer->full_address;
```

Migration from WooCommerce Plugin
---------------------------------

[](#migration-from-woocommerce-plugin)

If you're migrating from the WooCommerce plugin, here's a mapping of key components:

WooCommerceLaravel Package`OfficeGuyAPI``OfficeGuyApiService``OfficeGuyPayment``PaymentService``OfficeGuyTokens``TokenService``OfficeGuyStock``StockService``OfficeGuySubscriptions``SubscriptionService`WooCommerce HooksLaravel EventsGateway SettingsConfig FilePayment MetaPayment ModelToken MetaPaymentToken ModelTesting
-------

[](#testing)

Run the package tests:

```
composer test
```

Security
--------

[](#security)

- Never store raw credit card data
- All card data is tokenized via SUMIT's API
- Use HTTPS in production
- Validate webhook signatures
- Log all payment attempts
- Regular security audits recommended

Support
-------

[](#support)

For support and bug reports:

- GitHub Issues:
- Email:
- SUMIT Support:

License
-------

[](#license)

MIT License. See LICENSE file for details.

Credits
-------

[](#credits)

Developed by NM Digital Hub Based on the WooCommerce OfficeGuy Plugin

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance47

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

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

[![nm-digitalhub](https://avatars.githubusercontent.com/u/211350234?v=4)](https://github.com/nm-digitalhub "nm-digitalhub (3 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (2 commits)")

### Embed Badge

![Health badge](/badges/nm-digitalhub-laravel-officeguy/health.svg)

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

###  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)
