> For the complete documentation index, see [llms.txt](https://wallee.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wallee.gitbook.io/documentation/payments/integrations/plugins/built-by-wallee/magento-2/integration.md).

# Integration

### Prerequisites

If you don’t already have one, create a {inject-platform-name} account.

### Installation

1. Update the `composer.json` file in the root directory of your Magento store and wait for Composer to finish updating the dependencies.

   ```
   composer require wallee/magento-2
   ```
2. Enable the extension and clear the static view files.

   ```
   bin/magento module:enable Wallee_Payment --clear-static-content
   ```
3. Register the extension and initiate the database migrations.

   ```
   bin/magento setup:upgrade
   ```
4. Recompile the Magento project.

   ```
   bin/magento setup:di:compile
   ```
5. Clear the Magento store’s cache.

   ```
   bin/magento cache:flush
   ```

{% hint style="info" %}
If you install via FTP upload from our GitHub repositories, use the [magento-2](https://github.com/wallee-payment/magento-2) repository for Magento 2.4 and above.
{% endhint %}

### Configuration

1. Go to **Stores > Configuration > Sales > {inject-platform-name} Payment** in Magento.
2. Enter your User ID, Authentication Key, and Space ID from {inject-platform-name}.
3. Save the configuration. Payment methods will sync automatically.

{% hint style="warning" %}
Most payment method settings are managed in {inject-platform-name}.
{% endhint %}

#### Line items

You can control line item calculation under **Stores > Configuration > {inject-platform-name} Payment > Line Items**.

### Payment method configuration

* Payment method settings are synchronized from {inject-platform-name}.
* To change the payment method description, title or logo, update them in {inject-platform-name} — the change syncs to Magento automatically. See [Payment Methods](/documentation/payments/integrations/payment-methods.md).

#### Order state mapping

| State in {inject-platform-name}      | Magento order state |
| ------------------------------------ | ------------------- |
| Pending in {inject-platform-name}    | Pending Payment     |
| Authorized in {inject-platform-name} | On Hold Delivery    |
| Fulfill in {inject-platform-name}    | Processing          |

#### Invoice state mapping

| State in {inject-platform-name}      | Magento invoice state |
| ------------------------------------ | --------------------- |
| Authorized in {inject-platform-name} | Invoice Pending       |
| Paid in {inject-platform-name}       | Invoice Paid          |

See [Transaction States](/documentation/payments/overview/transaction-states.md) for what each state means.

### Transaction management

You can capture, void and refund transactions in Magento.

{% hint style="warning" %}
Captures, voids and refunds done in {inject-platform-name} are synchronized to Magento only with limitations. Perform them **in Magento** — otherwise your Magento orders and invoices can end up out of step with the actual payment. See [Refunds](/documentation/payments/overview/transaction-states/refunds.md) for how refunds work on the platform side.
{% endhint %}

#### On-hold orders

Orders remain **On Hold** if:

* the transaction is not yet completed, or
* a manual task exists in {inject-platform-name}.

Manual tasks appear both in {inject-platform-name} and in the Magento backend — see [Manual Tasks](/documentation/readme/manual-tasks.md).

### Related topics

* [Overview](/documentation/payments/integrations/plugins/overview.md) — how a plugin connects to your space.
* [Connector Configuration](/documentation/payments/overview/processors-payment-methods-and-connectors/connectors.md) — where capture behaviour is configured.
