gocardless_pro 4.2.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +16 -12
- data/lib/gocardless_pro/client.rb +33 -3
- data/lib/gocardless_pro/error.rb +3 -3
- data/lib/gocardless_pro/list_response.rb +2 -2
- data/lib/gocardless_pro/middlewares/raise_gocardless_errors.rb +11 -3
- data/lib/gocardless_pro/paginator.rb +3 -2
- data/lib/gocardless_pro/resources/balance.rb +4 -1
- data/lib/gocardless_pro/resources/bank_account_detail.rb +5 -1
- data/lib/gocardless_pro/resources/bank_account_holder_verification.rb +44 -0
- data/lib/gocardless_pro/resources/bank_authorisation.rb +9 -2
- data/lib/gocardless_pro/resources/bank_details_lookup.rb +3 -1
- data/lib/gocardless_pro/resources/billing_request.rb +24 -10
- data/lib/gocardless_pro/resources/billing_request_flow.rb +18 -2
- data/lib/gocardless_pro/resources/billing_request_template.rb +18 -2
- data/lib/gocardless_pro/resources/billing_request_with_action.rb +6 -5
- data/lib/gocardless_pro/resources/block.rb +12 -8
- data/lib/gocardless_pro/resources/creditor.rb +26 -6
- data/lib/gocardless_pro/resources/creditor_bank_account.rb +17 -7
- data/lib/gocardless_pro/resources/currency_exchange_rate.rb +4 -1
- data/lib/gocardless_pro/resources/customer.rb +22 -5
- data/lib/gocardless_pro/resources/customer_bank_account.rb +24 -10
- data/lib/gocardless_pro/resources/customer_notification.rb +8 -5
- data/lib/gocardless_pro/resources/event.rb +31 -4
- data/lib/gocardless_pro/resources/export.rb +7 -1
- data/lib/gocardless_pro/resources/funds_availability.rb +38 -0
- data/lib/gocardless_pro/resources/instalment_schedule.rb +8 -2
- data/lib/gocardless_pro/resources/institution.rb +11 -4
- data/lib/gocardless_pro/resources/logo.rb +2 -1
- data/lib/gocardless_pro/resources/mandate.rb +21 -6
- data/lib/gocardless_pro/resources/mandate_import.rb +29 -22
- data/lib/gocardless_pro/resources/mandate_import_entry.rb +16 -17
- data/lib/gocardless_pro/resources/mandate_pdf.rb +5 -4
- data/lib/gocardless_pro/resources/negative_balance_limit.rb +4 -2
- data/lib/gocardless_pro/resources/outbound_payment.rb +33 -12
- data/lib/gocardless_pro/resources/outbound_payment_import.rb +81 -0
- data/lib/gocardless_pro/resources/outbound_payment_import_entry.rb +77 -0
- data/lib/gocardless_pro/resources/payer_authorisation.rb +34 -32
- data/lib/gocardless_pro/resources/payment.rb +24 -8
- data/lib/gocardless_pro/resources/payment_account.rb +64 -0
- data/lib/gocardless_pro/resources/payment_account_transaction.rb +79 -0
- data/lib/gocardless_pro/resources/payout.rb +19 -8
- data/lib/gocardless_pro/resources/payout_item.rb +4 -3
- data/lib/gocardless_pro/resources/redirect_flow.rb +44 -25
- data/lib/gocardless_pro/resources/refund.rb +16 -7
- data/lib/gocardless_pro/resources/scheme_identifier.rb +18 -3
- data/lib/gocardless_pro/resources/subscription.rb +37 -16
- data/lib/gocardless_pro/resources/tax_rate.rb +8 -3
- data/lib/gocardless_pro/resources/transferred_mandate.rb +3 -1
- data/lib/gocardless_pro/resources/verification_detail.rb +19 -8
- data/lib/gocardless_pro/resources/webhook.rb +13 -2
- data/lib/gocardless_pro/services/balances_service.rb +11 -3
- data/lib/gocardless_pro/services/bank_account_details_service.rb +14 -3
- data/lib/gocardless_pro/services/bank_account_holder_verifications_service.rb +92 -0
- data/lib/gocardless_pro/services/bank_authorisations_service.rb +9 -3
- data/lib/gocardless_pro/services/bank_details_lookups_service.rb +14 -6
- data/lib/gocardless_pro/services/billing_request_flows_service.rb +8 -2
- data/lib/gocardless_pro/services/billing_request_templates_service.rb +14 -7
- data/lib/gocardless_pro/services/billing_request_with_actions_service.rb +7 -1
- data/lib/gocardless_pro/services/billing_requests_service.rb +38 -33
- data/lib/gocardless_pro/services/blocks_service.rb +17 -10
- data/lib/gocardless_pro/services/creditor_bank_accounts_service.rb +14 -7
- data/lib/gocardless_pro/services/creditors_service.rb +13 -6
- data/lib/gocardless_pro/services/currency_exchange_rates_service.rb +10 -3
- data/lib/gocardless_pro/services/customer_bank_accounts_service.rb +25 -15
- data/lib/gocardless_pro/services/customer_notifications_service.rb +8 -3
- data/lib/gocardless_pro/services/customers_service.rb +15 -9
- data/lib/gocardless_pro/services/events_service.rb +16 -4
- data/lib/gocardless_pro/services/exports_service.rb +8 -2
- data/lib/gocardless_pro/services/funds_availabilities_service.rb +56 -0
- data/lib/gocardless_pro/services/instalment_schedules_service.rb +21 -13
- data/lib/gocardless_pro/services/institutions_service.rb +8 -2
- data/lib/gocardless_pro/services/logos_service.rb +9 -3
- data/lib/gocardless_pro/services/mandate_import_entries_service.rb +10 -4
- data/lib/gocardless_pro/services/mandate_imports_service.rb +16 -8
- data/lib/gocardless_pro/services/mandate_pdfs_service.rb +11 -5
- data/lib/gocardless_pro/services/mandates_service.rb +23 -16
- data/lib/gocardless_pro/services/negative_balance_limits_service.rb +10 -3
- data/lib/gocardless_pro/services/outbound_payment_import_entries_service.rb +64 -0
- data/lib/gocardless_pro/services/outbound_payment_imports_service.rb +118 -0
- data/lib/gocardless_pro/services/outbound_payments_service.rb +34 -12
- data/lib/gocardless_pro/services/payer_authorisations_service.rb +18 -15
- data/lib/gocardless_pro/services/payer_themes_service.rb +7 -1
- data/lib/gocardless_pro/services/payment_account_transactions_service.rb +93 -0
- data/lib/gocardless_pro/services/payment_accounts_service.rb +83 -0
- data/lib/gocardless_pro/services/payments_service.rb +29 -21
- data/lib/gocardless_pro/services/payout_items_service.rb +12 -7
- data/lib/gocardless_pro/services/payouts_service.rb +14 -7
- data/lib/gocardless_pro/services/redirect_flows_service.rb +19 -9
- data/lib/gocardless_pro/services/refunds_service.rb +18 -13
- data/lib/gocardless_pro/services/scenario_simulators_service.rb +90 -81
- data/lib/gocardless_pro/services/scheme_identifiers_service.rb +15 -9
- data/lib/gocardless_pro/services/subscriptions_service.rb +57 -47
- data/lib/gocardless_pro/services/tax_rates_service.rb +11 -4
- data/lib/gocardless_pro/services/transferred_mandates_service.rb +8 -2
- data/lib/gocardless_pro/services/verification_details_service.rb +7 -1
- data/lib/gocardless_pro/services/webhooks_service.rb +13 -6
- data/lib/gocardless_pro/version.rb +1 -1
- data/lib/gocardless_pro/webhook.rb +45 -0
- data/lib/gocardless_pro.rb +18 -0
- metadata +38 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 391ae6d45356b902c0a936c5bb167740fd9415d1213c146fd0ba9bdd5416cc4c
|
|
4
|
+
data.tar.gz: cea405daca5960666de0eb79eaee3d963a1b3fba19df415cfef9f9e755ca719f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a0890972bcdb70acf2d1b6834093226cd46aad6ef811b9edf00dd2235c6c9527165c6d6b50b1883fc5af8fd28ad77d1d69036dc7d3e1764a1cc89df5e8bff04
|
|
7
|
+
data.tar.gz: 2c31f226752ba9ef70f61e1befb5cbc1c1d716c7f6d6f46b7c94ddb2d4b10f31e60e8b8611e956aadd163e2deadb24aef404796c29b8edbaee9d6080c4c35bf6
|
data/README.md
CHANGED
|
@@ -250,6 +250,22 @@ class WebhooksController < ApplicationController
|
|
|
250
250
|
end
|
|
251
251
|
```
|
|
252
252
|
|
|
253
|
+
#### Accessing the webhook ID
|
|
254
|
+
|
|
255
|
+
If you need to access the webhook ID for debugging purposes, you can use `parse_with_meta` instead:
|
|
256
|
+
|
|
257
|
+
```ruby
|
|
258
|
+
result = GoCardlessPro::Webhook.parse_with_meta(
|
|
259
|
+
request_body: request.raw_post,
|
|
260
|
+
signature_header: request.headers['Webhook-Signature'],
|
|
261
|
+
webhook_endpoint_secret: webhook_endpoint_secret
|
|
262
|
+
)
|
|
263
|
+
events = result.events
|
|
264
|
+
webhook_id = result.webhook_id # e.g. "WB123" - useful for debugging
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Note: The webhook ID is intended for debugging and logging purposes only. It should not be used for deduplication - instead, use the event IDs to deduplicate, as each event has a unique ID that remains consistent if the same event is sent multiple times.
|
|
268
|
+
|
|
253
269
|
For more details on working with webhooks, see our ["Getting started" guide](https://developer.gocardless.com/getting-started/api/introduction/?lang=ruby).
|
|
254
270
|
|
|
255
271
|
### Using the OAuth API
|
|
@@ -260,18 +276,6 @@ OAuth simply provides a means by which you obtain an access token - once you hav
|
|
|
260
276
|
|
|
261
277
|
We recommend using the [oauth2](https://github.com/intridea/oauth2) gem to handle the authorisation process and gain a token. For an example of this in action, see our [open-source OAuth demo app](https://github.com/gocardless/oauth-demo/blob/master/app.rb#L46).
|
|
262
278
|
|
|
263
|
-
## Supporting Ruby < 2.0.0
|
|
264
|
-
The client only supports Ruby >= 2.0.0 out of the box due to our use of
|
|
265
|
-
Enumerable::Lazy for lazy loading of paginated API resources.
|
|
266
|
-
|
|
267
|
-
If you wish to use this gem with a previous ruby version, you should be able to
|
|
268
|
-
do so with the [backports](https://github.com/marcandre/backports) gem:
|
|
269
|
-
|
|
270
|
-
1. Add backports to your Gemfile
|
|
271
|
-
```gem 'backports'```
|
|
272
|
-
2. Require lazy enumerables
|
|
273
|
-
```require 'backports/2.0.0/enumerable/lazy.rb'```
|
|
274
|
-
|
|
275
279
|
## Contributing
|
|
276
280
|
|
|
277
281
|
This client is auto-generated from Crank, a toolchain that we hope to open source soon. For now, issues should be reported on this repository. __Please do not modify the source code yourself, your changes will be overriden!__
|
|
@@ -13,6 +13,11 @@ module GoCardlessPro
|
|
|
13
13
|
@bank_account_details ||= Services::BankAccountDetailsService.new(@api_service)
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
# Access to the service for bank_account_holder_verification to make API calls
|
|
17
|
+
def bank_account_holder_verifications
|
|
18
|
+
@bank_account_holder_verifications ||= Services::BankAccountHolderVerificationsService.new(@api_service)
|
|
19
|
+
end
|
|
20
|
+
|
|
16
21
|
# Access to the service for bank_authorisation to make API calls
|
|
17
22
|
def bank_authorisations
|
|
18
23
|
@bank_authorisations ||= Services::BankAuthorisationsService.new(@api_service)
|
|
@@ -88,6 +93,11 @@ module GoCardlessPro
|
|
|
88
93
|
@exports ||= Services::ExportsService.new(@api_service)
|
|
89
94
|
end
|
|
90
95
|
|
|
96
|
+
# Access to the service for funds_availability to make API calls
|
|
97
|
+
def funds_availabilities
|
|
98
|
+
@funds_availabilities ||= Services::FundsAvailabilitiesService.new(@api_service)
|
|
99
|
+
end
|
|
100
|
+
|
|
91
101
|
# Access to the service for instalment_schedule to make API calls
|
|
92
102
|
def instalment_schedules
|
|
93
103
|
@instalment_schedules ||= Services::InstalmentSchedulesService.new(@api_service)
|
|
@@ -133,6 +143,16 @@ module GoCardlessPro
|
|
|
133
143
|
@outbound_payments ||= Services::OutboundPaymentsService.new(@api_service)
|
|
134
144
|
end
|
|
135
145
|
|
|
146
|
+
# Access to the service for outbound_payment_import to make API calls
|
|
147
|
+
def outbound_payment_imports
|
|
148
|
+
@outbound_payment_imports ||= Services::OutboundPaymentImportsService.new(@api_service)
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Access to the service for outbound_payment_import_entry to make API calls
|
|
152
|
+
def outbound_payment_import_entries
|
|
153
|
+
@outbound_payment_import_entries ||= Services::OutboundPaymentImportEntriesService.new(@api_service)
|
|
154
|
+
end
|
|
155
|
+
|
|
136
156
|
# Access to the service for payer_authorisation to make API calls
|
|
137
157
|
def payer_authorisations
|
|
138
158
|
@payer_authorisations ||= Services::PayerAuthorisationsService.new(@api_service)
|
|
@@ -148,6 +168,16 @@ module GoCardlessPro
|
|
|
148
168
|
@payments ||= Services::PaymentsService.new(@api_service)
|
|
149
169
|
end
|
|
150
170
|
|
|
171
|
+
# Access to the service for payment_account to make API calls
|
|
172
|
+
def payment_accounts
|
|
173
|
+
@payment_accounts ||= Services::PaymentAccountsService.new(@api_service)
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Access to the service for payment_account_transaction to make API calls
|
|
177
|
+
def payment_account_transactions
|
|
178
|
+
@payment_account_transactions ||= Services::PaymentAccountTransactionsService.new(@api_service)
|
|
179
|
+
end
|
|
180
|
+
|
|
151
181
|
# Access to the service for payout to make API calls
|
|
152
182
|
def payouts
|
|
153
183
|
@payouts ||= Services::PayoutsService.new(@api_service)
|
|
@@ -253,8 +283,8 @@ module GoCardlessPro
|
|
|
253
283
|
'User-Agent' => "#{user_agent}",
|
|
254
284
|
'Content-Type' => 'application/json',
|
|
255
285
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
|
256
|
-
'GoCardless-Client-Version' => '4.
|
|
257
|
-
}
|
|
286
|
+
'GoCardless-Client-Version' => '4.4.1',
|
|
287
|
+
},
|
|
258
288
|
}
|
|
259
289
|
end
|
|
260
290
|
|
|
@@ -274,7 +304,7 @@ module GoCardlessPro
|
|
|
274
304
|
comment = [
|
|
275
305
|
"#{ruby_engine}/#{ruby_version}",
|
|
276
306
|
"#{RUBY_ENGINE}/#{interpreter_version}",
|
|
277
|
-
"#{RUBY_PLATFORM}"
|
|
307
|
+
"#{RUBY_PLATFORM}",
|
|
278
308
|
]
|
|
279
309
|
comment << "faraday/#{Faraday::VERSION}"
|
|
280
310
|
"#{gem_info} #{comment.join(' ')}"
|
data/lib/gocardless_pro/error.rb
CHANGED
|
@@ -22,12 +22,12 @@ module GoCardlessPro
|
|
|
22
22
|
|
|
23
23
|
# return the before cursor for paginating
|
|
24
24
|
def before
|
|
25
|
-
@response.body
|
|
25
|
+
@response.body.dig('meta', 'cursors', 'before')
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
# return the after cursor for paginating
|
|
29
29
|
def after
|
|
30
|
-
@response.body
|
|
30
|
+
@response.body.dig('meta', 'cursors', 'after')
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -13,6 +13,13 @@ module GoCardlessPro
|
|
|
13
13
|
return unless CLIENT_ERROR_STATUSES.include?(env.status)
|
|
14
14
|
|
|
15
15
|
json_body ||= JSON.parse(env.body) unless env.body.empty?
|
|
16
|
+
if json_body['error'].is_a?(String)
|
|
17
|
+
# Some errors are returned as string rather than objects, wrap in standard format
|
|
18
|
+
json_body['error'] = {
|
|
19
|
+
'message' => json_body['error'],
|
|
20
|
+
'status' => env.status,
|
|
21
|
+
}
|
|
22
|
+
end
|
|
16
23
|
error_type = json_body['error']['type']
|
|
17
24
|
|
|
18
25
|
error_class = error_class_for_status(env.status) || error_class_for_type(error_type)
|
|
@@ -24,9 +31,10 @@ module GoCardlessPro
|
|
|
24
31
|
|
|
25
32
|
def error_class_for_status(code)
|
|
26
33
|
{
|
|
34
|
+
400 => GoCardlessPro::InvalidApiUsageError,
|
|
27
35
|
401 => GoCardlessPro::AuthenticationError,
|
|
28
36
|
403 => GoCardlessPro::PermissionError,
|
|
29
|
-
429 => GoCardlessPro::RateLimitError
|
|
37
|
+
429 => GoCardlessPro::RateLimitError,
|
|
30
38
|
}.fetch(code, nil)
|
|
31
39
|
end
|
|
32
40
|
|
|
@@ -35,7 +43,7 @@ module GoCardlessPro
|
|
|
35
43
|
validation_failed: GoCardlessPro::ValidationError,
|
|
36
44
|
gocardless: GoCardlessPro::GoCardlessError,
|
|
37
45
|
invalid_api_usage: GoCardlessPro::InvalidApiUsageError,
|
|
38
|
-
invalid_state: GoCardlessPro::InvalidStateError
|
|
46
|
+
invalid_state: GoCardlessPro::InvalidStateError,
|
|
39
47
|
}.fetch(type.to_sym)
|
|
40
48
|
end
|
|
41
49
|
|
|
@@ -45,7 +53,7 @@ module GoCardlessPro
|
|
|
45
53
|
"code: #{env.status}\n" \
|
|
46
54
|
"headers: #{env.response_headers}\n" \
|
|
47
55
|
"body: #{env.body}",
|
|
48
|
-
'code' => env.status
|
|
56
|
+
'code' => env.status,
|
|
49
57
|
}
|
|
50
58
|
end
|
|
51
59
|
|
|
@@ -8,6 +8,7 @@ module GoCardlessPro
|
|
|
8
8
|
def initialize(options = {})
|
|
9
9
|
@service = options.fetch(:service)
|
|
10
10
|
@options = options.fetch(:options)
|
|
11
|
+
@uri_params = options.reject { |k, _| %i[service options].include?(k) }
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
# Get a lazy enumerable for listing data from the API
|
|
@@ -22,7 +23,7 @@ module GoCardlessPro
|
|
|
22
23
|
|
|
23
24
|
@options[:params] ||= {}
|
|
24
25
|
@options[:params] = @options[:params].merge(after: after_cursor)
|
|
25
|
-
response = @service.list(@options.merge(after: after_cursor))
|
|
26
|
+
response = @service.list(*@uri_params.values, @options.merge(after: after_cursor))
|
|
26
27
|
end
|
|
27
28
|
end.lazy
|
|
28
29
|
end
|
|
@@ -30,7 +31,7 @@ module GoCardlessPro
|
|
|
30
31
|
private
|
|
31
32
|
|
|
32
33
|
def get_initial_response
|
|
33
|
-
@initial_response ||= @service.list(@options)
|
|
34
|
+
@initial_response ||= @service.list(*@uri_params.values, @options)
|
|
34
35
|
end
|
|
35
36
|
end
|
|
36
37
|
end
|
|
@@ -18,7 +18,10 @@ module GoCardlessPro
|
|
|
18
18
|
# likely won’t match what’s shown in the dashboard as the dashboard balances
|
|
19
19
|
# are updated much less frequently (once per day).
|
|
20
20
|
class Balance
|
|
21
|
-
attr_reader :amount
|
|
21
|
+
attr_reader :amount
|
|
22
|
+
attr_reader :balance_type
|
|
23
|
+
attr_reader :currency
|
|
24
|
+
attr_reader :last_updated_at
|
|
22
25
|
|
|
23
26
|
# Initialize a balance resource instance
|
|
24
27
|
# @param object [Hash] an object returned from the API
|
|
@@ -12,7 +12,11 @@ module GoCardlessPro
|
|
|
12
12
|
|
|
13
13
|
# Retrieve bank account details in JWE encrypted format
|
|
14
14
|
class BankAccountDetail
|
|
15
|
-
attr_reader :ciphertext
|
|
15
|
+
attr_reader :ciphertext
|
|
16
|
+
attr_reader :encrypted_key
|
|
17
|
+
attr_reader :iv
|
|
18
|
+
attr_reader :protected
|
|
19
|
+
attr_reader :tag
|
|
16
20
|
|
|
17
21
|
# Initialize a bank_account_detail resource instance
|
|
18
22
|
# @param object [Hash] an object returned from the API
|
|
@@ -0,0 +1,44 @@
|
|
|
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 bank_account_holder_verification resource returned from the API
|
|
12
|
+
|
|
13
|
+
# Create a bank account holder verification for a bank account.
|
|
14
|
+
class BankAccountHolderVerification
|
|
15
|
+
attr_reader :actual_account_name
|
|
16
|
+
attr_reader :id
|
|
17
|
+
attr_reader :result
|
|
18
|
+
attr_reader :status
|
|
19
|
+
attr_reader :type
|
|
20
|
+
|
|
21
|
+
# Initialize a bank_account_holder_verification resource instance
|
|
22
|
+
# @param object [Hash] an object returned from the API
|
|
23
|
+
def initialize(object, response = nil)
|
|
24
|
+
@object = object
|
|
25
|
+
|
|
26
|
+
@actual_account_name = object['actual_account_name']
|
|
27
|
+
@id = object['id']
|
|
28
|
+
@result = object['result']
|
|
29
|
+
@status = object['status']
|
|
30
|
+
@type = object['type']
|
|
31
|
+
@response = response
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def api_response
|
|
35
|
+
ApiResponse.new(@response)
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Provides the bank_account_holder_verification resource as a hash of all its readable attributes
|
|
39
|
+
def to_h
|
|
40
|
+
@object
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -21,8 +21,15 @@ 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
|
-
|
|
24
|
+
attr_reader :authorisation_type
|
|
25
|
+
attr_reader :authorised_at
|
|
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
|
|
26
33
|
|
|
27
34
|
# Initialize a bank_authorisation resource instance
|
|
28
35
|
# @param object [Hash] an object returned from the API
|
|
@@ -12,7 +12,9 @@ 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
|
|
15
|
+
attr_reader :available_debit_schemes
|
|
16
|
+
attr_reader :bank_name
|
|
17
|
+
attr_reader :bic
|
|
16
18
|
|
|
17
19
|
# Initialize a bank_details_lookup resource instance
|
|
18
20
|
# @param object [Hash] an object returned from the API
|
|
@@ -10,20 +10,32 @@ module GoCardlessPro
|
|
|
10
10
|
module Resources
|
|
11
11
|
# Represents an instance of a billing_request resource returned from the API
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
#
|
|
13
|
+
# Billing Requests help create resources that require input or action from a
|
|
14
|
+
# customer. An example of required input might be additional customer
|
|
15
15
|
# billing details, while an action would be asking a customer to authorise a
|
|
16
16
|
# payment using their mobile banking app.
|
|
17
17
|
#
|
|
18
|
-
# See
|
|
19
|
-
#
|
|
20
|
-
# for how-to's, explanations and tutorials.
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
# supported for ACH and PAD schemes.</p>
|
|
18
|
+
# See Billing Requests: Overview
|
|
19
|
+
# (https://developer.gocardless.com/getting-started/billing-requests/overview/)
|
|
20
|
+
# for how-to's, explanations and tutorials. Important: All properties
|
|
21
|
+
# associated with `subscription_request` and `instalment_schedule_request`
|
|
22
|
+
# are only supported for ACH and PAD schemes.
|
|
24
23
|
class BillingRequest
|
|
25
|
-
attr_reader :actions
|
|
26
|
-
|
|
24
|
+
attr_reader :actions
|
|
25
|
+
attr_reader :created_at
|
|
26
|
+
attr_reader :fallback_enabled
|
|
27
|
+
attr_reader :fallback_occurred
|
|
28
|
+
attr_reader :id
|
|
29
|
+
attr_reader :instalment_schedule_request
|
|
30
|
+
attr_reader :mandate_request
|
|
31
|
+
attr_reader :metadata
|
|
32
|
+
attr_reader :payment_context_code
|
|
33
|
+
attr_reader :payment_purpose_code
|
|
34
|
+
attr_reader :payment_request
|
|
35
|
+
attr_reader :purpose_code
|
|
36
|
+
attr_reader :resources
|
|
37
|
+
attr_reader :status
|
|
38
|
+
attr_reader :subscription_request
|
|
27
39
|
|
|
28
40
|
# Initialize a billing_request resource instance
|
|
29
41
|
# @param object [Hash] an object returned from the API
|
|
@@ -39,6 +51,8 @@ module GoCardlessPro
|
|
|
39
51
|
@links = object['links']
|
|
40
52
|
@mandate_request = object['mandate_request']
|
|
41
53
|
@metadata = object['metadata']
|
|
54
|
+
@payment_context_code = object['payment_context_code']
|
|
55
|
+
@payment_purpose_code = object['payment_purpose_code']
|
|
42
56
|
@payment_request = object['payment_request']
|
|
43
57
|
@purpose_code = object['purpose_code']
|
|
44
58
|
@resources = object['resources']
|
|
@@ -14,8 +14,24 @@ 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
|
-
|
|
17
|
+
attr_reader :authorisation_url
|
|
18
|
+
attr_reader :auto_fulfil
|
|
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
|
|
34
|
+
attr_reader :skip_success_screen
|
|
19
35
|
|
|
20
36
|
# Initialize a billing_request_flow resource instance
|
|
21
37
|
# @param object [Hash] an object returned from the API
|
|
@@ -26,8 +26,24 @@ 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
|
-
|
|
29
|
+
attr_reader :authorisation_url
|
|
30
|
+
attr_reader :created_at
|
|
31
|
+
attr_reader :id
|
|
32
|
+
attr_reader :mandate_request_constraints
|
|
33
|
+
attr_reader :mandate_request_currency
|
|
34
|
+
attr_reader :mandate_request_description
|
|
35
|
+
attr_reader :mandate_request_metadata
|
|
36
|
+
attr_reader :mandate_request_scheme
|
|
37
|
+
attr_reader :mandate_request_verify
|
|
38
|
+
attr_reader :metadata
|
|
39
|
+
attr_reader :name
|
|
40
|
+
attr_reader :payment_request_amount
|
|
41
|
+
attr_reader :payment_request_currency
|
|
42
|
+
attr_reader :payment_request_description
|
|
43
|
+
attr_reader :payment_request_metadata
|
|
44
|
+
attr_reader :payment_request_scheme
|
|
45
|
+
attr_reader :redirect_uri
|
|
46
|
+
attr_reader :updated_at
|
|
31
47
|
|
|
32
48
|
# Initialize a billing_request_template resource instance
|
|
33
49
|
# @param object [Hash] an object returned from the API
|
|
@@ -10,16 +10,17 @@ module GoCardlessPro
|
|
|
10
10
|
module Resources
|
|
11
11
|
# Represents an instance of a billing_request_with_action resource returned from the API
|
|
12
12
|
|
|
13
|
-
#
|
|
14
|
-
#
|
|
13
|
+
# Billing Requests help create resources that require input or action from a
|
|
14
|
+
# customer. An example of required input might be additional customer
|
|
15
15
|
# billing details, while an action would be asking a customer to authorise a
|
|
16
16
|
# payment using their mobile banking app.
|
|
17
17
|
#
|
|
18
|
-
# See
|
|
19
|
-
#
|
|
18
|
+
# See Billing Requests: Overview
|
|
19
|
+
# (https://developer.gocardless.com/getting-started/billing-requests/overview/)
|
|
20
20
|
# for how-to's, explanations and tutorials.
|
|
21
21
|
class BillingRequestWithAction
|
|
22
|
-
attr_reader :bank_authorisations
|
|
22
|
+
attr_reader :bank_authorisations
|
|
23
|
+
attr_reader :billing_requests
|
|
23
24
|
|
|
24
25
|
# Initialize a billing_request_with_action resource instance
|
|
25
26
|
# @param object [Hash] an object returned from the API
|
|
@@ -31,9 +31,9 @@ module GoCardlessPro
|
|
|
31
31
|
#
|
|
32
32
|
# Please note:
|
|
33
33
|
#
|
|
34
|
-
#
|
|
34
|
+
# - Payments and subscriptions cannot be created against a mandate in
|
|
35
35
|
# blocked state.
|
|
36
|
-
#
|
|
36
|
+
# - A mandate can never be transitioned out of the blocked state.
|
|
37
37
|
#
|
|
38
38
|
# The one exception to this is when blocking a 'bank_name'. This block will
|
|
39
39
|
# prevent bank
|
|
@@ -43,14 +43,18 @@ module GoCardlessPro
|
|
|
43
43
|
# this block. Please
|
|
44
44
|
# be aware that we cannot always match a bank account to a given bank name.
|
|
45
45
|
#
|
|
46
|
-
# <p class="notice">
|
|
47
46
|
# This API is currently only available for GoCardless Protect+ integrators
|
|
48
|
-
# - please
|
|
49
|
-
#
|
|
50
|
-
# </p>
|
|
47
|
+
# - please get in touch (mailto:help@gocardless.com) if you would like to
|
|
48
|
+
# use this API.
|
|
51
49
|
class Block
|
|
52
|
-
attr_reader :active
|
|
53
|
-
|
|
50
|
+
attr_reader :active
|
|
51
|
+
attr_reader :block_type
|
|
52
|
+
attr_reader :created_at
|
|
53
|
+
attr_reader :id
|
|
54
|
+
attr_reader :reason_description
|
|
55
|
+
attr_reader :reason_type
|
|
56
|
+
attr_reader :resource_reference
|
|
57
|
+
attr_reader :updated_at
|
|
54
58
|
|
|
55
59
|
# Initialize a block resource instance
|
|
56
60
|
# @param object [Hash] an object returned from the API
|
|
@@ -10,16 +10,36 @@ module GoCardlessPro
|
|
|
10
10
|
module Resources
|
|
11
11
|
# Represents an instance of a creditor resource returned from the API
|
|
12
12
|
|
|
13
|
-
# Each
|
|
14
|
-
#
|
|
15
|
-
#
|
|
16
|
-
#
|
|
13
|
+
# Each payment
|
|
14
|
+
# (https://developer.gocardless.com/api-reference/#core-endpoints-payments)
|
|
15
|
+
# taken through the API is linked to a "creditor", to whom the payment is
|
|
16
|
+
# then paid out. In most cases your organisation will have a single
|
|
17
|
+
# "creditor", but the API also supports collecting payments on behalf of
|
|
18
|
+
# others.
|
|
17
19
|
#
|
|
18
20
|
# Currently, for Anti Money Laundering reasons, any creditors you add must
|
|
19
21
|
# be directly related to your organisation.
|
|
20
22
|
class Creditor
|
|
21
|
-
attr_reader :address_line1
|
|
22
|
-
|
|
23
|
+
attr_reader :address_line1
|
|
24
|
+
attr_reader :address_line2
|
|
25
|
+
attr_reader :address_line3
|
|
26
|
+
attr_reader :bank_reference_prefix
|
|
27
|
+
attr_reader :can_create_refunds
|
|
28
|
+
attr_reader :city
|
|
29
|
+
attr_reader :country_code
|
|
30
|
+
attr_reader :created_at
|
|
31
|
+
attr_reader :creditor_type
|
|
32
|
+
attr_reader :custom_payment_pages_enabled
|
|
33
|
+
attr_reader :fx_payout_currency
|
|
34
|
+
attr_reader :id
|
|
35
|
+
attr_reader :logo_url
|
|
36
|
+
attr_reader :mandate_imports_enabled
|
|
37
|
+
attr_reader :merchant_responsible_for_notifications
|
|
38
|
+
attr_reader :name
|
|
39
|
+
attr_reader :postal_code
|
|
40
|
+
attr_reader :region
|
|
41
|
+
attr_reader :scheme_identifiers
|
|
42
|
+
attr_reader :verification_status
|
|
23
43
|
|
|
24
44
|
# Initialize a creditor resource instance
|
|
25
45
|
# @param object [Hash] an object returned from the API
|
|
@@ -10,9 +10,11 @@ module GoCardlessPro
|
|
|
10
10
|
module Resources
|
|
11
11
|
# Represents an instance of a creditor_bank_account resource returned from the API
|
|
12
12
|
|
|
13
|
-
# Creditor Bank Accounts hold the bank details of a
|
|
14
|
-
#
|
|
15
|
-
#
|
|
13
|
+
# Creditor Bank Accounts hold the bank details of a creditor
|
|
14
|
+
# (https://developer.gocardless.com/api-reference/#core-endpoints-creditors).
|
|
15
|
+
# These are the bank accounts which your payouts
|
|
16
|
+
# (https://developer.gocardless.com/api-reference/#core-endpoints-payouts)
|
|
17
|
+
# will be sent to.
|
|
16
18
|
#
|
|
17
19
|
# Note that creditor bank accounts must be unique, and so you will encounter
|
|
18
20
|
# a `bank_account_exists` error if you try to create a duplicate bank
|
|
@@ -20,11 +22,19 @@ module GoCardlessPro
|
|
|
20
22
|
# instead, the ID of which will be provided as
|
|
21
23
|
# `links[creditor_bank_account]` in the error response.
|
|
22
24
|
#
|
|
23
|
-
#
|
|
24
|
-
# available for partner integrations.</p>
|
|
25
|
+
# Restricted: This API is not available for partner integrations.
|
|
25
26
|
class CreditorBankAccount
|
|
26
|
-
attr_reader :account_holder_name
|
|
27
|
-
|
|
27
|
+
attr_reader :account_holder_name
|
|
28
|
+
attr_reader :account_number_ending
|
|
29
|
+
attr_reader :account_type
|
|
30
|
+
attr_reader :bank_name
|
|
31
|
+
attr_reader :country_code
|
|
32
|
+
attr_reader :created_at
|
|
33
|
+
attr_reader :currency
|
|
34
|
+
attr_reader :enabled
|
|
35
|
+
attr_reader :id
|
|
36
|
+
attr_reader :metadata
|
|
37
|
+
attr_reader :verification_status
|
|
28
38
|
|
|
29
39
|
# Initialize a creditor_bank_account resource instance
|
|
30
40
|
# @param object [Hash] an object returned from the API
|
|
@@ -12,7 +12,10 @@ module GoCardlessPro
|
|
|
12
12
|
|
|
13
13
|
# Currency exchange rates from our foreign exchange provider.
|
|
14
14
|
class CurrencyExchangeRate
|
|
15
|
-
attr_reader :rate
|
|
15
|
+
attr_reader :rate
|
|
16
|
+
attr_reader :source
|
|
17
|
+
attr_reader :target
|
|
18
|
+
attr_reader :time
|
|
16
19
|
|
|
17
20
|
# Initialize a currency_exchange_rate resource instance
|
|
18
21
|
# @param object [Hash] an object returned from the API
|
|
@@ -11,12 +11,29 @@ module GoCardlessPro
|
|
|
11
11
|
# Represents an instance of a customer resource returned from the API
|
|
12
12
|
|
|
13
13
|
# Customer objects hold the contact details for a customer. A customer can
|
|
14
|
-
# have several
|
|
15
|
-
#
|
|
16
|
-
# several Direct Debit
|
|
14
|
+
# have several customer bank accounts
|
|
15
|
+
# (https://developer.gocardless.com/api-reference/#core-endpoints-customer-bank-accounts),
|
|
16
|
+
# which in turn can have several Direct Debit mandates
|
|
17
|
+
# (https://developer.gocardless.com/api-reference/#core-endpoints-mandates).
|
|
17
18
|
class Customer
|
|
18
|
-
attr_reader :address_line1
|
|
19
|
-
|
|
19
|
+
attr_reader :address_line1
|
|
20
|
+
attr_reader :address_line2
|
|
21
|
+
attr_reader :address_line3
|
|
22
|
+
attr_reader :city
|
|
23
|
+
attr_reader :company_name
|
|
24
|
+
attr_reader :country_code
|
|
25
|
+
attr_reader :created_at
|
|
26
|
+
attr_reader :danish_identity_number
|
|
27
|
+
attr_reader :email
|
|
28
|
+
attr_reader :family_name
|
|
29
|
+
attr_reader :given_name
|
|
30
|
+
attr_reader :id
|
|
31
|
+
attr_reader :language
|
|
32
|
+
attr_reader :metadata
|
|
33
|
+
attr_reader :phone_number
|
|
34
|
+
attr_reader :postal_code
|
|
35
|
+
attr_reader :region
|
|
36
|
+
attr_reader :swedish_identity_number
|
|
20
37
|
|
|
21
38
|
# Initialize a customer resource instance
|
|
22
39
|
# @param object [Hash] an object returned from the API
|