Download the PHP package intelfric-technology/laravel-snippe without Composer

On this page you can find all versions of the php package intelfric-technology/laravel-snippe. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-snippe

Laravel Snippe

A clean, expressive Laravel package for integrating the Snippe Tanzania payment gateway. Supports Mobile Money (Airtel, M-Pesa, Halotel, Mixx), Bank Transfer, Card payments, Dynamic QR codes, and Payment Sessions (hosted checkout) — with webhook signature verification and a fluent builder API.

Built by Intelfric Technology: https://intelfric.com

Our Story & Philosophy

Smart Ideas Born from Real Challenges

We believe the most powerful innovations emerge when intelligence meets resistance. Every challenge we face in Africa becomes a catalyst for creating solutions that work locally and scale to global impact.

The Ant Philosophy

The ant in our logo is not just a design element, it is a philosophy. Ants represent structure, teamwork, resilience, and purpose. They build complex systems through small, intentional actions, reflecting how we build software: focused, unified, efficient, and mission-driven.

The Meaning Behind Intelfric

Intelfric combines two core ideas:

Together, the name reflects our belief that smart ideas born from real challenges, deeply rooted in Africa, can create solutions with global impact.

Core Values

Our Mission

To leverage cutting-edge technology and innovative thinking to deliver custom software solutions that solve real business problems, improve operational efficiency, and accelerate growth across industries.

Our Vision

To be the leading technology partner in East Africa, recognized for innovative solutions, exceptional quality, and commitment to digital transformation that creates sustainable value for businesses and communities.


Requirements

Dependency Version
PHP ^8.2
Laravel ^11.0 | ^12.0 | ^13.0

Installation

Package discovery is automatic — no need to manually register the service provider.

Publish the config file

This creates config/snippe.php in your application.

Add credentials to .env

Find SNIPPE_WEBHOOK_SECRET in your Snippe Dashboard → Webhooks → Signing Secret.

Exclude webhook route from CSRF

In Laravel 11 / 12 / 13 (bootstrap/app.php):

Or if you register your own route (see Custom Webhook Controller):


Quick Start


Usage

Payment Sessions (Hosted Checkout) — Recommended

A Payment Session creates a Snippe-hosted checkout page. Redirect your customer there to pay. This is the recommended approach for subscriptions and one-off charges because you do not need to handle card/mobile-money UI yourself.

When payment completes, Snippe fires your webhook with the metadata you attached, allowing you to activate the subscription automatically on the server side.

Payment Session Builder Methods

Method Signature Description
session session(?int $amount) Start a session (omit amount to allow customer input)
customer ->customer(string $name, string $email) Attach customer info
allowedMethods ->allowedMethods(array $methods) Restrict to specific methods: mobile_money, bank_transfer, card, qr
redirectTo ->redirectTo(string $success, string $cancel) URLs Snippe redirects to after payment
webhook ->webhook(string $url) Override the webhook URL for this session
metadata ->metadata(array $data) Arbitrary key-value data included in webhook payload
expiresIn ->expiresIn(int $seconds) Session expiry window (default: 3600)
allowCustomAmount ->allowCustomAmount() Let the customer enter their own amount (e.g. top-ups)
send ->send() Execute — returns a PaymentSession object

Allow custom amount (e.g. top-ups)


Mobile Money

Bank Transfer

Card Payment

Dynamic QR Code

Raw Array Payloads


Payment Operations

Verify / Check Status

List Payments

Account Balance

Retry USSD Push


Object Reference

Payment Object

Method Returns Description
reference() ?string Unique payment UUID
status() ?string pending | completed | failed | expired | voided
paymentType() ?string mobile | card | dynamic-qr
amount() ?int Payment amount in TZS
currency() ?string TZS
isPending() bool
isCompleted() bool
isFailed() bool
isExpired() bool
isVoided() bool
paymentUrl() ?string Checkout URL (card / QR)
qrCode() ?string QR data string
fees() ?int Transaction fees (available after completion)
netAmount() ?int Amount after fees
customer() array Customer info (name, email, phone)
completedAt() ?string Completion timestamp (ISO 8601)
createdAt() ?string Creation timestamp (ISO 8601)
toArray() array Full raw API response

Payment Session Object

Method Returns Description
reference() ?string Session reference e.g. sess_abc123
status() ?string pending | completed | expired | cancelled
checkoutUrl() ?string Hosted checkout URL — redirect the customer here
paymentLinkUrl() ?string Shareable short link
shortCode() ?string Abbreviated session code
amount() ?int Fixed session amount (null when allowCustomAmount is set)
currency() ?string TZS
isPending() bool
isCompleted() bool
isExpired() bool
isCancelled() bool
expiresAt() ?string Session expiry timestamp (ISO 8601)
completedAt() ?string Completion timestamp (ISO 8601)
toArray() array Full raw API response

Webhook Object

Method Returns Description
fromRaw(string $body, array $headers) static Parse raw webhook payload
verifyOrFail(string $secret) void Throws SnippeException if signature is invalid
verify(string $secret) bool Returns false instead of throwing
isPaymentCompleted() bool True when event type is payment.completed
isPaymentFailed() bool True when event type is payment.failed
reference() ?string Payment reference from the event
amount() ?int Payment amount
currency() ?string TZS
metadata() array The metadata array you attached to the session/payment
toArray() array Full raw webhook payload

Phone Number Normalisation

The builder automatically normalises any Tanzanian number format:


Webhooks

Built-in Route

Set SNIPPE_WEBHOOK_PATH=snippe/webhook and point your Snippe dashboard to:

The package registers this route automatically and fires Laravel events:

Custom Webhook Controller

Disable the built-in route with SNIPPE_WEBHOOK_PATH=false and register your own:

Signature Verification


Subscription Integration Pattern

The recommended end-to-end pattern for SaaS subscription billing:


Error Handling

All API errors throw a SnippeException:

HTTP Error Code Meaning
400 validation_error Missing or invalid field
401 unauthorized Bad or missing API key
403 insufficient_scope API key lacks permission
404 not_found Payment or session not found
422 validation_error Unprocessable entity

Testing

The package ships with a full Pest test suite:

In your own application, use Laravel's Http::fake() to mock Snippe API responses:


Configuration Reference


Changelog

v1.0.3 — 2026-04-11

v1.0.2


License

MIT — see LICENSE.


All versions of laravel-snippe with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/http Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package intelfric-technology/laravel-snippe contains the following files

Loading the files please wait ...