Skip to main content
Use the orsunpay gem with Ruby 3.1 or later. For a Rails app, place the supplied SDK source under vendor/orsunpay, add it to your Gemfile, then run bundle install:

Configure the merchant client

From a server-side service or job, look up the existing transaction with the original order ID:
For sale, payout, payment link and refund creation, persist the key with the order and pass it as idempotency_key:. Use decimal strings for amounts and store the returned IDs. Idempotency

Verify an incoming Rails webhook

Use the raw request body rather than Rails’ parsed parameters:
Handle OrsunPay::SignatureError as a rejected delivery. On success, use the event ID to process the change exactly once before returning 2xx. Webhook delivery