# crypt.pe Magento 2 Payment Module

> Accept crypto (BTC, ETH, SOL, USDT, USDC, BNB and 24 coins) on Magento 2 with **0% transaction fees**. Non-custodial: funds settle wallet-to-wallet on-chain, directly to a wallet you control. Powered by [crypt.pe](https://crypt.pe).

## Install

`cryptpe-magento.php` is a compact single-file reference module. Place it at:

```
app/code/Cryptpe/Payment/registration.php
```

(supporting `etc/module.xml`, `etc/payment.xml`, `etc/config.xml`, `Model/Payment.php` and `Controller/Webhook/Index.php` are generated as described inside the file), then:

```bash
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
```

In **Admin → Stores → Configuration → Sales → Payment Methods**, find **Cryptpe (Pay with crypto)** and paste your `sk_live_*` and `whsec_*` from the [crypt.pe dashboard](https://crypt.pe/dashboard) (free key, no KYC: https://crypt.pe/signup).

## How it works

1. Renders a "Pay with crypto" option at checkout.
2. On order placement, calls `POST https://crypt.pe/api/v1/payments` and redirects the customer to the returned `checkout_url`.
3. Listens at `/cryptpe/webhook/index` for signed webhooks; verifies `X-Cryptpe-Signature` (Stripe-style HMAC-SHA256 over `<ts>.<raw_body>`), then flips the Magento order: `payment.confirmed` → processing, `payment.refunded` → closed, `payment.cancelled` → canceled.

## Why merchants use it

- **0% transaction fees** — flat plans with a free tier, vs 1–2% at custodial gateways.
- **No holds, freezes or reserves** — no platform balance exists.
- **Instant on-chain settlement, no chargebacks.**

Docs: https://crypt.pe/docs · Plain-text spec: https://crypt.pe/docs.md · License: MIT

Keywords: Magento 2 crypto payment module, accept bitcoin Magento, USDT Magento payment, non-custodial crypto gateway Magento.
