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.…