src/Config/ShopCapabilities.php
public function getTokenInfo()
    {
        $result = array();
        $result['invoiceSource'] = array(
            'more-info' => ucfirst($this->t('invoice_source')),
            'class' => '\Siel\Acumulus\Invoice\Source',
            'properties' => array(
                'type (' . $this->t(Source::Order) . ' ' . $this->t('or') . ' ' . $this->t(Source::CreditNote) . ')',
                'id (' . $this->t('internal_id') . ')',
                'reference (' . $this->t('external_id') . ')',
                'date',
                'status (' . $this->t('internal_not_label') . ')',
                'paymentMethod (' . $this->t('internal_not_label') . ')',
                'paymentStatus (1: ' . $this->t('payment_status_1') . '; 2: ' . $this->t('payment_status_2') . ')',
                'paymentDate',
                'countryCode',
                'currency',
                'invoiceReference (' . $this->t('external_id') . ')',
                'invoiceDate',
            ),
            'properties-more' => false,
        );
        if (array_key_exists(Source::CreditNote, $this->getSupportedInvoiceSourceTypes())) {
            $result['originalInvoiceSource'] = array(
                'more-info' => ucfirst($this->t('original_invoice_source')),
                'properties' => array($this->t('see_invoice_source_above')),
                'properties-more' => false,
            );
        }
        $result['source'] = array_merge(array('more-info' => ucfirst($this->t('order_or_refund'))), $this->getTokenInfoSource());
        if (array_key_exists(Source::CreditNote, $this->getSupportedInvoiceSourceTypes())) {
            $result['refund'] = array_merge(array('more-info' => ucfirst($this->t('refund_only'))), $this->getTokenInfoRefund());
            $result['order'] = array_merge(array('more-info' => ucfirst($this->t('original_order_for_refund'))), $this->getTokenInfoOrder());
            $result['refundedInvoiceSource'] = array(
                'more-info' => ucfirst($this->t('original_invoice_source') . ' ' . ucfirst($this->t('refund_only'))),
                'properties' => array($this->t('see_invoice_source_above')),
                'properties-more' => false,
            );
            $result['refundedOrder'] = array(
                'more-info' => ucfirst($this->t('original_order_for_refund') . ' ' . ucfirst($this->t('refund_only'))),
                'properties' => array($this->t('see_order_above')),
                'properties-more' => false,
            );
        }
        $result += $this->getTokenInfoShopProperties();

        return $result;
    }
public function getTokenInfo()
    {
        $result = array();
        $result['invoiceSource'] = array(
            'more-info' => ucfirst($this->t('invoice_source')),
            'class' => '\Siel\Acumulus\Invoice\Source',
            'properties' => array(
                'type (' . $this->t(Source::Order) . ' ' . $this->t('or') . ' ' . $this->t(Source::CreditNote) . ')',
                'id (' . $this->t('internal_id') . ')',
                'reference (' . $this->t('external_id') . ')',
                'date',
                'status (' . $this->t('internal_not_label') . ')',
                'paymentMethod (' . $this->t('internal_not_label') . ')',
                'paymentStatus (1: ' . $this->t('payment_status_1') . '; 2: ' . $this->t('payment_status_2') . ')',
                'paymentDate',
                'countryCode',
                'currency',
                'invoiceReference (' . $this->t('external_id') . ')',
                'invoiceDate',
            ),
            'properties-more' => false,
        );
        if (array_key_exists(Source::CreditNote, $this->getSupportedInvoiceSourceTypes())) {
            $result['originalInvoiceSource'] = array(
                'more-info' => ucfirst($this->t('original_invoice_source')),
                'properties' => array($this->t('see_invoice_source_above')),
                'properties-more' => false,
            );
        }
        $result['source'] = array_merge(array('more-info' => ucfirst($this->t('order_or_refund'))), $this->getTokenInfoSource());
        if (array_key_exists(Source::CreditNote, $this->getSupportedInvoiceSourceTypes())) {
            $result['refund'] = array_merge(array('more-info' => ucfirst($this->t('refund_only'))), $this->getTokenInfoRefund());
            $result['order'] = array_merge(array('more-info' => ucfirst($this->t('original_order_for_refund'))), $this->getTokenInfoOrder());
            $result['refundedInvoiceSource'] = array(
                'more-info' => ucfirst($this->t('original_invoice_source') . ' ' . ucfirst($this->t('refund_only'))),
                'properties' => array($this->t('see_invoice_source_above')),
                'properties-more' => false,
            );
            $result['refundedOrder'] = array(
                'more-info' => ucfirst($this->t('original_order_for_refund') . ' ' . ucfirst($this->t('refund_only'))),
                'properties' => array($this->t('see_order_above')),
                'properties-more' => false,
            );
        }
        $result += $this->getTokenInfoShopProperties();

        return $result;
    }
public function getTokenInfo ( ) { $ result = array ( ) ; $ result [ 'invoiceSource' ] = array ( 'more-info' => ucfirst ( $ this -> t ( 'invoice_source' ) ) , 'class' => '\Siel\Acumulus\Invoice\Source' , 'properties' => array ( 'type (' . $ this -> t ( Source :: Order ) . ' ' . $ this -> t ( 'or' ) . ' ' . $ this -> t ( Source :: CreditNote ) . ')' , 'id (' . $ this -> t ( 'internal_id' ) . ')' , 'reference (' . $ this -> t ( 'external_id' ) . ')' , 'date' , 'status (' . $ this -> t ( 'internal_not_label' ) . ')' , 'paymentMethod (' . $ this -> t ( 'internal_not_label' ) . ')' , 'paymentStatus (1: ' . $ this -> t ( 'payment_status_1' ) . '; 2: ' . $ this -> t ( 'payment_status_2' ) . ')' , 'paymentDate' , 'countryCode' , 'currency' , 'invoiceReference (' . $ this -> t ( 'external_id' ) . ')' , 'invoiceDate' , ) , 'properties-more' => false , ) ; if ( array_key_exists ( Source :: CreditNote , $ this -> getSupportedInvoiceSourceTypes ( ) ) ) { $ result [ 'originalInvoiceSource' ] = array ( 'more-info' => ucfirst ( $ this -> t ( 'original_invoice_source' ) ) , 'properties' => array ( $ this -> t ( 'see_invoice_source_above' ) ) , 'properties-more' => false , ) ; } $ result [ 'source' ] = array_merge ( array ( 'more-info' => ucfirst ( $ this -> t ( 'order_or_refund' ) ) ) , $ this -> getTokenInfoSource ( ) ) ; if ( array_key_exists ( Source :: CreditNote , $ this -> getSupportedInvoiceSourceTypes ( ) ) ) { $ result [ 'refund' ] = array_merge ( array ( 'more-info' => ucfirst ( $ this -> t ( 'refund_only' ) ) ) , $ this -> getTokenInfoRefund ( ) ) ; $ result [ 'order' ] = array_merge ( array ( 'more-info' => ucfirst ( $ this -> t ( 'original_order_for_refund' ) ) ) , $ this -> getTokenInfoOrder ( ) ) ; $ result [ 'refundedInvoiceSource' ] = array ( 'more-info' => ucfirst ( $ this -> t ( 'original_invoice_source' ) . ' ' . ucfirst ( $ this -> t ( 'refund_only' ) ) ) , 'properties' => array ( $ this -> t ( 'see_invoice_source_above' ) ) , 'properties-more' => false , ) ; $ result [ 'refundedOrder' ] = array ( 'more-info' => ucfirst ( $ this -> t ( 'original_order_for_refund' ) . ' ' . ucfirst ( $ this -> t ( 'refund_only' ) ) ) , 'properties' => array ( $ this -> t ( 'see_order_above' ) ) , 'properties-more' => false , ) ; } $ result += $ this -> getTokenInfoShopProperties ( ) ; return $ result ; }
Returns a list with the shop specific token info.

Many fields of an Acumulus invoice can be filled with user configured and
dynamically looked up values of properties or method return values from
webshop objects that are made available when creating the invoice. The
advanced settings form gives the user an overview of what objects,
properties and methods are available. This overview is based on the info
that this method returns.

This base implementation returns the info that is available in all
webshops. Overriding methods should add the webshop specific info, which
must at least include the "property source" 'source', being the webshop's
order or refund object or array.

This method returns an array of token infos keyed by the "property
source" name. A token info is an array that can have the following keys:
* more-info (string, optional): free text to tell the use where to look
for more info.
* class (string|string[], optional): class or array of class names where
the properties come from.
* file (string|string[], optional): file or array of file names where
the properties come from.
* table (string|string[], optional): database table or array of table names
where the properties come from.
* additional-info (string, optional): free text to give the user
additional info.
* properties (string[], required): array of property and method names
that can be used as token.
* properties-more: bool indicating if not all properties were listed and
a message indicating where to look for more properties should be shown.
It is expected that 1 of the keys class, file, or table is defined. If
class is defined, file may also be defined.

@return array[]
An array of token infos keyed by the "property source" name.
Returns a list with the shop specific token info .