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
|
@@ -57,16 +57,6 @@ module GenesisRuby
|
|
|
57
57
|
}
|
|
58
58
|
end
|
|
59
59
|
|
|
60
|
-
# Field value dependencies for MPI parameters
|
|
61
|
-
def mpi_attributes_field_dependencies
|
|
62
|
-
{
|
|
63
|
-
mpi_protocol_version: Hash[
|
|
64
|
-
Api::Constants::Transactions::Parameters::MpiProtocolVersions::PROTOCOL_VERSION_2,
|
|
65
|
-
%w(mpi_directory_server_id)
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
end
|
|
69
|
-
|
|
70
60
|
end
|
|
71
61
|
end
|
|
72
62
|
end
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/money_transfer/types'
|
|
4
|
+
require 'genesis_ruby/api/constants/transactions/parameters/money_transfer/sender_account_number_types'
|
|
5
|
+
require 'genesis_ruby/api/constants/transactions/parameters/money_transfer/purpose_of_payments'
|
|
6
|
+
require 'genesis_ruby/api/constants/transactions/parameters/money_transfer/source_of_funds'
|
|
7
|
+
|
|
8
|
+
module GenesisRuby
|
|
9
|
+
module Api
|
|
10
|
+
module Mixins
|
|
11
|
+
module Requests
|
|
12
|
+
module Financial
|
|
13
|
+
# Money Transfer Payout Attributes
|
|
14
|
+
module MoneyTransferPayoutAttributes
|
|
15
|
+
|
|
16
|
+
attr_accessor :money_transfer_sender_account_number,
|
|
17
|
+
:money_transfer_service_provider_name,
|
|
18
|
+
:money_transfer_sender_address_country,
|
|
19
|
+
:money_transfer_sender_address_city,
|
|
20
|
+
:money_transfer_sender_address_line,
|
|
21
|
+
:money_transfer_sender_address_state,
|
|
22
|
+
:money_transfer_sender_address_postal_code,
|
|
23
|
+
:money_transfer_receiver_first_name,
|
|
24
|
+
:money_transfer_receiver_last_name,
|
|
25
|
+
:money_transfer_receiver_address_country,
|
|
26
|
+
:money_transfer_receiver_address_city,
|
|
27
|
+
:money_transfer_receiver_address_line,
|
|
28
|
+
:money_transfer_receiver_address_state,
|
|
29
|
+
:money_transfer_receiver_address_postal_code,
|
|
30
|
+
:money_transfer_receiver_account_number,
|
|
31
|
+
:money_transfer_receiver_account_number_type
|
|
32
|
+
|
|
33
|
+
attr_reader :money_transfer_type, :money_transfer_sender_account_number_type,
|
|
34
|
+
:money_transfer_purpose_of_payment, :money_transfer_source_of_funds
|
|
35
|
+
|
|
36
|
+
# Money Transfer Type setter
|
|
37
|
+
def money_transfer_type=(value)
|
|
38
|
+
allowed_options(
|
|
39
|
+
attribute: __method__,
|
|
40
|
+
allowed: Api::Constants::Transactions::Parameters::MoneyTransfer::Types.all,
|
|
41
|
+
value: value,
|
|
42
|
+
error_message: 'Invalid data for Money Transfer Type',
|
|
43
|
+
allow_empty: true
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Money Transfer Sender Account Number Type setter
|
|
48
|
+
def money_transfer_sender_account_number_type=(value)
|
|
49
|
+
allowed_options(
|
|
50
|
+
attribute: __method__,
|
|
51
|
+
allowed: Api::Constants::Transactions::Parameters::MoneyTransfer::
|
|
52
|
+
SenderAccountNumberTypes.all,
|
|
53
|
+
value: value,
|
|
54
|
+
error_message: 'Invalid data for Money Transfer Sender Account Number Type',
|
|
55
|
+
allow_empty: true
|
|
56
|
+
)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Money Transfer Purpose of Payment setter
|
|
60
|
+
def money_transfer_purpose_of_payment=(value)
|
|
61
|
+
allowed_options(
|
|
62
|
+
attribute: __method__,
|
|
63
|
+
allowed: Api::Constants::Transactions::Parameters::MoneyTransfer::PurposeOfPayments.all,
|
|
64
|
+
value: value,
|
|
65
|
+
error_message: 'Invalid data for Money Transfer Purpose of Payment',
|
|
66
|
+
allow_empty: true
|
|
67
|
+
)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Money Transfer Source of Funds setter
|
|
71
|
+
def money_transfer_source_of_funds=(value)
|
|
72
|
+
allowed_options(
|
|
73
|
+
attribute: __method__,
|
|
74
|
+
allowed: Api::Constants::Transactions::Parameters::MoneyTransfer::SourceOfFunds.all,
|
|
75
|
+
value: value,
|
|
76
|
+
error_message: 'Invalid data for Money Transfer Source of Funds',
|
|
77
|
+
allow_empty: true
|
|
78
|
+
)
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Money Transfer Sender Birth Date accessor
|
|
82
|
+
def money_transfer_sender_birth_date
|
|
83
|
+
@money_transfer_sender_birth_date&.strftime(
|
|
84
|
+
Api::Constants::DateTimeFormats::DD_MM_YYYY_L_HYPHENS
|
|
85
|
+
)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Money Transfer Sender Birth Date setter
|
|
89
|
+
def money_transfer_sender_birth_date=(value)
|
|
90
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
protected
|
|
94
|
+
|
|
95
|
+
# Money Transfer Payout Attributes Structure
|
|
96
|
+
def money_transfer_payout_attributes_structure # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
|
97
|
+
{
|
|
98
|
+
type: money_transfer_type,
|
|
99
|
+
sender_account_number: money_transfer_sender_account_number,
|
|
100
|
+
sender_birth_date: money_transfer_sender_birth_date,
|
|
101
|
+
service_provider_name: money_transfer_service_provider_name,
|
|
102
|
+
sender_account_number_type: money_transfer_sender_account_number_type,
|
|
103
|
+
purpose_of_payment: money_transfer_purpose_of_payment,
|
|
104
|
+
source_of_funds: money_transfer_source_of_funds,
|
|
105
|
+
sender_address: {
|
|
106
|
+
country: money_transfer_sender_address_country,
|
|
107
|
+
city: money_transfer_sender_address_city,
|
|
108
|
+
line: money_transfer_sender_address_line,
|
|
109
|
+
state: money_transfer_sender_address_state,
|
|
110
|
+
postal_code: money_transfer_sender_address_postal_code
|
|
111
|
+
},
|
|
112
|
+
receiver: {
|
|
113
|
+
first_name: money_transfer_receiver_first_name,
|
|
114
|
+
last_name: money_transfer_receiver_last_name,
|
|
115
|
+
country: money_transfer_receiver_address_country,
|
|
116
|
+
city: money_transfer_receiver_address_city,
|
|
117
|
+
line: money_transfer_receiver_address_line,
|
|
118
|
+
state: money_transfer_receiver_address_state,
|
|
119
|
+
postal_code: money_transfer_receiver_address_postal_code,
|
|
120
|
+
account_number: money_transfer_receiver_account_number,
|
|
121
|
+
account_number_type: money_transfer_receiver_account_number_type
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|
|
@@ -15,38 +15,100 @@ module GenesisRuby
|
|
|
15
15
|
else
|
|
16
16
|
Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
17
17
|
end
|
|
18
|
-
|
|
19
18
|
@start_date&.strftime format
|
|
20
19
|
end
|
|
21
20
|
|
|
22
21
|
# Start of the requested date range (time is optional)
|
|
23
22
|
def start_date=(value)
|
|
24
23
|
self.start_date_time = Utils::Common.date_has_time? value
|
|
25
|
-
|
|
26
24
|
parse_date attribute: __method__, value: value, allow_empty: true
|
|
27
25
|
end
|
|
28
26
|
|
|
29
|
-
#
|
|
27
|
+
# End of the requested date range (time is optional)
|
|
30
28
|
def end_date
|
|
31
29
|
format = if end_date_time?
|
|
32
30
|
Api::Constants::DateTimeFormats::YYYY_MM_DD_H_I_S
|
|
33
31
|
else
|
|
34
32
|
Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
35
33
|
end
|
|
36
|
-
|
|
37
34
|
@end_date&.strftime format
|
|
38
35
|
end
|
|
39
36
|
|
|
40
37
|
# End of the requested date range (time is optional)
|
|
41
38
|
def end_date=(value)
|
|
42
39
|
self.end_date_time = Utils::Common.date_has_time? value
|
|
40
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Start of the requested date range in UTC.
|
|
44
|
+
def start_date_from
|
|
45
|
+
format = if start_date_from_time?
|
|
46
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_H_I_S
|
|
47
|
+
else
|
|
48
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
49
|
+
end
|
|
50
|
+
@start_date_from&.strftime format
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Start of the requested date range in UTC.
|
|
54
|
+
def start_date_from=(value)
|
|
55
|
+
self.start_date_from_time = Utils::Common.date_has_time? value
|
|
56
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# End of the requested date range in UTC.
|
|
60
|
+
def start_date_to
|
|
61
|
+
format = if start_date_to_time?
|
|
62
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_H_I_S
|
|
63
|
+
else
|
|
64
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
65
|
+
end
|
|
66
|
+
@start_date_to&.strftime format
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# End of the requested date range in UTC.
|
|
70
|
+
def start_date_to=(value)
|
|
71
|
+
self.start_date_to_time = Utils::Common.date_has_time? value
|
|
72
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Start of the requested date range in UTC.
|
|
76
|
+
def end_date_from
|
|
77
|
+
format = if end_date_from_time?
|
|
78
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_H_I_S
|
|
79
|
+
else
|
|
80
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
81
|
+
end
|
|
82
|
+
@end_date_from&.strftime format
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Start of the requested date range in UTC.
|
|
86
|
+
def end_date_from=(value)
|
|
87
|
+
self.end_date_from_time = Utils::Common.date_has_time? value
|
|
88
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# End of the requested date range in UTC.
|
|
92
|
+
def end_date_to
|
|
93
|
+
format = if end_date_to_time?
|
|
94
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_H_I_S
|
|
95
|
+
else
|
|
96
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
97
|
+
end
|
|
98
|
+
@end_date_to&.strftime format
|
|
99
|
+
end
|
|
43
100
|
|
|
101
|
+
# End of the requested date range in UTC.
|
|
102
|
+
def end_date_to=(value)
|
|
103
|
+
self.end_date_to_time = Utils::Common.date_has_time? value
|
|
44
104
|
parse_date attribute: __method__, value: value, allow_empty: true
|
|
45
105
|
end
|
|
46
106
|
|
|
47
107
|
private
|
|
48
108
|
|
|
49
|
-
attr_accessor :start_date_time, :end_date_time
|
|
109
|
+
attr_accessor :start_date_time, :end_date_time,
|
|
110
|
+
:start_date_from_time, :start_date_to_time,
|
|
111
|
+
:end_date_from_time, :end_date_to_time
|
|
50
112
|
|
|
51
113
|
# Start Date has time within the given string
|
|
52
114
|
def start_date_time?
|
|
@@ -58,6 +120,26 @@ module GenesisRuby
|
|
|
58
120
|
self.end_date_time ||= false
|
|
59
121
|
end
|
|
60
122
|
|
|
123
|
+
# Start Date has time within the given string
|
|
124
|
+
def start_date_from_time?
|
|
125
|
+
self.start_date_from_time ||= false
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# End Date has time within the given string
|
|
129
|
+
def start_date_to_time?
|
|
130
|
+
self.start_date_to_time ||= false
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# End Date has time within the given string
|
|
134
|
+
def end_date_from_time?
|
|
135
|
+
self.end_date_from_time ||= false
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
# End Date has time within the given string
|
|
139
|
+
def end_date_to_time?
|
|
140
|
+
self.end_date_to_time ||= false
|
|
141
|
+
end
|
|
142
|
+
|
|
61
143
|
end
|
|
62
144
|
end
|
|
63
145
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Mixins
|
|
6
|
+
module Requests
|
|
7
|
+
module NonFinancial
|
|
8
|
+
module Kyc
|
|
9
|
+
# Business-related AML screening attributes
|
|
10
|
+
module BusinessAttributes
|
|
11
|
+
|
|
12
|
+
attr_accessor :business_name
|
|
13
|
+
|
|
14
|
+
# Date of incorporation of the business
|
|
15
|
+
def business_incorporation_date
|
|
16
|
+
@business_incorporation_date&.strftime(
|
|
17
|
+
GenesisRuby::Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
18
|
+
)
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Date of incorporation of the business
|
|
22
|
+
def business_incorporation_date=(value)
|
|
23
|
+
parse_date attribute: __method__, value: value, allow_empty: true
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
protected
|
|
27
|
+
|
|
28
|
+
# Defines the structure of the business attributes
|
|
29
|
+
def business_attributes_structure
|
|
30
|
+
{
|
|
31
|
+
name: business_name,
|
|
32
|
+
incorporation_date: business_incorporation_date
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -9,7 +9,7 @@ module GenesisRuby
|
|
|
9
9
|
# Document Attributes mixin
|
|
10
10
|
module DocumentAttributes
|
|
11
11
|
|
|
12
|
-
attr_accessor :proof, :full_address
|
|
12
|
+
attr_accessor :proof, :additional_proof, :full_address
|
|
13
13
|
attr_reader :first_name, :middle_name, :last_name
|
|
14
14
|
|
|
15
15
|
# Gets date of birth for the document attributes
|
|
@@ -44,12 +44,13 @@ module GenesisRuby
|
|
|
44
44
|
# Defines the structure of the document attributes
|
|
45
45
|
def document_attributes_structure
|
|
46
46
|
{
|
|
47
|
-
proof:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
proof: proof,
|
|
48
|
+
additional_proof: additional_proof,
|
|
49
|
+
date_of_birth: date_of_birth,
|
|
50
|
+
first_name: first_name,
|
|
51
|
+
middle_name: middle_name,
|
|
52
|
+
last_name: last_name,
|
|
53
|
+
full_address: full_address
|
|
53
54
|
}
|
|
54
55
|
end
|
|
55
56
|
|
|
@@ -15,12 +15,13 @@ module GenesisRuby
|
|
|
15
15
|
include Mixins::Requests::AttributeValidation
|
|
16
16
|
|
|
17
17
|
PROTOCOL_HTTPS = 'https'
|
|
18
|
-
PORT_HTTPS
|
|
18
|
+
PORT_HTTPS = 443
|
|
19
19
|
|
|
20
|
-
METHOD_POST
|
|
21
|
-
METHOD_GET
|
|
22
|
-
METHOD_PUT
|
|
23
|
-
METHOD_PATCH
|
|
20
|
+
METHOD_POST = 'POST'
|
|
21
|
+
METHOD_GET = 'GET'
|
|
22
|
+
METHOD_PUT = 'PUT'
|
|
23
|
+
METHOD_PATCH = 'PATCH'
|
|
24
|
+
METHOD_DELETE = 'DELETE'
|
|
24
25
|
|
|
25
26
|
AUTH_TYPE_BASIC = 'basic'
|
|
26
27
|
AUTH_TYPE_TOKEN = 'bearer'
|
|
@@ -28,9 +29,9 @@ module GenesisRuby
|
|
|
28
29
|
attr_reader :api_config
|
|
29
30
|
|
|
30
31
|
def initialize(configuration, builder_interface = 'xml')
|
|
31
|
-
@configuration
|
|
32
|
+
@configuration = configuration
|
|
32
33
|
@builder_interface = builder_interface
|
|
33
|
-
@api_config
|
|
34
|
+
@api_config = GenesisRuby::Utils::Options::ApiConfig.new
|
|
34
35
|
|
|
35
36
|
init_configuration
|
|
36
37
|
init_field_validations
|
|
@@ -91,9 +92,14 @@ module GenesisRuby
|
|
|
91
92
|
@api_config.load_patch_config
|
|
92
93
|
end
|
|
93
94
|
|
|
95
|
+
# Pre-defined DELETE Request Configuration
|
|
96
|
+
def init_delete_configuration
|
|
97
|
+
@api_config.load_delete_config
|
|
98
|
+
end
|
|
99
|
+
|
|
94
100
|
# Initializes Api EndPoint Url with request path & terminal token
|
|
95
101
|
def init_api_gateway_configuration(options = { request_path: 'process', include_token: true })
|
|
96
|
-
request_path
|
|
102
|
+
request_path = options.fetch :request_path, 'process'
|
|
97
103
|
include_token = options.fetch :include_token, true
|
|
98
104
|
|
|
99
105
|
api_config.url = build_request_url(
|
|
@@ -168,7 +174,7 @@ module GenesisRuby
|
|
|
168
174
|
# path - the requested service /blacklists, threeds/threeds_method/<unique_id>, wpf/reconcile, etc/
|
|
169
175
|
# token - the MID configuration, appended to the end of the URL
|
|
170
176
|
def build_request_url(options = { subdomain: 'gateway', path: '', token: '' })
|
|
171
|
-
options
|
|
177
|
+
options = parse_request_parameters(options)
|
|
172
178
|
|
|
173
179
|
format('%{protocol}://%{sub}%{domain}:%{port}/%{path}', {
|
|
174
180
|
protocol: api_config.protocol || PROTOCOL_HTTPS,
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/order_by_fields'
|
|
4
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/sort_directions'
|
|
5
|
+
|
|
6
|
+
module GenesisRuby
|
|
7
|
+
module Api
|
|
8
|
+
module Requests
|
|
9
|
+
module Base
|
|
10
|
+
module NonFinancial
|
|
11
|
+
module BillingApi
|
|
12
|
+
# Base class for Billing API GraphQL requests
|
|
13
|
+
class Base < Requests::Base::Graphql
|
|
14
|
+
|
|
15
|
+
include Api::Mixins::Requests::NonFinancial::BillingApi::SortAttributes
|
|
16
|
+
include Api::Mixins::Requests::NonFinancial::DateAttributes
|
|
17
|
+
include Api::Mixins::Requests::NonFinancial::PagingAttributes
|
|
18
|
+
|
|
19
|
+
# List of billing statement names
|
|
20
|
+
def billing_statement
|
|
21
|
+
@billing_statement || []
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# List of billing statement names
|
|
25
|
+
def billing_statement=(value)
|
|
26
|
+
parse_array_of_strings attribute: __method__, value: value, allow_empty: true
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
protected
|
|
30
|
+
|
|
31
|
+
# Billing API Authorization Token
|
|
32
|
+
def init_authorization_token
|
|
33
|
+
api_config.bearer_token = configuration.billing_api_token
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Additional optional filter arguments (sort + paging)
|
|
37
|
+
def additional_arguments
|
|
38
|
+
[request_order, request_paging].reject(&:empty?).join(' ')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Validate max size of an array attribute
|
|
42
|
+
def validate_array_size(attribute, size)
|
|
43
|
+
return if __send__(attribute).length <= size
|
|
44
|
+
|
|
45
|
+
raise ParameterError,
|
|
46
|
+
format('Max array length on %{attribute} exceed allowed size of %{size}',
|
|
47
|
+
attribute: attribute, size: size)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Validate a pair of date attributes: both required, from < to
|
|
51
|
+
def validate_date_range(from_attr, to_attr, max_days_difference = 7)
|
|
52
|
+
from_val = instance_variable_get("@#{from_attr}")
|
|
53
|
+
to_val = instance_variable_get("@#{to_attr}")
|
|
54
|
+
message = "If filter #{from_attr} is provided, then #{to_attr} should also be provided and vice versa."
|
|
55
|
+
|
|
56
|
+
raise ParameterError, message unless from_val.is_a?(DateTime) && to_val.is_a?(DateTime)
|
|
57
|
+
raise ParameterError, "#{to_attr} must be after #{from_attr}!" if from_val >= to_val
|
|
58
|
+
|
|
59
|
+
days_diff = to_val - from_val
|
|
60
|
+
return unless days_diff > max_days_difference
|
|
61
|
+
|
|
62
|
+
raise ParameterError, "Maximum difference between date range is #{max_days_difference} days"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Wraps a date attribute value in GraphQL double-quotes, or returns nil if blank
|
|
66
|
+
def escape_argument(attribute)
|
|
67
|
+
val = __send__(attribute)
|
|
68
|
+
val.to_s.empty? ? nil : "\"#{val}\""
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Wraps a string value in GraphQL double-quotes, or returns nil if blank
|
|
72
|
+
def escape_string(val)
|
|
73
|
+
val.to_s.empty? ? nil : "\"#{val}\""
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
private
|
|
77
|
+
|
|
78
|
+
# Generate the paging part of the GraphQL query
|
|
79
|
+
def request_paging
|
|
80
|
+
paging = {}
|
|
81
|
+
paging[:page] = page if page
|
|
82
|
+
paging[:perPage] = per_page if per_page
|
|
83
|
+
generate_graphql_code(paging, 'paging')
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Generate the sort/order part of the GraphQL query
|
|
87
|
+
def request_order
|
|
88
|
+
elements = {}
|
|
89
|
+
elements[:byDirection] = sort_by_direction if sort_by_direction
|
|
90
|
+
elements[:byField] = sort_by_field if sort_by_field
|
|
91
|
+
generate_graphql_code(elements, 'sort')
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Render a GraphQL inline argument block: key { k: v ... }
|
|
95
|
+
def generate_graphql_code(hash, key)
|
|
96
|
+
return '' if hash.empty?
|
|
97
|
+
|
|
98
|
+
pairs = hash.map { |param, value| "#{param}: #{value.inspect}" }.join(', ')
|
|
99
|
+
"#{key} { #{pairs} }"
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Requests
|
|
6
|
+
module Base
|
|
7
|
+
module NonFinancial
|
|
8
|
+
module Payee
|
|
9
|
+
# Base Request class for Payee Non-Financial API services (non-versioned)
|
|
10
|
+
class Base < Api::Request
|
|
11
|
+
|
|
12
|
+
protected
|
|
13
|
+
|
|
14
|
+
attr_reader :request_path
|
|
15
|
+
|
|
16
|
+
# Constructor for the Payee Base Request
|
|
17
|
+
def initialize(configuration, _builder_interface = nil)
|
|
18
|
+
super configuration, Builder::JSON
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Defines the endpoint of the request
|
|
22
|
+
def request_path=(value)
|
|
23
|
+
@request_path = value.to_s
|
|
24
|
+
|
|
25
|
+
init_configuration
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Initialize Request configuration
|
|
29
|
+
def init_configuration
|
|
30
|
+
super
|
|
31
|
+
|
|
32
|
+
init_json_configuration
|
|
33
|
+
init_api_service_configuration request_path: request_path if request_path && !request_path.empty?
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Request structure. Overridden for common structure parameters
|
|
37
|
+
def populate_structure
|
|
38
|
+
super
|
|
39
|
+
|
|
40
|
+
@tree_structure = request_structure
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Request structure
|
|
44
|
+
def request_structure
|
|
45
|
+
{}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
@@ -51,14 +51,12 @@ module GenesisRuby
|
|
|
51
51
|
|
|
52
52
|
field_value_dependencies.merge! required_tokenization_fields_conditional, required_cc_fields_conditional,
|
|
53
53
|
required_recurring_managed_type_field_conditional,
|
|
54
|
-
threeds_field_conditional_validations
|
|
54
|
+
threeds_field_conditional_validations
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
# Special validations upon document building
|
|
58
58
|
def check_requirements
|
|
59
59
|
validate_threeds_card_holder_dates
|
|
60
|
-
# MPI Directory Server ID is optional when Scheme Tokenized with MPI Protocol Version 2
|
|
61
|
-
field_value_dependencies.delete :mpi_protocol_version if scheme_tokenized
|
|
62
60
|
|
|
63
61
|
super
|
|
64
62
|
end
|
|
@@ -20,6 +20,7 @@ module GenesisRuby
|
|
|
20
20
|
include Mixins::Requests::Financial::CustomerIdentificationAttributes
|
|
21
21
|
include Mixins::Requests::Financial::DynamicDescriptorAttributes
|
|
22
22
|
include Mixins::Requests::Financial::GamingAttributes
|
|
23
|
+
include Mixins::Requests::Financial::MoneyTransferPayoutAttributes
|
|
23
24
|
include Mixins::Requests::Financial::MotoAttributes
|
|
24
25
|
include Mixins::Requests::Financial::PurposeOfPaymentAttributes
|
|
25
26
|
include Mixins::Requests::Financial::SourceOfFundsAttributes
|
|
@@ -61,7 +62,8 @@ module GenesisRuby
|
|
|
61
62
|
billing_address: billing_address_parameters_structure,
|
|
62
63
|
shipping_address: shipping_address_parameters_structure,
|
|
63
64
|
customer_identification: customer_identification_attributes_structure,
|
|
64
|
-
dynamic_descriptor_params: dynamic_descriptor_structure
|
|
65
|
+
dynamic_descriptor_params: dynamic_descriptor_structure,
|
|
66
|
+
money_transfer: money_transfer_payout_attributes_structure
|
|
65
67
|
}
|
|
66
68
|
)
|
|
67
69
|
end
|
|
@@ -49,14 +49,12 @@ module GenesisRuby
|
|
|
49
49
|
|
|
50
50
|
field_value_dependencies.merge! required_tokenization_fields_conditional, required_cc_fields_conditional,
|
|
51
51
|
required_recurring_managed_type_field_conditional,
|
|
52
|
-
threeds_field_conditional_validations
|
|
52
|
+
threeds_field_conditional_validations
|
|
53
53
|
end
|
|
54
54
|
|
|
55
55
|
# Special validations upon document building
|
|
56
56
|
def check_requirements
|
|
57
57
|
validate_threeds_card_holder_dates
|
|
58
|
-
# MPI Directory Server ID is optional when Scheme Tokenized with MPI Protocol Version 2
|
|
59
|
-
field_value_dependencies.delete :mpi_protocol_version if scheme_tokenized
|
|
60
58
|
|
|
61
59
|
super
|
|
62
60
|
end
|