genesis_ruby 0.3.1 → 0.3.2
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/.kiro/specs/f2025112509-add_managed_recurring_api/.config.kiro +1 -0
- data/.kiro/specs/f2025112509-add_managed_recurring_api/design.md +332 -0
- data/.kiro/specs/f2025112509-add_managed_recurring_api/requirements.md +91 -0
- data/.kiro/specs/f2025112509-add_managed_recurring_api/tasks.md +139 -0
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/.config.kiro +1 -0
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/design.md +148 -0
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/requirements.md +81 -0
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/tasks.md +48 -0
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/.config.kiro +1 -0
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/design.md +112 -0
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/requirements.md +74 -0
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/tasks.md +38 -0
- data/.kiro/specs/f2025112609_update_payee_request_params/design.md +86 -0
- data/.kiro/specs/f2025112609_update_payee_request_params/requirements.md +86 -0
- data/.kiro/specs/f2025112609_update_payee_request_params/tasks.md +40 -0
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/.config.kiro +1 -0
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/design.md +246 -0
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/requirements.md +287 -0
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/tasks.md +76 -0
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/design.md +84 -0
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/requirements.md +88 -0
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/tasks.md +38 -0
- data/.kiro/steering/product.md +15 -0
- data/.kiro/steering/spec-folder-naming.md +16 -0
- data/.kiro/steering/structure.md +96 -0
- data/.kiro/steering/tech.md +66 -0
- data/CHANGELOG.md +23 -0
- data/Gemfile.lock +4 -4
- data/README.md +33 -0
- data/VERSION +1 -1
- data/lib/genesis_ruby/api/constants/non_financial/kyc/address_document_supported_types.rb +81 -0
- data/lib/genesis_ruby/api/constants/non_financial/payee/document_types.rb +57 -0
- data/lib/genesis_ruby/api/constants/non_financial/payee/owner_types.rb +30 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/purpose_of_payments.rb +50 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/sender_account_number_types.rb +50 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/source_of_funds.rb +44 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/types.rb +26 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/statement_response_fields.rb +37 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/mpi_attributes.rb +0 -10
- data/lib/genesis_ruby/api/mixins/requests/financial/money_transfer_payout_attributes.rb +131 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/date_attributes.rb +87 -5
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/business_attributes.rb +42 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/document_attributes.rb +8 -7
- data/lib/genesis_ruby/api/request.rb +15 -9
- data/lib/genesis_ruby/api/requests/base/non_financial/billing_api/base.rb +108 -0
- data/lib/genesis_ruby/api/requests/base/non_financial/payee/base.rb +54 -0
- data/lib/genesis_ruby/api/requests/financial/cards/authorize3d.rb +1 -3
- data/lib/genesis_ruby/api/requests/financial/cards/payout.rb +3 -1
- data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +1 -3
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/statement.rb +170 -0
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/transactions.rb +20 -60
- data/lib/genesis_ruby/api/requests/non_financial/kyc/business/create.rb +45 -0
- data/lib/genesis_ruby/api/requests/non_financial/kyc/business/document.rb +60 -0
- data/lib/genesis_ruby/api/requests/non_financial/kyc/business/document_list.rb +59 -0
- data/lib/genesis_ruby/api/requests/non_financial/kyc/business/verification.rb +52 -0
- data/lib/genesis_ruby/api/requests/non_financial/kyc/verifications/address_by_document_proof.rb +92 -0
- data/lib/genesis_ruby/api/requests/non_financial/kyc/verifications/create.rb +4 -1
- data/lib/genesis_ruby/api/requests/non_financial/managed_recurring/cancel.rb +63 -0
- data/lib/genesis_ruby/api/requests/non_financial/managed_recurring/fetch.rb +63 -0
- data/lib/genesis_ruby/api/requests/non_financial/managed_recurring/fetch_all.rb +37 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/account/reverify.rb +61 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/associate_payee_with_owners.rb +105 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/create.rb +37 -7
- data/lib/genesis_ruby/api/requests/non_financial/payee/create_payee_document.rb +61 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/dissociate_payee_with_owners.rb +94 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/list.rb +38 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/list_payee_documents.rb +57 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/list_payee_owners.rb +70 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/associate_owner_with_owners.rb +109 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/create.rb +71 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/create_owner_document.rb +63 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/delete.rb +54 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/dissociate_owners.rb +96 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/list_owner_documents.rb +59 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/list_owners.rb +46 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/retrieve.rb +59 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/retrieve_owner_document.rb +62 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/owners/update.rb +66 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/retrieve_payee_document.rb +60 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/update.rb +34 -4
- data/lib/genesis_ruby/api/requests/non_financial/payee/verifications/create_payee_verification.rb +58 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/verifications/list_payee_verifications.rb +59 -0
- data/lib/genesis_ruby/api/requests/non_financial/payee/verifications/retrieve_payee_verification.rb +62 -0
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/retokenize.rb +45 -0
- data/lib/genesis_ruby/api/requests/wpf/create.rb +19 -0
- data/lib/genesis_ruby/api/response.rb +15 -0
- data/lib/genesis_ruby/dependencies.rb +2 -0
- data/lib/genesis_ruby/network/adapter/net_http_adapter.rb +31 -5
- data/lib/genesis_ruby/network/base_network.rb +5 -0
- data/lib/genesis_ruby/network/net_http.rb +16 -4
- data/lib/genesis_ruby/utils/options/api_config.rb +43 -32
- data/lib/genesis_ruby/utils/options/network_adapter_config.rb +1 -1
- data/lib/genesis_ruby/version.rb +1 -1
- metadata +72 -3
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module ManagedRecurring
|
|
8
|
+
# Cancels an active managed recurring item by its unique identifier.
|
|
9
|
+
class Cancel < Base::Versioned
|
|
10
|
+
|
|
11
|
+
attr_writer :unique_id
|
|
12
|
+
|
|
13
|
+
# Cancel initialization
|
|
14
|
+
def initialize(configuration, _builder_interface = nil)
|
|
15
|
+
super configuration
|
|
16
|
+
|
|
17
|
+
self.request_path = 'managed_recurring/items/:unique_id'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Unique identifier of the managed recurring item
|
|
21
|
+
def unique_id
|
|
22
|
+
@unique_id.to_s
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
protected
|
|
26
|
+
|
|
27
|
+
# Override default Versioned Network configuration
|
|
28
|
+
def init_configuration
|
|
29
|
+
super
|
|
30
|
+
|
|
31
|
+
init_delete_configuration
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Cancel request field validations
|
|
35
|
+
def init_field_validations
|
|
36
|
+
super
|
|
37
|
+
|
|
38
|
+
required_fields.push *%i[unique_id]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Cancel request structure
|
|
42
|
+
def request_structure
|
|
43
|
+
{}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Override API endpoint with provided Unique ID
|
|
47
|
+
def process_request_parameters
|
|
48
|
+
super
|
|
49
|
+
|
|
50
|
+
processed_path = request_path.gsub(':unique_id', unique_id.to_s)
|
|
51
|
+
|
|
52
|
+
init_api_gateway_configuration(
|
|
53
|
+
request_path: "#{version}/#{processed_path}",
|
|
54
|
+
include_token: false
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module ManagedRecurring
|
|
8
|
+
# Retrieves details about a specific managed recurring item based on its unique ID.
|
|
9
|
+
class Fetch < Base::Versioned
|
|
10
|
+
|
|
11
|
+
attr_writer :unique_id
|
|
12
|
+
|
|
13
|
+
# Fetch initialization
|
|
14
|
+
def initialize(configuration, _builder_interface = nil)
|
|
15
|
+
super configuration
|
|
16
|
+
|
|
17
|
+
self.request_path = 'managed_recurring/items/:unique_id'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Unique identifier of the managed recurring item
|
|
21
|
+
def unique_id
|
|
22
|
+
@unique_id.to_s
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
protected
|
|
26
|
+
|
|
27
|
+
# Override default Versioned Network configuration
|
|
28
|
+
def init_configuration
|
|
29
|
+
super
|
|
30
|
+
|
|
31
|
+
init_get_configuration
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Fetch request field validations
|
|
35
|
+
def init_field_validations
|
|
36
|
+
super
|
|
37
|
+
|
|
38
|
+
required_fields.push *%i[unique_id]
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Fetch request structure
|
|
42
|
+
def request_structure
|
|
43
|
+
{}
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Override API endpoint with provided Unique ID
|
|
47
|
+
def process_request_parameters
|
|
48
|
+
super
|
|
49
|
+
|
|
50
|
+
processed_path = request_path.gsub(':unique_id', unique_id.to_s)
|
|
51
|
+
|
|
52
|
+
init_api_gateway_configuration(
|
|
53
|
+
request_path: "#{version}/#{processed_path}",
|
|
54
|
+
include_token: false
|
|
55
|
+
)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module ManagedRecurring
|
|
8
|
+
# Retrieves all active managed recurring items.
|
|
9
|
+
class FetchAll < Base::Versioned
|
|
10
|
+
|
|
11
|
+
# FetchAll initialization
|
|
12
|
+
def initialize(configuration, _builder_interface = nil)
|
|
13
|
+
super configuration
|
|
14
|
+
|
|
15
|
+
self.request_path = 'managed_recurring/items'
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
protected
|
|
19
|
+
|
|
20
|
+
# Override default Versioned Network configuration
|
|
21
|
+
def init_configuration
|
|
22
|
+
super
|
|
23
|
+
|
|
24
|
+
init_get_configuration
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# FetchAll request structure
|
|
28
|
+
def request_structure
|
|
29
|
+
{}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module Payee
|
|
8
|
+
module Account
|
|
9
|
+
# Reverify a specific Account that belongs to a specific Payee.
|
|
10
|
+
class Reverify < Request
|
|
11
|
+
|
|
12
|
+
REQUEST_PATH = 'payee/:payee_unique_id/account/:account_unique_id/reverify'
|
|
13
|
+
|
|
14
|
+
attr_accessor :payee_unique_id, :account_unique_id
|
|
15
|
+
|
|
16
|
+
# Reverify Payee Account initialization
|
|
17
|
+
def initialize(configuration, _builder_interface = nil)
|
|
18
|
+
super configuration, Builder::JSON
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
protected
|
|
22
|
+
|
|
23
|
+
# Sets the request field validations
|
|
24
|
+
def init_field_validations
|
|
25
|
+
super
|
|
26
|
+
|
|
27
|
+
required_fields.push *%i[
|
|
28
|
+
payee_unique_id account_unique_id
|
|
29
|
+
]
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Request configuration
|
|
33
|
+
def init_configuration
|
|
34
|
+
init_json_configuration
|
|
35
|
+
|
|
36
|
+
api_config.type = METHOD_POST
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Override API endpoint configuration
|
|
40
|
+
def process_request_parameters
|
|
41
|
+
processed_path = REQUEST_PATH.dup
|
|
42
|
+
.gsub(':payee_unique_id', payee_unique_id.to_s)
|
|
43
|
+
.gsub(':account_unique_id', account_unique_id.to_s)
|
|
44
|
+
|
|
45
|
+
init_api_service_configuration request_path: processed_path
|
|
46
|
+
|
|
47
|
+
super
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Request structure
|
|
51
|
+
def populate_structure
|
|
52
|
+
@tree_structure = {}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module Payee
|
|
8
|
+
# Associate Owners with a specific Payee.
|
|
9
|
+
class AssociatePayeeWithOwners < Base::NonFinancial::Payee::Base
|
|
10
|
+
|
|
11
|
+
attr_accessor :payee_unique_id
|
|
12
|
+
|
|
13
|
+
# Associate Payee With Owners initialization
|
|
14
|
+
def initialize(configuration, _builder_interface = nil)
|
|
15
|
+
super configuration
|
|
16
|
+
|
|
17
|
+
self.request_path = 'payee/:payee_unique_id/owners'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Add a single owner to the owners collection
|
|
21
|
+
def add_owner(unique_id:, **options)
|
|
22
|
+
raise GenesisRuby::InvalidArgumentError, 'Owner unique_id must be a String' unless unique_id.is_a?(String)
|
|
23
|
+
raise GenesisRuby::InvalidArgumentError, 'Owner unique_id is required' if unique_id.empty?
|
|
24
|
+
|
|
25
|
+
validate_percent_ownership(options[:percent_ownership]) if options.key?(:percent_ownership)
|
|
26
|
+
|
|
27
|
+
owners << { unique_id: unique_id }.merge(options)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Assign owners collection with validation
|
|
31
|
+
def owners=(value)
|
|
32
|
+
if value.nil?
|
|
33
|
+
@owners = nil
|
|
34
|
+
elsif !value.is_a?(Array)
|
|
35
|
+
raise GenesisRuby::InvalidArgumentError, 'Owners must be an Array'
|
|
36
|
+
else
|
|
37
|
+
validate_owners_collection(value)
|
|
38
|
+
@owners = value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
protected
|
|
43
|
+
|
|
44
|
+
# Owners collection
|
|
45
|
+
def owners
|
|
46
|
+
@owners ||= []
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Sets the request field validations
|
|
50
|
+
def init_field_validations
|
|
51
|
+
super
|
|
52
|
+
|
|
53
|
+
required_fields.push *%i[
|
|
54
|
+
payee_unique_id
|
|
55
|
+
owners
|
|
56
|
+
]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
private
|
|
60
|
+
|
|
61
|
+
# Validate the owners collection entries
|
|
62
|
+
def validate_owners_collection(value)
|
|
63
|
+
value.each_with_index do |owner, index|
|
|
64
|
+
unless owner.is_a?(Hash) && owner[:unique_id].is_a?(String) && !owner[:unique_id].empty?
|
|
65
|
+
raise GenesisRuby::InvalidArgumentError,
|
|
66
|
+
"Owner at index #{index} must be a Hash with a non-empty String unique_id"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
validate_percent_ownership(owner[:percent_ownership]) if owner.key?(:percent_ownership)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Validate percent_ownership value when provided
|
|
74
|
+
def validate_percent_ownership(value)
|
|
75
|
+
return if value.nil?
|
|
76
|
+
|
|
77
|
+
raise GenesisRuby::InvalidArgumentError, 'percent_ownership must be numeric' unless value.is_a?(Numeric)
|
|
78
|
+
|
|
79
|
+
return if value >= 0.0 && value <= 100.0
|
|
80
|
+
|
|
81
|
+
raise GenesisRuby::InvalidArgumentError, 'percent_ownership must be between 0.0 and 100.0'
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Returns the request structure
|
|
85
|
+
def request_structure
|
|
86
|
+
{
|
|
87
|
+
owners: owners
|
|
88
|
+
}
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Override API endpoint configuration
|
|
92
|
+
def process_request_parameters
|
|
93
|
+
super
|
|
94
|
+
|
|
95
|
+
processed_path = request_path.dup.gsub(':payee_unique_id', payee_unique_id.to_s)
|
|
96
|
+
|
|
97
|
+
init_api_service_configuration request_path: processed_path, include_token: false
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
@@ -11,7 +11,19 @@ module GenesisRuby
|
|
|
11
11
|
PAYEE_TYPE_PERSON = 'person'
|
|
12
12
|
PAYEE_TYPE_COMPANY = 'company'
|
|
13
13
|
|
|
14
|
-
attr_accessor :payee_type, :payee_name, :payee_country
|
|
14
|
+
attr_accessor :payee_type, :payee_name, :payee_country, :payee_notification_url,
|
|
15
|
+
:payee_registration_number, :payee_address_city, :payee_address_street,
|
|
16
|
+
:payee_address_state, :payee_address_country, :payee_address_zip_code
|
|
17
|
+
|
|
18
|
+
# Payee date getter formatted as YYYY-MM-DD
|
|
19
|
+
def payee_date
|
|
20
|
+
@payee_date&.strftime GenesisRuby::Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Payee date setter with date validation
|
|
24
|
+
def payee_date=(value)
|
|
25
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
26
|
+
end
|
|
15
27
|
|
|
16
28
|
# Create Payee initialization
|
|
17
29
|
def initialize(configuration, _builder_interface = nil)
|
|
@@ -30,17 +42,22 @@ module GenesisRuby
|
|
|
30
42
|
payee_type payee_name payee_country
|
|
31
43
|
]
|
|
32
44
|
|
|
33
|
-
field_values.merge! payee_type:
|
|
34
|
-
payee_country:
|
|
45
|
+
field_values.merge! payee_type: [PAYEE_TYPE_PERSON, PAYEE_TYPE_COMPANY],
|
|
46
|
+
payee_country: GenesisRuby::Utils::Country::COUNTRIES.keys,
|
|
47
|
+
payee_address_country: GenesisRuby::Utils::Country::COUNTRIES.keys
|
|
35
48
|
end
|
|
36
49
|
|
|
37
50
|
# Returns the request structure
|
|
38
|
-
def request_structure
|
|
51
|
+
def request_structure # rubocop:disable Metrics/MethodLength
|
|
39
52
|
{
|
|
40
53
|
payee: {
|
|
41
|
-
type:
|
|
42
|
-
name:
|
|
43
|
-
country:
|
|
54
|
+
type: payee_type,
|
|
55
|
+
name: payee_name,
|
|
56
|
+
country: payee_country,
|
|
57
|
+
date: payee_date,
|
|
58
|
+
notification_url: payee_notification_url,
|
|
59
|
+
registration_number: payee_registration_number,
|
|
60
|
+
address: payee_address_structure
|
|
44
61
|
}
|
|
45
62
|
}
|
|
46
63
|
end
|
|
@@ -52,6 +69,19 @@ module GenesisRuby
|
|
|
52
69
|
init_api_service_configuration request_path: request_path, include_token: false
|
|
53
70
|
end
|
|
54
71
|
|
|
72
|
+
private
|
|
73
|
+
|
|
74
|
+
# Build the nested address structure
|
|
75
|
+
def payee_address_structure
|
|
76
|
+
{
|
|
77
|
+
city: payee_address_city,
|
|
78
|
+
street: payee_address_street,
|
|
79
|
+
state: payee_address_state,
|
|
80
|
+
country: payee_address_country,
|
|
81
|
+
zip_code: payee_address_zip_code
|
|
82
|
+
}
|
|
83
|
+
end
|
|
84
|
+
|
|
55
85
|
end
|
|
56
86
|
end
|
|
57
87
|
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'genesis_ruby/api/constants/non_financial/payee/document_types'
|
|
4
|
+
|
|
5
|
+
module GenesisRuby
|
|
6
|
+
module Api
|
|
7
|
+
module Requests
|
|
8
|
+
module NonFinancial
|
|
9
|
+
module Payee
|
|
10
|
+
# Create a Document for a specific Payee.
|
|
11
|
+
class CreatePayeeDocument < Base::NonFinancial::Payee::Base
|
|
12
|
+
|
|
13
|
+
attr_accessor :payee_unique_id, :document_type, :file
|
|
14
|
+
|
|
15
|
+
# Create Payee Document initialization
|
|
16
|
+
def initialize(configuration, _builder_interface = nil)
|
|
17
|
+
super configuration
|
|
18
|
+
|
|
19
|
+
self.request_path = 'payee/:payee_unique_id/documents'
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
protected
|
|
23
|
+
|
|
24
|
+
# Sets the request field validations
|
|
25
|
+
def init_field_validations
|
|
26
|
+
super
|
|
27
|
+
|
|
28
|
+
required_fields.push *%i[
|
|
29
|
+
payee_unique_id
|
|
30
|
+
document_type
|
|
31
|
+
file
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
field_values.merge! document_type: GenesisRuby::Api::Constants::NonFinancial::Payee::DocumentTypes.all
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns the request structure
|
|
38
|
+
def request_structure
|
|
39
|
+
{
|
|
40
|
+
document: {
|
|
41
|
+
document_type: document_type,
|
|
42
|
+
file: file
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Override API endpoint configuration
|
|
48
|
+
def process_request_parameters
|
|
49
|
+
super
|
|
50
|
+
|
|
51
|
+
processed_path = request_path.dup.gsub(':payee_unique_id', payee_unique_id.to_s)
|
|
52
|
+
|
|
53
|
+
init_api_service_configuration request_path: processed_path, include_token: false
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module Payee
|
|
8
|
+
# Dissociate Owners from a specific Payee.
|
|
9
|
+
class DissociatePayeeWithOwners < Base::NonFinancial::Payee::Base
|
|
10
|
+
|
|
11
|
+
attr_accessor :payee_unique_id
|
|
12
|
+
|
|
13
|
+
# Dissociate Payee With Owners initialization
|
|
14
|
+
def initialize(configuration, _builder_interface = nil)
|
|
15
|
+
super configuration
|
|
16
|
+
|
|
17
|
+
self.request_path = 'payee/:payee_unique_id/owners'
|
|
18
|
+
|
|
19
|
+
init_delete_configuration
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# Add a unique_id to the collection of owners to dissociate
|
|
23
|
+
def add_unique_id(value)
|
|
24
|
+
raise GenesisRuby::InvalidArgumentError, 'Unique ID must be a String' unless value.is_a?(String)
|
|
25
|
+
raise GenesisRuby::InvalidArgumentError, 'Unique ID is required' if value.empty?
|
|
26
|
+
|
|
27
|
+
unique_ids << value
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Assign unique_ids collection with validation
|
|
31
|
+
def unique_ids=(value)
|
|
32
|
+
if value.nil?
|
|
33
|
+
@unique_ids = nil
|
|
34
|
+
elsif !value.is_a?(Array)
|
|
35
|
+
raise GenesisRuby::InvalidArgumentError, 'Unique IDs must be an Array'
|
|
36
|
+
else
|
|
37
|
+
validate_unique_ids_collection(value)
|
|
38
|
+
@unique_ids = value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
protected
|
|
43
|
+
|
|
44
|
+
# Unique IDs collection
|
|
45
|
+
def unique_ids
|
|
46
|
+
@unique_ids ||= []
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Sets the request field validations
|
|
50
|
+
def init_field_validations
|
|
51
|
+
super
|
|
52
|
+
|
|
53
|
+
required_fields.push *%i[
|
|
54
|
+
payee_unique_id
|
|
55
|
+
unique_ids
|
|
56
|
+
]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns the request structure
|
|
60
|
+
def request_structure
|
|
61
|
+
{
|
|
62
|
+
owners: {
|
|
63
|
+
unique_ids: unique_ids
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# Override API endpoint configuration
|
|
69
|
+
def process_request_parameters
|
|
70
|
+
super
|
|
71
|
+
|
|
72
|
+
processed_path = request_path.dup.gsub(':payee_unique_id', payee_unique_id.to_s)
|
|
73
|
+
|
|
74
|
+
init_api_service_configuration request_path: processed_path, include_token: false
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
private
|
|
78
|
+
|
|
79
|
+
# Validate unique_ids collection entries
|
|
80
|
+
def validate_unique_ids_collection(value)
|
|
81
|
+
value.each_with_index do |uid, index|
|
|
82
|
+
unless uid.is_a?(String) && !uid.empty?
|
|
83
|
+
raise GenesisRuby::InvalidArgumentError,
|
|
84
|
+
"Unique ID at index #{index} must be a non-empty String"
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module Payee
|
|
8
|
+
# Retrieve the details of all Payees.
|
|
9
|
+
class List < Request
|
|
10
|
+
|
|
11
|
+
REQUEST_PATH = 'payee'
|
|
12
|
+
|
|
13
|
+
def initialize(configuration, _builder_interface = nil)
|
|
14
|
+
super configuration, Builder::JSON
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
protected
|
|
18
|
+
|
|
19
|
+
# Request configuration
|
|
20
|
+
def init_configuration
|
|
21
|
+
init_json_configuration
|
|
22
|
+
|
|
23
|
+
api_config.type = METHOD_GET
|
|
24
|
+
|
|
25
|
+
init_api_service_configuration request_path: REQUEST_PATH
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Request structure
|
|
29
|
+
def populate_structure
|
|
30
|
+
@tree_structure = {}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module NonFinancial
|
|
7
|
+
module Payee
|
|
8
|
+
# Retrieve the details of all Document records that belongs to specific Payee.
|
|
9
|
+
class ListPayeeDocuments < Base::NonFinancial::Payee::Base
|
|
10
|
+
|
|
11
|
+
attr_accessor :payee_unique_id
|
|
12
|
+
|
|
13
|
+
# List Payee Documents initialization
|
|
14
|
+
def initialize(configuration, _builder_interface = nil)
|
|
15
|
+
super configuration
|
|
16
|
+
|
|
17
|
+
self.request_path = 'payee/:payee_unique_id/documents'
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
protected
|
|
21
|
+
|
|
22
|
+
# Override default Versioned Network configuration
|
|
23
|
+
def init_configuration
|
|
24
|
+
super
|
|
25
|
+
|
|
26
|
+
init_get_configuration
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# Sets the request field validations
|
|
30
|
+
def init_field_validations
|
|
31
|
+
super
|
|
32
|
+
|
|
33
|
+
required_fields.push *%i[
|
|
34
|
+
payee_unique_id
|
|
35
|
+
]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns the request structure
|
|
39
|
+
def request_structure
|
|
40
|
+
{}
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Override API endpoint configuration
|
|
44
|
+
def process_request_parameters
|
|
45
|
+
processed_path = request_path.dup.gsub(':payee_unique_id', payee_unique_id.to_s)
|
|
46
|
+
|
|
47
|
+
init_api_service_configuration request_path: processed_path, include_token: false
|
|
48
|
+
|
|
49
|
+
super
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|