three_oh_eight/laravel-payflo
Composer 安装命令:
composer require three_oh_eight/laravel-payflo
包简介
Laravel SDK for the Payflo invoicing and EU VAT API
README 文档
README
Laravel SDK for the Payflo invoicing and EU VAT API.
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.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-05-15