gocardless_pro 2.45.0 → 2.46.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 +4 -4
- data/lib/gocardless_pro/client.rb +6 -1
- data/lib/gocardless_pro/resources/bank_authorisation.rb +2 -0
- data/lib/gocardless_pro/resources/creditor.rb +2 -0
- data/lib/gocardless_pro/resources/institution.rb +2 -2
- data/lib/gocardless_pro/resources/negative_balance_limit.rb +69 -0
- data/lib/gocardless_pro/resources/subscription.rb +0 -1
- data/lib/gocardless_pro/services/creditors_service.rb +0 -55
- data/lib/gocardless_pro/services/negative_balance_limits_service.rb +77 -0
- data/lib/gocardless_pro/services/scheme_identifiers_service.rb +1 -1
- 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: 48f0431f3dc2e7308c560e95cb938c975ce7d3dc6a731357975779e04c9fb724
|
4
|
+
data.tar.gz: 5efc3b834b594cb4ed1a8c8d0355537d69e55ca9a44c036810e5c07f0e7ae86a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5d8b6cacedabdf6658e7567f0b4b0cfd5687d7c25fee78d70bc124168f87dd7bdd035d36125378b6ecd797fc3025ec2f785397238d57457a5c0719c5d6d2cb6
|
7
|
+
data.tar.gz: 82df3b65a0f45cb0d067ba0f98794cd7a716d6aa5ce515b55a15124f8d9b88b94c4baf05eec3f41a1e2e1bce26e243a965f213b55db06a12a4f1cf02ec8680fc
|
@@ -98,6 +98,11 @@ module GoCardlessPro
|
|
98
98
|
@mandate_pdfs ||= Services::MandatePdfsService.new(@api_service)
|
99
99
|
end
|
100
100
|
|
101
|
+
# Access to the service for negative_balance_limit to make API calls
|
102
|
+
def negative_balance_limits
|
103
|
+
@negative_balance_limits ||= Services::NegativeBalanceLimitsService.new(@api_service)
|
104
|
+
end
|
105
|
+
|
101
106
|
# Access to the service for payer_authorisation to make API calls
|
102
107
|
def payer_authorisations
|
103
108
|
@payer_authorisations ||= Services::PayerAuthorisationsService.new(@api_service)
|
@@ -208,7 +213,7 @@ module GoCardlessPro
|
|
208
213
|
'User-Agent' => "#{user_agent}",
|
209
214
|
'Content-Type' => 'application/json',
|
210
215
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
211
|
-
'GoCardless-Client-Version' => '2.
|
216
|
+
'GoCardless-Client-Version' => '2.46.0',
|
212
217
|
},
|
213
218
|
}
|
214
219
|
end
|
@@ -27,6 +27,7 @@ module GoCardlessPro
|
|
27
27
|
attr_reader :expires_at
|
28
28
|
attr_reader :id
|
29
29
|
attr_reader :last_visited_at
|
30
|
+
attr_reader :qr_code_url
|
30
31
|
attr_reader :redirect_uri
|
31
32
|
attr_reader :url
|
32
33
|
|
@@ -42,6 +43,7 @@ module GoCardlessPro
|
|
42
43
|
@id = object['id']
|
43
44
|
@last_visited_at = object['last_visited_at']
|
44
45
|
@links = object['links']
|
46
|
+
@qr_code_url = object['qr_code_url']
|
45
47
|
@redirect_uri = object['redirect_uri']
|
46
48
|
@url = object['url']
|
47
49
|
@response = response
|
@@ -21,6 +21,7 @@ module GoCardlessPro
|
|
21
21
|
attr_reader :address_line1
|
22
22
|
attr_reader :address_line2
|
23
23
|
attr_reader :address_line3
|
24
|
+
attr_reader :bank_reference_prefix
|
24
25
|
attr_reader :can_create_refunds
|
25
26
|
attr_reader :city
|
26
27
|
attr_reader :country_code
|
@@ -46,6 +47,7 @@ module GoCardlessPro
|
|
46
47
|
@address_line1 = object['address_line1']
|
47
48
|
@address_line2 = object['address_line2']
|
48
49
|
@address_line3 = object['address_line3']
|
50
|
+
@bank_reference_prefix = object['bank_reference_prefix']
|
49
51
|
@can_create_refunds = object['can_create_refunds']
|
50
52
|
@city = object['city']
|
51
53
|
@country_code = object['country_code']
|
@@ -17,7 +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 :
|
20
|
+
attr_reader :autocompletes_collect_bank_account
|
21
21
|
attr_reader :country_code
|
22
22
|
attr_reader :icon_url
|
23
23
|
attr_reader :id
|
@@ -29,7 +29,7 @@ module GoCardlessPro
|
|
29
29
|
def initialize(object, response = nil)
|
30
30
|
@object = object
|
31
31
|
|
32
|
-
@
|
32
|
+
@autocompletes_collect_bank_account = object['autocompletes_collect_bank_account']
|
33
33
|
@country_code = object['country_code']
|
34
34
|
@icon_url = object['icon_url']
|
35
35
|
@id = object['id']
|
@@ -0,0 +1,69 @@
|
|
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 negative_balance_limit resource returned from the API
|
12
|
+
|
13
|
+
# The negative balance limit for a creditor. If the creditor would exceed
|
14
|
+
# this limit, we will not allow the creation of refunds.
|
15
|
+
class NegativeBalanceLimit
|
16
|
+
attr_reader :active
|
17
|
+
attr_reader :balance_limit
|
18
|
+
attr_reader :created_at
|
19
|
+
attr_reader :currency
|
20
|
+
attr_reader :id
|
21
|
+
attr_reader :reason
|
22
|
+
attr_reader :updated_at
|
23
|
+
|
24
|
+
# Initialize a negative_balance_limit resource instance
|
25
|
+
# @param object [Hash] an object returned from the API
|
26
|
+
def initialize(object, response = nil)
|
27
|
+
@object = object
|
28
|
+
|
29
|
+
@active = object['active']
|
30
|
+
@balance_limit = object['balance_limit']
|
31
|
+
@created_at = object['created_at']
|
32
|
+
@currency = object['currency']
|
33
|
+
@id = object['id']
|
34
|
+
@links = object['links']
|
35
|
+
@reason = object['reason']
|
36
|
+
@updated_at = object['updated_at']
|
37
|
+
@response = response
|
38
|
+
end
|
39
|
+
|
40
|
+
def api_response
|
41
|
+
ApiResponse.new(@response)
|
42
|
+
end
|
43
|
+
|
44
|
+
# Return the links that the resource has
|
45
|
+
def links
|
46
|
+
@negative_balance_limit_links ||= Links.new(@links)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Provides the negative_balance_limit resource as a hash of all its readable attributes
|
50
|
+
def to_h
|
51
|
+
@object
|
52
|
+
end
|
53
|
+
|
54
|
+
class Links
|
55
|
+
def initialize(links)
|
56
|
+
@links = links || {}
|
57
|
+
end
|
58
|
+
|
59
|
+
def creator_user
|
60
|
+
@links['creator_user']
|
61
|
+
end
|
62
|
+
|
63
|
+
def creditor
|
64
|
+
@links['creditor']
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
@@ -17,7 +17,6 @@ module GoCardlessPro
|
|
17
17
|
#
|
18
18
|
# The following rules apply when specifying recurrence:
|
19
19
|
#
|
20
|
-
# - The first payment must be charged within 1 year.
|
21
20
|
# - If `day_of_month` and `start_date` are not provided `start_date` will be
|
22
21
|
# the [mandate](#core-endpoints-mandates)'s `next_possible_charge_date` and
|
23
22
|
# the subscription will then recur based on the `interval` & `interval_unit`
|
@@ -117,61 +117,6 @@ module GoCardlessPro
|
|
117
117
|
Resources::Creditor.new(unenvelope_body(response.body), response)
|
118
118
|
end
|
119
119
|
|
120
|
-
# Applies a [scheme identifier](#core-endpoints-scheme-identifiers) to a
|
121
|
-
# creditor.
|
122
|
-
#
|
123
|
-
# If the scheme identifier has a `pending` status, it will be applied
|
124
|
-
# asynchronously
|
125
|
-
# once it becomes `active`.
|
126
|
-
#
|
127
|
-
# If the creditor already has a scheme identifier for the scheme, it will be
|
128
|
-
# replaced,
|
129
|
-
# and any mandates attached to it transferred asynchronously. On Bacs and SEPA,
|
130
|
-
# if
|
131
|
-
# payments were about to be submitted, they will be delayed. To minimise this
|
132
|
-
# delay, we
|
133
|
-
# recommend that you apply the new scheme identifier after the daily payment
|
134
|
-
# submission
|
135
|
-
# time (4 PM Europe/London time).
|
136
|
-
#
|
137
|
-
# Example URL: /creditors/:identity/actions/apply_scheme_identifier
|
138
|
-
#
|
139
|
-
# @param identity # Unique identifier, beginning with "CR".
|
140
|
-
# @param options [Hash] parameters as a hash, under a params key.
|
141
|
-
def apply_scheme_identifier(identity, options = {})
|
142
|
-
path = sub_url('/creditors/:identity/actions/apply_scheme_identifier', {
|
143
|
-
'identity' => identity,
|
144
|
-
})
|
145
|
-
|
146
|
-
params = options.delete(:params) || {}
|
147
|
-
options[:params] = {}
|
148
|
-
options[:params]['data'] = params
|
149
|
-
|
150
|
-
options[:retry_failures] = false
|
151
|
-
|
152
|
-
begin
|
153
|
-
response = make_request(:post, path, options)
|
154
|
-
|
155
|
-
# Response doesn't raise any errors until #body is called
|
156
|
-
response.tap(&:body)
|
157
|
-
rescue InvalidStateError => e
|
158
|
-
if e.idempotent_creation_conflict?
|
159
|
-
case @api_service.on_idempotency_conflict
|
160
|
-
when :raise
|
161
|
-
raise IdempotencyConflict, e.error
|
162
|
-
when :fetch
|
163
|
-
return get(e.conflicting_resource_id)
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
raise e
|
168
|
-
end
|
169
|
-
|
170
|
-
return if response.body.nil?
|
171
|
-
|
172
|
-
Resources::Creditor.new(unenvelope_body(response.body), response)
|
173
|
-
end
|
174
|
-
|
175
120
|
private
|
176
121
|
|
177
122
|
# Unenvelope the response of the body using the service's `envelope_key`
|
@@ -0,0 +1,77 @@
|
|
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 NegativeBalanceLimit endpoints
|
12
|
+
class NegativeBalanceLimitsService < BaseService
|
13
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of negative
|
14
|
+
# balance limits.
|
15
|
+
# Example URL: /negative_balance_limits
|
16
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
17
|
+
def list(options = {})
|
18
|
+
path = '/negative_balance_limits'
|
19
|
+
|
20
|
+
options[:retry_failures] = true
|
21
|
+
|
22
|
+
response = make_request(:get, path, options)
|
23
|
+
|
24
|
+
ListResponse.new(
|
25
|
+
response: response,
|
26
|
+
unenveloped_body: unenvelope_body(response.body),
|
27
|
+
resource_class: Resources::NegativeBalanceLimit
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Get a lazily enumerated list of all the items returned. This is similar to the `list` method but will paginate for you automatically.
|
32
|
+
#
|
33
|
+
# @param options [Hash] parameters as a hash. If the request is a GET, these will be converted to query parameters.
|
34
|
+
# Otherwise they will be the body of the request.
|
35
|
+
def all(options = {})
|
36
|
+
Paginator.new(
|
37
|
+
service: self,
|
38
|
+
options: options
|
39
|
+
).enumerator
|
40
|
+
end
|
41
|
+
|
42
|
+
# Creates a new negative balance limit, which also deactivates the existing
|
43
|
+
# limit (if present) for that currency and creditor combination.
|
44
|
+
# Example URL: /negative_balance_limits
|
45
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
46
|
+
def create(options = {})
|
47
|
+
path = '/negative_balance_limits'
|
48
|
+
|
49
|
+
params = options.delete(:params) || {}
|
50
|
+
options[:params] = {}
|
51
|
+
options[:params][envelope_key] = params
|
52
|
+
|
53
|
+
options[:retry_failures] = true
|
54
|
+
|
55
|
+
response = make_request(:post, path, options)
|
56
|
+
|
57
|
+
return if response.body.nil?
|
58
|
+
|
59
|
+
Resources::NegativeBalanceLimit.new(unenvelope_body(response.body), response)
|
60
|
+
end
|
61
|
+
|
62
|
+
private
|
63
|
+
|
64
|
+
# Unenvelope the response of the body using the service's `envelope_key`
|
65
|
+
#
|
66
|
+
# @param body [Hash]
|
67
|
+
def unenvelope_body(body)
|
68
|
+
body[envelope_key] || body['data']
|
69
|
+
end
|
70
|
+
|
71
|
+
# return the key which API responses will envelope data under
|
72
|
+
def envelope_key
|
73
|
+
'negative_balance_limits'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -33,7 +33,7 @@ module GoCardlessPro
|
|
33
33
|
# :-------------------------------------------------- |
|
34
34
|
# | `bacs` | 18 characters | `/` `.` `&` `-`
|
35
35
|
# |
|
36
|
-
# | `
|
36
|
+
# | `sepa` | 70 characters | `/` `?` `:` `(` `)` `.` `,` `+` `&`
|
37
37
|
# `<` `>` `'` `"` |
|
38
38
|
# | `ach` | 16 characters | `/` `?` `:` `(` `)` `.` `,` `'` `+`
|
39
39
|
# `-` |
|
data/lib/gocardless_pro.rb
CHANGED
@@ -96,6 +96,9 @@ require_relative 'gocardless_pro/services/mandate_import_entries_service'
|
|
96
96
|
require_relative 'gocardless_pro/resources/mandate_pdf'
|
97
97
|
require_relative 'gocardless_pro/services/mandate_pdfs_service'
|
98
98
|
|
99
|
+
require_relative 'gocardless_pro/resources/negative_balance_limit'
|
100
|
+
require_relative 'gocardless_pro/services/negative_balance_limits_service'
|
101
|
+
|
99
102
|
require_relative 'gocardless_pro/resources/payer_authorisation'
|
100
103
|
require_relative 'gocardless_pro/services/payer_authorisations_service'
|
101
104
|
|
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.
|
4
|
+
version: 2.46.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -131,6 +131,7 @@ files:
|
|
131
131
|
- lib/gocardless_pro/resources/mandate_import.rb
|
132
132
|
- lib/gocardless_pro/resources/mandate_import_entry.rb
|
133
133
|
- lib/gocardless_pro/resources/mandate_pdf.rb
|
134
|
+
- lib/gocardless_pro/resources/negative_balance_limit.rb
|
134
135
|
- lib/gocardless_pro/resources/payer_authorisation.rb
|
135
136
|
- lib/gocardless_pro/resources/payment.rb
|
136
137
|
- lib/gocardless_pro/resources/payout.rb
|
@@ -164,6 +165,7 @@ files:
|
|
164
165
|
- lib/gocardless_pro/services/mandate_imports_service.rb
|
165
166
|
- lib/gocardless_pro/services/mandate_pdfs_service.rb
|
166
167
|
- lib/gocardless_pro/services/mandates_service.rb
|
168
|
+
- lib/gocardless_pro/services/negative_balance_limits_service.rb
|
167
169
|
- lib/gocardless_pro/services/payer_authorisations_service.rb
|
168
170
|
- lib/gocardless_pro/services/payments_service.rb
|
169
171
|
- lib/gocardless_pro/services/payout_items_service.rb
|