gocardless_pro 3.7.0 → 3.8.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_with_action.rb +47 -0
- data/lib/gocardless_pro/resources/outbound_payment.rb +3 -2
- data/lib/gocardless_pro/services/billing_request_with_actions_service.rb +52 -0
- data/lib/gocardless_pro/services/refunds_service.rb +0 -3
- 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: cb18a622d5c0c067330de44a389114cf405a64cfc0edea91a919e394ae474f04
|
4
|
+
data.tar.gz: 69e13eaaa22df8ec0cc104205ffb96c1505471dfb0d1dd30df831756439cd924
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 228213efb6ebec8cc8a1cefebc7177f288d07ad6553d554fdca1357e67891af93036d236a17c0a544c851d64251025b80162fc1e6367aa2660afcf9ce8bd6bdd
|
7
|
+
data.tar.gz: ac9e1c9f784c67e41effafaddbc444d5d19eae51d00970f39edc0ea4cd466833761f517b1528f776f5ec4194c27595ac0b9fa6e4b5471284aaa92eed876ca783
|
@@ -38,6 +38,11 @@ module GoCardlessPro
|
|
38
38
|
@billing_request_templates ||= Services::BillingRequestTemplatesService.new(@api_service)
|
39
39
|
end
|
40
40
|
|
41
|
+
# Access to the service for billing_request_with_action to make API calls
|
42
|
+
def billing_request_with_actions
|
43
|
+
@billing_request_with_actions ||= Services::BillingRequestWithActionsService.new(@api_service)
|
44
|
+
end
|
45
|
+
|
41
46
|
# Access to the service for block to make API calls
|
42
47
|
def blocks
|
43
48
|
@blocks ||= Services::BlocksService.new(@api_service)
|
@@ -248,7 +253,7 @@ module GoCardlessPro
|
|
248
253
|
'User-Agent' => "#{user_agent}",
|
249
254
|
'Content-Type' => 'application/json',
|
250
255
|
'GoCardless-Client-Library' => 'gocardless-pro-ruby',
|
251
|
-
'GoCardless-Client-Version' => '3.
|
256
|
+
'GoCardless-Client-Version' => '3.8.0'
|
252
257
|
}
|
253
258
|
}
|
254
259
|
end
|
@@ -0,0 +1,47 @@
|
|
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 billing_request_with_action resource returned from the API
|
12
|
+
|
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.
|
17
|
+
#
|
18
|
+
# See [Billing Requests:
|
19
|
+
# Overview](https://developer.gocardless.com/getting-started/billing-requests/overview/)
|
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>
|
24
|
+
class BillingRequestWithAction
|
25
|
+
attr_reader :bank_authorisations, :billing_requests
|
26
|
+
|
27
|
+
# Initialize a billing_request_with_action resource instance
|
28
|
+
# @param object [Hash] an object returned from the API
|
29
|
+
def initialize(object, response = nil)
|
30
|
+
@object = object
|
31
|
+
|
32
|
+
@bank_authorisations = object['bank_authorisations']
|
33
|
+
@billing_requests = object['billing_requests']
|
34
|
+
@response = response
|
35
|
+
end
|
36
|
+
|
37
|
+
def api_response
|
38
|
+
ApiResponse.new(@response)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Provides the billing_request_with_action resource as a hash of all its readable attributes
|
42
|
+
def to_h
|
43
|
+
@object
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -23,8 +23,8 @@ module GoCardlessPro
|
|
23
23
|
# refining our API to ensure it meets your needs and provides the best
|
24
24
|
# experience.</p>
|
25
25
|
class OutboundPayment
|
26
|
-
attr_reader :amount, :created_at, :description, :execution_date, :id, :is_withdrawal, :metadata,
|
27
|
-
:scheme, :status, :verifications
|
26
|
+
attr_reader :amount, :created_at, :currency, :description, :execution_date, :id, :is_withdrawal, :metadata,
|
27
|
+
:reference, :scheme, :status, :verifications
|
28
28
|
|
29
29
|
# Initialize a outbound_payment resource instance
|
30
30
|
# @param object [Hash] an object returned from the API
|
@@ -33,6 +33,7 @@ module GoCardlessPro
|
|
33
33
|
|
34
34
|
@amount = object['amount']
|
35
35
|
@created_at = object['created_at']
|
36
|
+
@currency = object['currency']
|
36
37
|
@description = object['description']
|
37
38
|
@execution_date = object['execution_date']
|
38
39
|
@id = object['id']
|
@@ -0,0 +1,52 @@
|
|
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 BillingRequestWithAction endpoints
|
12
|
+
class BillingRequestWithActionsService < BaseService
|
13
|
+
# Creates a billing request and completes any specified actions in a single
|
14
|
+
# request.
|
15
|
+
# This endpoint allows you to create a billing request and immediately complete
|
16
|
+
# actions
|
17
|
+
# such as collecting customer details, bank account details, or other required
|
18
|
+
# actions.
|
19
|
+
# Example URL: /billing_requests/create_with_actions
|
20
|
+
# @param options [Hash] parameters as a hash, under a params key.
|
21
|
+
def create_with_actions(options = {})
|
22
|
+
path = '/billing_requests/create_with_actions'
|
23
|
+
|
24
|
+
params = options.delete(:params) || {}
|
25
|
+
options[:params] = {}
|
26
|
+
options[:params][envelope_key] = params
|
27
|
+
|
28
|
+
options[:retry_failures] = true
|
29
|
+
|
30
|
+
response = make_request(:post, path, options)
|
31
|
+
|
32
|
+
return if response.body.nil?
|
33
|
+
|
34
|
+
Resources::BillingRequestWithAction.new(unenvelope_body(response.body), response)
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
# Unenvelope the response of the body using the service's `envelope_key`
|
40
|
+
#
|
41
|
+
# @param body [Hash]
|
42
|
+
def unenvelope_body(body)
|
43
|
+
body[envelope_key] || body['data']
|
44
|
+
end
|
45
|
+
|
46
|
+
# return the key which API responses will envelope data under
|
47
|
+
def envelope_key
|
48
|
+
'billing_requests'
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -20,9 +20,6 @@ module GoCardlessPro
|
|
20
20
|
# the total amount refunded for the payment. This safeguard is there to prevent
|
21
21
|
# two processes from creating refunds without awareness of each other.
|
22
22
|
#
|
23
|
-
# - `number_of_refunds_exceeded` if twenty five or more refunds have already
|
24
|
-
# been created against the payment.
|
25
|
-
#
|
26
23
|
# - `available_refund_amount_insufficient` if the creditor does not have
|
27
24
|
# sufficient balance for refunds available to cover the cost of the requested
|
28
25
|
# refund.
|
data/lib/gocardless_pro.rb
CHANGED
@@ -60,6 +60,9 @@ require_relative 'gocardless_pro/services/billing_request_flows_service'
|
|
60
60
|
require_relative 'gocardless_pro/resources/billing_request_template'
|
61
61
|
require_relative 'gocardless_pro/services/billing_request_templates_service'
|
62
62
|
|
63
|
+
require_relative 'gocardless_pro/resources/billing_request_with_action'
|
64
|
+
require_relative 'gocardless_pro/services/billing_request_with_actions_service'
|
65
|
+
|
63
66
|
require_relative 'gocardless_pro/resources/block'
|
64
67
|
require_relative 'gocardless_pro/services/blocks_service'
|
65
68
|
|
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.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GoCardless
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -119,6 +119,7 @@ files:
|
|
119
119
|
- lib/gocardless_pro/resources/billing_request.rb
|
120
120
|
- lib/gocardless_pro/resources/billing_request_flow.rb
|
121
121
|
- lib/gocardless_pro/resources/billing_request_template.rb
|
122
|
+
- lib/gocardless_pro/resources/billing_request_with_action.rb
|
122
123
|
- lib/gocardless_pro/resources/block.rb
|
123
124
|
- lib/gocardless_pro/resources/creditor.rb
|
124
125
|
- lib/gocardless_pro/resources/creditor_bank_account.rb
|
@@ -159,6 +160,7 @@ files:
|
|
159
160
|
- lib/gocardless_pro/services/base_service.rb
|
160
161
|
- lib/gocardless_pro/services/billing_request_flows_service.rb
|
161
162
|
- lib/gocardless_pro/services/billing_request_templates_service.rb
|
163
|
+
- lib/gocardless_pro/services/billing_request_with_actions_service.rb
|
162
164
|
- lib/gocardless_pro/services/billing_requests_service.rb
|
163
165
|
- lib/gocardless_pro/services/blocks_service.rb
|
164
166
|
- lib/gocardless_pro/services/creditor_bank_accounts_service.rb
|