gocardless_pro 2.50.0 → 2.52.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 +6 -1
- 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/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 +49 -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: 0c000a6064233392116682a759d6e67afe5be9ff2cfc0eae35e93a3e3c5939ae
|
4
|
+
data.tar.gz: ec4bceb84381e78d933773426e1ce7ec4f43b6a73e5f58722590e1bf1aa4ef20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e92dfdc0bfaa9753bbc3364df627454500eb3512720403919adf32e4a45f879ce90196bbfac19ee817331a0da937e8b7506428923d27204ac613698c58b29e6b
|
7
|
+
data.tar.gz: 9e342b6891ce817f369c59e81f57bc395cdeb9aaf0bd16104564cbe92aed3106e2f1b78357a08682e0352b5fae79b17dc2529977b54eadd603d42f68d1789b74
|
@@ -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.52.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
|
@@ -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_customer_bank_details
|
16
|
+
attr_reader :encrypted_decryption_key
|
17
|
+
attr_reader :public_key_id
|
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_customer_bank_details = object['encrypted_customer_bank_details']
|
25
|
+
@encrypted_decryption_key = object['encrypted_decryption_key']
|
26
|
+
@links = object['links']
|
27
|
+
@public_key_id = object['public_key_id']
|
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,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 TransferredMandate endpoints
|
12
|
+
class TransferredMandatesService < BaseService
|
13
|
+
# Returns new customer bank details for a mandate that's been recently
|
14
|
+
# transferred
|
15
|
+
# Example URL: /transferred_mandates/:identity
|
16
|
+
#
|
17
|
+
# @param identity # Unique identifier, beginning with "MD". Note that this prefix may not
|
18
|
+
# apply to mandates created before 2016.
|
19
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
20
|
+
def transferred_mandates(identity, options = {})
|
21
|
+
path = sub_url('/transferred_mandates/:identity', {
|
22
|
+
'identity' => identity,
|
23
|
+
})
|
24
|
+
|
25
|
+
options[:retry_failures] = false
|
26
|
+
|
27
|
+
response = make_request(:get, path, options)
|
28
|
+
|
29
|
+
return if response.body.nil?
|
30
|
+
|
31
|
+
Resources::TransferredMandate.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
|
+
'transferred_mandates'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
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.52.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-24 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
|