gocardless_pro 2.55.0 → 2.57.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 +16 -1
- data/lib/gocardless_pro/resources/export.rb +44 -0
- data/lib/gocardless_pro/resources/logo.rb +38 -0
- data/lib/gocardless_pro/resources/payer_theme.rb +36 -0
- data/lib/gocardless_pro/resources/subscription.rb +2 -0
- data/lib/gocardless_pro/services/exports_service.rb +75 -0
- data/lib/gocardless_pro/services/logos_service.rb +53 -0
- data/lib/gocardless_pro/services/payer_themes_service.rb +49 -0
- data/lib/gocardless_pro/version.rb +1 -1
- data/lib/gocardless_pro.rb +9 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0a146b35e39aaaec207ce920824529baf883e1a47f145ca7925de250438aab9
|
4
|
+
data.tar.gz: 688023c522f8547e097e53ec3ef20fc11bf06d1d12a2149c97383d7bf6b3ead0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1fc013bde352a7494de64b4625e588825bd7a2411ad4cbed44f6b79d42751ef7add42013e6e4ef18e37c4d439fc3a16acdb749cb2286a90b486c5c3e41eee75
|
7
|
+
data.tar.gz: d97c7be78b0af2dd1d1d3f31265db04761055d2fd4cb16de12945cd28ba4c8ba66ed6471d7a014b5e8723e6ba7d4a3d5f23ab770c2a4fde8f823c4fbd00c8219
|
@@ -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)
|
@@ -78,6 +83,11 @@ module GoCardlessPro
|
|
78
83
|
@institutions ||= Services::InstitutionsService.new(@api_service)
|
79
84
|
end
|
80
85
|
|
86
|
+
# Access to the service for logo to make API calls
|
87
|
+
def logos
|
88
|
+
@logos ||= Services::LogosService.new(@api_service)
|
89
|
+
end
|
90
|
+
|
81
91
|
# Access to the service for mandate to make API calls
|
82
92
|
def mandates
|
83
93
|
@mandates ||= Services::MandatesService.new(@api_service)
|
@@ -108,6 +118,11 @@ module GoCardlessPro
|
|
108
118
|
@payer_authorisations ||= Services::PayerAuthorisationsService.new(@api_service)
|
109
119
|
end
|
110
120
|
|
121
|
+
# Access to the service for payer_theme to make API calls
|
122
|
+
def payer_themes
|
123
|
+
@payer_themes ||= Services::PayerThemesService.new(@api_service)
|
124
|
+
end
|
125
|
+
|
111
126
|
# Access to the service for payment to make API calls
|
112
127
|
def payments
|
113
128
|
@payments ||= Services::PaymentsService.new(@api_service)
|
@@ -218,7 +233,7 @@ module GoCardlessPro
|
|
218
233
|
'User-Agent' => "#{user_agent}",
|
219
234
|
'Content-Type' => 'application/json',
|
220
235
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
221
|
-
'GoCardless-Client-Version' => '2.
|
236
|
+
'GoCardless-Client-Version' => '2.57.0',
|
222
237
|
},
|
223
238
|
}
|
224
239
|
end
|
@@ -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 export resource returned from the API
|
12
|
+
|
13
|
+
# File-based exports of data
|
14
|
+
class Export
|
15
|
+
attr_reader :created_at
|
16
|
+
attr_reader :currency
|
17
|
+
attr_reader :download_url
|
18
|
+
attr_reader :export_type
|
19
|
+
attr_reader :id
|
20
|
+
|
21
|
+
# Initialize a export resource instance
|
22
|
+
# @param object [Hash] an object returned from the API
|
23
|
+
def initialize(object, response = nil)
|
24
|
+
@object = object
|
25
|
+
|
26
|
+
@created_at = object['created_at']
|
27
|
+
@currency = object['currency']
|
28
|
+
@download_url = object['download_url']
|
29
|
+
@export_type = object['export_type']
|
30
|
+
@id = object['id']
|
31
|
+
@response = response
|
32
|
+
end
|
33
|
+
|
34
|
+
def api_response
|
35
|
+
ApiResponse.new(@response)
|
36
|
+
end
|
37
|
+
|
38
|
+
# Provides the export resource as a hash of all its readable attributes
|
39
|
+
def to_h
|
40
|
+
@object
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -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
|
@@ -82,6 +82,7 @@ module GoCardlessPro
|
|
82
82
|
attr_reader :metadata
|
83
83
|
attr_reader :month
|
84
84
|
attr_reader :name
|
85
|
+
attr_reader :parent_plan_paused
|
85
86
|
attr_reader :payment_reference
|
86
87
|
attr_reader :retry_if_possible
|
87
88
|
attr_reader :start_date
|
@@ -108,6 +109,7 @@ module GoCardlessPro
|
|
108
109
|
@metadata = object['metadata']
|
109
110
|
@month = object['month']
|
110
111
|
@name = object['name']
|
112
|
+
@parent_plan_paused = object['parent_plan_paused']
|
111
113
|
@payment_reference = object['payment_reference']
|
112
114
|
@retry_if_possible = object['retry_if_possible']
|
113
115
|
@start_date = object['start_date']
|
@@ -0,0 +1,75 @@
|
|
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 Export endpoints
|
12
|
+
class ExportsService < BaseService
|
13
|
+
# Returns a single export.
|
14
|
+
# Example URL: /exports/:identity
|
15
|
+
#
|
16
|
+
# @param identity # Unique identifier, beginning with "EX".
|
17
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
18
|
+
def get(identity, options = {})
|
19
|
+
path = sub_url('/exports/:identity', {
|
20
|
+
'identity' => identity,
|
21
|
+
})
|
22
|
+
|
23
|
+
options[:retry_failures] = true
|
24
|
+
|
25
|
+
response = make_request(:get, path, options)
|
26
|
+
|
27
|
+
return if response.body.nil?
|
28
|
+
|
29
|
+
Resources::Export.new(unenvelope_body(response.body), response)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns a list of exports which are available for download.
|
33
|
+
# Example URL: /exports
|
34
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
35
|
+
def list(options = {})
|
36
|
+
path = '/exports'
|
37
|
+
|
38
|
+
options[:retry_failures] = true
|
39
|
+
|
40
|
+
response = make_request(:get, path, options)
|
41
|
+
|
42
|
+
ListResponse.new(
|
43
|
+
response: response,
|
44
|
+
unenveloped_body: unenvelope_body(response.body),
|
45
|
+
resource_class: Resources::Export
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Get a lazily enumerated list of all the items returned. This is similar to the `list` method but will paginate for you automatically.
|
50
|
+
#
|
51
|
+
# @param options [Hash] parameters as a hash. If the request is a GET, these will be converted to query parameters.
|
52
|
+
# Otherwise they will be the body of the request.
|
53
|
+
def all(options = {})
|
54
|
+
Paginator.new(
|
55
|
+
service: self,
|
56
|
+
options: options
|
57
|
+
).enumerator
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
|
62
|
+
# Unenvelope the response of the body using the service's `envelope_key`
|
63
|
+
#
|
64
|
+
# @param body [Hash]
|
65
|
+
def unenvelope_body(body)
|
66
|
+
body[envelope_key] || body['data']
|
67
|
+
end
|
68
|
+
|
69
|
+
# return the key which API responses will envelope data under
|
70
|
+
def envelope_key
|
71
|
+
'exports'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,53 @@
|
|
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
|
+
#
|
16
|
+
# We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px
|
17
|
+
# by 40px. For more guidance on how to upload logos that will look
|
18
|
+
# great across your customer payment page and notification emails see
|
19
|
+
# [here](https://developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo).
|
20
|
+
# Example URL: /branding/logos
|
21
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
22
|
+
def create_for_creditor(options = {})
|
23
|
+
path = '/branding/logos'
|
24
|
+
|
25
|
+
params = options.delete(:params) || {}
|
26
|
+
options[:params] = {}
|
27
|
+
options[:params][envelope_key] = params
|
28
|
+
|
29
|
+
options[:retry_failures] = true
|
30
|
+
|
31
|
+
response = make_request(:post, path, options)
|
32
|
+
|
33
|
+
return if response.body.nil?
|
34
|
+
|
35
|
+
Resources::Logo.new(unenvelope_body(response.body), response)
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
# Unenvelope the response of the body using the service's `envelope_key`
|
41
|
+
#
|
42
|
+
# @param body [Hash]
|
43
|
+
def unenvelope_body(body)
|
44
|
+
body[envelope_key] || body['data']
|
45
|
+
end
|
46
|
+
|
47
|
+
# return the key which API responses will envelope data under
|
48
|
+
def envelope_key
|
49
|
+
'logos'
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
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
|
data/lib/gocardless_pro.rb
CHANGED
@@ -78,12 +78,18 @@ require_relative 'gocardless_pro/services/customer_notifications_service'
|
|
78
78
|
require_relative 'gocardless_pro/resources/event'
|
79
79
|
require_relative 'gocardless_pro/services/events_service'
|
80
80
|
|
81
|
+
require_relative 'gocardless_pro/resources/export'
|
82
|
+
require_relative 'gocardless_pro/services/exports_service'
|
83
|
+
|
81
84
|
require_relative 'gocardless_pro/resources/instalment_schedule'
|
82
85
|
require_relative 'gocardless_pro/services/instalment_schedules_service'
|
83
86
|
|
84
87
|
require_relative 'gocardless_pro/resources/institution'
|
85
88
|
require_relative 'gocardless_pro/services/institutions_service'
|
86
89
|
|
90
|
+
require_relative 'gocardless_pro/resources/logo'
|
91
|
+
require_relative 'gocardless_pro/services/logos_service'
|
92
|
+
|
87
93
|
require_relative 'gocardless_pro/resources/mandate'
|
88
94
|
require_relative 'gocardless_pro/services/mandates_service'
|
89
95
|
|
@@ -102,6 +108,9 @@ require_relative 'gocardless_pro/services/negative_balance_limits_service'
|
|
102
108
|
require_relative 'gocardless_pro/resources/payer_authorisation'
|
103
109
|
require_relative 'gocardless_pro/services/payer_authorisations_service'
|
104
110
|
|
111
|
+
require_relative 'gocardless_pro/resources/payer_theme'
|
112
|
+
require_relative 'gocardless_pro/services/payer_themes_service'
|
113
|
+
|
105
114
|
require_relative 'gocardless_pro/resources/payment'
|
106
115
|
require_relative 'gocardless_pro/services/payments_service'
|
107
116
|
|
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.57.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-05
|
11
|
+
date: 2024-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -125,14 +125,17 @@ files:
|
|
125
125
|
- lib/gocardless_pro/resources/customer_bank_account.rb
|
126
126
|
- lib/gocardless_pro/resources/customer_notification.rb
|
127
127
|
- lib/gocardless_pro/resources/event.rb
|
128
|
+
- lib/gocardless_pro/resources/export.rb
|
128
129
|
- lib/gocardless_pro/resources/instalment_schedule.rb
|
129
130
|
- lib/gocardless_pro/resources/institution.rb
|
131
|
+
- lib/gocardless_pro/resources/logo.rb
|
130
132
|
- lib/gocardless_pro/resources/mandate.rb
|
131
133
|
- lib/gocardless_pro/resources/mandate_import.rb
|
132
134
|
- lib/gocardless_pro/resources/mandate_import_entry.rb
|
133
135
|
- lib/gocardless_pro/resources/mandate_pdf.rb
|
134
136
|
- lib/gocardless_pro/resources/negative_balance_limit.rb
|
135
137
|
- lib/gocardless_pro/resources/payer_authorisation.rb
|
138
|
+
- lib/gocardless_pro/resources/payer_theme.rb
|
136
139
|
- lib/gocardless_pro/resources/payment.rb
|
137
140
|
- lib/gocardless_pro/resources/payout.rb
|
138
141
|
- lib/gocardless_pro/resources/payout_item.rb
|
@@ -160,14 +163,17 @@ files:
|
|
160
163
|
- lib/gocardless_pro/services/customer_notifications_service.rb
|
161
164
|
- lib/gocardless_pro/services/customers_service.rb
|
162
165
|
- lib/gocardless_pro/services/events_service.rb
|
166
|
+
- lib/gocardless_pro/services/exports_service.rb
|
163
167
|
- lib/gocardless_pro/services/instalment_schedules_service.rb
|
164
168
|
- lib/gocardless_pro/services/institutions_service.rb
|
169
|
+
- lib/gocardless_pro/services/logos_service.rb
|
165
170
|
- lib/gocardless_pro/services/mandate_import_entries_service.rb
|
166
171
|
- lib/gocardless_pro/services/mandate_imports_service.rb
|
167
172
|
- lib/gocardless_pro/services/mandate_pdfs_service.rb
|
168
173
|
- lib/gocardless_pro/services/mandates_service.rb
|
169
174
|
- lib/gocardless_pro/services/negative_balance_limits_service.rb
|
170
175
|
- lib/gocardless_pro/services/payer_authorisations_service.rb
|
176
|
+
- lib/gocardless_pro/services/payer_themes_service.rb
|
171
177
|
- lib/gocardless_pro/services/payments_service.rb
|
172
178
|
- lib/gocardless_pro/services/payout_items_service.rb
|
173
179
|
- lib/gocardless_pro/services/payouts_service.rb
|