# PrestaShop

Install the Kustom Checkout module for PrestaShop, map Kustom order states onto PrestaShop statuses and run captures and refunds from the back office — including what existing Klarna Checkout module users must do to move across.

Kustom Checkout for PrestaShop is an embedded checkout module that keeps the customer in your
store rather than redirecting them out. It's built and supported by Invertus, and published on
the PrestaShop Addons marketplace as *Kustom Checkout (official)*. This page covers installing
it, configuring credentials and environment, mapping order statuses and running captures and
refunds from the back office.

## Before you start

- PrestaShop 1.7.2.x up to 9.
- PHP 7.1.x or newer. The upstream module notes contradict themselves here — they cap PHP at
  "latest compatible with PrestaShop 8" while claiming support up to PrestaShop 9. Use the PHP
  version your PrestaShop release certifies and confirm with Invertus if you're on 9.
- Prices configured to **two decimal places**. The module requires it, and one decimal produces
  totals Kustom rejects.
- A Kustom merchant account with API credentials — see
  [Activate Kustom Checkout on your platform](/partners/activate-kustom-checkout/). Generate
  them for the environment you're configuring: the
  [playground Portal](https://portal.playground.kustom.co/) for sandbox, the
  [live Portal](https://portal.kustom.co/) for production.

**If your store runs the old Klarna Checkout module**, that module is no longer maintained and
now redirects to the Kustom Checkout product page. Install Kustom Checkout, verify your
credentials and settings, deactivate the previous Klarna Checkout module and test in a
development environment before deploying to production. Don't run both.

## Step by step

### 1. Install the module

Either route works.

**From the Module Manager.** Log in to the back office, go to **Modules → Modules Manager**,
click **Upload a Module** and drop in `kustomcheckoutofficial.zip`. You can also search for
"Kustom Checkout" in the Module Manager and install it directly from the marketplace listing.

**Over FTP.** Download and extract `kustomcheckoutofficial`, upload the folder to `/modules`,
then in the back office go to **Modules → Modules Catalog**, search for **Kustom** and click
**Install**.

The marketplace listing is
[Kustom Checkout on PrestaShop Addons](https://addons.prestashop.com/en/payment-card-wallet/96437-kustom-checkout-official.html).

To reach the settings later: **Modules → Module Manager**, search **Kustom**, click **Configure**.

### 2. Select the environment and enter credentials

The module has two checkboxes for **Sandbox** and **Production**. Production is selected by
default, so switch to Sandbox before you test.

Enter the **API Username** and **Password** generated in the Portal for the environment you
selected. Sandbox credentials in production mode won't work, and the failure is quiet.

Enable **Debug Mode** while you're testing to get full logs. Turn it off afterwards.

### 3. Map Kustom order states onto PrestaShop statuses

The module ships these defaults. Change them to match how your fulfillment team reads the order
list.

| Kustom state | Default PrestaShop status |
| --- | --- |
| New orders | Payment accepted |
| Captured orders | Shipped |
| Cancelled orders | Canceled |
| Refunded orders | Refunded |
| Partially captured orders | Partially captured |

### 4. Decide how captures happen

**Automatically.** Enable **Capture upon fulfillment**, choose the order status that should
trigger it — typically Shipped — and save. Moving an order into that status captures the payment.

**Manually.** Go to **Orders → Orders**, open a Kustom order and click **Capture Payment** or
**Cancel Order**.

### 5. Optional settings

- **Allow automatic order status change.** Enabled, a Kustom status change updates the
  PrestaShop order. Disabled, only the initial status is ever applied.
- **Styling.** The checkout's appearance can be customized if your Kustom account supports it.

### 6. Go live

Switch the environment to Production, replace the credentials with the ones from the live Portal,
disable debug mode and run one real purchase.

## Check that it works

In Sandbox:

1. Add a product to the cart and go through checkout. The Kustom checkout should render embedded,
   not as a redirect.
2. Complete a payment with [test data](/basics/test-data/).
3. Confirm the order appears under **Orders → Orders** with the status you mapped to "New orders",
   and that the total matches.
4. Capture it — automatically by moving it into the trigger status, or manually from the order —
   and confirm the status moves to your "Captured orders" mapping.
5. Refund it from the **Manage Kustom Order** section and confirm the status follows.
6. Open the module's logs and confirm each call shows a request, a response, its context and a
   correlation ID. Keep the correlation ID: it's what support will ask for.

Then repeat once in production with a low-priced real purchase.

## Variations

### Partial captures and partial refunds

Both are supported from the back office, unlike on several other platforms.

- **Partial capture** — click **Capture Order** and select the individual items, or an amount.
- **Partial refund** — the same flow from the **Manage Kustom Order** section. The refund button
  only appears after a capture, because there's nothing to refund before then.

## Troubleshooting

**The checkout doesn't render.** Check the environment checkbox against the credentials you
entered — the default is Production, which is the wrong pairing for a sandbox key.

**Totals don't match.** Set price display to two decimal places.

**A status never changes.** Check **Allow automatic order status change**. With it disabled, only
the initial status is ever applied and everything afterwards has to be done by hand.

For module and technical questions, contact Invertus at `support@invertus.eu`. For account,
payout or specific-purchase questions, contact `support@kustom.co`.

## Related

- [Capture an order](/order-management/capture/) — what capture means on Kustom's side
- [Refunds](/order-management/refunds/) — including the production test purchase you just made
- [Open source platform responsibility](/partners/open-source-responsibility/) — what you own running Kustom on PrestaShop
- [Activate Kustom Checkout on your platform](/partners/activate-kustom-checkout/) — getting the merchant account and credentials
- [Authentication and environments](/api/authentication/) — sandbox versus production credentials
- [Test data](/basics/test-data/) — identities and cards that pass in sandbox
- [Order management](/order-management/) — the states the status mapping is mapping
- [Platform catalogue](/partners/) — the other platforms with plugins
