gocardless_pro 2.49.0 → 2.51.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/billing_request.rb +4 -0
- data/lib/gocardless_pro/resources/billing_request_flow.rb +2 -0
- data/lib/gocardless_pro/resources/billing_request_template.rb +15 -1
- data/lib/gocardless_pro/resources/creditor_bank_account.rb +2 -0
- data/lib/gocardless_pro/resources/transferred_mandate.rb +60 -0
- data/lib/gocardless_pro/services/billing_requests_service.rb +4 -0
- data/lib/gocardless_pro/services/transferred_mandates_service.rb +48 -0
- 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: 3d1328075d0ff385462311f7794d0c3d8e7ffec62bb63f0f7909bf98b0bdd057
|
4
|
+
data.tar.gz: 39d4d8f486b7b34abe93ed4e6324031d3125d36939c4de5a0eb612b588d2ed3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9f1a58f1003b8e7853ad534f35778ea7da9f0be28508f6a1d3ccf38d46a1d06640f6322233f2b3c5a47946b8189ced7d8ac4ae5c3e121a2922fa9961c585372
|
7
|
+
data.tar.gz: 1109ba23c7de3b637a92faeaf4ec438b060bad7541047ad512186bfa4b8043bf56b7d219094b7942974be1425519c4a4139109f6f7376b3db0d5b4db13d4e6fd
|
@@ -153,6 +153,11 @@ module GoCardlessPro
|
|
153
153
|
@tax_rates ||= Services::TaxRatesService.new(@api_service)
|
154
154
|
end
|
155
155
|
|
156
|
+
# Access to the service for transferred_mandate to make API calls
|
157
|
+
def transferred_mandates
|
158
|
+
@transferred_mandates ||= Services::TransferredMandatesService.new(@api_service)
|
159
|
+
end
|
160
|
+
|
156
161
|
# Access to the service for verification_detail to make API calls
|
157
162
|
def verification_details
|
158
163
|
@verification_details ||= Services::VerificationDetailsService.new(@api_service)
|
@@ -213,7 +218,7 @@ module GoCardlessPro
|
|
213
218
|
'User-Agent' => "#{user_agent}",
|
214
219
|
'Content-Type' => 'application/json',
|
215
220
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
216
|
-
'GoCardless-Client-Version' => '2.
|
221
|
+
'GoCardless-Client-Version' => '2.51.0',
|
217
222
|
},
|
218
223
|
}
|
219
224
|
end
|
@@ -17,6 +17,7 @@ module GoCardlessPro
|
|
17
17
|
attr_reader :authorisation_url
|
18
18
|
attr_reader :auto_fulfil
|
19
19
|
attr_reader :created_at
|
20
|
+
attr_reader :customer_details_captured
|
20
21
|
attr_reader :exit_uri
|
21
22
|
attr_reader :expires_at
|
22
23
|
attr_reader :id
|
@@ -39,6 +40,7 @@ module GoCardlessPro
|
|
39
40
|
@authorisation_url = object['authorisation_url']
|
40
41
|
@auto_fulfil = object['auto_fulfil']
|
41
42
|
@created_at = object['created_at']
|
43
|
+
@customer_details_captured = object['customer_details_captured']
|
42
44
|
@exit_uri = object['exit_uri']
|
43
45
|
@expires_at = object['expires_at']
|
44
46
|
@id = object['id']
|
@@ -10,7 +10,21 @@ module GoCardlessPro
|
|
10
10
|
module Resources
|
11
11
|
# Represents an instance of a billing_request_template resource returned from the API
|
12
12
|
|
13
|
-
# Billing Request Templates
|
13
|
+
# Billing Request Templates are reusable templates that result in
|
14
|
+
# numerous Billing Requests with similar attributes. They provide
|
15
|
+
# a no-code solution for generating various types of multi-user payment
|
16
|
+
# links.
|
17
|
+
#
|
18
|
+
# Each template includes a reusable URL that can be embedded in a website
|
19
|
+
# or shared with customers via email. Every time the URL is opened,
|
20
|
+
# it generates a new Billing Request.
|
21
|
+
#
|
22
|
+
# Billing Request Templates overcome the key limitation of the Billing
|
23
|
+
# Request:
|
24
|
+
# a Billing Request cannot be shared among multiple users because it is
|
25
|
+
# intended
|
26
|
+
# for single-use and is designed to cater to the unique needs of individual
|
27
|
+
# customers.
|
14
28
|
class BillingRequestTemplate
|
15
29
|
attr_reader :authorisation_url
|
16
30
|
attr_reader :created_at
|
@@ -33,6 +33,7 @@ module GoCardlessPro
|
|
33
33
|
attr_reader :enabled
|
34
34
|
attr_reader :id
|
35
35
|
attr_reader :metadata
|
36
|
+
attr_reader :verification_status
|
36
37
|
|
37
38
|
# Initialize a creditor_bank_account resource instance
|
38
39
|
# @param object [Hash] an object returned from the API
|
@@ -50,6 +51,7 @@ module GoCardlessPro
|
|
50
51
|
@id = object['id']
|
51
52
|
@links = object['links']
|
52
53
|
@metadata = object['metadata']
|
54
|
+
@verification_status = object['verification_status']
|
53
55
|
@response = response
|
54
56
|
end
|
55
57
|
|
@@ -0,0 +1,60 @@
|
|
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 transferred_mandate resource returned from the API
|
12
|
+
|
13
|
+
# Mandates that have been transferred using Current Account Switch Service
|
14
|
+
class TransferredMandate
|
15
|
+
attr_reader :encrypted_data
|
16
|
+
attr_reader :key
|
17
|
+
attr_reader :kid
|
18
|
+
|
19
|
+
# Initialize a transferred_mandate resource instance
|
20
|
+
# @param object [Hash] an object returned from the API
|
21
|
+
def initialize(object, response = nil)
|
22
|
+
@object = object
|
23
|
+
|
24
|
+
@encrypted_data = object['encrypted_data']
|
25
|
+
@key = object['key']
|
26
|
+
@kid = object['kid']
|
27
|
+
@links = object['links']
|
28
|
+
@response = response
|
29
|
+
end
|
30
|
+
|
31
|
+
def api_response
|
32
|
+
ApiResponse.new(@response)
|
33
|
+
end
|
34
|
+
|
35
|
+
# Return the links that the resource has
|
36
|
+
def links
|
37
|
+
@transferred_mandate_links ||= Links.new(@links)
|
38
|
+
end
|
39
|
+
|
40
|
+
# Provides the transferred_mandate resource as a hash of all its readable attributes
|
41
|
+
def to_h
|
42
|
+
@object
|
43
|
+
end
|
44
|
+
|
45
|
+
class Links
|
46
|
+
def initialize(links)
|
47
|
+
@links = links || {}
|
48
|
+
end
|
49
|
+
|
50
|
+
def customer_bank_account
|
51
|
+
@links['customer_bank_account']
|
52
|
+
end
|
53
|
+
|
54
|
+
def mandate
|
55
|
+
@links['mandate']
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -101,6 +101,10 @@ module GoCardlessPro
|
|
101
101
|
# the bank account is valid for the billing request scheme before creating
|
102
102
|
# and attaching it.
|
103
103
|
#
|
104
|
+
# If the scheme is PayTo and the pay_id is available, this can be included in
|
105
|
+
# the payload along with the
|
106
|
+
# country_code.
|
107
|
+
#
|
104
108
|
# _ACH scheme_ For compliance reasons, an extra validation step is done using
|
105
109
|
# a third-party provider to make sure the customer's bank account can accept
|
106
110
|
# Direct Debit. If a bank account is discovered to be closed or invalid, the
|
@@ -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 TransferredMandate endpoints
|
12
|
+
class TransferredMandatesService < BaseService
|
13
|
+
# Returns encrypted bank details for the transferred mandate
|
14
|
+
# Example URL: /transferred_mandate/:identity
|
15
|
+
#
|
16
|
+
# @param identity # Unique identifier, beginning with "MD". Note that this prefix may not
|
17
|
+
# apply to mandates created before 2016.
|
18
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
19
|
+
def transferred_mandates(identity, options = {})
|
20
|
+
path = sub_url('/transferred_mandate/:identity', {
|
21
|
+
'identity' => identity,
|
22
|
+
})
|
23
|
+
|
24
|
+
options[:retry_failures] = false
|
25
|
+
|
26
|
+
response = make_request(:get, path, options)
|
27
|
+
|
28
|
+
return if response.body.nil?
|
29
|
+
|
30
|
+
Resources::TransferredMandate.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
|
+
'transferred_mandate'
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/lib/gocardless_pro.rb
CHANGED
@@ -129,6 +129,9 @@ require_relative 'gocardless_pro/services/subscriptions_service'
|
|
129
129
|
require_relative 'gocardless_pro/resources/tax_rate'
|
130
130
|
require_relative 'gocardless_pro/services/tax_rates_service'
|
131
131
|
|
132
|
+
require_relative 'gocardless_pro/resources/transferred_mandate'
|
133
|
+
require_relative 'gocardless_pro/services/transferred_mandates_service'
|
134
|
+
|
132
135
|
require_relative 'gocardless_pro/resources/verification_detail'
|
133
136
|
require_relative 'gocardless_pro/services/verification_details_service'
|
134
137
|
|
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.51.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-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -142,6 +142,7 @@ files:
|
|
142
142
|
- lib/gocardless_pro/resources/scheme_identifier.rb
|
143
143
|
- lib/gocardless_pro/resources/subscription.rb
|
144
144
|
- lib/gocardless_pro/resources/tax_rate.rb
|
145
|
+
- lib/gocardless_pro/resources/transferred_mandate.rb
|
145
146
|
- lib/gocardless_pro/resources/verification_detail.rb
|
146
147
|
- lib/gocardless_pro/resources/webhook.rb
|
147
148
|
- lib/gocardless_pro/response.rb
|
@@ -176,6 +177,7 @@ files:
|
|
176
177
|
- lib/gocardless_pro/services/scheme_identifiers_service.rb
|
177
178
|
- lib/gocardless_pro/services/subscriptions_service.rb
|
178
179
|
- lib/gocardless_pro/services/tax_rates_service.rb
|
180
|
+
- lib/gocardless_pro/services/transferred_mandates_service.rb
|
179
181
|
- lib/gocardless_pro/services/verification_details_service.rb
|
180
182
|
- lib/gocardless_pro/services/webhooks_service.rb
|
181
183
|
- lib/gocardless_pro/version.rb
|