PHPackages                             zenphp/obsidian - 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. zenphp/obsidian

ActiveLibrary[Payment Processing](/categories/payments)

zenphp/obsidian
===============

Obsidian provides expressive, fluent subscription billing for Laravel applications using CCBill and SegPay payment processors.

v1.0.4(5mo ago)09MITPHPPHP ^8.4CI passing

Since Nov 21Pushed 5mo agoCompare

[ Source](https://github.com/zenphporg/obsidian)[ Packagist](https://packagist.org/packages/zenphp/obsidian)[ RSS](/packages/zenphp-obsidian/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (5)Dependencies (14)Versions (7)Used By (0)

   ![Obsidian](.github/img/light.png)[![Coverage](https://camo.githubusercontent.com/51a789292f2c48c27dae19cd0b9411a4671fe2c0cb2e63faa72e2f81675f8dc7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f64796e616d69632f786d6c3f636f6c6f723d73756363657373266c6162656c3d636f7665726167652671756572793d726f756e64253238253246253246636f76657261676525324670726f6a6563742532466d657472696373253246253430636f7665726564656c656d656e7473253230646976253230253246253246636f76657261676525324670726f6a6563742532466d657472696373253246253430656c656d656e7473253230253241253230313030253239267375666669783d2532352675726c3d68747470732533412532462532467261772e67697468756275736572636f6e74656e742e636f6d2532467a656e7068706f72672532466f6273696469616e2532466d61696e253246636f7665726167652e786d6c)](https://github.com/zenphporg/obsidian/blob/main/coverage.xml)[![Build Status](https://camo.githubusercontent.com/0bb6929ed581bd54c2274c7f71f7445475d2376aa80187e26137737a74e79a3d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a656e7068706f72672f6f6273696469616e2f6d61696e2e796d6c3f6272616e63683d6d61696e)](https://github.com/zenphporg/obsidian/actions)[![Total Downloads](https://camo.githubusercontent.com/3a37bb96a47602c237f384ba95c9bf267e69d99570d854167b9a14e01d404f79/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a656e7068702f6f6273696469616e)](https://packagist.org/packages/zenphp/obsidian)[![Latest Stable Version](https://camo.githubusercontent.com/9088ee671dae3e465bc5fe7fc9eaee9ff5fd41d0a24f7b5acaa68e7540239cf2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a656e7068702f6f6273696469616e)](https://packagist.org/packages/zenphp/obsidian)[![License](https://camo.githubusercontent.com/632c5c34caf005340d7d16d8adb6e6f7243e67548c33c00c91c71588b5e92f20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a656e7068702f6f6273696469616e2e737667)](https://packagist.org/packages/zenphp/obsidian)

About Obsidian
==============

[](#about-obsidian)

Obsidian provides expressive, fluent subscription billing for Laravel applications using **CCBill** and **SegPay** payment processors. Built specifically for adult content platforms and high-risk merchants who need reliable, compliant payment processing.

Gateway Support Status
----------------------

[](#gateway-support-status)

GatewayStatusSubscriptionsOne-Time ChargesWebhooksCancellationCCBill✅ Implemented✅✅✅✅ (via DataLink)SegPay🚧 Planned❌❌❌❌Fake✅ Implemented✅✅✅✅> **Note:** SegPay integration is planned for a future release. Currently, all SegPay gateway methods will throw a `GatewayException`.

Features
--------

[](#features)

- **Multiple Payment Gateways** - Support for CCBill with SegPay planned
- **Subscription Management** - Create, cancel, and manage recurring subscriptions
- **Trial Periods** - Built-in support for trial subscriptions
- **Webhook Handling** - Automatic webhook processing with signature validation
- **One-Time Charges** - Process single payments alongside subscriptions
- **Fake Gateway** - Test your billing logic without hitting real APIs
- **100% Test Coverage** - Fully tested with comprehensive mocked responses
- **Type Safe** - Full PHP 8.4 type coverage with PHPStan level max

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

[](#requirements)

- PHP 8.4 or higher
- Laravel 12.0 or higher
- A CCBill merchant account (SegPay support coming soon)

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

[](#installation)

Install the package via Composer:

```
composer require zenphp/obsidian
```

### Publish Configuration

[](#publish-configuration)

Publish the configuration file and migrations:

```
php artisan vendor:publish --tag=obsidian-config
php artisan vendor:publish --tag=obsidian-migrations
```

Run the migrations:

```
php artisan migrate
```

### Environment Configuration

[](#environment-configuration)

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

```
# Default Gateway
OBSIDIAN_GATEWAY=ccbill

# CCBill Configuration
CCBILL_MERCHANT_ID=your_merchant_id
CCBILL_SUBACCOUNT_ID=your_subaccount_id
CCBILL_MERCHANT_APP_ID=your_merchant_application_id
CCBILL_SECRET_KEY=your_secret_key
CCBILL_DATALINK_USERNAME=your_datalink_username
CCBILL_DATALINK_PASSWORD=your_datalink_password
CCBILL_WEBHOOK_SECRET=your_webhook_secret

# Currency Settings
OBSIDIAN_CURRENCY=usd
OBSIDIAN_CURRENCY_LOCALE=en
```

### CCBill Requirements

[](#ccbill-requirements)

To use the CCBill gateway, you'll need:

1. **Merchant Application ID &amp; Secret Key** - For OAuth 2.0 authentication with the CCBill REST API
2. **DataLink Credentials** - Username and password for subscription cancellation via the legacy DataLink system
3. **Webhook Secret** - For validating incoming webhook signatures (HMAC SHA256)
4. **FlexForms** - A configured FlexForm for payment page generation

> **Important:** CCBill uses OAuth 2.0 for API authentication. The access token is automatically cached and refreshed as needed.

Setup
-----

[](#setup)

### Add the Billable Trait

[](#add-the-billable-trait)

Add the `Billable` trait to your `User` model (or any model that should have subscriptions):

```
