gocardless_pro 1.0.5 → 1.1.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/README.md +4 -2
- data/lib/gocardless_pro/api_service.rb +3 -3
- data/lib/gocardless_pro/resources/bank_details_lookup.rb +8 -10
- data/lib/gocardless_pro/resources/creditor.rb +36 -42
- data/lib/gocardless_pro/resources/creditor_bank_account.rb +24 -38
- data/lib/gocardless_pro/resources/customer.rb +12 -27
- data/lib/gocardless_pro/resources/customer_bank_account.rb +26 -39
- data/lib/gocardless_pro/resources/event.rb +49 -40
- data/lib/gocardless_pro/resources/mandate.rb +33 -35
- data/lib/gocardless_pro/resources/mandate_pdf.rb +10 -11
- data/lib/gocardless_pro/resources/payment.rb +34 -42
- data/lib/gocardless_pro/resources/payout.rb +23 -34
- data/lib/gocardless_pro/resources/redirect_flow.rb +49 -54
- data/lib/gocardless_pro/resources/refund.rb +24 -39
- data/lib/gocardless_pro/resources/subscription.rb +65 -84
- data/lib/gocardless_pro/services/bank_details_lookups_service.rb +6 -5
- data/lib/gocardless_pro/services/creditor_bank_accounts_service.rb +7 -6
- data/lib/gocardless_pro/services/creditors_service.rb +7 -6
- data/lib/gocardless_pro/services/customer_bank_accounts_service.rb +11 -10
- data/lib/gocardless_pro/services/customers_service.rb +7 -6
- data/lib/gocardless_pro/services/events_service.rb +8 -6
- data/lib/gocardless_pro/services/mandate_pdfs_service.rb +6 -5
- data/lib/gocardless_pro/services/mandates_service.rb +7 -6
- data/lib/gocardless_pro/services/payments_service.rb +7 -6
- data/lib/gocardless_pro/services/payouts_service.rb +7 -6
- data/lib/gocardless_pro/services/redirect_flows_service.rb +6 -5
- data/lib/gocardless_pro/services/refunds_service.rb +7 -6
- data/lib/gocardless_pro/services/subscriptions_service.rb +7 -6
- data/lib/gocardless_pro/version.rb +1 -1
- data/lib/gocardless_pro.rb +2 -3
- data/spec/resources/creditor_spec.rb +9 -1
- data/spec/resources/event_spec.rb +4 -0
- data/spec/resources/mandate_spec.rb +9 -1
- data/spec/resources/subscription_spec.rb +0 -4
- data/spec/services/creditor_bank_accounts_service_spec.rb +8 -0
- data/spec/services/creditors_service_spec.rb +39 -9
- data/spec/services/customer_bank_accounts_service_spec.rb +8 -0
- data/spec/services/customers_service_spec.rb +8 -0
- data/spec/services/events_service_spec.rb +8 -0
- data/spec/services/mandates_service_spec.rb +8 -0
- data/spec/services/payments_service_spec.rb +8 -0
- data/spec/services/payouts_service_spec.rb +8 -0
- data/spec/services/redirect_flows_service_spec.rb +8 -0
- data/spec/services/refunds_service_spec.rb +8 -0
- data/spec/services/subscriptions_service_spec.rb +8 -13
- metadata +19 -19
@@ -1,122 +1,109 @@
|
|
1
|
-
|
2
|
-
|
3
1
|
# encoding: utf-8
|
4
2
|
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
# https://github.com/gocardless/crank
|
3
|
+
# This client is automatically generated from a template and JSON schema definition.
|
4
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
8
5
|
#
|
6
|
+
|
9
7
|
require 'uri'
|
10
8
|
|
11
9
|
module GoCardlessPro
|
12
10
|
# A module containing classes for each of the resources in the GC Api
|
13
11
|
module Resources
|
12
|
+
# Represents an instance of a subscription resource returned from the API
|
13
|
+
|
14
14
|
# Subscriptions create [payments](#core-endpoints-payments) according to a
|
15
15
|
# schedule.
|
16
16
|
#
|
17
|
-
#
|
17
|
+
# ### Recurrence Rules
|
18
18
|
#
|
19
|
-
# The following
|
20
|
-
# when specifying recurrence:
|
21
|
-
# - The first payment must be charged within 1
|
22
|
-
# year.
|
23
|
-
# - When neither `month` nor `day_of_month` are present, the
|
24
|
-
# subscription will recur from the `start_date` based on the `interval_unit`.
|
25
|
-
|
26
|
-
# # - If `month` or `day_of_month` are present, the recurrence rules will be
|
27
|
-
# applied from the `start_date`, and the following validations apply:
|
19
|
+
# The following
|
20
|
+
# rules apply when specifying recurrence:
|
28
21
|
#
|
22
|
+
# - The first payment
|
23
|
+
# must be charged within 1 year.
|
24
|
+
# - When neither `month` nor
|
25
|
+
# `day_of_month` are present, the subscription will recur from the
|
26
|
+
# `start_date` based on the `interval_unit`.
|
27
|
+
# - If `month` or
|
28
|
+
# `day_of_month` are present, the recurrence rules will be applied from the
|
29
|
+
# `start_date`, and the following validations apply:
|
29
30
|
#
|
30
|
-
# |
|
31
|
+
# |
|
32
|
+
# interval_unit | month |
|
31
33
|
# day_of_month |
|
32
34
|
# | :-------------- |
|
33
35
|
# :--------------------------------------------- |
|
34
36
|
# :-------------------------------------- |
|
35
|
-
# | yearly |
|
36
|
-
# (required if `day_of_month` provided) | optional (required if
|
37
|
-
# provided) |
|
37
|
+
# | yearly |
|
38
|
+
# optional (required if `day_of_month` provided) | optional (required if
|
39
|
+
# `month` provided) |
|
38
40
|
# | monthly | invalid
|
39
|
-
#
|
40
|
-
# |
|
41
|
-
# invalid | invalid
|
42
|
-
#
|
41
|
+
# | required |
|
42
|
+
# |
|
43
|
+
# weekly | invalid | invalid
|
44
|
+
# |
|
43
45
|
#
|
44
46
|
# Examples:
|
45
47
|
#
|
46
|
-
# |
|
47
|
-
# month | day_of_month | valid?
|
48
|
-
#
|
49
|
-
# | :-------------- | :--------- |
|
48
|
+
# |
|
49
|
+
# interval_unit | interval | month | day_of_month | valid?
|
50
|
+
# |
|
51
|
+
# | :-------------- | :--------- |
|
52
|
+
# :------ | :------------- |
|
50
53
|
# :------------------------------------------------- |
|
51
|
-
# | yearly
|
52
|
-
# 1 | january | -1 | valid
|
53
|
-
#
|
54
|
+
# | yearly
|
55
|
+
# | 1 | january | -1 | valid
|
56
|
+
# |
|
54
57
|
# | yearly | 1 | march |
|
55
|
-
#
|
56
|
-
# |
|
57
|
-
#
|
58
|
-
#
|
59
|
-
# | monthly | 6 |
|
60
|
-
#
|
58
|
+
# | invalid - missing `day_of_month` |
|
59
|
+
# |
|
60
|
+
# monthly | 6 | | 12 | valid
|
61
|
+
# |
|
62
|
+
# | monthly | 6 |
|
63
|
+
# august | 12 | invalid - `month` must be blank
|
64
|
+
# |
|
65
|
+
# | weekly | 2 | | |
|
66
|
+
# valid |
|
61
67
|
# | weekly
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
68
|
+
# | 2 | october | 10 | invalid - `month` and
|
69
|
+
# `day_of_month` must be blank |
|
70
|
+
#
|
71
|
+
# ### Rolling dates
|
66
72
|
#
|
67
|
-
# ####
|
68
|
-
# Rolling dates
|
69
73
|
#
|
70
|
-
# When a charge date falls on a non-business day, one
|
71
|
-
#
|
74
|
+
# When a charge date falls on a non-business day, one of two things will
|
75
|
+
# happen:
|
72
76
|
#
|
73
|
-
# - if the recurrence rule specified `-1`
|
74
|
-
#
|
77
|
+
# - if the recurrence rule specified `-1` as the
|
78
|
+
# `day_of_month`, the charge date will be rolled __backwards__ to the
|
75
79
|
# previous business day (i.e., the last working day of the month).
|
76
80
|
# -
|
77
81
|
# otherwise the charge date will be rolled __forwards__ to the next business
|
78
82
|
# day.
|
79
83
|
#
|
80
|
-
# Represents an instance of a subscription resource returned from the API
|
81
84
|
class Subscription
|
82
85
|
attr_reader :amount
|
83
|
-
|
84
|
-
attr_reader :count
|
85
|
-
|
86
86
|
attr_reader :created_at
|
87
|
-
|
88
87
|
attr_reader :currency
|
89
|
-
|
90
88
|
attr_reader :day_of_month
|
91
|
-
|
92
89
|
attr_reader :end_date
|
93
|
-
|
94
90
|
attr_reader :id
|
95
|
-
|
96
91
|
attr_reader :interval
|
97
|
-
|
98
92
|
attr_reader :interval_unit
|
99
|
-
|
100
93
|
attr_reader :metadata
|
101
|
-
|
102
94
|
attr_reader :month
|
103
|
-
|
104
95
|
attr_reader :name
|
105
|
-
|
106
96
|
attr_reader :payment_reference
|
107
|
-
|
108
97
|
attr_reader :start_date
|
109
|
-
|
110
98
|
attr_reader :status
|
111
|
-
|
112
99
|
attr_reader :upcoming_payments
|
113
|
-
|
100
|
+
|
101
|
+
# Initialize a subscription resource instance
|
114
102
|
# @param object [Hash] an object returned from the API
|
115
103
|
def initialize(object, response = nil)
|
116
104
|
@object = object
|
117
105
|
|
118
106
|
@amount = object['amount']
|
119
|
-
@count = object['count']
|
120
107
|
@created_at = object['created_at']
|
121
108
|
@currency = object['currency']
|
122
109
|
@day_of_month = object['day_of_month']
|
@@ -139,31 +126,25 @@ module GoCardlessPro
|
|
139
126
|
ApiResponse.new(@response)
|
140
127
|
end
|
141
128
|
|
142
|
-
#
|
129
|
+
# Return the links that the resource has
|
143
130
|
def links
|
144
|
-
|
145
|
-
valid_links = (@links || {}).select { |key, _| valid_link_keys.include?(key) }
|
146
|
-
|
147
|
-
links_class = Struct.new(
|
148
|
-
*{
|
149
|
-
|
150
|
-
mandate: ''
|
151
|
-
|
152
|
-
}.keys
|
153
|
-
) do
|
154
|
-
def initialize(hash)
|
155
|
-
hash.each do |key, val|
|
156
|
-
send("#{key}=", val)
|
157
|
-
end
|
158
|
-
end
|
159
|
-
end
|
160
|
-
links_class.new(valid_links)
|
131
|
+
@links_links ||= Links.new(@links)
|
161
132
|
end
|
162
133
|
|
163
|
-
# Provides the resource as a hash of all
|
134
|
+
# Provides the subscription resource as a hash of all its readable attributes
|
164
135
|
def to_h
|
165
136
|
@object
|
166
137
|
end
|
138
|
+
|
139
|
+
class Links
|
140
|
+
def initialize(links)
|
141
|
+
@links = links
|
142
|
+
end
|
143
|
+
|
144
|
+
def mandate
|
145
|
+
@links['mandate']
|
146
|
+
end
|
147
|
+
end
|
167
148
|
end
|
168
149
|
end
|
169
150
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -52,12 +53,12 @@ module GoCardlessPro
|
|
52
53
|
'bank_details_lookups'
|
53
54
|
end
|
54
55
|
|
55
|
-
# take a URL with placeholder params and substitute them out for the
|
56
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
56
57
|
# @param url [String] the URL with placeholders in
|
57
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
58
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
58
59
|
def sub_url(url, param_map)
|
59
60
|
param_map.reduce(url) do |new_url, (param, value)|
|
60
|
-
new_url.gsub(":#{param}", value)
|
61
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
61
62
|
end
|
62
63
|
end
|
63
64
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -26,7 +27,7 @@ module GoCardlessPro
|
|
26
27
|
Resources::CreditorBankAccount.new(unenvelope_body(response.body), response)
|
27
28
|
end
|
28
29
|
|
29
|
-
# Returns a [cursor-paginated](#
|
30
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
30
31
|
# creditor bank accounts.
|
31
32
|
# Example URL: /creditor_bank_accounts
|
32
33
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -106,12 +107,12 @@ module GoCardlessPro
|
|
106
107
|
'creditor_bank_accounts'
|
107
108
|
end
|
108
109
|
|
109
|
-
# take a URL with placeholder params and substitute them out for the
|
110
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
110
111
|
# @param url [String] the URL with placeholders in
|
111
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
112
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
112
113
|
def sub_url(url, param_map)
|
113
114
|
param_map.reduce(url) do |new_url, (param, value)|
|
114
|
-
new_url.gsub(":#{param}", value)
|
115
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
115
116
|
end
|
116
117
|
end
|
117
118
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -26,7 +27,7 @@ module GoCardlessPro
|
|
26
27
|
Resources::Creditor.new(unenvelope_body(response.body), response)
|
27
28
|
end
|
28
29
|
|
29
|
-
# Returns a [cursor-paginated](#
|
30
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
30
31
|
# creditors.
|
31
32
|
# Example URL: /creditors
|
32
33
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -100,12 +101,12 @@ module GoCardlessPro
|
|
100
101
|
'creditors'
|
101
102
|
end
|
102
103
|
|
103
|
-
# take a URL with placeholder params and substitute them out for the
|
104
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
104
105
|
# @param url [String] the URL with placeholders in
|
105
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
106
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
106
107
|
def sub_url(url, param_map)
|
107
108
|
param_map.reduce(url) do |new_url, (param, value)|
|
108
|
-
new_url.gsub(":#{param}", value)
|
109
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
109
110
|
end
|
110
111
|
end
|
111
112
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -21,11 +22,11 @@ module GoCardlessPro
|
|
21
22
|
# - IBAN
|
22
23
|
#
|
23
24
|
# - [Customer Bank
|
24
|
-
# Account Tokens](#
|
25
|
+
# Account Tokens](#javascript-flow-create-a-customer-bank-account-token)
|
25
26
|
#
|
26
|
-
#
|
27
|
-
# information on the different fields required in each country, see
|
28
|
-
# details](#appendix-local-bank-details).
|
27
|
+
#
|
28
|
+
# For more information on the different fields required in each country, see
|
29
|
+
# [local bank details](#appendix-local-bank-details).
|
29
30
|
# Example URL: /customer_bank_accounts
|
30
31
|
# @param options [Hash] parameters as a hash, under a params key.
|
31
32
|
def create(options = {})
|
@@ -41,7 +42,7 @@ module GoCardlessPro
|
|
41
42
|
Resources::CustomerBankAccount.new(unenvelope_body(response.body), response)
|
42
43
|
end
|
43
44
|
|
44
|
-
# Returns a [cursor-paginated](#
|
45
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your bank
|
45
46
|
# accounts.
|
46
47
|
# Example URL: /customer_bank_accounts
|
47
48
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -140,12 +141,12 @@ module GoCardlessPro
|
|
140
141
|
'customer_bank_accounts'
|
141
142
|
end
|
142
143
|
|
143
|
-
# take a URL with placeholder params and substitute them out for the
|
144
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
144
145
|
# @param url [String] the URL with placeholders in
|
145
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
146
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
146
147
|
def sub_url(url, param_map)
|
147
148
|
param_map.reduce(url) do |new_url, (param, value)|
|
148
|
-
new_url.gsub(":#{param}", value)
|
149
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
149
150
|
end
|
150
151
|
end
|
151
152
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -26,7 +27,7 @@ module GoCardlessPro
|
|
26
27
|
Resources::Customer.new(unenvelope_body(response.body), response)
|
27
28
|
end
|
28
29
|
|
29
|
-
# Returns a [cursor-paginated](#
|
30
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
30
31
|
# customers.
|
31
32
|
# Example URL: /customers
|
32
33
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -100,12 +101,12 @@ module GoCardlessPro
|
|
100
101
|
'customers'
|
101
102
|
end
|
102
103
|
|
103
|
-
# take a URL with placeholder params and substitute them out for the
|
104
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
104
105
|
# @param url [String] the URL with placeholders in
|
105
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
106
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
106
107
|
def sub_url(url, param_map)
|
107
108
|
param_map.reduce(url) do |new_url, (param, value)|
|
108
|
-
new_url.gsub(":#{param}", value)
|
109
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
109
110
|
end
|
110
111
|
end
|
111
112
|
end
|
@@ -1,16 +1,18 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
11
12
|
# Service for making requests to the Event endpoints
|
12
13
|
class EventsService < BaseService
|
13
|
-
# Returns a [cursor-paginated](#
|
14
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
15
|
+
# events.
|
14
16
|
# Example URL: /events
|
15
17
|
# @param options [Hash] parameters as a hash, under a params key.
|
16
18
|
def list(options = {})
|
@@ -64,12 +66,12 @@ module GoCardlessPro
|
|
64
66
|
'events'
|
65
67
|
end
|
66
68
|
|
67
|
-
# take a URL with placeholder params and substitute them out for the
|
69
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
68
70
|
# @param url [String] the URL with placeholders in
|
69
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
71
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
70
72
|
def sub_url(url, param_map)
|
71
73
|
param_map.reduce(url) do |new_url, (param, value)|
|
72
|
-
new_url.gsub(":#{param}", value)
|
74
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
73
75
|
end
|
74
76
|
end
|
75
77
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -51,12 +52,12 @@ module GoCardlessPro
|
|
51
52
|
'mandate_pdfs'
|
52
53
|
end
|
53
54
|
|
54
|
-
# take a URL with placeholder params and substitute them out for the
|
55
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
55
56
|
# @param url [String] the URL with placeholders in
|
56
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
57
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
57
58
|
def sub_url(url, param_map)
|
58
59
|
param_map.reduce(url) do |new_url, (param, value)|
|
59
|
-
new_url.gsub(":#{param}", value)
|
60
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
60
61
|
end
|
61
62
|
end
|
62
63
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -26,7 +27,7 @@ module GoCardlessPro
|
|
26
27
|
Resources::Mandate.new(unenvelope_body(response.body), response)
|
27
28
|
end
|
28
29
|
|
29
|
-
# Returns a [cursor-paginated](#
|
30
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
30
31
|
# mandates.
|
31
32
|
# Example URL: /mandates
|
32
33
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -151,12 +152,12 @@ module GoCardlessPro
|
|
151
152
|
'mandates'
|
152
153
|
end
|
153
154
|
|
154
|
-
# take a URL with placeholder params and substitute them out for the
|
155
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
155
156
|
# @param url [String] the URL with placeholders in
|
156
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
157
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
157
158
|
def sub_url(url, param_map)
|
158
159
|
param_map.reduce(url) do |new_url, (param, value)|
|
159
|
-
new_url.gsub(":#{param}", value)
|
160
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
160
161
|
end
|
161
162
|
end
|
162
163
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -32,7 +33,7 @@ module GoCardlessPro
|
|
32
33
|
Resources::Payment.new(unenvelope_body(response.body), response)
|
33
34
|
end
|
34
35
|
|
35
|
-
# Returns a [cursor-paginated](#
|
36
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
36
37
|
# payments.
|
37
38
|
# Example URL: /payments
|
38
39
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -157,12 +158,12 @@ module GoCardlessPro
|
|
157
158
|
'payments'
|
158
159
|
end
|
159
160
|
|
160
|
-
# take a URL with placeholder params and substitute them out for the
|
161
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
161
162
|
# @param url [String] the URL with placeholders in
|
162
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
163
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
163
164
|
def sub_url(url, param_map)
|
164
165
|
param_map.reduce(url) do |new_url, (param, value)|
|
165
|
-
new_url.gsub(":#{param}", value)
|
166
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
166
167
|
end
|
167
168
|
end
|
168
169
|
end
|
@@ -1,16 +1,17 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
11
12
|
# Service for making requests to the Payout endpoints
|
12
13
|
class PayoutsService < BaseService
|
13
|
-
# Returns a [cursor-paginated](#
|
14
|
+
# Returns a [cursor-paginated](#api-usage-cursor-pagination) list of your
|
14
15
|
# payouts.
|
15
16
|
# Example URL: /payouts
|
16
17
|
# @param options [Hash] parameters as a hash, under a params key.
|
@@ -67,12 +68,12 @@ module GoCardlessPro
|
|
67
68
|
'payouts'
|
68
69
|
end
|
69
70
|
|
70
|
-
# take a URL with placeholder params and substitute them out for the
|
71
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
71
72
|
# @param url [String] the URL with placeholders in
|
72
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
73
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
73
74
|
def sub_url(url, param_map)
|
74
75
|
param_map.reduce(url) do |new_url, (param, value)|
|
75
|
-
new_url.gsub(":#{param}", value)
|
76
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
76
77
|
end
|
77
78
|
end
|
78
79
|
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
require_relative './base_service'
|
2
|
+
require 'uri'
|
2
3
|
|
3
4
|
# encoding: utf-8
|
4
5
|
#
|
5
|
-
#
|
6
|
+
# This client is automatically generated from a template and JSON schema definition.
|
7
|
+
# See https://github.com/gocardless/gocardless-pro-ruby#contributing before editing.
|
6
8
|
#
|
7
|
-
# https://github.com/gocardless/crank
|
8
9
|
|
9
10
|
module GoCardlessPro
|
10
11
|
module Services
|
@@ -84,12 +85,12 @@ module GoCardlessPro
|
|
84
85
|
'redirect_flows'
|
85
86
|
end
|
86
87
|
|
87
|
-
# take a URL with placeholder params and substitute them out for the
|
88
|
+
# take a URL with placeholder params and substitute them out for the actual value
|
88
89
|
# @param url [String] the URL with placeholders in
|
89
|
-
# @param param_map [Hash] a hash of placeholders and their actual values
|
90
|
+
# @param param_map [Hash] a hash of placeholders and their actual values (which will be escaped)
|
90
91
|
def sub_url(url, param_map)
|
91
92
|
param_map.reduce(url) do |new_url, (param, value)|
|
92
|
-
new_url.gsub(":#{param}", value)
|
93
|
+
new_url.gsub(":#{param}", URI.escape(value))
|
93
94
|
end
|
94
95
|
end
|
95
96
|
end
|