Menu

Accept crypto payments in Ruby on Rails
📰

Accept crypto payments in Ruby on Rails

DEV Community: ruby·Moonvex News·about 11 hours ago
#PHjr3k8o
#devtoruby#devto#dev#to_s#create
Long article (1540 words) — no AI summary yet.
Reading 0:00
15s threshold

How to accept crypto in a Rails app: a small Net::HTTP module creates a checkout, a controller sends the customer to the page where they pick the coin, and the webhook controller verifies the signature over request.raw_post and marks the order once.

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. In Rails use credentials or environment variables. The example includes the generator for a ProcessedEvent model with a unique index.

# keys go to credentials or environment variables export MOONVEX_SECRET_KEY = sk_live_... export MOONVEX_WEBHOOK_SECRET = whsec_...

bin/rails g model ProcessedEvent event_id:string:uniq

Enter fullscreen mode

Exit fullscreen mode

2.…

Continue reading — create a free account

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