gocardless_pro 3.0.0 → 3.2.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 +1 -1
- data/lib/gocardless_pro/resources/billing_request.rb +24 -8
- data/lib/gocardless_pro/resources/billing_request_flow.rb +2 -1
- data/lib/gocardless_pro/resources/mandate_import_entry.rb +2 -1
- data/lib/gocardless_pro/services/billing_requests_service.rb +74 -1
- data/lib/gocardless_pro/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d491b212bf75a7f70a1191be6b0d7d94eb4fb6cfd2d319047d62d0e2e9adf94b
|
4
|
+
data.tar.gz: e473a9b05df7ec6b70e48f2b426a7fae6585ed0c919a3963d91431d6fe5bd4a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b605624bcbbace950cf6ad9c4558a0b06abc9da731c85e934645716918cd9b9b9a5b25649e7a3e9fab57d8ca38f4facb8a221276062a1671e168eaff294d94e6
|
7
|
+
data.tar.gz: eeb013ab2a0278f9f56ccb437b0f61107d7afdbdbb9670a58aff1c6afea7086b319f9a349996401d64c68281c9be743a27d1e1e7318d6ae0a6681325e438a6d1
|
@@ -233,7 +233,7 @@ module GoCardlessPro
|
|
233
233
|
'User-Agent' => "#{user_agent}",
|
234
234
|
'Content-Type' => 'application/json',
|
235
235
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
236
|
-
'GoCardless-Client-Version' => '3.
|
236
|
+
'GoCardless-Client-Version' => '3.2.0'
|
237
237
|
}
|
238
238
|
}
|
239
239
|
end
|
@@ -10,18 +10,20 @@ module GoCardlessPro
|
|
10
10
|
module Resources
|
11
11
|
# Represents an instance of a billing_request resource returned from the API
|
12
12
|
|
13
|
-
#
|
14
|
-
# customer. An example of required input might be additional customer
|
15
|
-
# billing
|
16
|
-
#
|
17
|
-
# using their mobile banking app.
|
13
|
+
# Billing Requests help create resources that require input or action from
|
14
|
+
# a customer. An example of required input might be additional customer
|
15
|
+
# billing details, while an action would be asking a customer to authorise a
|
16
|
+
# payment using their mobile banking app.
|
18
17
|
#
|
19
18
|
# See [Billing Requests:
|
20
19
|
# Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/)
|
21
|
-
# for how-to's, explanations and tutorials.
|
20
|
+
# for how-to's, explanations and tutorials. <p
|
21
|
+
# class="notice"><strong>Important</strong>: All properties associated with
|
22
|
+
# `subscription_request` and `instalment_schedule_request` are only
|
23
|
+
# supported for ACH and PAD schemes.</p>
|
22
24
|
class BillingRequest
|
23
|
-
attr_reader :actions, :created_at, :fallback_enabled, :
|
24
|
-
:purpose_code, :resources, :status, :subscription_request
|
25
|
+
attr_reader :actions, :created_at, :fallback_enabled, :fallback_occurred, :id, :instalment_schedule_request,
|
26
|
+
:mandate_request, :metadata, :payment_request, :purpose_code, :resources, :status, :subscription_request
|
25
27
|
|
26
28
|
# Initialize a billing_request resource instance
|
27
29
|
# @param object [Hash] an object returned from the API
|
@@ -31,7 +33,9 @@ module GoCardlessPro
|
|
31
33
|
@actions = object['actions']
|
32
34
|
@created_at = object['created_at']
|
33
35
|
@fallback_enabled = object['fallback_enabled']
|
36
|
+
@fallback_occurred = object['fallback_occurred']
|
34
37
|
@id = object['id']
|
38
|
+
@instalment_schedule_request = object['instalment_schedule_request']
|
35
39
|
@links = object['links']
|
36
40
|
@mandate_request = object['mandate_request']
|
37
41
|
@metadata = object['metadata']
|
@@ -82,6 +86,14 @@ module GoCardlessPro
|
|
82
86
|
@links['customer_billing_detail']
|
83
87
|
end
|
84
88
|
|
89
|
+
def instalment_schedule_request
|
90
|
+
@links['instalment_schedule_request']
|
91
|
+
end
|
92
|
+
|
93
|
+
def instalment_schedule_request_instalment_schedule
|
94
|
+
@links['instalment_schedule_request_instalment_schedule']
|
95
|
+
end
|
96
|
+
|
85
97
|
def mandate_request
|
86
98
|
@links['mandate_request']
|
87
99
|
end
|
@@ -109,6 +121,10 @@ module GoCardlessPro
|
|
109
121
|
def subscription_request
|
110
122
|
@links['subscription_request']
|
111
123
|
end
|
124
|
+
|
125
|
+
def subscription_request_subscription
|
126
|
+
@links['subscription_request_subscription']
|
127
|
+
end
|
112
128
|
end
|
113
129
|
end
|
114
130
|
end
|
@@ -15,7 +15,7 @@ module GoCardlessPro
|
|
15
15
|
# authorisation (such as open banking single payments).
|
16
16
|
class BillingRequestFlow
|
17
17
|
attr_reader :authorisation_url, :auto_fulfil, :created_at, :customer_details_captured, :exit_uri, :expires_at,
|
18
|
-
:id, :language, :lock_bank_account, :lock_currency, :lock_customer_details, :prefilled_bank_account, :prefilled_customer, :redirect_uri, :session_token, :show_redirect_buttons, :show_success_redirect_button
|
18
|
+
:id, :language, :lock_bank_account, :lock_currency, :lock_customer_details, :prefilled_bank_account, :prefilled_customer, :redirect_uri, :session_token, :show_redirect_buttons, :show_success_redirect_button, :skip_success_screen
|
19
19
|
|
20
20
|
# Initialize a billing_request_flow resource instance
|
21
21
|
# @param object [Hash] an object returned from the API
|
@@ -40,6 +40,7 @@ module GoCardlessPro
|
|
40
40
|
@session_token = object['session_token']
|
41
41
|
@show_redirect_buttons = object['show_redirect_buttons']
|
42
42
|
@show_success_redirect_button = object['show_success_redirect_button']
|
43
|
+
@skip_success_screen = object['skip_success_screen']
|
43
44
|
@response = response
|
44
45
|
end
|
45
46
|
|
@@ -41,7 +41,7 @@ module GoCardlessPro
|
|
41
41
|
# href="mailto:help@gocardless.com">get in touch</a> if you would like to
|
42
42
|
# use this API.</p>
|
43
43
|
class MandateImportEntry
|
44
|
-
attr_reader :created_at, :record_identifier
|
44
|
+
attr_reader :created_at, :processing_errors, :record_identifier
|
45
45
|
|
46
46
|
# Initialize a mandate_import_entry resource instance
|
47
47
|
# @param object [Hash] an object returned from the API
|
@@ -50,6 +50,7 @@ module GoCardlessPro
|
|
50
50
|
|
51
51
|
@created_at = object['created_at']
|
52
52
|
@links = object['links']
|
53
|
+
@processing_errors = object['processing_errors']
|
53
54
|
@record_identifier = object['record_identifier']
|
54
55
|
@response = response
|
55
56
|
end
|
@@ -10,7 +10,8 @@ module GoCardlessPro
|
|
10
10
|
module Services
|
11
11
|
# Service for making requests to the BillingRequest endpoints
|
12
12
|
class BillingRequestsService < BaseService
|
13
|
-
#
|
13
|
+
# <p class="notice"><strong>Important</strong>: All properties associated with
|
14
|
+
# `subscription_request` are only supported for ACH and PAD schemes.</p>
|
14
15
|
# Example URL: /billing_requests
|
15
16
|
# @param options [Hash] parameters as a hash, under a params key.
|
16
17
|
def create(options = {})
|
@@ -45,6 +46,78 @@ module GoCardlessPro
|
|
45
46
|
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
46
47
|
end
|
47
48
|
|
49
|
+
# <p class="notice"><strong>Important</strong>: All properties associated with
|
50
|
+
# `instalment_schedule_request` are only supported for ACH and PAD schemes.</p>
|
51
|
+
# Example URL: /billing_requests
|
52
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
53
|
+
def create_with_instalments_with_dates(options = {})
|
54
|
+
path = '/billing_requests'
|
55
|
+
|
56
|
+
params = options.delete(:params) || {}
|
57
|
+
options[:params] = {}
|
58
|
+
options[:params][envelope_key] = params
|
59
|
+
|
60
|
+
options[:retry_failures] = true
|
61
|
+
|
62
|
+
begin
|
63
|
+
response = make_request(:post, path, options)
|
64
|
+
|
65
|
+
# Response doesn't raise any errors until #body is called
|
66
|
+
response.tap(&:body)
|
67
|
+
rescue InvalidStateError => e
|
68
|
+
if e.idempotent_creation_conflict?
|
69
|
+
case @api_service.on_idempotency_conflict
|
70
|
+
when :raise
|
71
|
+
raise IdempotencyConflict, e.error
|
72
|
+
when :fetch
|
73
|
+
return get(e.conflicting_resource_id)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
raise e
|
78
|
+
end
|
79
|
+
|
80
|
+
return if response.body.nil?
|
81
|
+
|
82
|
+
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
83
|
+
end
|
84
|
+
|
85
|
+
# <p class="notice"><strong>Important</strong>: All properties associated with
|
86
|
+
# `instalment_schedule_request` are only supported for ACH and PAD schemes.</p>
|
87
|
+
# Example URL: /billing_requests
|
88
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
89
|
+
def create_with_instalments_with_schedule(options = {})
|
90
|
+
path = '/billing_requests'
|
91
|
+
|
92
|
+
params = options.delete(:params) || {}
|
93
|
+
options[:params] = {}
|
94
|
+
options[:params][envelope_key] = params
|
95
|
+
|
96
|
+
options[:retry_failures] = true
|
97
|
+
|
98
|
+
begin
|
99
|
+
response = make_request(:post, path, options)
|
100
|
+
|
101
|
+
# Response doesn't raise any errors until #body is called
|
102
|
+
response.tap(&:body)
|
103
|
+
rescue InvalidStateError => e
|
104
|
+
if e.idempotent_creation_conflict?
|
105
|
+
case @api_service.on_idempotency_conflict
|
106
|
+
when :raise
|
107
|
+
raise IdempotencyConflict, e.error
|
108
|
+
when :fetch
|
109
|
+
return get(e.conflicting_resource_id)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
raise e
|
114
|
+
end
|
115
|
+
|
116
|
+
return if response.body.nil?
|
117
|
+
|
118
|
+
Resources::BillingRequest.new(unenvelope_body(response.body), response)
|
119
|
+
end
|
120
|
+
|
48
121
|
# If the billing request has a pending <code>collect_customer_details</code>
|
49
122
|
# action, this endpoint can be used to collect the details in order to
|
50
123
|
# complete it.
|
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: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -86,7 +86,7 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 0.9.11
|
89
|
-
description:
|
89
|
+
description:
|
90
90
|
email:
|
91
91
|
- engineering@gocardless.com
|
92
92
|
executables: []
|
@@ -192,7 +192,7 @@ homepage: https://github.com/gocardless/gocardless-pro-ruby
|
|
192
192
|
licenses:
|
193
193
|
- MIT
|
194
194
|
metadata: {}
|
195
|
-
post_install_message:
|
195
|
+
post_install_message:
|
196
196
|
rdoc_options: []
|
197
197
|
require_paths:
|
198
198
|
- lib
|
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
210
|
rubygems_version: 3.4.19
|
211
|
-
signing_key:
|
211
|
+
signing_key:
|
212
212
|
specification_version: 4
|
213
213
|
summary: A gem for calling the GoCardless Pro API
|
214
214
|
test_files: []
|