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)| Parameter | Type | Required | Description |
|---|---|---|---|
connection | Faraday::Connection, nil | The Faraday connection object used for API requests. If nil, a new connection will be created using the default API key. | |
secret_key | String, nil | Optional API key to use for creating a new connection. Only used if connection is nil. | |
sandbox_only | Boolean | Refuse 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
| Accessor | Page |
|---|---|
client.apple_pay | apple pay |
client.balances | balances |
client.banks | banks |
client.bulk_charges | bulk charges |
client.charges | charges |
client.customers | customers |
client.dedicated_virtual_accounts | dedicated virtual accounts |
client.direct_debits | direct debits |
client.disputes | disputes |
client.integrations | integrations |
client.miscellaneous | miscellaneous |
client.orders | orders |
client.pages | pages |
client.payment_requests | payment requests |
client.plans | plans |
client.products | products |
client.refunds | refunds |
client.settlements | settlements |
client.splits | splits |
client.storefronts | storefronts |
client.subaccounts | subaccounts |
client.subscriptions | subscriptions |
client.terminals | terminals |
client.transactions | transactions |
client.transfer_recipients | transfer recipients |
client.transfers | transfers |
client.virtual_terminals | virtual terminals |
client.webhook_events | webhook events |