Download the PHP package charlielangridge/lunar-xero without Composer

On this page you can find all versions of the php package charlielangridge/lunar-xero. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package lunar-xero

Lunar Xero

lunar-xero connects a Lunar store to Xero. It adds a Xero settings page to the Lunar admin, stores the OAuth connection locally, and syncs contacts, invoices, captured payments, and refunds through queued jobs.

The package is built around Lunar's existing models and events, so it fits into a normal Lunar install instead of replacing the order flow.

What it does

Requirements

Installation

Install the package:

Publish the config file if you want to override the defaults:

Publish the views only if you need to customise them:

Run your migrations:

The service provider is auto-discovered. In a standard Lunar panel setup the plugin page is registered automatically as well.

Configuration

The package config lives at config/lunarpanel-xero.php.

The main settings are:

Environment

Add these values to .env:

If XERO_REDIRECT_URI is left empty, the package falls back to the generated lunarpanel-xero.callback route.

Routes

The package registers these routes:

By default they sit under the Lunar panel path with /xero appended. If the panel path cannot be resolved, the fallback prefix is lunar/xero.

Admin areas

The Xero settings page lets you:

The package also extends existing Lunar admin screens:

Sync behaviour

Contacts

Customer sync is observer-driven.

Invoices

Invoice sync runs from the configured order-created event and can also be queued manually from the order page.

During invoice sync the package:

  1. creates a sync log entry
  2. resolves or creates a Xero contact
  3. builds invoice lines from the order
  4. resolves account codes from variant, product, then package default settings
  5. resolves or creates Xero item codes where possible
  6. creates or updates the Xero invoice
  7. stores the returned Xero invoice ID, invoice number, invoice status, and customer online invoice URL on the order
  8. backfills payments and refunds where appropriate

For account or pay-later order flows, the package can also sync and email an invoice in one queued operation. That flow always pushes the latest Lunar order details to Xero first, creates or updates the invoice as AUTHORISED, fetches the invoice from Xero, and only calls Xero's email endpoint when sent_to_contact is still false. If the invoice has already been sent from Xero or by a previous package run, the email step is skipped and logged as successful.

Synced orders can contain these Xero invoice fields:

Invoice references are composed from the order reference, purchase order reference, and customer reference, joined with -. Blank values and duplicate values are skipped, so an order with reference of GM-W-ABCDE and customer_reference of PO-1001 becomes GM-W-ABCDE - PO-1001. If the order stores a purchase order in meta.purchase_order, that value is used between the order reference and customer reference, such as GM-W-ABCDE - PO-1001 - Customer Ref.

The zero-value purchase-order line uses meta.purchase_order when present, falling back to customer_reference for stores that only use Lunar's built-in customer reference field.

Customers can be opted into order line notes from the Lunar customer edit page with the Include order line notes on Xero invoices toggle. The underlying xero_include_order_line_notes customer field defaults to false. When it is enabled and an order line has non-blank notes, the package appends the notes underneath the existing Xero invoice line description:

If the order contains charity VAT relief metadata, the package also appends zero-value traceability lines for the charity name, charity number, declaration name, and declared-at timestamp. By default these values are read from order.meta.charity_vat_relief.*, matching ganda-webstore, and the taxable product lines still keep their VAT mapping from Lunar tax data.

You can override those defaults in config/lunarpanel-xero.php:

Customer invoice links

For storefront customer order pages, use the stored xero_online_invoice_url after your app has already checked that the signed-in customer owns the order. Do not expose the internal go.xero.com invoice URL used by the Lunar admin panel; that link is intended for staff with Xero access.

Draft invoices are not customer-visible by default. The helper only returns a URL for AUTHORISED and PAID invoices:

A ganda-webstore style order show view can then render the link conditionally:

For an Inertia and Vue storefront, resolve the customer-safe URL in your Laravel controller or page response and pass only that final value to the component:

Then render it in the Vue page only when the prop is present:

Payments and refunds

Payment sync runs from the configured payment event and from the transaction observer.

Queueing

All sync jobs implement ShouldQueue and default to the xero queue unless you override defaults.sync_queue.

Example worker command:

Logging

Each sync attempt writes to xero_sync_logs, including:

That table is the first place to look when a sync has been skipped or has failed.

Development

Run the test suite:

Run static analysis:

Run formatting:

License

MIT. See LICENSE.md.


All versions of lunar-xero with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
filament/filament Version ^4.0
guzzlehttp/guzzle Version ^7.9
illuminate/database Version ^12.0||^13.0
illuminate/http Version ^12.0||^13.0
illuminate/routing Version ^12.0||^13.0
illuminate/support Version ^12.0||^13.0
lunarphp/lunar Version ^1.5
spatie/laravel-package-tools Version ^1.16
xeroapi/xero-php-oauth2 Version ^16.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package charlielangridge/lunar-xero contains the following files

Loading the files please wait ...