Class: GoCardlessPro::Services::PaymentAccountTransactionsService
- Inherits:
-
BaseService
- Object
- BaseService
- GoCardlessPro::Services::PaymentAccountTransactionsService
- Defined in:
- lib/gocardless_pro/services/payment_account_transactions_service.rb
Overview
Service for making requests to the PaymentAccountTransaction endpoints
Instance Method Summary collapse
-
#all(identity, options = {}) ⇒ Object
Get a lazily enumerated list of all the items returned.
-
#get(identity, options = {}) ⇒ Object
Retrieves the details of an existing payment account transaction.
-
#list(identity, options = {}) ⇒ Object
List transactions for a given payment account.
Methods inherited from BaseService
#initialize, #make_request, #sub_url
Constructor Details
This class inherits a constructor from GoCardlessPro::Services::BaseService
Instance Method Details
#all(identity, options = {}) ⇒ Object
Get a lazily enumerated list of all the items returned. This is similar to the list method but will paginate for you automatically.
(https://developer.gocardless.com/api-reference/#core-endpoints-creditor-bank-accounts) which happens to be the payment account. Otherwise they will be the body of the request.
64 65 66 67 68 69 70 |
# File 'lib/gocardless_pro/services/payment_account_transactions_service.rb', line 64 def all(identity, = {}) Paginator.new( service: self, options: , identity: identity ).enumerator end |
#get(identity, options = {}) ⇒ Object
Retrieves the details of an existing payment account transaction. Example URL: /payment_account_transactions/:identity
(https://developer.gocardless.com/api-reference/#core-endpoints-creditor-bank-accounts) which happens to be the payment account.
20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gocardless_pro/services/payment_account_transactions_service.rb', line 20 def get(identity, = {}) path = sub_url('/payment_account_transactions/:identity', { 'identity' => identity, }) [:retry_failures] = true response = make_request(:get, path, ) return if response.body.nil? Resources::PaymentAccountTransaction.new(unenvelope_body(response.body), response) end |
#list(identity, options = {}) ⇒ Object
List transactions for a given payment account. Example URL: /payment_accounts/:identity/transactions
(https://developer.gocardless.com/api-reference/#core-endpoints-creditor-bank-accounts) which happens to be the payment account.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/gocardless_pro/services/payment_account_transactions_service.rb', line 41 def list(identity, = {}) path = sub_url('/payment_accounts/:identity/transactions', { 'identity' => identity, }) [:retry_failures] = true response = make_request(:get, path, ) ListResponse.new( response: response, unenveloped_body: unenvelope_body(response.body), resource_class: Resources::PaymentAccountTransaction ) end |