Ir al contenido
ArionPay
PAGO CON BOT DE TELEGRAM
Próximamente

Recibe pagos en cripto dentro de Telegram

Estamos creando un bot de Telegram y un pago en Mini App para que tus clientes puedan pagar sin salir de Telegram. Aún no está disponible. Hoy puedes recibir alertas de pago en Telegram, ejecutar el bot de tienda para Telegram de ArionPay, ya listo para usar, o hacer que tu propio bot envíe a los clientes un enlace de pago de ArionPay creado con la REST API.

Alertas de pago en Telegram, Discord y por correo electrónico16 monedas y tokens en 9 redesWebhooks firmados para entregar el pedido
PróximamenteVista previa del pago con bot previsto
NC

Northwind Coffee

bot

/buy

12:04

Café en grano, 1 kg

Total: $29.99 USD
Cobrado directamente en la propia billetera de la tienda

Escribe /buy…

Ya funciona: envía un enlace de pago desde tu propio bot

Tu bot crea una factura con una sola solicitud firmada a la API y envía al cliente la invoice_url como botón. El cliente paga en la página de pago de ArionPay, directamente a tu billetera.

import hashlib, hmac, json, os, time
import requests
import telebot  # pip install pyTelegramBotAPI requests

bot = telebot.TeleBot(os.environ["TELEGRAM_BOT_TOKEN"])

API_KEY = os.environ["ARIONPAY_API_KEY"]        # pk_...
API_SECRET = os.environ["ARIONPAY_API_SECRET"]  # your store's secret
BASE_URL = os.environ["ARIONPAY_URL"]           # your ArionPay address

def create_invoice(payload):
    body = json.dumps(payload, separators=(",", ":"))
    ts = str(int(time.time()))
    sig = hmac.new(API_SECRET.encode(), f"{ts}.{body}".encode(), hashlib.sha256).hexdigest()
    res = requests.post(
        f"{BASE_URL}/api/v1/invoices",
        data=body,  # send exactly the bytes you signed
        headers={
            "Content-Type": "application/json",
            "x-api-key": API_KEY,
            "x-timestamp": ts,
            "x-signature": sig,
        },
        timeout=15,
    )
    res.raise_for_status()
    return res.json()

@bot.message_handler(commands=["buy"])
def buy(message):
    user_id = message.from_user.id
    invoice = create_invoice({
        "amount": "29.99",
        "currency": "USD",
        "orderId": f"tg-{user_id}-{int(time.time())}",
        "metadata": {"telegramUserId": user_id},
    })
    markup = telebot.types.InlineKeyboardMarkup()
    markup.add(telebot.types.InlineKeyboardButton("Pay with crypto", url=invoice["invoice_url"]))
    bot.send_message(message.chat.id, "Your order: $29.99. Tap below to pay.", reply_markup=markup)

# Deliver the order when your webhook endpoint receives invoice.paid
# (check the ArionPay-Signature header first; see /docs).

bot.infinity_polling()

Lo que funciona hoy

Alertas de pago. Recibe un mensaje en Telegram, Discord o por correo electrónico cuando llega un pago. Actívalas en tu panel.

Un bot de tienda. Ejecuta el bot de tienda para Telegram listo para usar en tu propio servidor, o crea una factura con la REST API desde tu propio bot, como en el código de arriba.

Entrega. Tu servidor recibe un webhook invoice.paid firmado y entonces puede enviar al cliente lo que compró.