PHPackages                             magenettic/module-btc-payment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. magenettic/module-btc-payment

ActiveMagento2-module[Payment Processing](/categories/payments)

magenettic/module-btc-payment
=============================

Bitcoin payment method for Magento 2 via BTCPay Server

00PHP

Since Jun 17Pushed 2d agoCompare

[ Source](https://github.com/magenettic/module-btc-payment)[ Packagist](https://packagist.org/packages/magenettic/module-btc-payment)[ RSS](/packages/magenettic-module-btc-payment/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Magenettic\_BtcPayment
======================

[](#magenettic_btcpayment)

**Bitcoin Payment Method for Magento 2 via BTCPay Server**

Overview
--------

[](#overview)

This module integrates Magento 2 with [BTCPay Server](https://btcpayserver.org/), enabling customers to pay with Bitcoin (BTC) at checkout. It uses the BTCPay Server Greenfield API to create invoices, monitor payments, and handle webhook events.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.2
- Magento 2.4.x (Community Edition)
- [BTCPay Server](https://btcpayserver.org/) instance (self-hosted or third-party)

Compatibility
-------------

[](#compatibility)

Magento VersionCompatible2.4.4 - 2.4.7YesInstallation
------------

[](#installation)

```
composer require magenettic/module-btc-payment
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

Configuration
-------------

[](#configuration)

1. Navigate to **Stores → Configuration → Sales → Payment Methods**.
2. Locate **Bitcoin Payment (Magenettic)**.
3. Configure the following settings:

SettingDescription**Enabled**Enable/disable the payment method**Title**Display name at checkout**BTCPay Server URL**Base URL of your BTCPay Server**API Key**Greenfield API key with invoice creation permissions**Store ID**BTCPay Store ID**Webhook Secret**HMAC-SHA256 secret for webhook validation**Sandbox Mode**Use BTCPay Testnet for development**Payment Timeout**Invoice expiration time in seconds (default: 900)**New Order Status**Initial order status after checkout4. Configure the **Webhook URL** (displayed in settings) in your BTCPay Server: **Server Settings → Webhooks**.

Architecture
------------

[](#architecture)

```
Magenettic_BtcPayment/
├── Block/                           # Layout blocks (form, info, config)
├── Controller/Webhook/              # Webhook endpoint (HTTP POST)
├── Cron/                            # Cron job for pending payments
├── Gateway/
│   ├── Config/                      # Payment gateway configuration
│   ├── Http/                        # HTTP client and transfer factory
│   ├── Request/                     # API request builders
│   ├── Response/                    # API response handlers
│   └── Validator/                   # Request/response validators
├── Helper/                          # Utility helpers
├── Model/
│   ├── BtcTransaction.php           # Transaction model
│   ├── Config/                      # Scope config and source models
│   ├── ResourceModel/               # Database resource models
│   └── Ui/                          # Checkout config provider
├── Observer/                        # Event observers
├── Setup/Patch/Data/                # Data patches (order statuses)
├── etc/                             # Module configuration (di, events, etc.)
└── view/                            # Frontend and admin templates

```

Payment Flow
------------

[](#payment-flow)

1. Customer selects **Bitcoin Payment** at checkout and places the order.
2. Module creates an invoice on BTCPay Server via Greenfield API.
3. Order status is set to `btc_pending` (Awaiting Bitcoin Payment).
4. Customer is redirected to the BTCPay checkout page to complete payment.
5. BTCPay Server sends webhook events as payment status changes.
6. Module updates order status accordingly:
    - `InvoicePaid` → `btc_confirmed`
    - `InvoiceSettled` → `processing`
    - `InvoiceExpired` → `btc_expired` (order cancelled)

Order Statuses
--------------

[](#order-statuses)

Status CodeLabelMagento State`btc_pending`Awaiting Bitcoin Payment`new``btc_confirmed`Bitcoin Payment Confirmed`processing``btc_processing`Bitcoin Processing`processing``btc_expired`Bitcoin Payment Expired`canceled``btc_refunded`Bitcoin Refunded`closed`Cron Jobs
---------

[](#cron-jobs)

- **`CheckPendingPayments`** — Automatically cancels expired orders (runs periodically).

Extensibility
-------------

[](#extensibility)

- **Event**: `btcpayment_webhook_received` — dispatched when a webhook is received
- **Plugins/interceptors**: all public methods in Gateway classes are extensible
- **Database schema**: `magenettic_btcpayment_transaction` table stores all invoice data

Security
--------

[](#security)

- API keys and webhook secrets are stored encrypted (`backend_model="Magento\Config\Model\Config\Backend\Encrypted`).
- CSP whitelist configured for BTCPay Server hosts.
- Webhook endpoint bypasses CSRF protection (`CsrfAwareActionInterface`).

Uninstallation
--------------

[](#uninstallation)

```
bin/magento module:disable Magenettic_BtcPayment
composer remove magenettic/module-btc-payment
bin/magento setup:upgrade
bin/magento setup:di:compile
```

Support
-------

[](#support)

Report issues at:

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

Copyright
---------

[](#copyright)

Copyright (c) 2026 Magenettic

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance65

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f83d5ebe7e1574accc3ffacf62101d3a8026a34b8324f9abf1b20957e9ffe546?d=identicon)[elieldepaula](/maintainers/elieldepaula)

---

Top Contributors

[![elieldepaula](https://avatars.githubusercontent.com/u/1477320?v=4)](https://github.com/elieldepaula "elieldepaula (1 commits)")

### Embed Badge

![Health badge](/badges/magenettic-module-btc-payment/health.svg)

```
[![Health](https://phpackages.com/badges/magenettic-module-btc-payment/health.svg)](https://phpackages.com/packages/magenettic-module-btc-payment)
```

###  Alternatives

[omnipay/coinbase

Coinbase driver for the Omnipay payment processing library

18570.2k1](/packages/omnipay-coinbase)[oxid-esales/amazon-pay-module

AmazonPay module for OXID

1824.3k](/packages/oxid-esales-amazon-pay-module)[yenepay/php-sdk

YenePay SDK for PHP

112.7k](/packages/yenepay-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
