# Merx

> This is the core of the plugin. The class mainly contains helper methods.

- Source: `src/Merx.php` <https://github.com/wagnerwagner/merx/blob/2.0.0-alpha.11/src/Merx.php>

## Pages

- [new Merx()](https://merx2.wagnerwagner.de/reference/classes/merx/__construct.md): Initializes cart and gateways
- [Merx::calculateTax()](https://merx2.wagnerwagner.de/reference/classes/merx/calculate-tax.md): Calculates tax amount from gross price and tax rate
- [$merx->cart()](https://merx2.wagnerwagner.de/reference/classes/merx/cart.md): Returns visitors cart.
- [$merx->createOrder()](https://merx2.wagnerwagner.de/reference/classes/merx/create-order.md): Stores order page to file system
- [Merx::currency()](https://merx2.wagnerwagner.de/reference/classes/merx/currency.md): Currency of the pricing rule
- [Merx::exceptionDetails()](https://merx2.wagnerwagner.de/reference/classes/merx/exception-details.md): Diagnostic details of an exception, for use in `Exception::$details`
- [Merx::filterOrderData()](https://merx2.wagnerwagner.de/reference/classes/merx/filter-order-data.md): Removes the fields Merx sets itself from client submitted order data
- [Merx::formatCurrency()](https://merx2.wagnerwagner.de/reference/classes/merx/format-currency.md): Formats a currency number E.g. 1045.12 → € 1,045.12 Similar to I18n::formatNumber()
- [Merx::formatIBAN()](https://merx2.wagnerwagner.de/reference/classes/merx/format-i-b-a-n.md): Helper method to format IBAN
- [Merx::formatPercent()](https://merx2.wagnerwagner.de/reference/classes/merx/format-percent.md): Formats a float to percent E.g. 0.19 → 19 % Similar to I18n::formatNumber()
- [$merx->initializeOrder()](https://merx2.wagnerwagner.de/reference/classes/merx/initialize-order.md): Creates virtual OrderPage and validates it. Runs the payment gateway’s `initializePayment` function. Saves virtual OrderPage in the customer’s session.
- [Merx::pricingRule()](https://merx2.wagnerwagner.de/reference/classes/merx/pricing-rule.md): Gets a pricing rule by its key, or finds the one that applies to the current context
- [Merx::pricingRules()](https://merx2.wagnerwagner.de/reference/classes/merx/pricing-rules.md): Gets all pricing rules defined by pricing rule option
- [Merx::returnUrl()](https://merx2.wagnerwagner.de/reference/classes/merx/return-url.md): Url to be used to complete the payment
- [Merx::taxRule()](https://merx2.wagnerwagner.de/reference/classes/merx/tax-rule.md): Gets the tax rule by its key
- [Merx::taxRules()](https://merx2.wagnerwagner.de/reference/classes/merx/tax-rules.md): Gets all tax rules defined by tax rule option
