genesis_ruby 0.3.2 → 0.4.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/CHANGELOG.md +35 -0
- data/README.md +169 -1
- data/VERSION +1 -1
- data/lib/genesis_ruby/api/constants/non_financial/alternatives/alipay/merchant_types.rb +26 -0
- data/lib/genesis_ruby/api/constants/non_financial/alternatives/alipay/site_types.rb +26 -0
- data/lib/genesis_ruby/api/constants/non_financial/kyc/bank_account_types.rb +24 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/foreign_retailer_indicators.rb +24 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/funding/person_types.rb +26 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/purpose_of_payments.rb +46 -19
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/sender_account_number_types.rb +14 -17
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/source_of_funds.rb +9 -18
- data/lib/genesis_ruby/api/constants/transactions/parameters/money_transfer/types.rb +31 -4
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/enhanced_statement_response_fields.rb +39 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/response_fields.rb +2 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/statement_order_by_fields.rb +31 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/billing_api/statement_response_fields.rb +14 -13
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/{processing_type.rb → scopes.rb} +4 -3
- data/lib/genesis_ruby/api/constants/transactions/parameters/purpose_of_payment.rb +117 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/purpose_of_payment_values.rb +267 -0
- data/lib/genesis_ruby/api/constants/transactions/parameters/wallets/e_wallet/payment_types.rb +46 -0
- data/lib/genesis_ruby/api/constants/transactions.rb +9 -0
- data/lib/genesis_ruby/api/mixins/requests/customer_address/billing_info_attributes.rb +3 -1
- data/lib/genesis_ruby/api/mixins/requests/financial/cards/credential_on_file_transaction_link_attributes.rb +83 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/commercial_card_attributes.rb +143 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/funding_attributes.rb +32 -3
- data/lib/genesis_ruby/api/mixins/requests/financial/marketplace_data_attributes.rb +179 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/money_transfer_payout_attributes.rb +49 -46
- data/lib/genesis_ruby/api/mixins/requests/financial/order_attributes.rb +36 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/purpose_of_payment_attributes.rb +14 -4
- data/lib/genesis_ruby/api/mixins/requests/financial/refund/bank_attributes.rb +41 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/refund/beneficiary_attributes.rb +31 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/refund/travel_ticket_attributes.rb +52 -0
- data/lib/genesis_ruby/api/mixins/requests/financial/threeds/force_threeds_attributes.rb +29 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/alternatives/alipay/site_information_attributes.rb +57 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/date_time_from_to_attributes.rb +102 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/background_checks_attributes.rb +31 -10
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/verification_document_attributes.rb +49 -7
- data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/verification_instructions_attributes.rb +90 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/reconcile_order_attributes.rb +30 -0
- data/lib/genesis_ruby/api/mixins/requests/non_financial/scope_attributes.rb +29 -0
- data/lib/genesis_ruby/api/mixins/requests/restricted_setter.rb +12 -0
- data/lib/genesis_ruby/api/mixins/requests/scheme_tokenized_attributes.rb +35 -0
- data/lib/genesis_ruby/api/requests/base/financials/credit_card.rb +1 -12
- data/lib/genesis_ruby/api/requests/base/graphql.rb +7 -0
- data/lib/genesis_ruby/api/requests/base/non_financial/billing_api/abstract_statement.rb +226 -0
- data/lib/genesis_ruby/api/requests/base/non_financial/billing_api/base.rb +39 -37
- data/lib/genesis_ruby/api/requests/base/non_financial/reconcile/base.rb +45 -0
- data/lib/genesis_ruby/api/requests/financial/async_refund.rb +41 -0
- data/lib/genesis_ruby/api/requests/financial/cards/authorize.rb +43 -24
- data/lib/genesis_ruby/api/requests/financial/cards/authorize3d.rb +13 -1
- data/lib/genesis_ruby/api/requests/financial/cards/payout.rb +21 -5
- data/lib/genesis_ruby/api/requests/financial/cards/sale.rb +42 -23
- data/lib/genesis_ruby/api/requests/financial/cards/sale3d.rb +13 -1
- data/lib/genesis_ruby/api/requests/financial/mobile/apple_pay.rb +5 -1
- data/lib/genesis_ruby/api/requests/financial/mobile/google_pay.rb +6 -2
- data/lib/genesis_ruby/api/requests/financial/online_banking_payments/my_bank.rb +1 -1
- data/lib/genesis_ruby/api/requests/financial/refund.rb +20 -35
- data/lib/genesis_ruby/api/requests/financial/sdd/sale.rb +6 -1
- data/lib/genesis_ruby/api/requests/financial/wallets/e_wallet.rb +72 -0
- data/lib/genesis_ruby/api/requests/non_financial/alternatives/alipay/register_merchant.rb +147 -0
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/enhanced_statement.rb +46 -0
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/statement.rb +12 -137
- data/lib/genesis_ruby/api/requests/non_financial/billing_api/transactions.rb +4 -2
- data/lib/genesis_ruby/api/requests/non_financial/fraud/chargeback/date_range.rb +10 -19
- data/lib/genesis_ruby/api/requests/non_financial/fraud/rdr/date_range.rb +91 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/rdr/transaction.rb +54 -0
- data/lib/genesis_ruby/api/requests/non_financial/fraud/retrieval/date_range.rb +10 -19
- data/lib/genesis_ruby/api/requests/non_financial/kyc/verifications/bank_account.rb +76 -0
- data/lib/genesis_ruby/api/requests/non_financial/kyc/verifications/create.rb +31 -4
- data/lib/genesis_ruby/api/requests/non_financial/payment_authorizations/date_range.rb +124 -0
- data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/date_range.rb +8 -15
- data/lib/genesis_ruby/api/requests/non_financial/processed_transactions/post_date_range.rb +12 -18
- data/lib/genesis_ruby/api/requests/non_financial/reconcile/date_range.rb +29 -4
- data/lib/genesis_ruby/api/requests/non_financial/reconcile/order.rb +40 -0
- data/lib/genesis_ruby/api/requests/non_financial/reconcile/transaction.rb +1 -15
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/cryptogram.rb +3 -1
- data/lib/genesis_ruby/api/requests/non_financial/tokenization/tokenize.rb +3 -1
- data/lib/genesis_ruby/api/requests/wpf/create.rb +4 -0
- data/lib/genesis_ruby/api/requests/wpf/reconcile.rb +11 -4
- data/lib/genesis_ruby/api/requests/wpf/reconcile_by_date.rb +62 -0
- data/lib/genesis_ruby/api/requests/wpf/reconcile_by_order.rb +38 -0
- data/lib/genesis_ruby/builders/graphql.rb +95 -40
- data/lib/genesis_ruby/dependencies.rb +2 -0
- data/lib/genesis_ruby/utils/money/format.rb +2 -1
- data/lib/genesis_ruby/utils/transactions/financial_types.rb +3 -2
- data/lib/genesis_ruby/utils/transactions/references/refundable_types.rb +2 -1
- data/lib/genesis_ruby/utils/transactions/wpf_types.rb +1 -1
- data/lib/genesis_ruby/version.rb +1 -1
- metadata +40 -35
- data/.kiro/specs/f2025112509-add_managed_recurring_api/.config.kiro +0 -1
- data/.kiro/specs/f2025112509-add_managed_recurring_api/design.md +0 -332
- data/.kiro/specs/f2025112509-add_managed_recurring_api/requirements.md +0 -91
- data/.kiro/specs/f2025112509-add_managed_recurring_api/tasks.md +0 -139
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/.config.kiro +0 -1
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/design.md +0 -148
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/requirements.md +0 -81
- data/.kiro/specs/f2025112603-add_reverify_endpoint_to_payee_account/tasks.md +0 -48
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/.config.kiro +0 -1
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/design.md +0 -112
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/requirements.md +0 -74
- data/.kiro/specs/f2025112606-add_list_payees_trx_request/tasks.md +0 -38
- data/.kiro/specs/f2025112609_update_payee_request_params/design.md +0 -86
- data/.kiro/specs/f2025112609_update_payee_request_params/requirements.md +0 -86
- data/.kiro/specs/f2025112609_update_payee_request_params/tasks.md +0 -40
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/.config.kiro +0 -1
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/design.md +0 -246
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/requirements.md +0 -287
- data/.kiro/specs/f2025112612-add_payee_owner_documents_and_verification_requests/tasks.md +0 -76
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/design.md +0 -84
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/requirements.md +0 -88
- data/.kiro/specs/f2025112614-add_money_transfer_payout_attributes_to_payout_rq/tasks.md +0 -38
- data/.kiro/steering/product.md +0 -15
- data/.kiro/steering/spec-folder-naming.md +0 -16
- data/.kiro/steering/structure.md +0 -96
- data/.kiro/steering/tech.md +0 -66
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -176
- data/Rakefile +0 -24
- data/genesis_ruby.gemspec +0 -47
- data/lib/genesis_ruby/api/constants/transactions/parameters/non_financial/externally_processed.rb +0 -24
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'genesis_ruby/api/constants/transactions/parameters/purpose_of_payment'
|
|
4
|
+
require 'genesis_ruby/api/constants/transactions/parameters/purpose_of_payment_values'
|
|
4
5
|
|
|
5
6
|
module GenesisRuby
|
|
6
7
|
module Api
|
|
@@ -15,14 +16,23 @@ module GenesisRuby
|
|
|
15
16
|
# Purpose of Payment setter
|
|
16
17
|
def purpose_of_payment=(value)
|
|
17
18
|
allowed_options(
|
|
18
|
-
attribute:
|
|
19
|
-
allowed:
|
|
20
|
-
value:
|
|
19
|
+
attribute: __method__,
|
|
20
|
+
allowed: allowed_purpose_of_payment_values,
|
|
21
|
+
value: value,
|
|
21
22
|
error_message: 'Invalid data for Purpose of Payment',
|
|
22
|
-
allow_empty:
|
|
23
|
+
allow_empty: true
|
|
23
24
|
)
|
|
24
25
|
end
|
|
25
26
|
|
|
27
|
+
protected
|
|
28
|
+
|
|
29
|
+
# Values accepted by the purpose_of_payment setter: the Visa codes and the Visa human-readable values.
|
|
30
|
+
# A request can override the method to widen the list (see Payout)
|
|
31
|
+
def allowed_purpose_of_payment_values
|
|
32
|
+
Api::Constants::Transactions::Parameters::PurposeOfPayment.all +
|
|
33
|
+
Api::Constants::Transactions::Parameters::PurposeOfPaymentValues.all
|
|
34
|
+
end
|
|
35
|
+
|
|
26
36
|
end
|
|
27
37
|
end
|
|
28
38
|
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/refund/bank_account_types'
|
|
4
|
+
|
|
5
|
+
module GenesisRuby
|
|
6
|
+
module Api
|
|
7
|
+
module Mixins
|
|
8
|
+
module Requests
|
|
9
|
+
module Financial
|
|
10
|
+
module Refund
|
|
11
|
+
# Customer bank attributes used by the refund transaction requests
|
|
12
|
+
module BankAttributes
|
|
13
|
+
|
|
14
|
+
attr_accessor :bank, :bank_branch, :bank_account, :bank_account_type
|
|
15
|
+
|
|
16
|
+
protected
|
|
17
|
+
|
|
18
|
+
# Customer bank attributes structure
|
|
19
|
+
def refund_bank_attributes_structure
|
|
20
|
+
{
|
|
21
|
+
bank: bank,
|
|
22
|
+
bank_branch: bank_branch,
|
|
23
|
+
bank_account: bank_account,
|
|
24
|
+
bank_account_type: bank_account_type
|
|
25
|
+
}
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Allowed values for the customer bank attributes
|
|
29
|
+
def refund_bank_attributes_field_validations
|
|
30
|
+
{
|
|
31
|
+
bank_account_type: Api::Constants::Transactions::Parameters::Refund::BankAccountTypes.all
|
|
32
|
+
}
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Mixins
|
|
6
|
+
module Requests
|
|
7
|
+
module Financial
|
|
8
|
+
module Refund
|
|
9
|
+
# Beneficiary bank account attributes used by the refund transaction requests
|
|
10
|
+
module BeneficiaryAttributes
|
|
11
|
+
|
|
12
|
+
attr_accessor :beneficiary_bank_code, :beneficiary_name, :beneficiary_account_number
|
|
13
|
+
|
|
14
|
+
protected
|
|
15
|
+
|
|
16
|
+
# Beneficiary bank account attributes structure (flat, no nested beneficiary node)
|
|
17
|
+
def refund_beneficiary_attributes_structure
|
|
18
|
+
{
|
|
19
|
+
beneficiary_bank_code: beneficiary_bank_code,
|
|
20
|
+
beneficiary_name: beneficiary_name,
|
|
21
|
+
beneficiary_account_number: beneficiary_account_number
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/refund/credit_reason_indicators'
|
|
4
|
+
require 'genesis_ruby/api/constants/transactions/parameters/refund/ticket_change_indicators'
|
|
5
|
+
|
|
6
|
+
# rubocop:disable Naming/VariableNumber
|
|
7
|
+
module GenesisRuby
|
|
8
|
+
module Api
|
|
9
|
+
module Mixins
|
|
10
|
+
module Requests
|
|
11
|
+
module Financial
|
|
12
|
+
module Refund
|
|
13
|
+
# Travel Level 3 ticket indicators used by the refund transaction requests
|
|
14
|
+
module TravelTicketAttributes
|
|
15
|
+
|
|
16
|
+
attr_accessor :credit_reason_indicator_1, :credit_reason_indicator_2, :ticket_change_indicator
|
|
17
|
+
|
|
18
|
+
protected
|
|
19
|
+
|
|
20
|
+
# Travel ticket indicators structure, serialised under travel / ticket
|
|
21
|
+
def refund_travel_ticket_attributes_structure
|
|
22
|
+
{
|
|
23
|
+
travel: {
|
|
24
|
+
ticket: {
|
|
25
|
+
credit_reason_indicator_1: credit_reason_indicator_1,
|
|
26
|
+
credit_reason_indicator_2: credit_reason_indicator_2,
|
|
27
|
+
ticket_change_indicator: ticket_change_indicator
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Allowed values for the travel ticket indicators
|
|
34
|
+
def refund_travel_ticket_attributes_field_validations
|
|
35
|
+
credit_reasons = Api::Constants::Transactions::Parameters::Refund::CreditReasonIndicators.all
|
|
36
|
+
ticket_changes = Api::Constants::Transactions::Parameters::Refund::TicketChangeIndicators.all
|
|
37
|
+
|
|
38
|
+
{
|
|
39
|
+
credit_reason_indicator_1: credit_reasons,
|
|
40
|
+
credit_reason_indicator_2: credit_reasons,
|
|
41
|
+
ticket_change_indicator: ticket_changes
|
|
42
|
+
}
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
# rubocop:enable Naming/VariableNumber
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Mixins
|
|
6
|
+
module Requests
|
|
7
|
+
module Financial
|
|
8
|
+
module Threeds
|
|
9
|
+
# Force 3DS attributes mixin
|
|
10
|
+
module ForceThreedsAttributes
|
|
11
|
+
|
|
12
|
+
attr_reader :force_threeds
|
|
13
|
+
|
|
14
|
+
# Force 3DSv2 authentication when no 3DSv2 parameters are sent
|
|
15
|
+
def force_threeds=(value)
|
|
16
|
+
allowed_options attribute: __method__,
|
|
17
|
+
allowed: [true, false],
|
|
18
|
+
value: value,
|
|
19
|
+
allow_empty: true,
|
|
20
|
+
error_message: 'Accepts only boolean values'
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'genesis_ruby/api/constants/non_financial/alternatives/alipay/site_types'
|
|
4
|
+
|
|
5
|
+
module GenesisRuby
|
|
6
|
+
module Api
|
|
7
|
+
module Mixins
|
|
8
|
+
module Requests
|
|
9
|
+
module NonFinancial
|
|
10
|
+
module Alternatives
|
|
11
|
+
module Alipay
|
|
12
|
+
# Alipay site information (site_information JSON object) attributes
|
|
13
|
+
module SiteInformationAttributes
|
|
14
|
+
|
|
15
|
+
attr_accessor :site_information_type
|
|
16
|
+
attr_reader :site_information_url, :site_information_name
|
|
17
|
+
|
|
18
|
+
# Website URL or app download URL, absolute http/https URL
|
|
19
|
+
def site_information_url=(value)
|
|
20
|
+
parse_url attribute: __method__, value: value, allow_empty: true
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
# Website name or app name, max 512 characters
|
|
24
|
+
def site_information_name=(value)
|
|
25
|
+
if value.to_s.empty?
|
|
26
|
+
assign_instance_variable __method__, nil
|
|
27
|
+
else
|
|
28
|
+
limited_string attribute: __method__, value: value.to_s, max: 512
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
protected
|
|
33
|
+
|
|
34
|
+
# Site information allowed values
|
|
35
|
+
def site_information_field_validations
|
|
36
|
+
{
|
|
37
|
+
site_information_type: Api::Constants::NonFinancial::Alternatives::Alipay::SiteTypes.all
|
|
38
|
+
}
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Site information structure
|
|
42
|
+
def site_information_structure
|
|
43
|
+
{
|
|
44
|
+
type: site_information_type,
|
|
45
|
+
url: site_information_url,
|
|
46
|
+
name: site_information_name
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Mixins
|
|
6
|
+
module Requests
|
|
7
|
+
module NonFinancial
|
|
8
|
+
# Date-or-datetime from/to range attributes: start_date_from/start_date_to and
|
|
9
|
+
# end_date_from/end_date_to. Mirrors the Genesis PHP DateTimeFromToAttributes trait.
|
|
10
|
+
module DateTimeFromToAttributes
|
|
11
|
+
|
|
12
|
+
# Start of the requested start-date range (inclusive, server-side)
|
|
13
|
+
def start_date_from
|
|
14
|
+
format_from_to_date @start_date_from, start_date_from_time?
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Start of the requested start-date range (inclusive, server-side)
|
|
18
|
+
def start_date_from=(value)
|
|
19
|
+
parse_from_to_date :start_date_from, :start_date_from_time, value
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# End of the requested start-date range (non-inclusive, server-side)
|
|
23
|
+
def start_date_to
|
|
24
|
+
format_from_to_date @start_date_to, start_date_to_time?
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# End of the requested start-date range (non-inclusive, server-side)
|
|
28
|
+
def start_date_to=(value)
|
|
29
|
+
parse_from_to_date :start_date_to, :start_date_to_time, value
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Start of the requested end-date range (inclusive, server-side)
|
|
33
|
+
def end_date_from
|
|
34
|
+
format_from_to_date @end_date_from, end_date_from_time?
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Start of the requested end-date range (inclusive, server-side)
|
|
38
|
+
def end_date_from=(value)
|
|
39
|
+
parse_from_to_date :end_date_from, :end_date_from_time, value
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# End of the requested end-date range (non-inclusive, server-side)
|
|
43
|
+
def end_date_to
|
|
44
|
+
format_from_to_date @end_date_to, end_date_to_time?
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# End of the requested end-date range (non-inclusive, server-side)
|
|
48
|
+
def end_date_to=(value)
|
|
49
|
+
parse_from_to_date :end_date_to, :end_date_to_time, value
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
private
|
|
53
|
+
|
|
54
|
+
attr_accessor :start_date_from_time, :start_date_to_time,
|
|
55
|
+
:end_date_from_time, :end_date_to_time
|
|
56
|
+
|
|
57
|
+
# Parses and assigns a from/to date, then records whether a time component was supplied.
|
|
58
|
+
# The time flag is updated only after parse_date succeeds, so a failed assignment cannot
|
|
59
|
+
# change the formatting of a previously stored valid date.
|
|
60
|
+
def parse_from_to_date(attribute, time_attribute, value)
|
|
61
|
+
parse_date attribute: attribute, value: value, allow_empty: true
|
|
62
|
+
|
|
63
|
+
__send__ "#{time_attribute}=", Utils::Common.date_has_time?(value)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Start Date From has time within the given string
|
|
67
|
+
def start_date_from_time?
|
|
68
|
+
self.start_date_from_time ||= false
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Start Date To has time within the given string
|
|
72
|
+
def start_date_to_time?
|
|
73
|
+
self.start_date_to_time ||= false
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# End Date From has time within the given string
|
|
77
|
+
def end_date_from_time?
|
|
78
|
+
self.end_date_from_time ||= false
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# End Date To has time within the given string
|
|
82
|
+
def end_date_to_time?
|
|
83
|
+
self.end_date_to_time ||= false
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Format a stored date, keeping the time component when it was provided
|
|
87
|
+
def format_from_to_date(value, has_time)
|
|
88
|
+
format = if has_time
|
|
89
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_H_I_S
|
|
90
|
+
else
|
|
91
|
+
Api::Constants::DateTimeFormats::YYYY_MM_DD_ISO_8601
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
value&.strftime format
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
end
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -13,7 +13,8 @@ module GenesisRuby
|
|
|
13
13
|
|
|
14
14
|
attr_accessor :background_checks_first_name, :background_checks_middle_name,
|
|
15
15
|
:background_checks_last_name, :background_checks_full_name, :background_checks_match_score
|
|
16
|
-
attr_reader :background_checks_async_update
|
|
16
|
+
attr_reader :background_checks_async_update, :background_checks_with_alias_search,
|
|
17
|
+
:background_checks_with_associates_search
|
|
17
18
|
|
|
18
19
|
# Customer's date of birth
|
|
19
20
|
def background_checks_date_of_birth
|
|
@@ -37,6 +38,24 @@ module GenesisRuby
|
|
|
37
38
|
error_message: 'Accepts only boolean values'
|
|
38
39
|
end
|
|
39
40
|
|
|
41
|
+
# Enables the user search within a list of aliases
|
|
42
|
+
def background_checks_with_alias_search=(value)
|
|
43
|
+
allowed_options attribute: __method__,
|
|
44
|
+
allowed: [true, false],
|
|
45
|
+
value: value,
|
|
46
|
+
allow_empty: true,
|
|
47
|
+
error_message: 'Accepts only boolean values'
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Enables the user search within a list of RCA (relatives and close associates)
|
|
51
|
+
def background_checks_with_associates_search=(value)
|
|
52
|
+
allowed_options attribute: __method__,
|
|
53
|
+
allowed: [true, false],
|
|
54
|
+
value: value,
|
|
55
|
+
allow_empty: true,
|
|
56
|
+
error_message: 'Accepts only boolean values'
|
|
57
|
+
end
|
|
58
|
+
|
|
40
59
|
# One or more AML Filters to query
|
|
41
60
|
def background_checks_filters
|
|
42
61
|
@background_checks_filters || []
|
|
@@ -53,16 +72,18 @@ module GenesisRuby
|
|
|
53
72
|
protected
|
|
54
73
|
|
|
55
74
|
# Defines the structure of the background checks attributes
|
|
56
|
-
def background_checks_attributes_structure
|
|
75
|
+
def background_checks_attributes_structure # rubocop:disable Metrics/MethodLength
|
|
57
76
|
{
|
|
58
|
-
first_name:
|
|
59
|
-
middle_name:
|
|
60
|
-
last_name:
|
|
61
|
-
full_name:
|
|
62
|
-
date_of_birth:
|
|
63
|
-
async_update:
|
|
64
|
-
filters:
|
|
65
|
-
match_score:
|
|
77
|
+
first_name: background_checks_first_name,
|
|
78
|
+
middle_name: background_checks_middle_name,
|
|
79
|
+
last_name: background_checks_last_name,
|
|
80
|
+
full_name: background_checks_full_name,
|
|
81
|
+
date_of_birth: background_checks_date_of_birth,
|
|
82
|
+
async_update: background_checks_async_update,
|
|
83
|
+
filters: background_checks_filters,
|
|
84
|
+
match_score: background_checks_match_score,
|
|
85
|
+
with_alias_search: background_checks_with_alias_search,
|
|
86
|
+
with_associates_search: background_checks_with_associates_search
|
|
66
87
|
}
|
|
67
88
|
end
|
|
68
89
|
|
data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/verification_document_attributes.rb
CHANGED
|
@@ -11,7 +11,9 @@ module GenesisRuby
|
|
|
11
11
|
module VerificationDocumentAttributes
|
|
12
12
|
|
|
13
13
|
attr_accessor :document_first_name, :document_last_name
|
|
14
|
-
attr_reader :document_allow_offline, :document_allow_online
|
|
14
|
+
attr_reader :document_allow_offline, :document_allow_online, :document_with_enhanced_data,
|
|
15
|
+
:document_allow_fuzzy_match, :document_allow_decline_during_single_step,
|
|
16
|
+
:document_with_optical_character_recognition_form
|
|
15
17
|
|
|
16
18
|
# Customer's date of birth
|
|
17
19
|
def document_date_of_birth
|
|
@@ -43,16 +45,56 @@ module GenesisRuby
|
|
|
43
45
|
error_message: 'Accepts only boolean values'
|
|
44
46
|
end
|
|
45
47
|
|
|
48
|
+
# Whether enhanced data extraction from the document is performed
|
|
49
|
+
def document_with_enhanced_data=(value)
|
|
50
|
+
allowed_options attribute: __method__,
|
|
51
|
+
allowed: [true, false],
|
|
52
|
+
value: value,
|
|
53
|
+
allow_empty: true,
|
|
54
|
+
error_message: 'Accepts only boolean values'
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Whether fuzzy match is performed
|
|
58
|
+
def document_allow_fuzzy_match=(value)
|
|
59
|
+
allowed_options attribute: __method__,
|
|
60
|
+
allowed: [true, false],
|
|
61
|
+
value: value,
|
|
62
|
+
allow_empty: true,
|
|
63
|
+
error_message: 'Accepts only boolean values'
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Whether the face step is rejected on incorrect face submission
|
|
67
|
+
def document_allow_decline_during_single_step=(value)
|
|
68
|
+
allowed_options attribute: __method__,
|
|
69
|
+
allowed: [true, false],
|
|
70
|
+
value: value,
|
|
71
|
+
allow_empty: true,
|
|
72
|
+
error_message: 'Accepts only boolean values'
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Whether the OCR form is shown in the verification form
|
|
76
|
+
def document_with_optical_character_recognition_form=(value)
|
|
77
|
+
allowed_options attribute: __method__,
|
|
78
|
+
allowed: [true, false],
|
|
79
|
+
value: value,
|
|
80
|
+
allow_empty: true,
|
|
81
|
+
error_message: 'Accepts only boolean values'
|
|
82
|
+
end
|
|
83
|
+
|
|
46
84
|
protected
|
|
47
85
|
|
|
48
86
|
# Defines the structure of the document attributes
|
|
49
|
-
def verification_document_attributes_structure
|
|
87
|
+
def verification_document_attributes_structure # rubocop:disable Metrics/MethodLength
|
|
50
88
|
{
|
|
51
|
-
first_name:
|
|
52
|
-
last_name:
|
|
53
|
-
date_of_birth:
|
|
54
|
-
allow_offline:
|
|
55
|
-
allow_online:
|
|
89
|
+
first_name: document_first_name,
|
|
90
|
+
last_name: document_last_name,
|
|
91
|
+
date_of_birth: document_date_of_birth,
|
|
92
|
+
allow_offline: document_allow_offline,
|
|
93
|
+
allow_online: document_allow_online,
|
|
94
|
+
with_enhanced_data: document_with_enhanced_data,
|
|
95
|
+
allow_fuzzy_match: document_allow_fuzzy_match,
|
|
96
|
+
allow_decline_during_single_step: document_allow_decline_during_single_step,
|
|
97
|
+
with_optical_character_recognition_form: document_with_optical_character_recognition_form
|
|
56
98
|
}
|
|
57
99
|
end
|
|
58
100
|
|
data/lib/genesis_ruby/api/mixins/requests/non_financial/kyc/verification_instructions_attributes.rb
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
# Parameters for additional restrictions of the document for verification
|
|
10
|
+
module VerificationInstructionsAttributes
|
|
11
|
+
|
|
12
|
+
attr_reader :verification_instructions_allow_paper_based, :verification_instructions_allow_photocopy,
|
|
13
|
+
:verification_instructions_allow_laminated, :verification_instructions_allow_screenshot,
|
|
14
|
+
:verification_instructions_allow_cropped, :verification_instructions_allow_scanned
|
|
15
|
+
|
|
16
|
+
# Enables scanning of a paper based document for the verification
|
|
17
|
+
def verification_instructions_allow_paper_based=(value)
|
|
18
|
+
allowed_options attribute: __method__,
|
|
19
|
+
allowed: [true, false],
|
|
20
|
+
value: value,
|
|
21
|
+
allow_empty: true,
|
|
22
|
+
error_message: 'Accepts only boolean values'
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Enables scanning of a photocopy of a document for the verification
|
|
26
|
+
def verification_instructions_allow_photocopy=(value)
|
|
27
|
+
allowed_options attribute: __method__,
|
|
28
|
+
allowed: [true, false],
|
|
29
|
+
value: value,
|
|
30
|
+
allow_empty: true,
|
|
31
|
+
error_message: 'Accepts only boolean values'
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Enables scanning of a laminated document for the verification
|
|
35
|
+
def verification_instructions_allow_laminated=(value)
|
|
36
|
+
allowed_options attribute: __method__,
|
|
37
|
+
allowed: [true, false],
|
|
38
|
+
value: value,
|
|
39
|
+
allow_empty: true,
|
|
40
|
+
error_message: 'Accepts only boolean values'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Enables scanning of a screenshot of a document for the verification
|
|
44
|
+
def verification_instructions_allow_screenshot=(value)
|
|
45
|
+
allowed_options attribute: __method__,
|
|
46
|
+
allowed: [true, false],
|
|
47
|
+
value: value,
|
|
48
|
+
allow_empty: true,
|
|
49
|
+
error_message: 'Accepts only boolean values'
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Enables scanning of a cropped document for the verification
|
|
53
|
+
def verification_instructions_allow_cropped=(value)
|
|
54
|
+
allowed_options attribute: __method__,
|
|
55
|
+
allowed: [true, false],
|
|
56
|
+
value: value,
|
|
57
|
+
allow_empty: true,
|
|
58
|
+
error_message: 'Accepts only boolean values'
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Enables scanning of a scanned document for the verification
|
|
62
|
+
def verification_instructions_allow_scanned=(value)
|
|
63
|
+
allowed_options attribute: __method__,
|
|
64
|
+
allowed: [true, false],
|
|
65
|
+
value: value,
|
|
66
|
+
allow_empty: true,
|
|
67
|
+
error_message: 'Accepts only boolean values'
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
protected
|
|
71
|
+
|
|
72
|
+
# Defines the structure of the verification instructions attributes
|
|
73
|
+
def verification_instructions_attributes_structure
|
|
74
|
+
{
|
|
75
|
+
allow_paper_based: verification_instructions_allow_paper_based,
|
|
76
|
+
allow_photocopy: verification_instructions_allow_photocopy,
|
|
77
|
+
allow_laminated: verification_instructions_allow_laminated,
|
|
78
|
+
allow_screenshot: verification_instructions_allow_screenshot,
|
|
79
|
+
allow_cropped: verification_instructions_allow_cropped,
|
|
80
|
+
allow_scanned: verification_instructions_allow_scanned
|
|
81
|
+
}
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GenesisRuby
|
|
4
|
+
module Api
|
|
5
|
+
module Mixins
|
|
6
|
+
module Requests
|
|
7
|
+
module NonFinancial
|
|
8
|
+
# Reconcile Order Attributes mixin
|
|
9
|
+
module ReconcileOrderAttributes
|
|
10
|
+
|
|
11
|
+
# Maximum allowed length of the order_id value
|
|
12
|
+
ORDER_ID_MAX_LENGTH = 255
|
|
13
|
+
|
|
14
|
+
attr_reader :order_id
|
|
15
|
+
|
|
16
|
+
# The merchant order identifier to filter by
|
|
17
|
+
def order_id=(value)
|
|
18
|
+
if value.to_s.empty?
|
|
19
|
+
assign_instance_variable __method__, nil
|
|
20
|
+
else
|
|
21
|
+
limited_string attribute: __method__, value: value, max: ORDER_ID_MAX_LENGTH
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'genesis_ruby/api/constants/transactions/parameters/non_financial/scopes'
|
|
4
|
+
|
|
5
|
+
module GenesisRuby
|
|
6
|
+
module Api
|
|
7
|
+
module Mixins
|
|
8
|
+
module Requests
|
|
9
|
+
module NonFinancial
|
|
10
|
+
# Scope Attributes mixin
|
|
11
|
+
module ScopeAttributes
|
|
12
|
+
|
|
13
|
+
attr_reader :scope
|
|
14
|
+
|
|
15
|
+
# Scope
|
|
16
|
+
def scope=(value)
|
|
17
|
+
allowed_options attribute: __method__,
|
|
18
|
+
allowed: GenesisRuby::Api::Constants::Transactions::Parameters::NonFinancial::
|
|
19
|
+
Scopes.all,
|
|
20
|
+
value: value,
|
|
21
|
+
allow_empty: true
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -91,6 +91,18 @@ module GenesisRuby
|
|
|
91
91
|
assign_instance_variable attribute, value
|
|
92
92
|
end
|
|
93
93
|
|
|
94
|
+
# Parses given value to a valid absolute http or https URL and assign it to the given attribute
|
|
95
|
+
# If allow_empty is true, it will assign nil if the value is empty
|
|
96
|
+
def parse_url(attribute:, value:, allow_empty: false)
|
|
97
|
+
return assign_instance_variable attribute, nil if allow_empty && value.to_s.empty?
|
|
98
|
+
|
|
99
|
+
unless GenesisRuby::Utils::Common.valid_url?(value.to_s)
|
|
100
|
+
raise InvalidArgumentError, "#{attribute} must be a valid http or https URL."
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
assign_instance_variable attribute, value
|
|
104
|
+
end
|
|
105
|
+
|
|
94
106
|
private
|
|
95
107
|
|
|
96
108
|
# Helper for assigning a attribute to the class instance
|