# Payment gateways

<figure><img src="/files/zMygpFMuNPtdDMVx9VxN" alt=""><figcaption></figcaption></figure>

{% hint style="info" icon="lightbulb" %}
Three gateway types — PSD2-ready, external, and manual — can be connected to markets, giving you full control over payment processing per business context.
{% endhint %}

## How payment gateways work

[Payment gateways](/core-api-reference/payment_gateways.md) allow you to process payments through Commerce Layer's API safely. You can connect different gateways to different markets via the available payment methods. Commerce Layer currently supports PSD2-ready gateways, custom external gateways, and manual gateways.

{% hint style="success" %}
Commerce Layer payments are **idempotent**. Order and payment statuses are guaranteed to remain consistent across multiple updates throughout the whole payment process.
{% endhint %}

Taxes are automatically calculated at checkout based on the price list associated with the market.

### PSD2-ready gateways

[PSD2-ready gateways](/how-tos/placing-orders/payments.md) are compliant with the PSD2 European regulation, which applies to all credit card payments. They allow you to implement a payment flow that supports SCA (Strong Customer Authentication) and 3DS2 (3D Secure 2) using the gateway's official SDK. Commerce Layer is currently integrated with some of the most popular payment gateways — **Adyen**, **Axerve**, **Braintree**, **Checkout.com**, **Klarna**, **PayPal**, **Satispay**, and **Stripe** — all PSD2-compliant.

### External payment gateways

[External payment gateways](/core/external-resources/external-payment-gateways.md) allow you to set up and configure payment gateways not integrated with Commerce Layer by default.

You can create an external payment gateway and define custom endpoints responding to the following actions:

* **Authorization** — to authorize a payment source.
* **Capture** — to capture an authorization.
* **Void** — to cancel a payment authorization.
* **Refund** — to refund a captured payment, either totally or partially.
* **Customer token** — to create a customer payment token.

The external endpoint is responsible for the integration with the payment gateway. The payment source associated with the order must be an external payment.

### Manual payment gateways

[Manual payment gateways](/core-api-reference/manual_gateways.md) are useful for processing wire transfers, cash payments, and other kinds of manual payments. This gateway type is associated with orders as their payment source type. Payments with manual gateways are always authorized.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.commercelayer.io/data-model/payments-and-tax/payment-gateways.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
