Search by

andriichuk / laravel-billing-bluesnap

andriichuk

Official BlueSnap driver for andriichuk/laravel-billing.

Package info

github.com/andriichuk/laravel-billing-bluesnap

pkg:composer/andriichuk/laravel-billing-bluesnap

Statistics

Installs: 8

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.4.1 2026-09-28 14:42 UTC

README

The official BlueSnap driver for andriichuk/laravel-billing, powered by the framework-agnostic andriichuk/bluesnap-php-sdk.

Requirements

  • PHP 8.5+
  • Laravel 13
  • A PSR-18 HTTP client and PSR-17 request/stream factories bound in Laravel's container
  • BlueSnap API credentials and a webhook security-header secret
  • A BlueSnap merchant ID when using Hosted Payment Page checkout

Installation

composer require andriichuk/laravel-billing-bluesnap
php artisan vendor:publish --tag=billing-bluesnap-config

Select the driver in config/billing.php:

'default' => env('BILLING_DRIVER', 'bluesnap'),

'drivers' => [
    'bluesnap' => config('billing-bluesnap'),
],

The package does not force an HTTP implementation. Bind your application's PSR-18 client and PSR-17 factories to Psr\Http\Client\ClientInterface, Psr\Http\Message\RequestFactoryInterface, and Psr\Http\Message\StreamFactoryInterface.

Credentials are validated only when the bluesnap driver is resolved, so discovery, route listing, and configuration caching remain usable without live secrets.

Usage

All portable operations use the core contracts. BlueSnap-only features are exposed by BlueSnapDriver:

use Andriichuk\LaravelBilling\Billing;
use Andriichuk\LaravelBillingBlueSnap\BlueSnapDriver;

$driver = Billing::driver('bluesnap');
assert($driver instanceof BlueSnapDriver);

$token = $driver->hostedFields()->createToken();
$paymentMethod = $token->toPaymentMethodReference();

$checkoutUrl = $driver->hostedCheckoutUrl([
    'plan_id' => 3173219,
    'return_url' => route('billing.bluesnap.return'),
    'merchant_transaction_id' => 'subscription-42',
    'email' => 'ada@example.com',
]);

The driver supports vaulted shoppers, subscriptions and trials, Hosted Payment Page checkout, plan and quantity changes, cancellation modes, transactions, refunds, payment-method updates, signed webhooks, subscription sweep reconciliation, and targeted reconciliation. It intentionally does not advertise pausing, usage billing, provider-independent proration, invoices, automatic tax, or metered billing.

See the configuration, customers, subscriptions, Hosted Payment Pages, payment sources, webhooks, reconciliation, and migration guide.

Quality

composer check

License

MIT