PHPackages                             serenity\_technologies/cashier-nowpayments - 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. serenity\_technologies/cashier-nowpayments

ActiveLibrary[Payment Processing](/categories/payments)

serenity\_technologies/cashier-nowpayments
==========================================

Laravel Cashier-style package for NOWPayments cryptocurrency billing

v1.2.15(2mo ago)131MITPHP ^8.2

Since Apr 9Compare

[ Source](https://github.com/Serenity-Technologies/cashier-nowpayments)[ Packagist](https://packagist.org/packages/serenity_technologies/cashier-nowpayments)[ RSS](/packages/serenity-technologies-cashier-nowpayments/feed)WikiDiscussions Synced 3w ago

READMEChangelogDependencies (13)Versions (25)Used By (0)

Laravel Cashier NOWPayments
===========================

[](#laravel-cashier-nowpayments)

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![PHP Version](https://camo.githubusercontent.com/c9f64f714c636ba27a3bba6dfd52f98426832db1262747efa54b212d16943651/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e322d626c7565)](https://www.php.net/)[![Laravel Version](https://camo.githubusercontent.com/2d699f3ce178375ab0ca1217af9fc6282e4fff0490ef9ce34ede2349ecef5ad4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d31302537433131253743313225374331332d666632643230)](https://laravel.com/)

> A Laravel Cashier-style package for accepting cryptocurrency payments and managing recurring subscriptions via the [NOWPayments](https://nowpayments.io) API.

---

Features
--------

[](#features)

- **One-Time Payments** — Direct crypto payments with a built-in checkout overlay UI
- **Hosted Invoices** — Generate NOWPayments hosted invoice pages with success/cancel redirects
- **Recurring Subscriptions** — Create plans, subscribe users, swap plans with automatic proration credits
- **Crypto Payouts** — Send single or batch payouts to external wallet addresses
- **Credit System** — Plan swap credits tracked with FIFO consumption and pessimistic locking
- **Guest Checkout** — Unauthenticated users can pay without an account
- **Webhook Handling** — HMAC + timestamp verified IPN callbacks for payments, invoices, subscriptions, and payouts
- **Idempotency** — Duplicate payment protection via SHA-256 keyed cache
- **JS Modal** — `CashierCheckout.open()` modal iframe for SPA integrations
- **Event-Driven** — 17 dispatchable events across 5 domains
- **Configurable Auth** — Payment status endpoints gated behind configurable auth guards

---

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

[](#requirements)

DependencyVersionPHP8.2+Laravel10.x, 11.x, 12.x, or 13.xPHP Extensions`ext-bcmath`, `ext-intl`NOWPayments Account[Merchant account](https://nowpayments.io) with API key---

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

[](#installation)

```
composer require serenity_technologies/cashier-nowpayments
```

### Publish Assets

[](#publish-assets)

```
# Config
php artisan vendor:publish --tag=cashier-nowpayments-config

# Views (checkout overlay)
php artisan vendor:publish --tag=cashier-nowpayments-views

# JavaScript assets
php artisan vendor:publish --tag=cashier-nowpayments-assets
```

### Run Migrations

[](#run-migrations)

```
# Recommended: uses the install command which applies table prefixes
php artisan cashier-nowpayments:install

# Then run the migrations
php artisan migrate
```

This creates 9 tables: `customers`, `payments`, `invoices`, `subscriptions`, `subscription_items`, `payouts`, `payout_withdrawals`, `credits`, and `plans`.

### Environment Variables

[](#environment-variables)

Add to your `.env`:

```
# API Credentials
NOWPAYMENTS_API_KEY=your_api_key
NOWPAYMENTS_IPN_SECRET=your_ipn_secret

# Defaults
CASHIER_NOWPAYMENTS_CURRENCY=usd

# Webhook
CASHIER_NOWPAYMENTS_WEBHOOK_PATH=/nowpayments/webhook
CASHIER_NOWPAYMENTS_WEBHOOK_TOLERANCE=300

# Routes
CASHIER_NOWPAYMENTS_ROUTE_PREFIX=cashier-nowpayments
CASHIER_NOWPAYMENTS_ROUTE_MIDDLEWARE=web

# Payment Behavior
CASHIER_NOWPAYMENTS_PAYMENT_METHOD=payment
CASHIER_NOWPAYMENTS_FIXED_RATE=false
CASHIER_NOWPAYMENTS_FEE_PAID_BY_USER=false

# Payment Status Auth
CASHIER_NOWPAYMENTS_PAYMENT_STATUS_AUTH=true
CASHIER_NOWPAYMENTS_PAYMENT_STATUS_GUARD=web

# Caching
CASHIER_NOWPAYMENTS_STATUS_CACHE_SECONDS=10
CASHIER_NOWPAYMENTS_PAYMENT_TIMEOUT=900
CASHIER_NOWPAYMENTS_SYNC_COOLDOWN=15

# Notifications
CASHIER_NOWPAYMENTS_NOTIFY_PAYMENT_RECEIVED=true
CASHIER_NOWPAYMENTS_NOTIFY_PAYMENT_FAILED=true
CASHIER_NOWPAYMENTS_NOTIFY_SUBSCRIPTION_ACTIVATED=true
```

---

Quick Start
-----------

[](#quick-start)

### 1. Prepare Your Billable Model

[](#1-prepare-your-billable-model)

Add the `Billable` trait to your `User` model (or any billable entity):

```
