Payments fiscalization

Contents...

The Webasyst framework contains a special system allowing various installed apps and plugins to ensure centralized control over the transmission of payment-related data to a state tax authority as a fiscalization measure. The use of this system is advisable to avoid sending the data related to the same fact of payment multiple times; e.g., by several different plugins.

Read below about how to use it in your apps and plugins.

Apps

An app allowing the receipt of payments must contain a PHP class, extending system class waAppPayment, with a name like [app_id]Payment. In that class, method declareFiscalization() must be overridden to implement the storage of information related to sending payments-related data to a tax authority. The actual data storage method and format are up to the app developer.

public function declareFiscalization ($order_id, waPayment $plugin, array $custom_data = null)

Parameters

  • $order_id

    ID of an order, or invoice, payment for which has been received from a client.

  • $plugin

    Instance of the main class of the payment plugin whose payment method was used to receive the payment.

  • $custom_data

    Additional values, optionally provided by a payment plugin which has performed the sending of the fiscalization data.

Plugins

Payments-related data can be sent to a tax authority by different types of plugins:

  • payment plugins,
  • app plugins.

Fiscalization by payment plugins

To transmit a system-wide notification of a completed fiscalization, a payment plugin must call method $this->getAdapter()->declareFiscalization(), which will eventually call method declareFiscalization() overridden in an app’s PHP class as described above.

Fiscalization by app plugins

To transmit a system-wide notification of a completed fiscalization, an app plugin must use the tools provided by its app. E.g., in a plugin for the Shop-Script app (as of version 11) you need to use the methods of the shopFiscalization class.