gocardless_pro 2.56.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gocardless_pro/client.rb +8 -3
- data/lib/gocardless_pro/error.rb +3 -3
- data/lib/gocardless_pro/middlewares/raise_gocardless_errors.rb +3 -3
- data/lib/gocardless_pro/resources/bank_authorisation.rb +2 -9
- data/lib/gocardless_pro/resources/bank_details_lookup.rb +1 -3
- data/lib/gocardless_pro/resources/billing_request.rb +7 -10
- data/lib/gocardless_pro/resources/billing_request_flow.rb +2 -17
- data/lib/gocardless_pro/resources/billing_request_template.rb +2 -17
- data/lib/gocardless_pro/resources/block.rb +2 -8
- data/lib/gocardless_pro/resources/creditor.rb +2 -20
- data/lib/gocardless_pro/resources/creditor_bank_account.rb +2 -11
- data/lib/gocardless_pro/resources/currency_exchange_rate.rb +1 -4
- data/lib/gocardless_pro/resources/customer.rb +2 -18
- data/lib/gocardless_pro/resources/customer_bank_account.rb +3 -10
- data/lib/gocardless_pro/resources/customer_notification.rb +1 -5
- data/lib/gocardless_pro/resources/event.rb +2 -8
- data/lib/gocardless_pro/resources/export.rb +40 -0
- data/lib/gocardless_pro/resources/instalment_schedule.rb +1 -8
- data/lib/gocardless_pro/resources/institution.rb +1 -6
- data/lib/gocardless_pro/resources/mandate.rb +3 -13
- data/lib/gocardless_pro/resources/mandate_import.rb +1 -4
- data/lib/gocardless_pro/resources/mandate_import_entry.rb +1 -2
- data/lib/gocardless_pro/resources/mandate_pdf.rb +1 -2
- data/lib/gocardless_pro/resources/negative_balance_limit.rb +1 -4
- data/lib/gocardless_pro/resources/payer_authorisation.rb +1 -7
- data/lib/gocardless_pro/resources/payment.rb +2 -13
- data/lib/gocardless_pro/resources/payout.rb +2 -12
- data/lib/gocardless_pro/resources/payout_item.rb +1 -3
- data/lib/gocardless_pro/resources/redirect_flow.rb +2 -10
- data/lib/gocardless_pro/resources/refund.rb +1 -8
- data/lib/gocardless_pro/resources/scheme_identifier.rb +2 -18
- data/lib/gocardless_pro/resources/subscription.rb +3 -19
- data/lib/gocardless_pro/resources/tax_rate.rb +1 -6
- data/lib/gocardless_pro/resources/transferred_mandate.rb +1 -3
- data/lib/gocardless_pro/resources/verification_detail.rb +2 -9
- data/lib/gocardless_pro/resources/webhook.rb +2 -13
- data/lib/gocardless_pro/services/bank_authorisations_service.rb +1 -1
- data/lib/gocardless_pro/services/billing_request_flows_service.rb +1 -1
- data/lib/gocardless_pro/services/billing_request_templates_service.rb +2 -2
- data/lib/gocardless_pro/services/billing_requests_service.rb +10 -10
- data/lib/gocardless_pro/services/blocks_service.rb +3 -3
- data/lib/gocardless_pro/services/creditor_bank_accounts_service.rb +2 -2
- data/lib/gocardless_pro/services/creditors_service.rb +2 -2
- data/lib/gocardless_pro/services/customer_bank_accounts_service.rb +3 -3
- data/lib/gocardless_pro/services/customer_notifications_service.rb +1 -1
- data/lib/gocardless_pro/services/customers_service.rb +3 -3
- data/lib/gocardless_pro/services/events_service.rb +1 -1
- data/lib/gocardless_pro/services/exports_service.rb +75 -0
- data/lib/gocardless_pro/services/instalment_schedules_service.rb +3 -3
- data/lib/gocardless_pro/services/institutions_service.rb +1 -1
- data/lib/gocardless_pro/services/logos_service.rb +5 -0
- data/lib/gocardless_pro/services/mandate_imports_service.rb +3 -3
- data/lib/gocardless_pro/services/mandates_service.rb +4 -4
- data/lib/gocardless_pro/services/payer_authorisations_service.rb +4 -4
- data/lib/gocardless_pro/services/payments_service.rb +4 -4
- data/lib/gocardless_pro/services/payouts_service.rb +2 -2
- data/lib/gocardless_pro/services/redirect_flows_service.rb +2 -2
- data/lib/gocardless_pro/services/refunds_service.rb +2 -2
- data/lib/gocardless_pro/services/scenario_simulators_service.rb +1 -1
- data/lib/gocardless_pro/services/scheme_identifiers_service.rb +1 -1
- data/lib/gocardless_pro/services/subscriptions_service.rb +5 -5
- data/lib/gocardless_pro/services/tax_rates_service.rb +1 -1
- data/lib/gocardless_pro/services/transferred_mandates_service.rb +1 -1
- data/lib/gocardless_pro/services/webhooks_service.rb +2 -2
- data/lib/gocardless_pro/version.rb +1 -1
- data/lib/gocardless_pro.rb +3 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e7c9c7f865d0173f9fc0f2a577c04178c49f5aea6dcb15499dec10f97eaf2b8
|
4
|
+
data.tar.gz: fe2d4c30469b84f035028d73a9d3edd4f8298306c0f35b3c0eef09653f235182
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a705da86320bda9c898ead0194d23350adbc8280048b0bb01f4f75b5cac1fc010869dbee793f507424640521aea3eb3a26e6d9d988a60809d17a042f1123d085
|
7
|
+
data.tar.gz: 756f6bddc3ba9d8aa5fd944f20427b74990e2dae69f2d30ca378f06ef4007c786d152e98abf8dc95000079261c28965436f0d63faeb096eb7e98f1ffacb8fe83
|
@@ -68,6 +68,11 @@ module GoCardlessPro
|
|
68
68
|
@events ||= Services::EventsService.new(@api_service)
|
69
69
|
end
|
70
70
|
|
71
|
+
# Access to the service for export to make API calls
|
72
|
+
def exports
|
73
|
+
@exports ||= Services::ExportsService.new(@api_service)
|
74
|
+
end
|
75
|
+
|
71
76
|
# Access to the service for instalment_schedule to make API calls
|
72
77
|
def instalment_schedules
|
73
78
|
@instalment_schedules ||= Services::InstalmentSchedulesService.new(@api_service)
|
@@ -228,8 +233,8 @@ module GoCardlessPro
|
|
228
233
|
'User-Agent' => "#{user_agent}",
|
229
234
|
'Content-Type' => 'application/json',
|
230
235
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
231
|
-
'GoCardless-Client-Version' => '
|
232
|
-
}
|
236
|
+
'GoCardless-Client-Version' => '3.0.0'
|
237
|
+
}
|
233
238
|
}
|
234
239
|
end
|
235
240
|
|
@@ -249,7 +254,7 @@ module GoCardlessPro
|
|
249
254
|
comment = [
|
250
255
|
"#{ruby_engine}/#{ruby_version}",
|
251
256
|
"#{RUBY_ENGINE}/#{interpreter_version}",
|
252
|
-
"#{RUBY_PLATFORM}"
|
257
|
+
"#{RUBY_PLATFORM}"
|
253
258
|
]
|
254
259
|
comment << "faraday/#{Faraday::VERSION}"
|
255
260
|
"#{gem_info} #{comment.join(' ')}"
|
data/lib/gocardless_pro/error.rb
CHANGED
@@ -26,7 +26,7 @@ module GoCardlessPro
|
|
26
26
|
{
|
27
27
|
401 => GoCardlessPro::AuthenticationError,
|
28
28
|
403 => GoCardlessPro::PermissionError,
|
29
|
-
429 => GoCardlessPro::RateLimitError
|
29
|
+
429 => GoCardlessPro::RateLimitError
|
30
30
|
}.fetch(code, nil)
|
31
31
|
end
|
32
32
|
|
@@ -35,7 +35,7 @@ module GoCardlessPro
|
|
35
35
|
validation_failed: GoCardlessPro::ValidationError,
|
36
36
|
gocardless: GoCardlessPro::GoCardlessError,
|
37
37
|
invalid_api_usage: GoCardlessPro::InvalidApiUsageError,
|
38
|
-
invalid_state: GoCardlessPro::InvalidStateError
|
38
|
+
invalid_state: GoCardlessPro::InvalidStateError
|
39
39
|
}.fetch(type.to_sym)
|
40
40
|
end
|
41
41
|
|
@@ -45,7 +45,7 @@ module GoCardlessPro
|
|
45
45
|
"code: #{env.status}\n" \
|
46
46
|
"headers: #{env.response_headers}\n" \
|
47
47
|
"body: #{env.body}",
|
48
|
-
'code' => env.status
|
48
|
+
'code' => env.status
|
49
49
|
}
|
50
50
|
end
|
51
51
|
|
@@ -21,15 +21,8 @@ module GoCardlessPro
|
|
21
21
|
# (see Billing Request Flows) to ensure we meet regulatory requirements for
|
22
22
|
# checkout flows.
|
23
23
|
class BankAuthorisation
|
24
|
-
attr_reader :authorisation_type
|
25
|
-
|
26
|
-
attr_reader :created_at
|
27
|
-
attr_reader :expires_at
|
28
|
-
attr_reader :id
|
29
|
-
attr_reader :last_visited_at
|
30
|
-
attr_reader :qr_code_url
|
31
|
-
attr_reader :redirect_uri
|
32
|
-
attr_reader :url
|
24
|
+
attr_reader :authorisation_type, :authorised_at, :created_at, :expires_at, :id, :last_visited_at, :qr_code_url,
|
25
|
+
:redirect_uri, :url
|
33
26
|
|
34
27
|
# Initialize a bank_authorisation resource instance
|
35
28
|
# @param object [Hash] an object returned from the API
|
@@ -12,9 +12,7 @@ module GoCardlessPro
|
|
12
12
|
|
13
13
|
# Look up the name and reachability of a bank account.
|
14
14
|
class BankDetailsLookup
|
15
|
-
attr_reader :available_debit_schemes
|
16
|
-
attr_reader :bank_name
|
17
|
-
attr_reader :bic
|
15
|
+
attr_reader :available_debit_schemes, :bank_name, :bic
|
18
16
|
|
19
17
|
# Initialize a bank_details_lookup resource instance
|
20
18
|
# @param object [Hash] an object returned from the API
|
@@ -20,16 +20,8 @@ module GoCardlessPro
|
|
20
20
|
# Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/)
|
21
21
|
# for how-to's, explanations and tutorials.
|
22
22
|
class BillingRequest
|
23
|
-
attr_reader :actions
|
24
|
-
|
25
|
-
attr_reader :fallback_enabled
|
26
|
-
attr_reader :id
|
27
|
-
attr_reader :mandate_request
|
28
|
-
attr_reader :metadata
|
29
|
-
attr_reader :payment_request
|
30
|
-
attr_reader :purpose_code
|
31
|
-
attr_reader :resources
|
32
|
-
attr_reader :status
|
23
|
+
attr_reader :actions, :created_at, :fallback_enabled, :id, :mandate_request, :metadata, :payment_request,
|
24
|
+
:purpose_code, :resources, :status, :subscription_request
|
33
25
|
|
34
26
|
# Initialize a billing_request resource instance
|
35
27
|
# @param object [Hash] an object returned from the API
|
@@ -47,6 +39,7 @@ module GoCardlessPro
|
|
47
39
|
@purpose_code = object['purpose_code']
|
48
40
|
@resources = object['resources']
|
49
41
|
@status = object['status']
|
42
|
+
@subscription_request = object['subscription_request']
|
50
43
|
@response = response
|
51
44
|
end
|
52
45
|
|
@@ -112,6 +105,10 @@ module GoCardlessPro
|
|
112
105
|
def payment_request_payment
|
113
106
|
@links['payment_request_payment']
|
114
107
|
end
|
108
|
+
|
109
|
+
def subscription_request
|
110
|
+
@links['subscription_request']
|
111
|
+
end
|
115
112
|
end
|
116
113
|
end
|
117
114
|
end
|
@@ -14,23 +14,8 @@ module GoCardlessPro
|
|
14
14
|
# payment created for a scheme with strong payer
|
15
15
|
# authorisation (such as open banking single payments).
|
16
16
|
class BillingRequestFlow
|
17
|
-
attr_reader :authorisation_url
|
18
|
-
|
19
|
-
attr_reader :created_at
|
20
|
-
attr_reader :customer_details_captured
|
21
|
-
attr_reader :exit_uri
|
22
|
-
attr_reader :expires_at
|
23
|
-
attr_reader :id
|
24
|
-
attr_reader :language
|
25
|
-
attr_reader :lock_bank_account
|
26
|
-
attr_reader :lock_currency
|
27
|
-
attr_reader :lock_customer_details
|
28
|
-
attr_reader :prefilled_bank_account
|
29
|
-
attr_reader :prefilled_customer
|
30
|
-
attr_reader :redirect_uri
|
31
|
-
attr_reader :session_token
|
32
|
-
attr_reader :show_redirect_buttons
|
33
|
-
attr_reader :show_success_redirect_button
|
17
|
+
attr_reader :authorisation_url, :auto_fulfil, :created_at, :customer_details_captured, :exit_uri, :expires_at,
|
18
|
+
:id, :language, :lock_bank_account, :lock_currency, :lock_customer_details, :prefilled_bank_account, :prefilled_customer, :redirect_uri, :session_token, :show_redirect_buttons, :show_success_redirect_button
|
34
19
|
|
35
20
|
# Initialize a billing_request_flow resource instance
|
36
21
|
# @param object [Hash] an object returned from the API
|
@@ -26,23 +26,8 @@ module GoCardlessPro
|
|
26
26
|
# for single-use and is designed to cater to the unique needs of individual
|
27
27
|
# customers.
|
28
28
|
class BillingRequestTemplate
|
29
|
-
attr_reader :authorisation_url
|
30
|
-
|
31
|
-
attr_reader :id
|
32
|
-
attr_reader :mandate_request_currency
|
33
|
-
attr_reader :mandate_request_description
|
34
|
-
attr_reader :mandate_request_metadata
|
35
|
-
attr_reader :mandate_request_scheme
|
36
|
-
attr_reader :mandate_request_verify
|
37
|
-
attr_reader :metadata
|
38
|
-
attr_reader :name
|
39
|
-
attr_reader :payment_request_amount
|
40
|
-
attr_reader :payment_request_currency
|
41
|
-
attr_reader :payment_request_description
|
42
|
-
attr_reader :payment_request_metadata
|
43
|
-
attr_reader :payment_request_scheme
|
44
|
-
attr_reader :redirect_uri
|
45
|
-
attr_reader :updated_at
|
29
|
+
attr_reader :authorisation_url, :created_at, :id, :mandate_request_currency, :mandate_request_description,
|
30
|
+
:mandate_request_metadata, :mandate_request_scheme, :mandate_request_verify, :metadata, :name, :payment_request_amount, :payment_request_currency, :payment_request_description, :payment_request_metadata, :payment_request_scheme, :redirect_uri, :updated_at
|
46
31
|
|
47
32
|
# Initialize a billing_request_template resource instance
|
48
33
|
# @param object [Hash] an object returned from the API
|
@@ -49,14 +49,8 @@ module GoCardlessPro
|
|
49
49
|
# would like to use this API.
|
50
50
|
# </p>
|
51
51
|
class Block
|
52
|
-
attr_reader :active
|
53
|
-
|
54
|
-
attr_reader :created_at
|
55
|
-
attr_reader :id
|
56
|
-
attr_reader :reason_description
|
57
|
-
attr_reader :reason_type
|
58
|
-
attr_reader :resource_reference
|
59
|
-
attr_reader :updated_at
|
52
|
+
attr_reader :active, :block_type, :created_at, :id, :reason_description, :reason_type, :resource_reference,
|
53
|
+
:updated_at
|
60
54
|
|
61
55
|
# Initialize a block resource instance
|
62
56
|
# @param object [Hash] an object returned from the API
|
@@ -18,26 +18,8 @@ module GoCardlessPro
|
|
18
18
|
# Currently, for Anti Money Laundering reasons, any creditors you add must
|
19
19
|
# be directly related to your organisation.
|
20
20
|
class Creditor
|
21
|
-
attr_reader :address_line1
|
22
|
-
|
23
|
-
attr_reader :address_line3
|
24
|
-
attr_reader :bank_reference_prefix
|
25
|
-
attr_reader :can_create_refunds
|
26
|
-
attr_reader :city
|
27
|
-
attr_reader :country_code
|
28
|
-
attr_reader :created_at
|
29
|
-
attr_reader :creditor_type
|
30
|
-
attr_reader :custom_payment_pages_enabled
|
31
|
-
attr_reader :fx_payout_currency
|
32
|
-
attr_reader :id
|
33
|
-
attr_reader :logo_url
|
34
|
-
attr_reader :mandate_imports_enabled
|
35
|
-
attr_reader :merchant_responsible_for_notifications
|
36
|
-
attr_reader :name
|
37
|
-
attr_reader :postal_code
|
38
|
-
attr_reader :region
|
39
|
-
attr_reader :scheme_identifiers
|
40
|
-
attr_reader :verification_status
|
21
|
+
attr_reader :address_line1, :address_line2, :address_line3, :bank_reference_prefix, :can_create_refunds, :city,
|
22
|
+
:country_code, :created_at, :creditor_type, :custom_payment_pages_enabled, :fx_payout_currency, :id, :logo_url, :mandate_imports_enabled, :merchant_responsible_for_notifications, :name, :postal_code, :region, :scheme_identifiers, :verification_status
|
41
23
|
|
42
24
|
# Initialize a creditor resource instance
|
43
25
|
# @param object [Hash] an object returned from the API
|
@@ -23,17 +23,8 @@ module GoCardlessPro
|
|
23
23
|
# <p class="restricted-notice"><strong>Restricted</strong>: This API is not
|
24
24
|
# available for partner integrations.</p>
|
25
25
|
class CreditorBankAccount
|
26
|
-
attr_reader :account_holder_name
|
27
|
-
|
28
|
-
attr_reader :account_type
|
29
|
-
attr_reader :bank_name
|
30
|
-
attr_reader :country_code
|
31
|
-
attr_reader :created_at
|
32
|
-
attr_reader :currency
|
33
|
-
attr_reader :enabled
|
34
|
-
attr_reader :id
|
35
|
-
attr_reader :metadata
|
36
|
-
attr_reader :verification_status
|
26
|
+
attr_reader :account_holder_name, :account_number_ending, :account_type, :bank_name, :country_code, :created_at,
|
27
|
+
:currency, :enabled, :id, :metadata, :verification_status
|
37
28
|
|
38
29
|
# Initialize a creditor_bank_account resource instance
|
39
30
|
# @param object [Hash] an object returned from the API
|
@@ -12,10 +12,7 @@ module GoCardlessPro
|
|
12
12
|
|
13
13
|
# Currency exchange rates from our foreign exchange provider.
|
14
14
|
class CurrencyExchangeRate
|
15
|
-
attr_reader :rate
|
16
|
-
attr_reader :source
|
17
|
-
attr_reader :target
|
18
|
-
attr_reader :time
|
15
|
+
attr_reader :rate, :source, :target, :time
|
19
16
|
|
20
17
|
# Initialize a currency_exchange_rate resource instance
|
21
18
|
# @param object [Hash] an object returned from the API
|
@@ -15,24 +15,8 @@ module GoCardlessPro
|
|
15
15
|
# accounts](#core-endpoints-customer-bank-accounts), which in turn can have
|
16
16
|
# several Direct Debit [mandates](#core-endpoints-mandates).
|
17
17
|
class Customer
|
18
|
-
attr_reader :address_line1
|
19
|
-
|
20
|
-
attr_reader :address_line3
|
21
|
-
attr_reader :city
|
22
|
-
attr_reader :company_name
|
23
|
-
attr_reader :country_code
|
24
|
-
attr_reader :created_at
|
25
|
-
attr_reader :danish_identity_number
|
26
|
-
attr_reader :email
|
27
|
-
attr_reader :family_name
|
28
|
-
attr_reader :given_name
|
29
|
-
attr_reader :id
|
30
|
-
attr_reader :language
|
31
|
-
attr_reader :metadata
|
32
|
-
attr_reader :phone_number
|
33
|
-
attr_reader :postal_code
|
34
|
-
attr_reader :region
|
35
|
-
attr_reader :swedish_identity_number
|
18
|
+
attr_reader :address_line1, :address_line2, :address_line3, :city, :company_name, :country_code, :created_at,
|
19
|
+
:danish_identity_number, :email, :family_name, :given_name, :id, :language, :metadata, :phone_number, :postal_code, :region, :swedish_identity_number
|
36
20
|
|
37
21
|
# Initialize a customer resource instance
|
38
22
|
# @param object [Hash] an object returned from the API
|
@@ -28,16 +28,8 @@ module GoCardlessPro
|
|
28
28
|
# [bank_details_lookups](#bank-details-lookups-perform-a-bank-details-lookup),
|
29
29
|
# before proceeding with creating the accounts
|
30
30
|
class CustomerBankAccount
|
31
|
-
attr_reader :account_holder_name
|
32
|
-
|
33
|
-
attr_reader :account_type
|
34
|
-
attr_reader :bank_name
|
35
|
-
attr_reader :country_code
|
36
|
-
attr_reader :created_at
|
37
|
-
attr_reader :currency
|
38
|
-
attr_reader :enabled
|
39
|
-
attr_reader :id
|
40
|
-
attr_reader :metadata
|
31
|
+
attr_reader :account_holder_name, :account_number_ending, :account_type, :bank_account_token, :bank_name,
|
32
|
+
:country_code, :created_at, :currency, :enabled, :id, :metadata
|
41
33
|
|
42
34
|
# Initialize a customer_bank_account resource instance
|
43
35
|
# @param object [Hash] an object returned from the API
|
@@ -47,6 +39,7 @@ module GoCardlessPro
|
|
47
39
|
@account_holder_name = object['account_holder_name']
|
48
40
|
@account_number_ending = object['account_number_ending']
|
49
41
|
@account_type = object['account_type']
|
42
|
+
@bank_account_token = object['bank_account_token']
|
50
43
|
@bank_name = object['bank_name']
|
51
44
|
@country_code = object['country_code']
|
52
45
|
@created_at = object['created_at']
|
@@ -25,11 +25,7 @@ module GoCardlessPro
|
|
25
25
|
# href="mailto:help@gocardless.com">get in touch</a> if you would like to
|
26
26
|
# use this API.</p>
|
27
27
|
class CustomerNotification
|
28
|
-
attr_reader :action_taken
|
29
|
-
attr_reader :action_taken_at
|
30
|
-
attr_reader :action_taken_by
|
31
|
-
attr_reader :id
|
32
|
-
attr_reader :type
|
28
|
+
attr_reader :action_taken, :action_taken_at, :action_taken_by, :id, :type
|
33
29
|
|
34
30
|
# Initialize a customer_notification resource instance
|
35
31
|
# @param object [Hash] an object returned from the API
|
@@ -17,14 +17,8 @@ module GoCardlessPro
|
|
17
17
|
# corresponding event getting included in API responses. See
|
18
18
|
# [here](#event-actions) for a complete list of event types.
|
19
19
|
class Event
|
20
|
-
attr_reader :action
|
21
|
-
|
22
|
-
attr_reader :customer_notifications
|
23
|
-
attr_reader :details
|
24
|
-
attr_reader :id
|
25
|
-
attr_reader :metadata
|
26
|
-
attr_reader :resource_metadata
|
27
|
-
attr_reader :resource_type
|
20
|
+
attr_reader :action, :created_at, :customer_notifications, :details, :id, :metadata, :resource_metadata,
|
21
|
+
:resource_type
|
28
22
|
|
29
23
|
# Initialize a event resource instance
|
30
24
|
# @param object [Hash] an object returned from the API
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#
|
2
|
+
# This client is automatically generated from a template and JSON schema definition.
|
3
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
4
|
+
#
|
5
|
+
|
6
|
+
require 'uri'
|
7
|
+
|
8
|
+
module GoCardlessPro
|
9
|
+
# A module containing classes for each of the resources in the GC Api
|
10
|
+
module Resources
|
11
|
+
# Represents an instance of a export resource returned from the API
|
12
|
+
|
13
|
+
# File-based exports of data
|
14
|
+
class Export
|
15
|
+
attr_reader :created_at, :currency, :download_url, :export_type, :id
|
16
|
+
|
17
|
+
# Initialize a export resource instance
|
18
|
+
# @param object [Hash] an object returned from the API
|
19
|
+
def initialize(object, response = nil)
|
20
|
+
@object = object
|
21
|
+
|
22
|
+
@created_at = object['created_at']
|
23
|
+
@currency = object['currency']
|
24
|
+
@download_url = object['download_url']
|
25
|
+
@export_type = object['export_type']
|
26
|
+
@id = object['id']
|
27
|
+
@response = response
|
28
|
+
end
|
29
|
+
|
30
|
+
def api_response
|
31
|
+
ApiResponse.new(@response)
|
32
|
+
end
|
33
|
+
|
34
|
+
# Provides the export resource as a hash of all its readable attributes
|
35
|
+
def to_h
|
36
|
+
@object
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -28,14 +28,7 @@ module GoCardlessPro
|
|
28
28
|
# of collection.
|
29
29
|
#
|
30
30
|
class InstalmentSchedule
|
31
|
-
attr_reader :created_at
|
32
|
-
attr_reader :currency
|
33
|
-
attr_reader :id
|
34
|
-
attr_reader :metadata
|
35
|
-
attr_reader :name
|
36
|
-
attr_reader :payment_errors
|
37
|
-
attr_reader :status
|
38
|
-
attr_reader :total_amount
|
31
|
+
attr_reader :created_at, :currency, :id, :metadata, :name, :payment_errors, :status, :total_amount
|
39
32
|
|
40
33
|
# Initialize a instalment_schedule resource instance
|
41
34
|
# @param object [Hash] an object returned from the API
|
@@ -17,12 +17,7 @@ module GoCardlessPro
|
|
17
17
|
# Not all institutions support both Payment Initiation (PIS) and Account
|
18
18
|
# Information (AIS) services.
|
19
19
|
class Institution
|
20
|
-
attr_reader :autocompletes_collect_bank_account
|
21
|
-
attr_reader :country_code
|
22
|
-
attr_reader :icon_url
|
23
|
-
attr_reader :id
|
24
|
-
attr_reader :logo_url
|
25
|
-
attr_reader :name
|
20
|
+
attr_reader :autocompletes_collect_bank_account, :country_code, :icon_url, :id, :logo_url, :name
|
26
21
|
|
27
22
|
# Initialize a institution resource instance
|
28
23
|
# @param object [Hash] an object returned from the API
|
@@ -16,19 +16,8 @@ module GoCardlessPro
|
|
16
16
|
# GoCardless will notify you via a [webhook](#appendix-webhooks) whenever
|
17
17
|
# the status of a mandate changes.
|
18
18
|
class Mandate
|
19
|
-
attr_reader :authorisation_source
|
20
|
-
|
21
|
-
attr_reader :created_at
|
22
|
-
attr_reader :funds_settlement
|
23
|
-
attr_reader :id
|
24
|
-
attr_reader :metadata
|
25
|
-
attr_reader :next_possible_charge_date
|
26
|
-
attr_reader :next_possible_standard_ach_charge_date
|
27
|
-
attr_reader :payments_require_approval
|
28
|
-
attr_reader :reference
|
29
|
-
attr_reader :scheme
|
30
|
-
attr_reader :status
|
31
|
-
attr_reader :verified_at
|
19
|
+
attr_reader :authorisation_source, :consent_parameters, :consent_type, :created_at, :funds_settlement, :id,
|
20
|
+
:metadata, :next_possible_charge_date, :next_possible_standard_ach_charge_date, :payments_require_approval, :reference, :scheme, :status, :verified_at
|
32
21
|
|
33
22
|
# Initialize a mandate resource instance
|
34
23
|
# @param object [Hash] an object returned from the API
|
@@ -37,6 +26,7 @@ module GoCardlessPro
|
|
37
26
|
|
38
27
|
@authorisation_source = object['authorisation_source']
|
39
28
|
@consent_parameters = object['consent_parameters']
|
29
|
+
@consent_type = object['consent_type']
|
40
30
|
@created_at = object['created_at']
|
41
31
|
@funds_settlement = object['funds_settlement']
|
42
32
|
@id = object['id']
|
@@ -53,10 +53,7 @@ module GoCardlessPro
|
|
53
53
|
# href="mailto:help@gocardless.com">get in touch</a> if you would like to
|
54
54
|
# use this API.</p>
|
55
55
|
class MandateImport
|
56
|
-
attr_reader :created_at
|
57
|
-
attr_reader :id
|
58
|
-
attr_reader :scheme
|
59
|
-
attr_reader :status
|
56
|
+
attr_reader :created_at, :id, :scheme, :status
|
60
57
|
|
61
58
|
# Initialize a mandate_import resource instance
|
62
59
|
# @param object [Hash] an object returned from the API
|
@@ -41,8 +41,7 @@ module GoCardlessPro
|
|
41
41
|
# href="mailto:help@gocardless.com">get in touch</a> if you would like to
|
42
42
|
# use this API.</p>
|
43
43
|
class MandateImportEntry
|
44
|
-
attr_reader :created_at
|
45
|
-
attr_reader :record_identifier
|
44
|
+
attr_reader :created_at, :record_identifier
|
46
45
|
|
47
46
|
# Initialize a mandate_import_entry resource instance
|
48
47
|
# @param object [Hash] an object returned from the API
|
@@ -14,8 +14,7 @@ module GoCardlessPro
|
|
14
14
|
# compliant](#appendix-compliance-requirements) Direct Debit mandates to
|
15
15
|
# your customers.
|
16
16
|
class MandatePdf
|
17
|
-
attr_reader :expires_at
|
18
|
-
attr_reader :url
|
17
|
+
attr_reader :expires_at, :url
|
19
18
|
|
20
19
|
# Initialize a mandate_pdf resource instance
|
21
20
|
# @param object [Hash] an object returned from the API
|
@@ -16,10 +16,7 @@ module GoCardlessPro
|
|
16
16
|
# changed on a per-creditor basis.
|
17
17
|
#
|
18
18
|
class NegativeBalanceLimit
|
19
|
-
attr_reader :balance_limit
|
20
|
-
attr_reader :created_at
|
21
|
-
attr_reader :currency
|
22
|
-
attr_reader :id
|
19
|
+
attr_reader :balance_limit, :created_at, :currency, :id
|
23
20
|
|
24
21
|
# Initialize a negative_balance_limit resource instance
|
25
22
|
# @param object [Hash] an object returned from the API
|
@@ -69,13 +69,7 @@ module GoCardlessPro
|
|
69
69
|
# your servers.
|
70
70
|
# </p>
|
71
71
|
class PayerAuthorisation
|
72
|
-
attr_reader :bank_account
|
73
|
-
attr_reader :created_at
|
74
|
-
attr_reader :customer
|
75
|
-
attr_reader :id
|
76
|
-
attr_reader :incomplete_fields
|
77
|
-
attr_reader :mandate
|
78
|
-
attr_reader :status
|
72
|
+
attr_reader :bank_account, :created_at, :customer, :id, :incomplete_fields, :mandate, :status
|
79
73
|
|
80
74
|
# Initialize a payer_authorisation resource instance
|
81
75
|
# @param object [Hash] an object returned from the API
|
@@ -18,19 +18,8 @@ module GoCardlessPro
|
|
18
18
|
# GoCardless will notify you via a [webhook](#appendix-webhooks) whenever
|
19
19
|
# the state of a payment changes.
|
20
20
|
class Payment
|
21
|
-
attr_reader :amount
|
22
|
-
|
23
|
-
attr_reader :charge_date
|
24
|
-
attr_reader :created_at
|
25
|
-
attr_reader :currency
|
26
|
-
attr_reader :description
|
27
|
-
attr_reader :faster_ach
|
28
|
-
attr_reader :fx
|
29
|
-
attr_reader :id
|
30
|
-
attr_reader :metadata
|
31
|
-
attr_reader :reference
|
32
|
-
attr_reader :retry_if_possible
|
33
|
-
attr_reader :status
|
21
|
+
attr_reader :amount, :amount_refunded, :charge_date, :created_at, :currency, :description, :faster_ach, :fx, :id,
|
22
|
+
:metadata, :reference, :retry_if_possible, :status
|
34
23
|
|
35
24
|
# Initialize a payment resource instance
|
36
25
|
# @param object [Hash] an object returned from the API
|
@@ -17,18 +17,8 @@ module GoCardlessPro
|
|
17
17
|
# Payouts are created automatically after a payment has been successfully
|
18
18
|
# collected.
|
19
19
|
class Payout
|
20
|
-
attr_reader :amount
|
21
|
-
|
22
|
-
attr_reader :created_at
|
23
|
-
attr_reader :currency
|
24
|
-
attr_reader :deducted_fees
|
25
|
-
attr_reader :fx
|
26
|
-
attr_reader :id
|
27
|
-
attr_reader :metadata
|
28
|
-
attr_reader :payout_type
|
29
|
-
attr_reader :reference
|
30
|
-
attr_reader :status
|
31
|
-
attr_reader :tax_currency
|
20
|
+
attr_reader :amount, :arrival_date, :created_at, :currency, :deducted_fees, :fx, :id, :metadata, :payout_type,
|
21
|
+
:reference, :status, :tax_currency
|
32
22
|
|
33
23
|
# Initialize a payout resource instance
|
34
24
|
# @param object [Hash] an object returned from the API
|
@@ -33,9 +33,7 @@ module GoCardlessPro
|
|
33
33
|
# <code>410 Gone</code>.
|
34
34
|
#
|
35
35
|
class PayoutItem
|
36
|
-
attr_reader :amount
|
37
|
-
attr_reader :taxes
|
38
|
-
attr_reader :type
|
36
|
+
attr_reader :amount, :taxes, :type
|
39
37
|
|
40
38
|
# Initialize a payout_item resource instance
|
41
39
|
# @param object [Hash] an object returned from the API
|
@@ -49,16 +49,8 @@ module GoCardlessPro
|
|
49
49
|
# complete an expired redirect flow. For an integrator this is shorter and
|
50
50
|
# they will expire after 10 minutes.
|
51
51
|
class RedirectFlow
|
52
|
-
attr_reader :confirmation_url
|
53
|
-
|
54
|
-
attr_reader :description
|
55
|
-
attr_reader :id
|
56
|
-
attr_reader :mandate_reference
|
57
|
-
attr_reader :metadata
|
58
|
-
attr_reader :redirect_url
|
59
|
-
attr_reader :scheme
|
60
|
-
attr_reader :session_token
|
61
|
-
attr_reader :success_redirect_url
|
52
|
+
attr_reader :confirmation_url, :created_at, :description, :id, :mandate_reference, :metadata, :redirect_url,
|
53
|
+
:scheme, :session_token, :success_redirect_url
|
62
54
|
|
63
55
|
# Initialize a redirect_flow resource instance
|
64
56
|
# @param object [Hash] an object returned from the API
|
@@ -18,14 +18,7 @@ module GoCardlessPro
|
|
18
18
|
# refund is created, and will update the `amount_refunded` property of the
|
19
19
|
# payment.
|
20
20
|
class Refund
|
21
|
-
attr_reader :amount
|
22
|
-
attr_reader :created_at
|
23
|
-
attr_reader :currency
|
24
|
-
attr_reader :fx
|
25
|
-
attr_reader :id
|
26
|
-
attr_reader :metadata
|
27
|
-
attr_reader :reference
|
28
|
-
attr_reader :status
|
21
|
+
attr_reader :amount, :created_at, :currency, :fx, :id, :metadata, :reference, :status
|
29
22
|
|
30
23
|
# Initialize a refund resource instance
|
31
24
|
# @param object [Hash] an object returned from the API
|