PHPackages                             cray/laravel-sdk - 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. cray/laravel-sdk

ActiveLibrary[Payment Processing](/categories/payments)

cray/laravel-sdk
================

Cray Laravel SDK for Card and MoMo payments

v1.0.0(6mo ago)031MITPHPPHP ^8.1

Since Nov 10Pushed 6mo agoCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Cray Laravel SDK
----------------

[](#cray-laravel-sdk)

- Package name: `cray/laravel-sdk`
- Installation: `composer require cray/laravel-sdk`
- Supported Frameworks: Laravel 8, 9, 10, 11 (PHP 8.1+)
- Auto-Discovery: Enabled by default
- Manual Registration (Lumen or Custom): Add `Cray\\LaravelSDK\\CrayServiceProvider` to providers and alias `Cray` to `Cray\\LaravelSDK\\Facades\\Cray`.

### Environment Configuration

[](#environment-configuration)

Publish config:

```
php artisan vendor:publish --provider="Cray\\LaravelSDK\\CrayServiceProvider" --tag="config"

```

Add to `.env`:

```
CRAY_PUBLIC_KEY=your_public_key
CRAY_SECRET_KEY=your_secret_key
CRAY_TIMEOUT=30

```

Environment switching (automatic):

- Uses `APP_ENV` to select base URL and environment.
- When `APP_ENV` is `production`/`prod`/`live` → base URL `https://pay.connectramp.com`, env `production`.
- Otherwise (e.g., `staging`, `sandbox`, `local`, `testing`) → base URL `https://dev-gateman.v3.connectramp.com`, env `sandbox`. − No need to set `CRAY_BASE_URL` or `CRAY_ENV` — they are derived. You may still override `CRAY_BASE_URL` if required.

---

SDK Usage Examples
------------------

[](#sdk-usage-examples)

### Card Payment Flow

[](#card-payment-flow)

Initiate a Card Transaction

```
use Cray\LaravelSDK\Facades\Cray;
use Illuminate\Support\Str;

$transaction = Cray::card()->initiate([
    'reference' => (string) Str::uuid(),
    'amount' => '100.00',
    'currency' => 'USD',
    'narration' => 'Payment for Order #12345',
    'card_data' => [
        'pan' => '5399832641760090',
        'cvv' => '146',
        'expiryMonth' => '05',
        'expiryYear' => '50',
    ],
    'callback_url' => route('cray.callback'),
    'customer_information' => [
        'email' => 'customer@example.com',
        'firstName' => 'John',
        'lastName' => 'Doe',
        'mobilePhone' => '+15551234567',
    ],
]);
```

Charge the Transaction

```
if ($transaction['status'] ?? false) {
    $txId = $transaction['data']['transaction_id'] ?? null;
    if ($txId) {
        $charge = Cray::card()->charge($txId);
    }
}
```

Query a Transaction

```
$status = Cray::card()->query('87c89286-afbc-4776-adfd-665c9927b2db');
```

Refund a Transaction

```
$refund = Cray::refund()->refund('87c89286-afbc-4776-adfd-665c9927b2db', 50.00);
```

Query Refund Status

```
$refundStatus = Cray::refund()->queryRefund('87c89286-afbc-4776-adfd-665c9927b2db');
```

---

### MoMo Payment Flow

[](#momo-payment-flow)

Initiate a MoMo Transaction

```
use Cray\LaravelSDK\Facades\Cray;
use Illuminate\Support\Str;

$momo = Cray::momo()->initiate([
    'customer_reference' => (string) Str::uuid(),
    'amount' => '200',
    'currency' => 'GHS',
    'phone_no' => '233801234567',
    'payment_provider' => 'MTN',
    'firstname' => 'John',
    'lastname' => 'Doe',
]);
```

Query MoMo Transaction

```
$requery = Cray::momo()->query('ad75b9bb-2501-4761-8980-42b525e21c37');
```

---

Key Features
------------

[](#key-features)

- Unified SDK for Card and MoMo APIs
- Supports refunding and querying across both transaction types
- Sandbox and production environment toggling
- Standardized response structure and built-in error handling
- Logging, retries, and correlation IDs included

---

CI/CD and Versioning
--------------------

[](#cicd-and-versioning)

- CI Matrix: PHP 8.1–8.3, Laravel 8–11
- Unit Tests: PHPUnit/Larastan static analysis
- Versioning: Semantic Versioning (v1.0.0)

---

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance73

Regular maintenance activity

Popularity4

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

180d ago

### Community

Maintainers

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

### Embed Badge

![Health badge](/badges/cray-laravel-sdk/health.svg)

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

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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