Menu

Accept crypto payments in Python
📰

Accept crypto payments in Python

DEV Community: flask·Moonvex News·about 18 hours ago
#Kxny5oeJ
#devtoflask#devto#dev#checkout#payment
Reading 0:00
15s threshold

A minimal Moonvex integration in Python with Flask and requests: create a checkout, send the customer to the Moonvex page where they pick the coin and network, receive the webhook and verify its HMAC-SHA256 signature with the standard library. Works for any WSGI app.

Step by step

1. Get an API key and a webhook secret

In the Moonvex dashboard go to “Integration” → “Create key” → type “Secret” (sk_live_…). The key is shown only once: store it on your server as MOONVEX_SECRET_KEY. On the same page add a webhook pointing to an https URL on your server and store its signing secret as MOONVEX_WEBHOOK_SECRET.

pip install flask requests

# environment variables on the server export MOONVEX_SECRET_KEY = sk_live_... export MOONVEX_WEBHOOK_SECRET = whsec_...

Enter fullscreen mode

Exit fullscreen mode

2. Create a checkout

POST /v1/payments with requests: Authorization: Bearer and Idempotency-Key in the headers; orderId, amount as a string and currency (USD, EUR, UAH, RUB or a coin) in the body.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.