gocardless_pro 2.54.0 → 2.56.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0785e0ba3bd331adfc4a66689db74d9002d3ef91b1167300cdd3dd6868f645aa'
4
- data.tar.gz: a9627b7713acc48be5544ac07548557cba21c816c8de681355b1b0a71e92b73a
3
+ metadata.gz: 2ff9a9f0905147eeb174b5e7d4ce029edc6f3b623525b8a23c18bed65964f95a
4
+ data.tar.gz: 9a8252e55308ecf44bd9b4c20dde80b34020dc1593ff56beb2301c0c34ac253f
5
5
  SHA512:
6
- metadata.gz: c65cf5d68e95ad31daed9bb9c0e887c04632869fed3731c48f724099f2febd024a06415fee1f16f216d56475dbd55afb92ef1c08e0a54dc1d951d5c8d2398e1b
7
- data.tar.gz: 3ce5ba13536d9f71947daf1998b60f21838a9438348c64215929737f66bbb956141e947ce048c1ca2b95e6ac19427c4824b8e7769e2b4dd3013f0dae970b2694
6
+ metadata.gz: b66fc420814c249b1f18280d9700c2dbd4f3953e2860f6a046c308e2ce11657ba9bcffed50d2925845a0f51996aa49d026b9d1ec1d51a6bcf8033b49bc187478
7
+ data.tar.gz: 7c4d56b3e7230598cfb3b2668c99e157fd168dbbcc60722dcbbaa87b2a807e54a791dbcaeb0d73a2cf9996ae3b64074cd27feaf438a990c8d83ba484c5378250
@@ -78,6 +78,11 @@ module GoCardlessPro
78
78
  @institutions ||= Services::InstitutionsService.new(@api_service)
79
79
  end
80
80
 
81
+ # Access to the service for logo to make API calls
82
+ def logos
83
+ @logos ||= Services::LogosService.new(@api_service)
84
+ end
85
+
81
86
  # Access to the service for mandate to make API calls
82
87
  def mandates
83
88
  @mandates ||= Services::MandatesService.new(@api_service)
@@ -108,6 +113,11 @@ module GoCardlessPro
108
113
  @payer_authorisations ||= Services::PayerAuthorisationsService.new(@api_service)
109
114
  end
110
115
 
116
+ # Access to the service for payer_theme to make API calls
117
+ def payer_themes
118
+ @payer_themes ||= Services::PayerThemesService.new(@api_service)
119
+ end
120
+
111
121
  # Access to the service for payment to make API calls
112
122
  def payments
113
123
  @payments ||= Services::PaymentsService.new(@api_service)
@@ -218,7 +228,7 @@ module GoCardlessPro
218
228
  'User-Agent' => "#{user_agent}",
219
229
  'Content-Type' => 'application/json',
220
230
  'GoCardless-Client-Library' => 'gocardless-pro-ruby',
221
- 'GoCardless-Client-Version' => '2.54.0',
231
+ 'GoCardless-Client-Version' => '2.56.0',
222
232
  },
223
233
  }
224
234
  end
@@ -3,9 +3,12 @@ module GoCardlessPro
3
3
  class RaiseGoCardlessErrors < Faraday::Middleware
4
4
  API_ERROR_STATUSES = 501..599
5
5
  CLIENT_ERROR_STATUSES = 400..500
6
+ API_STATUS_NO_CONTENT = 204
6
7
 
7
8
  def on_complete(env)
8
- raise ApiError, generate_error_data(env) if !json?(env) || API_ERROR_STATUSES.include?(env.status)
9
+ if !(env.status == API_STATUS_NO_CONTENT || json?(env)) || API_ERROR_STATUSES.include?(env.status)
10
+ raise ApiError, generate_error_data(env)
11
+ end
9
12
 
10
13
  return unless CLIENT_ERROR_STATUSES.include?(env.status)
11
14
 
@@ -0,0 +1,38 @@
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 logo resource returned from the API
12
+
13
+ # Logos are image uploads that, when associated with a creditor, are shown
14
+ # on the [billing request flow](#billing-requests-billing-request-flows)
15
+ # payment pages.
16
+ class Logo
17
+ attr_reader :id
18
+
19
+ # Initialize a logo resource instance
20
+ # @param object [Hash] an object returned from the API
21
+ def initialize(object, response = nil)
22
+ @object = object
23
+
24
+ @id = object['id']
25
+ @response = response
26
+ end
27
+
28
+ def api_response
29
+ ApiResponse.new(@response)
30
+ end
31
+
32
+ # Provides the logo resource as a hash of all its readable attributes
33
+ def to_h
34
+ @object
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,36 @@
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 payer_theme resource returned from the API
12
+
13
+ # Custom colour themes for payment pages and customer notifications.
14
+ class PayerTheme
15
+ attr_reader :id
16
+
17
+ # Initialize a payer_theme resource instance
18
+ # @param object [Hash] an object returned from the API
19
+ def initialize(object, response = nil)
20
+ @object = object
21
+
22
+ @id = object['id']
23
+ @response = response
24
+ end
25
+
26
+ def api_response
27
+ ApiResponse.new(@response)
28
+ end
29
+
30
+ # Provides the payer_theme resource as a hash of all its readable attributes
31
+ def to_h
32
+ @object
33
+ end
34
+ end
35
+ end
36
+ end
@@ -67,7 +67,6 @@ module GoCardlessPro
67
67
  # last working day of the month).
68
68
  # - otherwise the charge date will be rolled __forwards__ to the next
69
69
  # business day.
70
- #
71
70
  class Subscription
72
71
  attr_reader :amount
73
72
  attr_reader :app_fee
@@ -13,6 +13,12 @@ module GoCardlessPro
13
13
  # Performs a bank details lookup. As part of the lookup, a modulus check and
14
14
  # reachability check are performed.
15
15
  #
16
+ # For UK-based bank accounts, where an account holder name is provided (and an
17
+ # account number, a sort code or an iban
18
+ # are already present), we verify that the account holder name and bank account
19
+ # number match the details held by
20
+ # the relevant bank.
21
+ #
16
22
  # If your request returns an [error](#api-usage-errors) or the
17
23
  # `available_debit_schemes`
18
24
  # attribute is an empty array, you will not be able to collect payments from the
@@ -110,6 +110,12 @@ module GoCardlessPro
110
110
  # Direct Debit. If a bank account is discovered to be closed or invalid, the
111
111
  # customer is requested to adjust the account number/routing number and
112
112
  # succeed in this check to continue with the flow.
113
+ #
114
+ # _BACS scheme_ [Payer Name
115
+ # Verification](https://hub.gocardless.com/s/article/Introduction-to-Payer-Name-Verification?language=en_GB)
116
+ # is enabled by default for UK based bank accounts, meaning we verify the
117
+ # account holder name and bank account
118
+ # number match the details held by the relevant bank.
113
119
  # Example URL: /billing_requests/:identity/actions/collect_bank_account
114
120
  #
115
121
  # @param identity # Unique identifier, beginning with "BRQ".
@@ -0,0 +1,48 @@
1
+ require_relative './base_service'
2
+
3
+ # encoding: utf-8
4
+ #
5
+ # This client is automatically generated from a template and JSON schema definition.
6
+ # See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
7
+ #
8
+
9
+ module GoCardlessPro
10
+ module Services
11
+ # Service for making requests to the Logo endpoints
12
+ class LogosService < BaseService
13
+ # Creates a new logo associated with a creditor. If a creditor already has a
14
+ # logo, this will update the existing logo linked to the creditor.
15
+ # Example URL: /branding/logos
16
+ # @param options [Hash] parameters as a hash, under a params key.
17
+ def create_for_creditor(options = {})
18
+ path = '/branding/logos'
19
+
20
+ params = options.delete(:params) || {}
21
+ options[:params] = {}
22
+ options[:params][envelope_key] = params
23
+
24
+ options[:retry_failures] = true
25
+
26
+ response = make_request(:post, path, options)
27
+
28
+ return if response.body.nil?
29
+
30
+ Resources::Logo.new(unenvelope_body(response.body), response)
31
+ end
32
+
33
+ private
34
+
35
+ # Unenvelope the response of the body using the service's `envelope_key`
36
+ #
37
+ # @param body [Hash]
38
+ def unenvelope_body(body)
39
+ body[envelope_key] || body['data']
40
+ end
41
+
42
+ # return the key which API responses will envelope data under
43
+ def envelope_key
44
+ 'logos'
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,49 @@
1
+ require_relative './base_service'
2
+
3
+ # encoding: utf-8
4
+ #
5
+ # This client is automatically generated from a template and JSON schema definition.
6
+ # See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
7
+ #
8
+
9
+ module GoCardlessPro
10
+ module Services
11
+ # Service for making requests to the PayerTheme endpoints
12
+ class PayerThemesService < BaseService
13
+ # Creates a new payer theme associated with a creditor. If a creditor already
14
+ # has payer themes, this will update the existing payer theme linked to the
15
+ # creditor.
16
+ # Example URL: /branding/payer_themes
17
+ # @param options [Hash] parameters as a hash, under a params key.
18
+ def create_for_creditor(options = {})
19
+ path = '/branding/payer_themes'
20
+
21
+ params = options.delete(:params) || {}
22
+ options[:params] = {}
23
+ options[:params][envelope_key] = params
24
+
25
+ options[:retry_failures] = true
26
+
27
+ response = make_request(:post, path, options)
28
+
29
+ return if response.body.nil?
30
+
31
+ Resources::PayerTheme.new(unenvelope_body(response.body), response)
32
+ end
33
+
34
+ private
35
+
36
+ # Unenvelope the response of the body using the service's `envelope_key`
37
+ #
38
+ # @param body [Hash]
39
+ def unenvelope_body(body)
40
+ body[envelope_key] || body['data']
41
+ end
42
+
43
+ # return the key which API responses will envelope data under
44
+ def envelope_key
45
+ 'payer_themes'
46
+ end
47
+ end
48
+ end
49
+ end
@@ -180,7 +180,6 @@ module GoCardlessPro
180
180
  #
181
181
  # - `pause_cycles_must_be_greater_than_or_equal_to` if the provided value for
182
182
  # `pause_cycles` cannot be satisfied.
183
- #
184
183
  # Example URL: /subscriptions/:identity/actions/pause
185
184
  #
186
185
  # @param identity # Unique identifier, beginning with "SB".
@@ -3,5 +3,5 @@ end
3
3
 
4
4
  module GoCardlessPro
5
5
  # Current version of the GC gem
6
- VERSION = '2.54.0'
6
+ VERSION = '2.56.0'
7
7
  end
@@ -84,6 +84,9 @@ require_relative 'gocardless_pro/services/instalment_schedules_service'
84
84
  require_relative 'gocardless_pro/resources/institution'
85
85
  require_relative 'gocardless_pro/services/institutions_service'
86
86
 
87
+ require_relative 'gocardless_pro/resources/logo'
88
+ require_relative 'gocardless_pro/services/logos_service'
89
+
87
90
  require_relative 'gocardless_pro/resources/mandate'
88
91
  require_relative 'gocardless_pro/services/mandates_service'
89
92
 
@@ -102,6 +105,9 @@ require_relative 'gocardless_pro/services/negative_balance_limits_service'
102
105
  require_relative 'gocardless_pro/resources/payer_authorisation'
103
106
  require_relative 'gocardless_pro/services/payer_authorisations_service'
104
107
 
108
+ require_relative 'gocardless_pro/resources/payer_theme'
109
+ require_relative 'gocardless_pro/services/payer_themes_service'
110
+
105
111
  require_relative 'gocardless_pro/resources/payment'
106
112
  require_relative 'gocardless_pro/services/payments_service'
107
113
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gocardless_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.54.0
4
+ version: 2.56.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GoCardless
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-18 00:00:00.000000000 Z
11
+ date: 2024-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -127,12 +127,14 @@ files:
127
127
  - lib/gocardless_pro/resources/event.rb
128
128
  - lib/gocardless_pro/resources/instalment_schedule.rb
129
129
  - lib/gocardless_pro/resources/institution.rb
130
+ - lib/gocardless_pro/resources/logo.rb
130
131
  - lib/gocardless_pro/resources/mandate.rb
131
132
  - lib/gocardless_pro/resources/mandate_import.rb
132
133
  - lib/gocardless_pro/resources/mandate_import_entry.rb
133
134
  - lib/gocardless_pro/resources/mandate_pdf.rb
134
135
  - lib/gocardless_pro/resources/negative_balance_limit.rb
135
136
  - lib/gocardless_pro/resources/payer_authorisation.rb
137
+ - lib/gocardless_pro/resources/payer_theme.rb
136
138
  - lib/gocardless_pro/resources/payment.rb
137
139
  - lib/gocardless_pro/resources/payout.rb
138
140
  - lib/gocardless_pro/resources/payout_item.rb
@@ -162,12 +164,14 @@ files:
162
164
  - lib/gocardless_pro/services/events_service.rb
163
165
  - lib/gocardless_pro/services/instalment_schedules_service.rb
164
166
  - lib/gocardless_pro/services/institutions_service.rb
167
+ - lib/gocardless_pro/services/logos_service.rb
165
168
  - lib/gocardless_pro/services/mandate_import_entries_service.rb
166
169
  - lib/gocardless_pro/services/mandate_imports_service.rb
167
170
  - lib/gocardless_pro/services/mandate_pdfs_service.rb
168
171
  - lib/gocardless_pro/services/mandates_service.rb
169
172
  - lib/gocardless_pro/services/negative_balance_limits_service.rb
170
173
  - lib/gocardless_pro/services/payer_authorisations_service.rb
174
+ - lib/gocardless_pro/services/payer_themes_service.rb
171
175
  - lib/gocardless_pro/services/payments_service.rb
172
176
  - lib/gocardless_pro/services/payout_items_service.rb
173
177
  - lib/gocardless_pro/services/payouts_service.rb
@@ -201,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
205
  - !ruby/object:Gem::Version
202
206
  version: '0'
203
207
  requirements: []
204
- rubygems_version: 3.4.10
208
+ rubygems_version: 3.4.19
205
209
  signing_key:
206
210
  specification_version: 4
207
211
  summary: A gem for calling the GoCardless Pro API