# @alepha/commerce - Checkout

## Installation

```bash
npm install @alepha/commerce
```

## Overview

Turns a cart into a paid order.

Depends on the cart module and on `alepha/api/payments`, which owns the
intent lifecycle and the PSP adapters. Registers hosted-redirect payment by
default - the one handoff every PSP supports - leaving an embedded card field
to a substitution:

```ts
alepha.with({
  provide: CheckoutPaymentProvider,
  use: EmbeddedCheckoutPayment,
});
```

## API Reference

### Providers

- [`AddressRulesProvider`](https://latest.alepha.dev/docs/reference-providers-addressrulesprovider.md) - Per-country address rules for the EU.
- [`CheckoutPaymentProvider`](https://latest.alepha.dev/docs/reference-providers-checkoutpaymentprovider.md) - Bridges a checkout session to a payment rail.
- [`EmbeddedCheckoutPayment`](https://latest.alepha.dev/docs/reference-providers-embeddedcheckoutpayment.md) - Takes payment in a card field hosted on our own page.
- [`OrderDocumentsProvider`](https://latest.alepha.dev/docs/reference-providers-orderdocumentsprovider.md) - What documents exist for an order - invoice numbers, in practice.
- [`RedirectCheckoutPayment`](https://latest.alepha.dev/docs/reference-providers-redirectcheckoutpayment.md) - Takes payment by sending the browser to the PSP's hosted page.
- [`ShippingQuoteProvider`](https://latest.alepha.dev/docs/reference-providers-shippingquoteprovider.md) - Where the checkout asks what delivery costs.
- [`VatNumberChecker`](https://latest.alepha.dev/docs/reference-providers-vatnumberchecker.md) - Asks whether a VAT number exists. Abstract so a shop can use its own source
