articles / Marchand — POS

MoneroPay et AcceptXMR : intégrer XMR dans ton propre logiciel

· MoneroPay · AcceptXMR · intégration · API · Rust · Go

Si tu écris ton propre logiciel (SaaS, app mobile, plateforme custom, donation widget) et tu veux y intégrer Monero proprement, deux outils sérieux existent : MoneroPay (daemon Go, API HTTP, intégration langage-agnostique) et AcceptXMR (librairie Rust, intégration in-process pour apps Rust). Tous les deux sont open-source, non-custodial, view-only based. Voici comment choisir et le pattern d’intégration.

TL;DR

CritèreMoneroPayAcceptXMR
LangageGo (daemon)Rust (lib)
IntégrationAPI HTTP RESTIn-process Rust
SetupDaemon séparé + ton appLib intégrée à ton app Rust
Cas usageApp n’importe quel langageApp Rust uniquement
CustodyNon-custodial (view-only)Non-custodial (view-only)
PersistenceConfigurablePersistente, recovery sur crash/power loss
Repogithub.com/moneropay/moneropaygithub.com/busyboredom/acceptxmr

Choisis MoneroPay si : tu écris en Python, Node, PHP, Ruby, Java, ou tout autre langage, et tu veux une API REST simple à appeler depuis ton code.

Choisis AcceptXMR si : ton app est en Rust et tu veux la lib embarquée pour éviter un process externe.

MoneroPay (daemon Go)

github.com/moneropay/moneropay — standalone payment processor for incoming and outgoing transactions.

Architecture :

┌────────────────┐
│  Ton app       │
│  (n'importe    │
│   quel lang)   │
└───────┬────────┘
        │ HTTP REST

┌────────────────┐
│  MoneroPay     │
│  daemon (Go)   │
│  ├─ view key   │
│  ├─ subaddress │
│  │  manager    │
│  └─ webhooks   │
└───────┬────────┘
        │ RPC

┌────────────────┐
│  monero-wallet │
│  -rpc          │
└────────────────┘

   blockchain

Forces :

Faiblesses :

Cas d’usage typiques :

AcceptXMR (librairie Rust)

github.com/busyboredom/acceptxmr — a slim & performant library for use in Rust applications.

Architecture :

┌─────────────────────────────────┐
│  Ton app Rust                   │
│  ├─ AcceptXMR lib (in-process)  │
│  │  ├─ view key                 │
│  │  ├─ scanner                  │
│  │  └─ invoice store            │
│  └─ ton code business           │
└───────┬─────────────────────────┘
        │ direct RPC

┌────────────────┐
│  monero-daemon │
│  (node)        │
└────────────────┘

Forces :

Faiblesses :

Cas d’usage typiques :

Quand utiliser MoneroPay vs AcceptXMR vs autre

                    ┌─ Tu écris du Rust ?

       ┌── Oui ─────┤
       │            │
       │            └─→ Tu veux lib intégrée → AcceptXMR
       │                Tu veux daemon HTTP → MoneroPay

   ────┤

       └── Non ──────→ Tu veux daemon HTTP → MoneroPay
                       Tu veux ne pas écrire de code → 
                          - WordPress / WooCommerce → monerowp
                          - Multi-coin / boutique → BTCPay / Bitcart
                          - POS boutique physique → XMRetail / SuperPay

Décision en 30 secondes selon ton stack et ton cas d’usage.

Pattern d’intégration MoneroPay (exemple Python)

import requests
from flask import Flask, request

MONEROPAY_URL = "http://127.0.0.1:5000"  # daemon localhost

app = Flask(__name__)

@app.route("/api/create-invoice", methods=["POST"])
def create_invoice():
    amount = request.json["amount_xmr"]
    description = request.json.get("description", "")

    # Demande à MoneroPay de générer une invoice
    r = requests.post(f"{MONEROPAY_URL}/receive", json={
        "amount": int(amount * 1e12),  # XMR → atomic units
        "description": description,
    })
    invoice = r.json()

    # invoice["address"] = subaddress unique pour cette commande
    # invoice["payment_id"] = ID interne MoneroPay
    return invoice

@app.route("/webhook/moneropay", methods=["POST"])
def moneropay_webhook():
    # MoneroPay POST ici quand un paiement est confirmé
    data = request.json
    payment_id = data["payment_id"]
    amount_received = data["amount"]
    # Marquer la commande comme payée dans ton DB
    # ...
    return {"ok": True}

Côté config MoneroPay : --callback-url http://localhost:8000/webhook/moneropay.

Pattern d’intégration AcceptXMR (exemple Rust)

use acceptxmr::{PaymentGateway, AcceptXmrError};

let gateway = PaymentGateway::builder(
    private_view_key.to_string(),
    primary_address.to_string(),
    "/var/lib/myapp/invoice_store.sled".to_string(), // persistence
)
.daemon_url("http://127.0.0.1:18081".to_string())
.build()
.await?;

// Run le scanner en background
gateway.run().await?;

// Génère une invoice
let invoice_id = gateway.new_invoice(
    100_000_000_000, // 0.1 XMR en atomic units
    1, // confirmations attendues
    10, // expiration en blocs
    "Order #1234".to_string(),
)?;

// Subscribe aux updates
let mut subscriber = gateway.subscribe(invoice_id)?;
while let Some(invoice) = subscriber.recv().await {
    if invoice.is_confirmed() {
        // Marquer la commande comme payée
        break;
    }
}

OPSEC pour les deux

Limites communes

En résumé

Si…Tu prends
App Python / Node / PHP / Ruby / Java / GoMoneroPay
App Rust performance-critical ou edgeAcceptXMR
Tu veux pas écrire de code (WordPress)monerowp
Tu veux multi-coin avec UI complèteBTCPay ou Bitcart

Les deux outils Monero-native sont solides, maintenus, non-custodial. Le bon choix dépend uniquement de ton stack technique. Une fois intégrés, tu accèptes Monero exactement comme tu accepterais un virement bancaire — avec privacy en plus.


Sources : github.com/moneropay/moneropay, github.com/busyboredom/acceptxmr, docs.rs/acceptxmr, getmonero.dev/accepting-monero/overview.html.


profils liés


← Tous les articles ↻ Refaire le diagnostic