three_oh_eight/laravel-payflo

Laravel SDK for the Payflo invoicing and EU VAT API

Maintainers

Package info

github.com/Three-Oh-Eight/laravel-payflo

pkg:composer/three_oh_eight/laravel-payflo

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-05-15 08:24 UTC

This package is auto-updated.

Last update: 2026-05-15 08:30:11 UTC


README

Laravel SDK for the Payflo invoicing and EU VAT API.

Latest Version Tests License

Requirements

  • PHP 8.4 or 8.5
  • Laravel 12 or 13

Install

composer require three_oh_eight/laravel-payflo

Configure

Publish the config file:

php artisan vendor:publish --tag=payflo-config

Set the environment variables:

PAYFLO_ENABLED=true
PAYFLO_API_KEY=your-api-key
PAYFLO_API_URL=https://payflo.eu/api/v1
PAYFLO_CURRENCY_ID=1
PAYFLO_COUNTRY_ID=150

Usage

The Payflo facade exposes five resources.

Customers

use Payflo;

$customerId = Payflo::customers()->getOrCreate(
    externalId: 'crm-1234',
    name: 'Acme B.V.',
    billingEmail: 'billing@acme.example',
);

Invoices

$invoice = Payflo::invoices()
    ->for($customerId)
    ->createAndFinalize(
        description: 'Annual subscription',
        amountCents: 12000,
    );

// Or build line items by hand:
$draft = Payflo::invoices()->for($customerId)->create(
    lines: [
        ['description' => 'Setup fee', 'quantity' => 1, 'unit_price' => 99.00],
        ['description' => 'Monthly fee', 'quantity' => 3, 'unit_price' => 29.00],
    ],
    notes: 'Q1 services',
);

Payflo::invoices()->finalize($draft['uuid']);
Payflo::invoices()->markAsPaid($draft['uuid']);

$pdf = Payflo::invoices()->downloadPdf($draft['uuid']);

Tax calculation

$tax = Payflo::tax()->calculate(
    amount: 100.00,
    buyerCountryCode: 'DE',
    customerType: 'business',
    vatNumber: 'DE123456789',
);

VAT validation (VIES, cached for 24h)

$result = Payflo::vat()->validate('NL123456789B01');

if ($result['is_valid']) {
    // $result['company_name'], $result['company_address']
}

Credit notes

$creditNote = Payflo::creditNotes()->create(
    invoiceUuid: $invoice['uuid'],
    fullRefund: true,
    reason: 'Customer cancellation',
);

Testing

composer test

Security

See SECURITY.md for the responsible disclosure process.

License

MIT — see LICENSE.