Methods

PaymentMethod()

PaymentMethod(string  $name): \FAA\Interfaces\PaymentMethod

Get payment method Load a method instance

Parameters

string $name

The method name

Returns

\FAA\Interfaces\PaymentMethod

The payment method or null

PaymentMethodList()

PaymentMethodList(): array<mixed,\FAA\Interfaces\PaymentMethod>

Get method list Get the list of registered payment method handlers

Returns

array<mixed,\FAA\Interfaces\PaymentMethod> —

A list of registered handlers

DeliveryMethod()

DeliveryMethod(string  $name,string  $version = null): \FAA\Interfaces\DeliveryMethod

Get delivery method Load a method instance and fetch a legacy configuration on top on demand

Parameters

string $name

The method name

string $version

A git hash with the used delivery method version

Returns

\FAA\Interfaces\DeliveryMethod —

The delivery method or null

DeliveryMethodList()

DeliveryMethodList(): array<mixed,\FAA\Interfaces\DeliveryMethod>

Get method list Get the list of registered delivery method handlers

Returns

array<mixed,\FAA\Interfaces\DeliveryMethod> —

A list of registered handlers

WkHtmlToPdfExists()

WkHtmlToPdfExists(): boolean

Check if wkhtml2pdf is existing Test if the executable is present in /usr/local/bin

Returns

boolean —

True when defined and accessible

HtmlToPdf()

HtmlToPdf(string  $target_path,string  $body,string  $name,boolean  $crypt = false): \FAA\Obj\Result

Convert html to pdf

Convert the given html body to pdf file (uses wkhtmltopdf when installed, otherwise dompdf) In case of a encryption needed a zip archive will be wrapped around. Next to the output target the password will be generated into a file

Parameters

string $target_path

Output storage path

string $body

The html to render to pdf

string $name

Name of the output file

boolean $crypt

Save as encrypted version

Returns

\FAA\Obj\Result —

A default system result object

MergePdfFiles()

MergePdfFiles(array  $files,string  $name): \FAA\Obj\Result

Merge some pdf files

Takes the given list, merges them together and writes it to the assets folder

Parameters

array $files

The files to merge

string $name

The target name

Returns

\FAA\Obj\Result —

The merge result

CheckoutConfig()

CheckoutConfig(): mixed|null

Get the checkout configuration

Returns

mixed|null

CreateEncrypedArchive()

CreateEncrypedArchive(string  $pdf_path): \FAA\Obj\Result

Create an encrypted zip archive

Takes the path and creates an zip archive

Parameters

string $pdf_path

The absolute path to the source file

Returns

\FAA\Obj\Result —

The zip result

BasketToPdf()

BasketToPdf(integer  $id,string  $body): \FAA\Obj\Result

Create pfd file from basket

Parameters

integer $id

The basket id

string $body

The html body

Returns

\FAA\Obj\Result —

The result object

BasketToPdfEncryped()

BasketToPdfEncryped(integer  $id,string  $body): \FAA\Obj\Result

Create encrypted pfd file from basket

Parameters

integer $id

The basket id

string $body

The html body

Returns

\FAA\Obj\Result —

The result object

TranslateSalutation()

TranslateSalutation(string  $value,string  $language): null|string

Translate salutation Translate the given salutation key to the target language

Parameters

string $value

The salutation key

string $language

The target language

Returns

null|string —

The translated salutation or null

GetMailSetup()

GetMailSetup(string  $name,string  $language): \FAA\Obj\Result

Get a setup object Get a email setup instance by given name

Parameters

string $name

The name of the requested preset

string $language

Base language

Returns

\FAA\Obj\Result —

A system result object

GetRawMailSetup()

GetRawMailSetup(string  $name,string  $language): \FAA\Obj\Generic\EmailSetup

Get a setup object Get a email setup instance by given name

Parameters

string $name

The name of the requested preset

string $language

Base language

Returns

\FAA\Obj\Generic\EmailSetup —

The email setup or null

ResolveCountryCode()

ResolveCountryCode(integer  $id): string|null

Get country iso code by id

Parameters

integer $id

Returns

string|null

ExtractCountryCode()

ExtractCountryCode(  $address): string|null

Extract some country code from address object data

Parameters

$address

Returns

string|null

FetchCountries()

FetchCountries(string  $language): \FAA\Obj\Result

Get list of countries

Parameters

string $language

Returns

\FAA\Obj\Result —

The search result

FormatPrice()

FormatPrice(  $price,  $count = 1,  $tax = false,  $dec = ',',  $tho = '.')

Parameters

$price
$count
$tax
$dec
$tho

CheckAddress()

CheckAddress(array  $data,boolean  $no_mail = false): \FAA\Obj\Result

Check address data Validate the given data address components in checkout process

Parameters

array $data

The given request payload

boolean $no_mail

When true, do not check the email address

Returns

\FAA\Obj\Result —

A system result object

GetArticleStock()

GetArticleStock(  $id,  $type)

Parameters

$id
$type

UnlinkCurrent()

UnlinkCurrent()

CurrentId()

CurrentId(  $id = null)

Parameters

$id

OpenArticle()

OpenArticle(  $id,string  $type = 'article'): \FAA\Obj\Generic\Article|null

Parameters

$id
string $type

Returns

\FAA\Obj\Generic\Article|null

Open()

Open(  $id): \FAA\Obj\Generic\Basket|null

Open a basket by id

Parameters

$id

Returns

\FAA\Obj\Generic\Basket|null

GetCurrent()

GetCurrent(boolean  $create_on_demand = false): \FAA\Obj\Generic\Basket|null

Parameters

boolean $create_on_demand

Returns

\FAA\Obj\Generic\Basket|null

ChangeCurrentPaymentMethod()

ChangeCurrentPaymentMethod(string  $method): \FAA\Obj\Result

Change payment method

Changes the payment method of the current basket object The given id must match an active registered payment method and the basket must be registered in the session.

Parameters

string $method

The new method name

Returns

\FAA\Obj\Result —

A system result object

ChangeCurrentDeliveryMethod()

ChangeCurrentDeliveryMethod(string  $method): \FAA\Obj\Result

Change delivery method

Changes the delivery method of the current basket object The given id must match an active registered delivery method and the basket must be registered in the session.

Parameters

string $method

The new method name

Returns

\FAA\Obj\Result —

A system result object

ChangeArticleAmount()

ChangeArticleAmount(integer  $index,integer  $amount): \FAA\Obj\Result

Change article amount

This method changes the relation amount in the assigned articles list to the given number. Method will fail when the index is out of boundaries

Parameters

integer $index

The index of the article inside the basket

integer $amount

The new amount, can be either positive or negative

Returns

\FAA\Obj\Result —

A system result object

RemoveItemFromCurrent()

RemoveItemFromCurrent(integer  $index): \FAA\Obj\Result

Delete article from basket

Removes the element by index from array of articles and calls the object saver afterwards. Method will fail when the index is out of boundaries

Parameters

integer $index

The index of the article inside the basket

Returns

\FAA\Obj\Result —

A system result object

UpdateCurrentAddress()

UpdateCurrentAddress(string  $type,array  $address): \FAA\Obj\Result

Update a basket address Update the bill or delivery address of the current basket

Parameters

string $type

The address type, either bill or delivery

array $address

New address values, defined in address content type

Returns

\FAA\Obj\Result —

A system result object

AddCommentToCurrent()

AddCommentToCurrent(string  $content): \FAA\Obj\Result

Add or, replace comment Adds a comment to the basket object and calls the object saver

Parameters

string $content

A comment string

Returns

\FAA\Obj\Result —

A system result object

AddArticleToCurrent()

AddArticleToCurrent(string|integer  $content_id,string  $type,integer  $amount = 1,boolean  $replace = false): \FAA\Obj\Result

Add article

Adds an article by id and type to the current basket This method can either add at the end or override the article by id and type

Parameters

string|integer $content_id

The related article object content id

string $type

The object type name

integer $amount

Amount of entries to add, defaults to 1, can be either positive or negative

boolean $replace

Replace instead of add, defaults to false

Returns

\FAA\Obj\Result —

A system result object