Class: GoCardless::Client
- Inherits:
-
Object
- Object
- GoCardless::Client
- Extended by:
- Forwardable
- Defined in:
- lib/gocardless-pro/client.rb
Overview
A class for working with and talking to the GoCardless API
Instance Method Summary collapse
-
#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.
-
#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.
-
#subscriptions ⇒ Object
Access to the service for subscription to make API calls.
Constructor Details
#initialize(options) ⇒ Client
Get a Client configured to use HTTP Basic authentication with the GC Api
75 76 77 78 79 80 81 |
# File 'lib/gocardless-pro/client.rb', line 75 def initialize() access_token = .delete(:token) || fail('No Access Token given to GoCardless Client') environment = .delete(:environment) || :live url = .delete(:url) || url_for_environment(environment) = () @api_service = ApiService.new(url, access_token, ) end |
Instance Method Details
#creditor_bank_accounts ⇒ Object
Access to the service for creditor_bank_account to make API calls
12 13 14 |
# File 'lib/gocardless-pro/client.rb', line 12 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
7 8 9 |
# File 'lib/gocardless-pro/client.rb', line 7 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
22 23 24 |
# File 'lib/gocardless-pro/client.rb', line 22 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
17 18 19 |
# File 'lib/gocardless-pro/client.rb', line 17 def customers @customers ||= Services::CustomerService.new(@api_service) end |
#events ⇒ Object
Access to the service for event to make API calls
27 28 29 |
# File 'lib/gocardless-pro/client.rb', line 27 def events @events ||= Services::EventService.new(@api_service) end |
#helpers ⇒ Object
Access to the service for helper to make API calls
32 33 34 |
# File 'lib/gocardless-pro/client.rb', line 32 def helpers @helpers ||= Services::HelperService.new(@api_service) end |
#mandates ⇒ Object
Access to the service for mandate to make API calls
37 38 39 |
# File 'lib/gocardless-pro/client.rb', line 37 def mandates @mandates ||= Services::MandateService.new(@api_service) end |
#payments ⇒ Object
Access to the service for payment to make API calls
42 43 44 |
# File 'lib/gocardless-pro/client.rb', line 42 def payments @payments ||= Services::PaymentService.new(@api_service) end |
#payouts ⇒ Object
Access to the service for payout to make API calls
47 48 49 |
# File 'lib/gocardless-pro/client.rb', line 47 def payouts @payouts ||= Services::PayoutService.new(@api_service) end |
#redirect_flows ⇒ Object
Access to the service for redirect_flow to make API calls
52 53 54 |
# File 'lib/gocardless-pro/client.rb', line 52 def redirect_flows @redirect_flows ||= Services::RedirectFlowService.new(@api_service) end |
#refunds ⇒ Object
Access to the service for refund to make API calls
57 58 59 |
# File 'lib/gocardless-pro/client.rb', line 57 def refunds @refunds ||= Services::RefundService.new(@api_service) end |
#subscriptions ⇒ Object
Access to the service for subscription to make API calls
62 63 64 |
# File 'lib/gocardless-pro/client.rb', line 62 def subscriptions @subscriptions ||= Services::SubscriptionService.new(@api_service) end |