Ruby SDK
Official Declined.io client for Ruby. Source: Enoros/declined-sdk/declined-ruby
Install
bash
gem install declinedInitialize
ruby
require 'declined'
client = Declined::Client.new("decl_live_sk_...", base_url: "https://api.declined.io/api")Send a payment failed event
ruby
client.events.create(
event_id: "evt_123",
type: "payment_failed",
customer_id: "cus_123",
invoice_id: "inv_456",
amount: 24900,
currency: "usd",
provider: "stripe",
)Mark payment as recovered
When a customer pays outside Declined, notify the platform using either approach below. See the full Recoveries guide.
Via event API
ruby
client.events.mark_payment_recovered(
event_id: "evt_124",
customer_id: "cus_123",
invoice_id: "inv_456",
)Via recovery attempt ID
ruby
client.recoveries.mark_recovered("ra_abc123")List resources
All SDKs expose customers, recoveries, sequences, webhooks, incentives, and analytics list methods. See the REST API reference for response shapes.