Skip to content

Client ​

The Client class serves as the main entry point for interacting with the Paystack API. It initializes a connection to the Paystack API and provides access to various resources.

Creating a client ​

ruby
PaystackSdk::Client.new(connection = nil, secret_key: nil, sandbox_only: false, **options)
ParameterTypeRequiredDescription
connectionFaraday::Connection, nilThe Faraday connection object used for API requests. If nil, a new connection will be created using the default API key.
secret_keyString, nilOptional API key to use for creating a new connection. Only used if connection is nil.
sandbox_onlyBooleanRefuse to build a client unless the key is a test key (sk_test_...). Set this in staging and CI so they can never charge real money.

Methods ​

live? ​

ruby
client.live?

Whether this client is using a live key (sk_live_...), so requests move real money. A test key, or a key in any other form, is not live.

Returns Boolean

Resources ​

AccessorPage
client.apple_payapple pay
client.balancesbalances
client.banksbanks
client.bulk_chargesbulk charges
client.chargescharges
client.customerscustomers
client.dedicated_virtual_accountsdedicated virtual accounts
client.direct_debitsdirect debits
client.disputesdisputes
client.integrationsintegrations
client.miscellaneousmiscellaneous
client.ordersorders
client.pagespages
client.payment_requestspayment requests
client.plansplans
client.productsproducts
client.refundsrefunds
client.settlementssettlements
client.splitssplits
client.storefrontsstorefronts
client.subaccountssubaccounts
client.subscriptionssubscriptions
client.terminalsterminals
client.transactionstransactions
client.transfer_recipientstransfer recipients
client.transferstransfers
client.virtual_terminalsvirtual terminals
client.webhook_eventswebhook events

Unofficial community SDK. Not affiliated with or endorsed by Paystack. · MIT License · rubygems.org/gems/paystack_sdk