Class: GoCardless::Client
- Inherits:
-
Object
- Object
- GoCardless::Client
- Extended by:
- Forwardable
- Defined in:
- lib/gocardless-pro.rb
Overview
A class for working with and talking to the GoCardless API
Instance Method Summary collapse
-
#api_keys ⇒ Object
Access to the service for api_key to make API calls.
-
#creditor_bank_accounts ⇒ Object
Access to the service for creditor_bank_account to make API calls.
-
#creditors ⇒ Object
Access to the service for creditor to make API calls.
-
#customer_bank_accounts ⇒ Object
Access to the service for customer_bank_account to make API calls.
-
#customers ⇒ Object
Access to the service for customer to make API calls.
-
#events ⇒ Object
Access to the service for event to make API calls.
-
#helpers ⇒ Object
Access to the service for helper to make API calls.
-
#initialize(options) ⇒ Client
constructor
Get a Client configured to use HTTP Basic authentication with the GC Api.
-
#mandates ⇒ Object
Access to the service for mandate to make API calls.
-
#payments ⇒ Object
Access to the service for payment to make API calls.
-
#payouts ⇒ Object
Access to the service for payout to make API calls.
-
#publishable_api_keys ⇒ Object
Access to the service for publishable_api_key to make API calls.
-
#redirect_flows ⇒ Object
Access to the service for redirect_flow to make API calls.
-
#refunds ⇒ Object
Access to the service for refund to make API calls.
-
#roles ⇒ Object
Access to the service for role to make API calls.
-
#subscriptions ⇒ Object
Access to the service for subscription to make API calls.
-
#users ⇒ Object
Access to the service for user to make API calls.
Constructor Details
#initialize(options) ⇒ Client
Get a Client configured to use HTTP Basic authentication with the GC Api
182 183 184 185 186 187 188 189 |
# File 'lib/gocardless-pro.rb', line 182 def initialize() api_key = .delete(:api_key) || fail('No API key ID given to GoCardless Client') api_secret = .delete(:api_secret) || fail('No API secret given to GoCardless Client') environment = .delete(:environment) || :live url = .delete(:url) || url_for_environment(environment) = () @api_service = ApiService.new(url, api_key, api_secret, ) end |
Instance Method Details
#api_keys ⇒ Object
Access to the service for api_key to make API calls
93 94 95 |
# File 'lib/gocardless-pro.rb', line 93 def api_keys @api_keys ||= Services::ApiKeyService.new(@api_service) end |
#creditor_bank_accounts ⇒ Object
Access to the service for creditor_bank_account to make API calls
103 104 105 |
# File 'lib/gocardless-pro.rb', line 103 def creditor_bank_accounts @creditor_bank_accounts ||= Services::CreditorBankAccountService.new(@api_service) end |
#creditors ⇒ Object
Access to the service for creditor to make API calls
98 99 100 |
# File 'lib/gocardless-pro.rb', line 98 def creditors @creditors ||= Services::CreditorService.new(@api_service) end |
#customer_bank_accounts ⇒ Object
Access to the service for customer_bank_account to make API calls
113 114 115 |
# File 'lib/gocardless-pro.rb', line 113 def customer_bank_accounts @customer_bank_accounts ||= Services::CustomerBankAccountService.new(@api_service) end |
#customers ⇒ Object
Access to the service for customer to make API calls
108 109 110 |
# File 'lib/gocardless-pro.rb', line 108 def customers @customers ||= Services::CustomerService.new(@api_service) end |
#events ⇒ Object
Access to the service for event to make API calls
118 119 120 |
# File 'lib/gocardless-pro.rb', line 118 def events @events ||= Services::EventService.new(@api_service) end |
#helpers ⇒ Object
Access to the service for helper to make API calls
123 124 125 |
# File 'lib/gocardless-pro.rb', line 123 def helpers @helpers ||= Services::HelperService.new(@api_service) end |
#mandates ⇒ Object
Access to the service for mandate to make API calls
128 129 130 |
# File 'lib/gocardless-pro.rb', line 128 def mandates @mandates ||= Services::MandateService.new(@api_service) end |
#payments ⇒ Object
Access to the service for payment to make API calls
133 134 135 |
# File 'lib/gocardless-pro.rb', line 133 def payments @payments ||= Services::PaymentService.new(@api_service) end |
#payouts ⇒ Object
Access to the service for payout to make API calls
138 139 140 |
# File 'lib/gocardless-pro.rb', line 138 def payouts @payouts ||= Services::PayoutService.new(@api_service) end |
#publishable_api_keys ⇒ Object
Access to the service for publishable_api_key to make API calls
143 144 145 |
# File 'lib/gocardless-pro.rb', line 143 def publishable_api_keys @publishable_api_keys ||= Services::PublishableApiKeyService.new(@api_service) end |
#redirect_flows ⇒ Object
Access to the service for redirect_flow to make API calls
148 149 150 |
# File 'lib/gocardless-pro.rb', line 148 def redirect_flows @redirect_flows ||= Services::RedirectFlowService.new(@api_service) end |
#refunds ⇒ Object
Access to the service for refund to make API calls
153 154 155 |
# File 'lib/gocardless-pro.rb', line 153 def refunds @refunds ||= Services::RefundService.new(@api_service) end |
#roles ⇒ Object
Access to the service for role to make API calls
158 159 160 |
# File 'lib/gocardless-pro.rb', line 158 def roles @roles ||= Services::RoleService.new(@api_service) end |
#subscriptions ⇒ Object
Access to the service for subscription to make API calls
163 164 165 |
# File 'lib/gocardless-pro.rb', line 163 def subscriptions @subscriptions ||= Services::SubscriptionService.new(@api_service) end |
#users ⇒ Object
Access to the service for user to make API calls
168 169 170 |
# File 'lib/gocardless-pro.rb', line 168 def users @users ||= Services::UserService.new(@api_service) end |