noith/payment-bank-invoice

Bank invoice payment system for noith/payment-core.

Maintainers

Package info

gitlab.com/noith-payment/bank-invoice

Issues

pkg:composer/noith/payment-bank-invoice

Transparency log

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

1.0.1 2026-08-11 21:35 UTC

This package is auto-updated.

Last update: 2026-08-11 18:37:14 UTC


README

Extension package for noith/payment-core that adds the bank_invoice rail for B2B bank-transfer invoices.

The rail generates a PDF invoice, stores it in Laravel Storage, and returns a typed BankInvoiceResult with pdf_path and a resolver-generated pdf_url. It does not call an external provider and does not expose webhooks or app routes. The host application confirms payment through core ConfirmInvoiceAction.

Installation

composer require noith/payment-bank-invoice

Publish config and the printable Blade template when needed:

php artisan vendor:publish --tag=bank-invoice-config
php artisan vendor:publish --tag=bank-invoice-views
php artisan vendor:publish --tag=bank-invoice-lang

Seller Credentials

Store seller bank requisites under the bank_invoice payment system key:

[
    'name' => 'ООО Продавец',
    'inn' => '7700000000',
    'kpp' => '770001001',
    'legal_address' => 'г. Москва, ул. Примерная, 1',
    'bank_name' => 'АО Банк',
    'bik' => '044525000',
    'settlement_account' => '40702810000000000000',
    'correspondent_account' => '30101810000000000000',
]

Buyer Details

Buyer legal entity data is read from PaymentInvoice::$billing_details:

{
  "billing_details": {
    "name": "ООО Ромашка",
    "inn": "7701234567",
    "kpp": "770101001",
    "address": "г. Москва, ул. Ленина, 1",
    "contact": "Иванов И.И."
  }
}

For the bank_invoice rail, billing_details is the buyer legal entity object. name and inn are required; inn must be 10 or 12 digits, kpp (optional) must be 9 digits when present. address and contact are optional. Validation rules are defined by Noith\PaymentBankInvoice\Contracts\LegalEntityRules (default: DefaultLegalEntityRules) — rebind it in your own service provider to change the rules, messages, or attribute labels.

DefaultLegalEntityRules' messages and attribute labels come from the package's lang/{locale}/messages.php files (English and Russian ship in the box) and follow the host app's locale (App::setLocale()). Publish them with bank-invoice-lang to lang/vendor/bank-invoice/{locale} to override or add a locale.

Line Items

The printable PDF's line-items table and VAT breakdown are built from PaymentInvoice::$line_items, the column payment-core (>= v1.0.8) populates from your PaymentHandlerInterface::items() implementation (an Item[]). This package does not read payload for line items. If line_items is empty, createInvoice() throws a RuntimeException — there is no synthetic placeholder line, so make sure your handler always returns at least one item.

Current Scope

This is the package skeleton plus executable tests for the core contract: provider registration, result serialization, URL resolver binding, credentials validation, legal entity validation, line-items/VAT collection for the printable form, PDF generation, and invoice number assignment — including a full CreateInvoiceAction create-flow test (pending status, provider_data round-trip). Host UI, email delivery, reminders, and manual confirmation screens stay outside the package.